From 8b56400a22daac58ff4f22dcca20a5cb4dc327df Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 22 Oct 2019 15:28:53 +0800 Subject: [PATCH 01/55] Add new module and add v11 thrift protocol --- pom.xml | 7 + sql/thriftserver/if/TCLIService.thrift | 1298 + sql/thriftserver/pom.xml | 135 + .../service/rpc/thrift/TArrayTypeEntry.java | 377 + .../service/rpc/thrift/TBinaryColumn.java | 539 + .../spark/service/rpc/thrift/TBoolColumn.java | 539 + .../spark/service/rpc/thrift/TBoolValue.java | 381 + .../spark/service/rpc/thrift/TByteColumn.java | 539 + .../spark/service/rpc/thrift/TByteValue.java | 381 + .../spark/service/rpc/thrift/TCLIService.java | 19848 ++++++++++++++++ .../rpc/thrift/TCLIServiceConstants.java | 86 + .../rpc/thrift/TCancelDelegationTokenReq.java | 484 + .../thrift/TCancelDelegationTokenResp.java | 383 + .../rpc/thrift/TCancelOperationReq.java | 383 + .../rpc/thrift/TCancelOperationResp.java | 383 + .../rpc/thrift/TCloseOperationReq.java | 383 + .../rpc/thrift/TCloseOperationResp.java | 383 + .../service/rpc/thrift/TCloseSessionReq.java | 383 + .../service/rpc/thrift/TCloseSessionResp.java | 383 + .../spark/service/rpc/thrift/TColumn.java | 719 + .../spark/service/rpc/thrift/TColumnDesc.java | 695 + .../service/rpc/thrift/TColumnValue.java | 658 + .../service/rpc/thrift/TDoubleColumn.java | 539 + .../service/rpc/thrift/TDoubleValue.java | 381 + .../rpc/thrift/TExecuteStatementReq.java | 854 + .../rpc/thrift/TExecuteStatementResp.java | 499 + .../service/rpc/thrift/TFetchOrientation.java | 53 + .../service/rpc/thrift/TFetchResultsReq.java | 705 + .../service/rpc/thrift/TFetchResultsResp.java | 603 + .../service/rpc/thrift/TGetCatalogsReq.java | 383 + .../service/rpc/thrift/TGetCatalogsResp.java | 499 + .../service/rpc/thrift/TGetColumnsReq.java | 812 + .../service/rpc/thrift/TGetColumnsResp.java | 499 + .../rpc/thrift/TGetCrossReferenceReq.java | 1024 + .../rpc/thrift/TGetCrossReferenceResp.java | 499 + .../rpc/thrift/TGetDelegationTokenReq.java | 585 + .../rpc/thrift/TGetDelegationTokenResp.java | 494 + .../service/rpc/thrift/TGetFunctionsReq.java | 701 + .../service/rpc/thrift/TGetFunctionsResp.java | 499 + .../spark/service/rpc/thrift/TGetInfoReq.java | 496 + .../service/rpc/thrift/TGetInfoResp.java | 486 + .../service/rpc/thrift/TGetInfoType.java | 179 + .../service/rpc/thrift/TGetInfoValue.java | 580 + .../rpc/thrift/TGetOperationStatusReq.java | 492 + .../rpc/thrift/TGetOperationStatusResp.java | 1333 ++ .../rpc/thrift/TGetPrimaryKeysReq.java | 706 + .../rpc/thrift/TGetPrimaryKeysResp.java | 499 + .../service/rpc/thrift/TGetQueryIdReq.java | 383 + .../service/rpc/thrift/TGetQueryIdResp.java | 378 + .../rpc/thrift/TGetResultSetMetadataReq.java | 383 + .../rpc/thrift/TGetResultSetMetadataResp.java | 499 + .../service/rpc/thrift/TGetSchemasReq.java | 600 + .../service/rpc/thrift/TGetSchemasResp.java | 499 + .../service/rpc/thrift/TGetTableTypesReq.java | 383 + .../rpc/thrift/TGetTableTypesResp.java | 499 + .../service/rpc/thrift/TGetTablesReq.java | 861 + .../service/rpc/thrift/TGetTablesResp.java | 499 + .../service/rpc/thrift/TGetTypeInfoReq.java | 383 + .../service/rpc/thrift/TGetTypeInfoResp.java | 499 + .../service/rpc/thrift/THandleIdentifier.java | 499 + .../spark/service/rpc/thrift/TI16Column.java | 539 + .../spark/service/rpc/thrift/TI16Value.java | 381 + .../spark/service/rpc/thrift/TI32Column.java | 539 + .../spark/service/rpc/thrift/TI32Value.java | 381 + .../spark/service/rpc/thrift/TI64Column.java | 539 + .../spark/service/rpc/thrift/TI64Value.java | 381 + .../rpc/thrift/TJobExecutionStatus.java | 44 + .../service/rpc/thrift/TMapTypeEntry.java | 472 + .../service/rpc/thrift/TOpenSessionReq.java | 768 + .../service/rpc/thrift/TOpenSessionResp.java | 773 + .../service/rpc/thrift/TOperationHandle.java | 700 + .../service/rpc/thrift/TOperationState.java | 62 + .../service/rpc/thrift/TOperationType.java | 62 + .../rpc/thrift/TPrimitiveTypeEntry.java | 506 + .../rpc/thrift/TProgressUpdateResp.java | 1023 + .../service/rpc/thrift/TProtocolVersion.java | 68 + .../rpc/thrift/TRenewDelegationTokenReq.java | 484 + .../rpc/thrift/TRenewDelegationTokenResp.java | 383 + .../apache/spark/service/rpc/thrift/TRow.java | 432 + .../spark/service/rpc/thrift/TRowSet.java | 913 + .../service/rpc/thrift/TSessionHandle.java | 383 + .../service/rpc/thrift/TSetClientInfoReq.java | 546 + .../rpc/thrift/TSetClientInfoResp.java | 383 + .../spark/service/rpc/thrift/TStatus.java | 866 + .../spark/service/rpc/thrift/TStatusCode.java | 50 + .../service/rpc/thrift/TStringColumn.java | 539 + .../service/rpc/thrift/TStringValue.java | 383 + .../service/rpc/thrift/TStructTypeEntry.java | 441 + .../service/rpc/thrift/TTableSchema.java | 432 + .../spark/service/rpc/thrift/TTypeDesc.java | 432 + .../spark/service/rpc/thrift/TTypeEntry.java | 597 + .../spark/service/rpc/thrift/TTypeId.java | 104 + .../rpc/thrift/TTypeQualifierValue.java | 348 + .../service/rpc/thrift/TTypeQualifiers.java | 443 + .../service/rpc/thrift/TUnionTypeEntry.java | 441 + .../rpc/thrift/TUserDefinedTypeEntry.java | 378 + 96 files changed, 66348 insertions(+) create mode 100644 sql/thriftserver/if/TCLIService.thrift create mode 100644 sql/thriftserver/pom.xml create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBinaryColumn.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolColumn.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolValue.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteColumn.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteValue.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIService.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumn.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnDesc.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnValue.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleColumn.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleValue.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchOrientation.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoType.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoValue.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/THandleIdentifier.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Column.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Value.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Column.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Value.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Column.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Value.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationHandle.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationState.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationType.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProtocolVersion.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRow.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRowSet.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSessionHandle.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatus.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatusCode.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringColumn.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringValue.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTableSchema.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeDesc.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeEntry.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeId.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java create mode 100644 sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java diff --git a/pom.xml b/pom.xml index 69b5b79b7b07..b31748446437 100644 --- a/pom.xml +++ b/pom.xml @@ -2974,6 +2974,13 @@ + + spark-thriftserver + + sql/thriftserver + + + hadoop-cloud diff --git a/sql/thriftserver/if/TCLIService.thrift b/sql/thriftserver/if/TCLIService.thrift new file mode 100644 index 000000000000..924e79eef8cd --- /dev/null +++ b/sql/thriftserver/if/TCLIService.thrift @@ -0,0 +1,1298 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Coding Conventions for this file: +// +// Structs/Enums/Unions +// * Struct, Enum, and Union names begin with a "T", +// and use a capital letter for each new word, with no underscores. +// * All fields should be declared as either optional or required. +// +// Functions +// * Function names start with a capital letter and have a capital letter for +// each new word, with no underscores. +// * Each function should take exactly one parameter, named TFunctionNameReq, +// and should return either void or TFunctionNameResp. This convention allows +// incremental updates. +// +// Services +// * Service names begin with the letter "T", use a capital letter for each +// new word (with no underscores), and end with the word "Service". + +namespace java org.apache.spark.service.rpc.thrift +namespace cpp apache.spark.service.rpc.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 { + HIVE_CLI_SERVICE_PROTOCOL_V1, + + // V2 adds support for asynchronous execution + HIVE_CLI_SERVICE_PROTOCOL_V2 + + // V3 add varchar type, primitive type qualifiers + HIVE_CLI_SERVICE_PROTOCOL_V3 + + // V4 add decimal precision/scale, char type + HIVE_CLI_SERVICE_PROTOCOL_V4 + + // V5 adds error details when GetOperationStatus returns in error state + HIVE_CLI_SERVICE_PROTOCOL_V5 + + // V6 uses binary type for binary payload (was string) and uses columnar result set + HIVE_CLI_SERVICE_PROTOCOL_V6 + + // V7 adds support for delegation token based connection + HIVE_CLI_SERVICE_PROTOCOL_V7 + + // V8 adds support for interval types + HIVE_CLI_SERVICE_PROTOCOL_V8 + + // V9 adds support for serializing ResultSets in SerDe + HIVE_CLI_SERVICE_PROTOCOL_V9 + + // V10 adds support for in place updates via GetOperationStatus + HIVE_CLI_SERVICE_PROTOCOL_V10 + + // V11 adds timestamp with local time zone type + HIVE_CLI_SERVICE_PROTOCOL_V11 +} + +enum TTypeId { + BOOLEAN_TYPE, + TINYINT_TYPE, + SMALLINT_TYPE, + INT_TYPE, + BIGINT_TYPE, + FLOAT_TYPE, + DOUBLE_TYPE, + STRING_TYPE, + TIMESTAMP_TYPE, + BINARY_TYPE, + ARRAY_TYPE, + MAP_TYPE, + STRUCT_TYPE, + UNION_TYPE, + USER_DEFINED_TYPE, + DECIMAL_TYPE, + NULL_TYPE, + DATE_TYPE, + VARCHAR_TYPE, + CHAR_TYPE, + INTERVAL_YEAR_MONTH_TYPE, + INTERVAL_DAY_TIME_TYPE, + TIMESTAMPLOCALTZ_TYPE +} + +const set PRIMITIVE_TYPES = [ + TTypeId.BOOLEAN_TYPE, + TTypeId.TINYINT_TYPE, + TTypeId.SMALLINT_TYPE, + TTypeId.INT_TYPE, + TTypeId.BIGINT_TYPE, + TTypeId.FLOAT_TYPE, + TTypeId.DOUBLE_TYPE, + TTypeId.STRING_TYPE, + TTypeId.TIMESTAMP_TYPE, + TTypeId.BINARY_TYPE, + TTypeId.DECIMAL_TYPE, + TTypeId.NULL_TYPE, + TTypeId.DATE_TYPE, + TTypeId.VARCHAR_TYPE, + TTypeId.CHAR_TYPE, + TTypeId.INTERVAL_YEAR_MONTH_TYPE, + TTypeId.INTERVAL_DAY_TIME_TYPE, + TTypeId.TIMESTAMPLOCALTZ_TYPE +] + +const set COMPLEX_TYPES = [ + TTypeId.ARRAY_TYPE + TTypeId.MAP_TYPE + TTypeId.STRUCT_TYPE + TTypeId.UNION_TYPE + TTypeId.USER_DEFINED_TYPE +] + +const set COLLECTION_TYPES = [ + TTypeId.ARRAY_TYPE + TTypeId.MAP_TYPE +] + +const map TYPE_NAMES = { + TTypeId.BOOLEAN_TYPE: "BOOLEAN", + TTypeId.TINYINT_TYPE: "TINYINT", + TTypeId.SMALLINT_TYPE: "SMALLINT", + TTypeId.INT_TYPE: "INT", + TTypeId.BIGINT_TYPE: "BIGINT", + TTypeId.FLOAT_TYPE: "FLOAT", + TTypeId.DOUBLE_TYPE: "DOUBLE", + TTypeId.STRING_TYPE: "STRING", + TTypeId.TIMESTAMP_TYPE: "TIMESTAMP", + TTypeId.BINARY_TYPE: "BINARY", + TTypeId.ARRAY_TYPE: "ARRAY", + TTypeId.MAP_TYPE: "MAP", + TTypeId.STRUCT_TYPE: "STRUCT", + TTypeId.UNION_TYPE: "UNIONTYPE", + TTypeId.DECIMAL_TYPE: "DECIMAL", + TTypeId.NULL_TYPE: "NULL" + TTypeId.DATE_TYPE: "DATE" + TTypeId.VARCHAR_TYPE: "VARCHAR" + TTypeId.CHAR_TYPE: "CHAR" + TTypeId.INTERVAL_YEAR_MONTH_TYPE: "INTERVAL_YEAR_MONTH" + TTypeId.INTERVAL_DAY_TIME_TYPE: "INTERVAL_DAY_TIME" + TTypeId.TIMESTAMPLOCALTZ_TYPE: "TIMESTAMP WITH LOCAL TIME ZONE" +} + +// Thrift does not support recursively defined types or forward declarations, +// which makes it difficult to represent Hive's nested types. +// To get around these limitations TTypeDesc employs a type list that maps +// integer "pointers" to TTypeEntry objects. The following examples show +// how different types are represented using this scheme: +// +// "INT": +// TTypeDesc { +// types = [ +// TTypeEntry.primitive_entry { +// type = INT_TYPE +// } +// ] +// } +// +// "ARRAY": +// TTypeDesc { +// types = [ +// TTypeEntry.array_entry { +// object_type_ptr = 1 +// }, +// TTypeEntry.primitive_entry { +// type = INT_TYPE +// } +// ] +// } +// +// "MAP": +// TTypeDesc { +// types = [ +// TTypeEntry.map_entry { +// key_type_ptr = 1 +// value_type_ptr = 2 +// }, +// TTypeEntry.primitive_entry { +// type = INT_TYPE +// }, +// TTypeEntry.primitive_entry { +// type = STRING_TYPE +// } +// ] +// } + +typedef i32 TTypeEntryPtr + +// Valid TTypeQualifiers key names +const string CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" + +// Type qualifier key name for decimal +const string PRECISION = "precision" +const string SCALE = "scale" + +union TTypeQualifierValue { + 1: optional i32 i32Value + 2: optional string stringValue +} + +// Type qualifiers for primitive type. +struct TTypeQualifiers { + 1: required map qualifiers +} + +// Type entry for a primitive type. +struct TPrimitiveTypeEntry { + // The primitive type token. This must satisfy the condition + // that type is in the PRIMITIVE_TYPES set. + 1: required TTypeId type + 2: optional TTypeQualifiers typeQualifiers +} + +// Type entry for an ARRAY type. +struct TArrayTypeEntry { + 1: required TTypeEntryPtr objectTypePtr +} + +// Type entry for a MAP type. +struct TMapTypeEntry { + 1: required TTypeEntryPtr keyTypePtr + 2: required TTypeEntryPtr valueTypePtr +} + +// Type entry for a STRUCT type. +struct TStructTypeEntry { + 1: required map nameToTypePtr +} + +// Type entry for a UNIONTYPE type. +struct TUnionTypeEntry { + 1: required map nameToTypePtr +} + +struct TUserDefinedTypeEntry { + // The fully qualified name of the class implementing this type. + 1: required string typeClassName +} + +// We use a union here since Thrift does not support inheritance. +union TTypeEntry { + 1: TPrimitiveTypeEntry primitiveEntry + 2: TArrayTypeEntry arrayEntry + 3: TMapTypeEntry mapEntry + 4: TStructTypeEntry structEntry + 5: TUnionTypeEntry unionEntry + 6: TUserDefinedTypeEntry userDefinedTypeEntry +} + +// Type descriptor for columns. +struct TTypeDesc { + // The "top" type is always the first element of the list. + // If the top type is an ARRAY, MAP, STRUCT, or UNIONTYPE + // type, then subsequent elements represent nested types. + 1: required list types +} + +// A result set column descriptor. +struct TColumnDesc { + // The name of the column + 1: required string columnName + + // The type descriptor for this column + 2: required TTypeDesc typeDesc + + // The ordinal position of this column in the schema + 3: required i32 position + + 4: optional string comment +} + +// Metadata used to describe the schema (column names, types, comments) +// of result sets. +struct TTableSchema { + 1: required list columns +} + +// A Boolean column value. +struct TBoolValue { + // NULL if value is unset. + 1: optional bool value +} + +// A Byte column value. +struct TByteValue { + // NULL if value is unset. + 1: optional byte value +} + +// A signed, 16 bit column value. +struct TI16Value { + // NULL if value is unset + 1: optional i16 value +} + +// A signed, 32 bit column value +struct TI32Value { + // NULL if value is unset + 1: optional i32 value +} + +// A signed 64 bit column value +struct TI64Value { + // NULL if value is unset + 1: optional i64 value +} + +// A floating point 64 bit column value +struct TDoubleValue { + // NULL if value is unset + 1: optional double value +} + +struct TStringValue { + // NULL if value is unset + 1: optional string value +} + +// A single column value in a result set. +// Note that Hive's type system is richer than Thrift's, +// so in some cases we have to map multiple Hive types +// to the same Thrift type. On the client-side this is +// disambiguated by looking at the Schema of the +// result set. +union TColumnValue { + 1: TBoolValue boolVal // BOOLEAN + 2: TByteValue byteVal // TINYINT + 3: TI16Value i16Val // SMALLINT + 4: TI32Value i32Val // INT + 5: TI64Value i64Val // BIGINT, TIMESTAMP + 6: TDoubleValue doubleVal // FLOAT, DOUBLE + 7: TStringValue stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, BINARY, DECIMAL, NULL, INTERVAL_YEAR_MONTH, INTERVAL_DAY_TIME +} + +// Represents a row in a rowset. +struct TRow { + 1: required list colVals +} + +struct TBoolColumn { + 1: required list values + 2: required binary nulls +} + +struct TByteColumn { + 1: required list values + 2: required binary nulls +} + +struct TI16Column { + 1: required list values + 2: required binary nulls +} + +struct TI32Column { + 1: required list values + 2: required binary nulls +} + +struct TI64Column { + 1: required list values + 2: required binary nulls +} + +struct TDoubleColumn { + 1: required list values + 2: required binary nulls +} + +struct TStringColumn { + 1: required list values + 2: required binary nulls +} + +struct TBinaryColumn { + 1: required list values + 2: required binary nulls +} + +// Note that Hive's type system is richer than Thrift's, +// so in some cases we have to map multiple Hive types +// to the same Thrift type. On the client-side this is +// disambiguated by looking at the Schema of the +// result set. +union TColumn { + 1: TBoolColumn boolVal // BOOLEAN + 2: TByteColumn byteVal // TINYINT + 3: TI16Column i16Val // SMALLINT + 4: TI32Column i32Val // INT + 5: TI64Column i64Val // BIGINT, TIMESTAMP + 6: TDoubleColumn doubleVal // FLOAT, DOUBLE + 7: TStringColumn stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, DECIMAL, NULL + 8: TBinaryColumn binaryVal // BINARY +} + +// Represents a rowset +struct TRowSet { + // The starting row offset of this rowset. + 1: required i64 startRowOffset + 2: required list rows + 3: optional list columns + 4: optional binary binaryColumns + 5: optional i32 columnCount +} + +// The return status code contained in each response. +enum TStatusCode { + SUCCESS_STATUS, + SUCCESS_WITH_INFO_STATUS, + STILL_EXECUTING_STATUS, + ERROR_STATUS, + INVALID_HANDLE_STATUS +} + +// The return status of a remote request +struct TStatus { + 1: required TStatusCode statusCode + + // If status is SUCCESS_WITH_INFO, info_msgs may be populated with + // additional diagnostic information. + 2: optional list infoMessages + + // If status is ERROR, then the following fields may be set + 3: optional string sqlState // as defined in the ISO/IEF CLI specification + 4: optional i32 errorCode // internal error code + 5: optional string errorMessage +} + +// The state of an operation (i.e. a query or other +// asynchronous operation that generates a result set) +// on the server. +enum TOperationState { + // The operation has been initialized + INITIALIZED_STATE, + + // The operation is running. In this state the result + // set is not available. + RUNNING_STATE, + + // The operation has completed. When an operation is in + // this state its result set may be fetched. + FINISHED_STATE, + + // The operation was canceled by a client + CANCELED_STATE, + + // The operation was closed by a client + CLOSED_STATE, + + // The operation failed due to an error + ERROR_STATE, + + // The operation is in an unrecognized state + UKNOWN_STATE, + + // The operation is in an pending state + PENDING_STATE, + + // The operation is in an timedout state + TIMEDOUT_STATE, +} + +// A string identifier. This is interpreted literally. +typedef string TIdentifier + +// A search pattern. +// +// Valid search pattern characters: +// '_': Any single character. +// '%': Any sequence of zero or more characters. +// '\': Escape character used to include special characters, +// e.g. '_', '%', '\'. If a '\' precedes a non-special +// character it has no special meaning and is interpreted +// literally. +typedef string TPattern + + +// A search pattern or identifier. Used as input +// parameter for many of the catalog functions. +typedef string TPatternOrIdentifier + +struct THandleIdentifier { + // 16 byte globally unique identifier + // This is the public ID of the handle and + // can be used for reporting. + 1: required binary guid, + + // 16 byte secret generated by the server + // and used to verify that the handle is not + // being hijacked by another user. + 2: required binary secret, +} + +// Client-side handle to persistent +// session information on the server-side. +struct TSessionHandle { + 1: required THandleIdentifier sessionId +} + +// The subtype of an OperationHandle. +enum TOperationType { + EXECUTE_STATEMENT, + GET_TYPE_INFO, + GET_CATALOGS, + GET_SCHEMAS, + GET_TABLES, + GET_TABLE_TYPES, + GET_COLUMNS, + GET_FUNCTIONS, + UNKNOWN, +} + +// Client-side reference to a task running +// asynchronously on the server. +struct TOperationHandle { + 1: required THandleIdentifier operationId + 2: required TOperationType operationType + + // If hasResultSet = TRUE, then this operation + // generates a result set that can be fetched. + // Note that the result set may be empty. + // + // If hasResultSet = FALSE, then this operation + // does not generate a result set, and calling + // GetResultSetMetadata or FetchResults against + // this OperationHandle will generate an error. + 3: required bool hasResultSet + + // For operations that don't generate result sets, + // modifiedRowCount is either: + // + // 1) The number of rows that were modified by + // the DML operation (e.g. number of rows inserted, + // number of rows deleted, etc). + // + // 2) 0 for operations that don't modify or add rows. + // + // 3) < 0 if the operation is capable of modifiying rows, + // but Hive is unable to determine how many rows were + // modified. For example, Hive's LOAD DATA command + // doesn't generate row count information because + // Hive doesn't inspect the data as it is loaded. + // + // modifiedRowCount is unset if the operation generates + // a result set. + 4: optional double modifiedRowCount +} + + +// OpenSession() +// +// Open a session (connection) on the server against +// which operations may be executed. +struct TOpenSessionReq { + // The version of the HiveServer2 protocol that the client is using. + 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10 + + // Username and password for authentication. + // Depending on the authentication scheme being used, + // this information may instead be provided by a lower + // protocol layer, in which case these fields may be + // left unset. + 2: optional string username + 3: optional string password + + // Configuration overlay which is applied when the session is + // first created. + 4: optional map configuration +} + +struct TOpenSessionResp { + 1: required TStatus status + + // The protocol version that the server is using. + 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10 + + // Session Handle + 3: optional TSessionHandle sessionHandle + + // The configuration settings for this session. + 4: optional map configuration +} + +struct TSetClientInfoReq { + 1: required TSessionHandle sessionHandle, + 2: optional map configuration +} + +struct TSetClientInfoResp { + 1: required TStatus status +} + + +// CloseSession() +// +// Closes the specified session and frees any resources +// currently allocated to that session. Any open +// operations in that session will be canceled. +struct TCloseSessionReq { + 1: required TSessionHandle sessionHandle +} + +struct TCloseSessionResp { + 1: required TStatus status +} + + + +enum TGetInfoType { + CLI_MAX_DRIVER_CONNECTIONS = 0, + CLI_MAX_CONCURRENT_ACTIVITIES = 1, + CLI_DATA_SOURCE_NAME = 2, + CLI_FETCH_DIRECTION = 8, + CLI_SERVER_NAME = 13, + CLI_SEARCH_PATTERN_ESCAPE = 14, + CLI_DBMS_NAME = 17, + CLI_DBMS_VER = 18, + CLI_ACCESSIBLE_TABLES = 19, + CLI_ACCESSIBLE_PROCEDURES = 20, + CLI_CURSOR_COMMIT_BEHAVIOR = 23, + CLI_DATA_SOURCE_READ_ONLY = 25, + CLI_DEFAULT_TXN_ISOLATION = 26, + CLI_IDENTIFIER_CASE = 28, + CLI_IDENTIFIER_QUOTE_CHAR = 29, + CLI_MAX_COLUMN_NAME_LEN = 30, + CLI_MAX_CURSOR_NAME_LEN = 31, + CLI_MAX_SCHEMA_NAME_LEN = 32, + CLI_MAX_CATALOG_NAME_LEN = 34, + CLI_MAX_TABLE_NAME_LEN = 35, + CLI_SCROLL_CONCURRENCY = 43, + CLI_TXN_CAPABLE = 46, + CLI_USER_NAME = 47, + CLI_TXN_ISOLATION_OPTION = 72, + CLI_INTEGRITY = 73, + CLI_GETDATA_EXTENSIONS = 81, + CLI_NULL_COLLATION = 85, + CLI_ALTER_TABLE = 86, + CLI_ORDER_BY_COLUMNS_IN_SELECT = 90, + CLI_SPECIAL_CHARACTERS = 94, + CLI_MAX_COLUMNS_IN_GROUP_BY = 97, + CLI_MAX_COLUMNS_IN_INDEX = 98, + CLI_MAX_COLUMNS_IN_ORDER_BY = 99, + CLI_MAX_COLUMNS_IN_SELECT = 100, + CLI_MAX_COLUMNS_IN_TABLE = 101, + CLI_MAX_INDEX_SIZE = 102, + CLI_MAX_ROW_SIZE = 104, + CLI_MAX_STATEMENT_LEN = 105, + CLI_MAX_TABLES_IN_SELECT = 106, + CLI_MAX_USER_NAME_LEN = 107, + CLI_OJ_CAPABILITIES = 115, + + CLI_XOPEN_CLI_YEAR = 10000, + CLI_CURSOR_SENSITIVITY = 10001, + CLI_DESCRIBE_PARAMETER = 10002, + CLI_CATALOG_NAME = 10003, + CLI_COLLATION_SEQ = 10004, + CLI_MAX_IDENTIFIER_LEN = 10005, + CLI_ODBC_KEYWORDS = 10006 +} + +union TGetInfoValue { + 1: string stringValue + 2: i16 smallIntValue + 3: i32 integerBitmask + 4: i32 integerFlag + 5: i32 binaryValue + 6: i64 lenValue +} + +// GetInfo() +// +// This function is based on ODBC's CLIGetInfo() function. +// The function returns general information about the data source +// using the same keys as ODBC. +struct TGetInfoReq { + // The sesssion to run this request against + 1: required TSessionHandle sessionHandle + + 2: required TGetInfoType infoType +} + +struct TGetInfoResp { + 1: required TStatus status + + 2: required TGetInfoValue infoValue +} + + +// ExecuteStatement() +// +// Execute a statement. +// The returned OperationHandle can be used to check on the +// status of the statement, and to fetch results once the +// statement has finished executing. +struct TExecuteStatementReq { + // The session to execute the statement against + 1: required TSessionHandle sessionHandle + + // The statement to be executed (DML, DDL, SET, etc) + 2: required string statement + + // Configuration properties that are overlayed on top of the + // the existing session configuration before this statement + // is executed. These properties apply to this statement + // only and will not affect the subsequent state of the Session. + 3: optional map confOverlay + + // Execute asynchronously when runAsync is true + 4: optional bool runAsync = false + + // The number of seconds after which the query will timeout on the server + 5: optional i64 queryTimeout = 0 +} + +struct TExecuteStatementResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + +// GetTypeInfo() +// +// Get information about types supported by the HiveServer instance. +// The information is returned as a result set which can be fetched +// using the OperationHandle provided in the response. +// +// Refer to the documentation for ODBC's CLIGetTypeInfo function for +// the format of the result set. +struct TGetTypeInfoReq { + // The session to run this request against. + 1: required TSessionHandle sessionHandle +} + +struct TGetTypeInfoResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + + +// GetCatalogs() +// +// Returns the list of catalogs (databases) +// Results are ordered by TABLE_CATALOG +// +// Resultset columns : +// col1 +// name: TABLE_CAT +// type: STRING +// desc: Catalog name. NULL if not applicable. +// +struct TGetCatalogsReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle +} + +struct TGetCatalogsResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + + +// GetSchemas() +// +// Retrieves the schema names available in this database. +// The results are ordered by TABLE_CATALOG and TABLE_SCHEM. +// col1 +// name: TABLE_SCHEM +// type: STRING +// desc: schema name +// col2 +// name: TABLE_CATALOG +// type: STRING +// desc: catalog name +struct TGetSchemasReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // Name of the catalog. Must not contain a search pattern. + 2: optional TIdentifier catalogName + + // schema name or pattern + 3: optional TPatternOrIdentifier schemaName +} + +struct TGetSchemasResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + + +// GetTables() +// +// Returns a list of tables with catalog, schema, and table +// type information. The information is returned as a result +// set which can be fetched using the OperationHandle +// provided in the response. +// Results are ordered by TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, and TABLE_NAME +// +// Result Set Columns: +// +// col1 +// name: TABLE_CAT +// type: STRING +// desc: Catalog name. NULL if not applicable. +// +// col2 +// name: TABLE_SCHEM +// type: STRING +// desc: Schema name. +// +// col3 +// name: TABLE_NAME +// type: STRING +// desc: Table name. +// +// col4 +// name: TABLE_TYPE +// type: STRING +// desc: The table type, e.g. "TABLE", "VIEW", etc. +// +// col5 +// name: REMARKS +// type: STRING +// desc: Comments about the table +// +struct TGetTablesReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // Name of the catalog or a search pattern. + 2: optional TPatternOrIdentifier catalogName + + // Name of the schema or a search pattern. + 3: optional TPatternOrIdentifier schemaName + + // Name of the table or a search pattern. + 4: optional TPatternOrIdentifier tableName + + // List of table types to match + // e.g. "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", + // "LOCAL TEMPORARY", "ALIAS", "SYNONYM", etc. + 5: optional list tableTypes +} + +struct TGetTablesResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + + +// GetTableTypes() +// +// Returns the table types available in this database. +// The results are ordered by table type. +// +// col1 +// name: TABLE_TYPE +// type: STRING +// desc: Table type name. +struct TGetTableTypesReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle +} + +struct TGetTableTypesResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + + +// GetColumns() +// +// Returns a list of columns in the specified tables. +// The information is returned as a result set which can be fetched +// using the OperationHandle provided in the response. +// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME, +// and ORDINAL_POSITION. +// +// Result Set Columns are the same as those for the ODBC CLIColumns +// function. +// +struct TGetColumnsReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // Name of the catalog. Must not contain a search pattern. + 2: optional TIdentifier catalogName + + // Schema name or search pattern + 3: optional TPatternOrIdentifier schemaName + + // Table name or search pattern + 4: optional TPatternOrIdentifier tableName + + // Column name or search pattern + 5: optional TPatternOrIdentifier columnName +} + +struct TGetColumnsResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + + +// GetFunctions() +// +// Returns a list of functions supported by the data source. The +// behavior of this function matches +// java.sql.DatabaseMetaData.getFunctions() both in terms of +// inputs and outputs. +// +// Result Set Columns: +// +// col1 +// name: FUNCTION_CAT +// type: STRING +// desc: Function catalog (may be null) +// +// col2 +// name: FUNCTION_SCHEM +// type: STRING +// desc: Function schema (may be null) +// +// col3 +// name: FUNCTION_NAME +// type: STRING +// desc: Function name. This is the name used to invoke the function. +// +// col4 +// name: REMARKS +// type: STRING +// desc: Explanatory comment on the function. +// +// col5 +// name: FUNCTION_TYPE +// type: SMALLINT +// desc: Kind of function. One of: +// * functionResultUnknown - Cannot determine if a return value or a table +// will be returned. +// * functionNoTable - Does not a return a table. +// * functionReturnsTable - Returns a table. +// +// col6 +// name: SPECIFIC_NAME +// type: STRING +// desc: The name which uniquely identifies this function within its schema. +// In this case this is the fully qualified class name of the class +// that implements this function. +// +struct TGetFunctionsReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // A catalog name; must match the catalog name as it is stored in the + // database; "" retrieves those without a catalog; null means + // that the catalog name should not be used to narrow the search. + 2: optional TIdentifier catalogName + + // A schema name pattern; must match the schema name as it is stored + // in the database; "" retrieves those without a schema; null means + // that the schema name should not be used to narrow the search. + 3: optional TPatternOrIdentifier schemaName + + // A function name pattern; must match the function name as it is stored + // in the database. + 4: required TPatternOrIdentifier functionName +} + +struct TGetFunctionsResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + +struct TGetPrimaryKeysReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // Name of the catalog. + 2: optional TIdentifier catalogName + + // Name of the schema. + 3: optional TIdentifier schemaName + + // Name of the table. + 4: optional TIdentifier tableName +} + +struct TGetPrimaryKeysResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + +struct TGetCrossReferenceReq { + // Session to run this request against + 1: required TSessionHandle sessionHandle + + // Name of the parent catalog. + 2: optional TIdentifier parentCatalogName + + // Name of the parent schema. + 3: optional TIdentifier parentSchemaName + + // Name of the parent table. + 4: optional TIdentifier parentTableName + + // Name of the foreign catalog. + 5: optional TIdentifier foreignCatalogName + + // Name of the foreign schema. + 6: optional TIdentifier foreignSchemaName + + // Name of the foreign table. + 7: optional TIdentifier foreignTableName +} + +struct TGetCrossReferenceResp { + 1: required TStatus status + 2: optional TOperationHandle operationHandle +} + +// GetOperationStatus() +// +// Get the status of an operation running on the server. +struct TGetOperationStatusReq { + // Session to run this request against + 1: required TOperationHandle operationHandle + // optional arguments to get progress information + 2: optional bool getProgressUpdate +} + +struct TGetOperationStatusResp { + 1: required TStatus status + 2: optional TOperationState operationState + + // If operationState is ERROR_STATE, then the following fields may be set + // sqlState as defined in the ISO/IEF CLI specification + 3: optional string sqlState + + // Internal error code + 4: optional i32 errorCode + + // Error message + 5: optional string errorMessage + + // List of statuses of sub tasks + 6: optional string taskStatus + + // When was the operation started + 7: optional i64 operationStarted + + // When was the operation completed + 8: optional i64 operationCompleted + + // If the operation has the result + 9: optional bool hasResultSet + + 10: optional TProgressUpdateResp progressUpdateResponse + +} + + +// CancelOperation() +// +// Cancels processing on the specified operation handle and +// frees any resources which were allocated. +struct TCancelOperationReq { + // Operation to cancel + 1: required TOperationHandle operationHandle +} + +struct TCancelOperationResp { + 1: required TStatus status +} + + +// CloseOperation() +// +// Given an operation in the FINISHED, CANCELED, +// or ERROR states, CloseOperation() will free +// all of the resources which were allocated on +// the server to service the operation. +struct TCloseOperationReq { + 1: required TOperationHandle operationHandle +} + +struct TCloseOperationResp { + 1: required TStatus status +} + + +// GetResultSetMetadata() +// +// Retrieves schema information for the specified operation +struct TGetResultSetMetadataReq { + // Operation for which to fetch result set schema information + 1: required TOperationHandle operationHandle +} + +struct TGetResultSetMetadataResp { + 1: required TStatus status + 2: optional TTableSchema schema +} + + +enum TFetchOrientation { + // Get the next rowset. The fetch offset is ignored. + FETCH_NEXT, + + // Get the previous rowset. The fetch offset is ignored. + // NOT SUPPORTED + FETCH_PRIOR, + + // Return the rowset at the given fetch offset relative + // to the curren rowset. + // NOT SUPPORTED + FETCH_RELATIVE, + + // Return the rowset at the specified fetch offset. + // NOT SUPPORTED + FETCH_ABSOLUTE, + + // Get the first rowset in the result set. + FETCH_FIRST, + + // Get the last rowset in the result set. + // NOT SUPPORTED + FETCH_LAST +} + +// FetchResults() +// +// Fetch rows from the server corresponding to +// a particular OperationHandle. +struct TFetchResultsReq { + // Operation from which to fetch results. + 1: required TOperationHandle operationHandle + + // The fetch orientation. For V1 this must be either + // FETCH_NEXT or FETCH_FIRST. Defaults to FETCH_NEXT. + 2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT + + // Max number of rows that should be returned in + // the rowset. + 3: required i64 maxRows + + // The type of a fetch results request. 0 represents Query output. 1 represents Log + 4: optional i16 fetchType = 0 +} + +struct TFetchResultsResp { + 1: required TStatus status + + // TRUE if there are more rows left to fetch from the server. + 2: optional bool hasMoreRows + + // The rowset. This is optional so that we have the + // option in the future of adding alternate formats for + // representing result set data, e.g. delimited strings, + // binary encoded, etc. + 3: optional TRowSet results +} + +// GetDelegationToken() +// Retrieve delegation token for the current user +struct TGetDelegationTokenReq { + // session handle + 1: required TSessionHandle sessionHandle + + // userid for the proxy user + 2: required string owner + + // designated renewer userid + 3: required string renewer +} + +struct TGetDelegationTokenResp { + // status of the request + 1: required TStatus status + + // delegation token string + 2: optional string delegationToken +} + +// CancelDelegationToken() +// Cancel the given delegation token +struct TCancelDelegationTokenReq { + // session handle + 1: required TSessionHandle sessionHandle + + // delegation token to cancel + 2: required string delegationToken +} + +struct TCancelDelegationTokenResp { + // status of the request + 1: required TStatus status +} + +// RenewDelegationToken() +// Renew the given delegation token +struct TRenewDelegationTokenReq { + // session handle + 1: required TSessionHandle sessionHandle + + // delegation token to renew + 2: required string delegationToken +} + +struct TRenewDelegationTokenResp { + // status of the request + 1: required TStatus status +} + +enum TJobExecutionStatus { + IN_PROGRESS, + COMPLETE, + NOT_AVAILABLE +} + +struct TProgressUpdateResp { + 1: required list headerNames + 2: required list> rows + 3: required double progressedPercentage + 4: required TJobExecutionStatus status + 5: required string footerSummary + 6: required i64 startTime +} + +struct TGetQueryIdReq { + 1: required TOperationHandle operationHandle +} + +struct TGetQueryIdResp { + 1: required string queryId +} + +service TCLIService { + + TOpenSessionResp OpenSession(1:TOpenSessionReq req); + + TCloseSessionResp CloseSession(1:TCloseSessionReq req); + + TGetInfoResp GetInfo(1:TGetInfoReq req); + + TExecuteStatementResp ExecuteStatement(1:TExecuteStatementReq req); + + TGetTypeInfoResp GetTypeInfo(1:TGetTypeInfoReq req); + + TGetCatalogsResp GetCatalogs(1:TGetCatalogsReq req); + + TGetSchemasResp GetSchemas(1:TGetSchemasReq req); + + TGetTablesResp GetTables(1:TGetTablesReq req); + + TGetTableTypesResp GetTableTypes(1:TGetTableTypesReq req); + + TGetColumnsResp GetColumns(1:TGetColumnsReq req); + + TGetFunctionsResp GetFunctions(1:TGetFunctionsReq req); + + TGetPrimaryKeysResp GetPrimaryKeys(1:TGetPrimaryKeysReq req); + + TGetCrossReferenceResp GetCrossReference(1:TGetCrossReferenceReq req); + + TGetOperationStatusResp GetOperationStatus(1:TGetOperationStatusReq req); + + TCancelOperationResp CancelOperation(1:TCancelOperationReq req); + + TCloseOperationResp CloseOperation(1:TCloseOperationReq req); + + TGetResultSetMetadataResp GetResultSetMetadata(1:TGetResultSetMetadataReq req); + + TFetchResultsResp FetchResults(1:TFetchResultsReq req); + + TGetDelegationTokenResp GetDelegationToken(1:TGetDelegationTokenReq req); + + TCancelDelegationTokenResp CancelDelegationToken(1:TCancelDelegationTokenReq req); + + TRenewDelegationTokenResp RenewDelegationToken(1:TRenewDelegationTokenReq req); + + TGetQueryIdResp GetQueryId(1:TGetQueryIdReq req); + + TSetClientInfoResp SetClientInfo(1:TSetClientInfoReq req); +} diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml new file mode 100644 index 000000000000..e0220513472b --- /dev/null +++ b/sql/thriftserver/pom.xml @@ -0,0 +1,135 @@ + + 4.0.0 + + org.apache.spark + spark-parent_2.12 + 3.0.0-SNAPSHOT + ../../pom.xml + + + spark-thriftserver_2.12 + jar + Spark Project Thrift Server + http://spark.apache.org/ + + thriftserver + + + + + org.apache.spark + spark-hive_${scala.binary.version} + ${project.version} + + + org.apache.spark + spark-core_${scala.binary.version} + ${project.version} + test-jar + test + + + org.apache.spark + spark-catalyst_${scala.binary.version} + ${project.version} + test-jar + test + + + org.apache.spark + spark-hive_${scala.binary.version} + ${project.version} + test-jar + test + + + com.google.guava + guava + + + ${hive.group} + hive-cli + + + ${hive.group} + hive-jdbc + + + ${hive.group} + hive-beeline + + + org.eclipse.jetty + jetty-server + provided + + + org.eclipse.jetty + jetty-servlet + provided + + + + org.seleniumhq.selenium + selenium-java + test + + + org.seleniumhq.selenium + selenium-htmlunit-driver + test + + + org.apache.spark + spark-sql_${scala.binary.version} + test-jar + ${project.version} + test + + + org.apache.spark + spark-tags_${scala.binary.version} + + + + + org.apache.spark + spark-tags_${scala.binary.version} + test-jar + test + + + + net.sf.jpam + jpam + + + + target/scala-${scala.binary.version}/classes + target/scala-${scala.binary.version}/test-classes + + + org.codehaus.mojo + build-helper-maven-plugin + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java new file mode 100644 index 000000000000..50b54a9162b7 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java @@ -0,0 +1,377 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry"); + + private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TArrayTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TArrayTypeEntryTupleSchemeFactory()); + } + + private int objectTypePtr; // 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 { + OBJECT_TYPE_PTR((short)1, "objectTypePtr"); + + 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: // OBJECT_TYPE_PTR + return OBJECT_TYPE_PTR; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __OBJECTTYPEPTR_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap); + } + + public TArrayTypeEntry() { + } + + public TArrayTypeEntry( + int objectTypePtr) + { + this(); + this.objectTypePtr = objectTypePtr; + setObjectTypePtrIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TArrayTypeEntry(TArrayTypeEntry other) { + __isset_bitfield = other.__isset_bitfield; + this.objectTypePtr = other.objectTypePtr; + } + + public TArrayTypeEntry deepCopy() { + return new TArrayTypeEntry(this); + } + + @Override + public void clear() { + setObjectTypePtrIsSet(false); + this.objectTypePtr = 0; + } + + public int getObjectTypePtr() { + return this.objectTypePtr; + } + + public void setObjectTypePtr(int objectTypePtr) { + this.objectTypePtr = objectTypePtr; + setObjectTypePtrIsSet(true); + } + + public void unsetObjectTypePtr() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + } + + /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetObjectTypePtr() { + return EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + } + + public void setObjectTypePtrIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case OBJECT_TYPE_PTR: + if (value == null) { + unsetObjectTypePtr(); + } else { + setObjectTypePtr((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case OBJECT_TYPE_PTR: + return getObjectTypePtr(); + + } + 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 OBJECT_TYPE_PTR: + return isSetObjectTypePtr(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TArrayTypeEntry) + return this.equals((TArrayTypeEntry)that); + return false; + } + + public boolean equals(TArrayTypeEntry that) { + if (that == null) + return false; + + boolean this_present_objectTypePtr = true; + boolean that_present_objectTypePtr = true; + if (this_present_objectTypePtr || that_present_objectTypePtr) { + if (!(this_present_objectTypePtr && that_present_objectTypePtr)) + return false; + if (this.objectTypePtr != that.objectTypePtr) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_objectTypePtr = true; + list.add(present_objectTypePtr); + if (present_objectTypePtr) + list.add(objectTypePtr); + + return list.hashCode(); + } + + @Override + public int compareTo(TArrayTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetObjectTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectTypePtr, other.objectTypePtr); + 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("TArrayTypeEntry("); + boolean first = true; + + sb.append("objectTypePtr:"); + sb.append(this.objectTypePtr); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetObjectTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'objectTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TArrayTypeEntryStandardSchemeFactory implements SchemeFactory { + public TArrayTypeEntryStandardScheme getScheme() { + return new TArrayTypeEntryStandardScheme(); + } + } + + private static class TArrayTypeEntryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry 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: // OBJECT_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.objectTypePtr = iprot.readI32(); + struct.setObjectTypePtrIsSet(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, TArrayTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(OBJECT_TYPE_PTR_FIELD_DESC); + oprot.writeI32(struct.objectTypePtr); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TArrayTypeEntryTupleSchemeFactory implements SchemeFactory { + public TArrayTypeEntryTupleScheme getScheme() { + return new TArrayTypeEntryTupleScheme(); + } + } + + private static class TArrayTypeEntryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.objectTypePtr); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.objectTypePtr = iprot.readI32(); + struct.setObjectTypePtrIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBinaryColumn.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBinaryColumn.java new file mode 100644 index 000000000000..e23aa1d5dc5b --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBinaryColumn.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBinaryColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBinaryColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryColumn.class, metaDataMap); + } + + public TBinaryColumn() { + } + + public TBinaryColumn( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TBinaryColumn(TBinaryColumn other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TBinaryColumn deepCopy() { + return new TBinaryColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(ByteBuffer elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TBinaryColumn) + return this.equals((TBinaryColumn)that); + return false; + } + + public boolean equals(TBinaryColumn that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TBinaryColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TBinaryColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.values, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TBinaryColumnStandardSchemeFactory implements SchemeFactory { + public TBinaryColumnStandardScheme getScheme() { + return new TBinaryColumnStandardScheme(); + } + } + + private static class TBinaryColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); + struct.values = new ArrayList(_list110.size); + ByteBuffer _elem111; + for (int _i112 = 0; _i112 < _list110.size; ++_i112) + { + _elem111 = iprot.readBinary(); + struct.values.add(_elem111); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TBinaryColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (ByteBuffer _iter113 : struct.values) + { + oprot.writeBinary(_iter113); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TBinaryColumnTupleSchemeFactory implements SchemeFactory { + public TBinaryColumnTupleScheme getScheme() { + return new TBinaryColumnTupleScheme(); + } + } + + private static class TBinaryColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (ByteBuffer _iter114 : struct.values) + { + oprot.writeBinary(_iter114); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new ArrayList(_list115.size); + ByteBuffer _elem116; + for (int _i117 = 0; _i117 < _list115.size; ++_i117) + { + _elem116 = iprot.readBinary(); + struct.values.add(_elem116); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolColumn.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolColumn.java new file mode 100644 index 000000000000..c1b0f77cccf5 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolColumn.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBoolColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBoolColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolColumn.class, metaDataMap); + } + + public TBoolColumn() { + } + + public TBoolColumn( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TBoolColumn(TBoolColumn other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TBoolColumn deepCopy() { + return new TBoolColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(boolean elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TBoolColumn) + return this.equals((TBoolColumn)that); + return false; + } + + public boolean equals(TBoolColumn that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TBoolColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TBoolColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TBoolColumnStandardSchemeFactory implements SchemeFactory { + public TBoolColumnStandardScheme getScheme() { + return new TBoolColumnStandardScheme(); + } + } + + private static class TBoolColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); + struct.values = new ArrayList(_list54.size); + boolean _elem55; + for (int _i56 = 0; _i56 < _list54.size; ++_i56) + { + _elem55 = iprot.readBool(); + struct.values.add(_elem55); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TBoolColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.values.size())); + for (boolean _iter57 : struct.values) + { + oprot.writeBool(_iter57); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TBoolColumnTupleSchemeFactory implements SchemeFactory { + public TBoolColumnTupleScheme getScheme() { + return new TBoolColumnTupleScheme(); + } + } + + private static class TBoolColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (boolean _iter58 : struct.values) + { + oprot.writeBool(_iter58); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); + struct.values = new ArrayList(_list59.size); + boolean _elem60; + for (int _i61 = 0; _i61 < _list59.size; ++_i61) + { + _elem60 = iprot.readBool(); + struct.values.add(_elem60); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolValue.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolValue.java new file mode 100644 index 000000000000..4640838ee2f4 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolValue.java @@ -0,0 +1,381 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBoolValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBoolValueTupleSchemeFactory()); + } + + private boolean value; // 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 { + VALUE((short)1, "value"); + + 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: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolValue.class, metaDataMap); + } + + public TBoolValue() { + } + + /** + * Performs a deep copy on other. + */ + public TBoolValue(TBoolValue other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TBoolValue deepCopy() { + return new TBoolValue(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = false; + } + + public boolean isValue() { + return this.value; + } + + public void setValue(boolean value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return isValue(); + + } + 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 VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TBoolValue) + return this.equals((TBoolValue)that); + return false; + } + + public boolean equals(TBoolValue that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(TBoolValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("TBoolValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TBoolValueStandardSchemeFactory implements SchemeFactory { + public TBoolValueStandardScheme getScheme() { + return new TBoolValueStandardScheme(); + } + } + + private static class TBoolValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.value = iprot.readBool(); + struct.setValueIsSet(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, TBoolValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBool(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TBoolValueTupleSchemeFactory implements SchemeFactory { + public TBoolValueTupleScheme getScheme() { + return new TBoolValueTupleScheme(); + } + } + + private static class TBoolValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeBool(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readBool(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteColumn.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteColumn.java new file mode 100644 index 000000000000..a0a4cfcf049f --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteColumn.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TByteColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TByteColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteColumn.class, metaDataMap); + } + + public TByteColumn() { + } + + public TByteColumn( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TByteColumn(TByteColumn other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TByteColumn deepCopy() { + return new TByteColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(byte elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TByteColumn) + return this.equals((TByteColumn)that); + return false; + } + + public boolean equals(TByteColumn that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TByteColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TByteColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TByteColumnStandardSchemeFactory implements SchemeFactory { + public TByteColumnStandardScheme getScheme() { + return new TByteColumnStandardScheme(); + } + } + + private static class TByteColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); + struct.values = new ArrayList(_list62.size); + byte _elem63; + for (int _i64 = 0; _i64 < _list62.size; ++_i64) + { + _elem63 = iprot.readByte(); + struct.values.add(_elem63); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TByteColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, struct.values.size())); + for (byte _iter65 : struct.values) + { + oprot.writeByte(_iter65); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TByteColumnTupleSchemeFactory implements SchemeFactory { + public TByteColumnTupleScheme getScheme() { + return new TByteColumnTupleScheme(); + } + } + + private static class TByteColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (byte _iter66 : struct.values) + { + oprot.writeByte(_iter66); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); + struct.values = new ArrayList(_list67.size); + byte _elem68; + for (int _i69 = 0; _i69 < _list67.size; ++_i69) + { + _elem68 = iprot.readByte(); + struct.values.add(_elem68); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteValue.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteValue.java new file mode 100644 index 000000000000..cc638dc99af8 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteValue.java @@ -0,0 +1,381 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TByteValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TByteValueTupleSchemeFactory()); + } + + private byte value; // 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 { + VALUE((short)1, "value"); + + 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: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteValue.class, metaDataMap); + } + + public TByteValue() { + } + + /** + * Performs a deep copy on other. + */ + public TByteValue(TByteValue other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TByteValue deepCopy() { + return new TByteValue(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public byte getValue() { + return this.value; + } + + public void setValue(byte value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((Byte)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + 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 VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TByteValue) + return this.equals((TByteValue)that); + return false; + } + + public boolean equals(TByteValue that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(TByteValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("TByteValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TByteValueStandardSchemeFactory implements SchemeFactory { + public TByteValueStandardScheme getScheme() { + return new TByteValueStandardScheme(); + } + } + + private static class TByteValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { + struct.value = iprot.readByte(); + struct.setValueIsSet(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, TByteValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeByte(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TByteValueTupleSchemeFactory implements SchemeFactory { + public TByteValueTupleScheme getScheme() { + return new TByteValueTupleScheme(); + } + } + + private static class TByteValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeByte(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readByte(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIService.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIService.java new file mode 100644 index 000000000000..35210c081bfc --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIService.java @@ -0,0 +1,19848 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCLIService { + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public interface Iface { + + public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException; + + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException; + + public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException; + + public TExecuteStatementResp ExecuteStatement(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; + + public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException; + + public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException; + + public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException; + + public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException; + + public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException; + + public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException; + + public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException; + + public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException; + + public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException; + + public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException; + + public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException; + + public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException; + + public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException; + + public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException; + + public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException; + + public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException; + + public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException; + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public interface AsyncIface { + + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void ExecuteStatement(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; + + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Client extends org.apache.thrift.TServiceClient implements Iface { + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException + { + send_OpenSession(req); + return recv_OpenSession(); + } + + public void send_OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException + { + OpenSession_args args = new OpenSession_args(); + args.setReq(req); + sendBase("OpenSession", args); + } + + public TOpenSessionResp recv_OpenSession() throws org.apache.thrift.TException + { + OpenSession_result result = new OpenSession_result(); + receiveBase(result, "OpenSession"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result"); + } + + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException + { + send_CloseSession(req); + return recv_CloseSession(); + } + + public void send_CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException + { + CloseSession_args args = new CloseSession_args(); + args.setReq(req); + sendBase("CloseSession", args); + } + + public TCloseSessionResp recv_CloseSession() throws org.apache.thrift.TException + { + CloseSession_result result = new CloseSession_result(); + receiveBase(result, "CloseSession"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseSession failed: unknown result"); + } + + public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException + { + send_GetInfo(req); + return recv_GetInfo(); + } + + public void send_GetInfo(TGetInfoReq req) throws org.apache.thrift.TException + { + GetInfo_args args = new GetInfo_args(); + args.setReq(req); + sendBase("GetInfo", args); + } + + public TGetInfoResp recv_GetInfo() throws org.apache.thrift.TException + { + GetInfo_result result = new GetInfo_result(); + receiveBase(result, "GetInfo"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetInfo failed: unknown result"); + } + + public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException + { + send_ExecuteStatement(req); + return recv_ExecuteStatement(); + } + + public void send_ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException + { + ExecuteStatement_args args = new ExecuteStatement_args(); + args.setReq(req); + sendBase("ExecuteStatement", args); + } + + public TExecuteStatementResp recv_ExecuteStatement() throws org.apache.thrift.TException + { + ExecuteStatement_result result = new ExecuteStatement_result(); + receiveBase(result, "ExecuteStatement"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result"); + } + + public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException + { + send_GetTypeInfo(req); + return recv_GetTypeInfo(); + } + + public void send_GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException + { + GetTypeInfo_args args = new GetTypeInfo_args(); + args.setReq(req); + sendBase("GetTypeInfo", args); + } + + public TGetTypeInfoResp recv_GetTypeInfo() throws org.apache.thrift.TException + { + GetTypeInfo_result result = new GetTypeInfo_result(); + receiveBase(result, "GetTypeInfo"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTypeInfo failed: unknown result"); + } + + public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException + { + send_GetCatalogs(req); + return recv_GetCatalogs(); + } + + public void send_GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException + { + GetCatalogs_args args = new GetCatalogs_args(); + args.setReq(req); + sendBase("GetCatalogs", args); + } + + public TGetCatalogsResp recv_GetCatalogs() throws org.apache.thrift.TException + { + GetCatalogs_result result = new GetCatalogs_result(); + receiveBase(result, "GetCatalogs"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCatalogs failed: unknown result"); + } + + public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException + { + send_GetSchemas(req); + return recv_GetSchemas(); + } + + public void send_GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException + { + GetSchemas_args args = new GetSchemas_args(); + args.setReq(req); + sendBase("GetSchemas", args); + } + + public TGetSchemasResp recv_GetSchemas() throws org.apache.thrift.TException + { + GetSchemas_result result = new GetSchemas_result(); + receiveBase(result, "GetSchemas"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetSchemas failed: unknown result"); + } + + public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException + { + send_GetTables(req); + return recv_GetTables(); + } + + public void send_GetTables(TGetTablesReq req) throws org.apache.thrift.TException + { + GetTables_args args = new GetTables_args(); + args.setReq(req); + sendBase("GetTables", args); + } + + public TGetTablesResp recv_GetTables() throws org.apache.thrift.TException + { + GetTables_result result = new GetTables_result(); + receiveBase(result, "GetTables"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTables failed: unknown result"); + } + + public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException + { + send_GetTableTypes(req); + return recv_GetTableTypes(); + } + + public void send_GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException + { + GetTableTypes_args args = new GetTableTypes_args(); + args.setReq(req); + sendBase("GetTableTypes", args); + } + + public TGetTableTypesResp recv_GetTableTypes() throws org.apache.thrift.TException + { + GetTableTypes_result result = new GetTableTypes_result(); + receiveBase(result, "GetTableTypes"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTableTypes failed: unknown result"); + } + + public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException + { + send_GetColumns(req); + return recv_GetColumns(); + } + + public void send_GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException + { + GetColumns_args args = new GetColumns_args(); + args.setReq(req); + sendBase("GetColumns", args); + } + + public TGetColumnsResp recv_GetColumns() throws org.apache.thrift.TException + { + GetColumns_result result = new GetColumns_result(); + receiveBase(result, "GetColumns"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetColumns failed: unknown result"); + } + + public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException + { + send_GetFunctions(req); + return recv_GetFunctions(); + } + + public void send_GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException + { + GetFunctions_args args = new GetFunctions_args(); + args.setReq(req); + sendBase("GetFunctions", args); + } + + public TGetFunctionsResp recv_GetFunctions() throws org.apache.thrift.TException + { + GetFunctions_result result = new GetFunctions_result(); + receiveBase(result, "GetFunctions"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetFunctions failed: unknown result"); + } + + public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException + { + send_GetPrimaryKeys(req); + return recv_GetPrimaryKeys(); + } + + public void send_GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException + { + GetPrimaryKeys_args args = new GetPrimaryKeys_args(); + args.setReq(req); + sendBase("GetPrimaryKeys", args); + } + + public TGetPrimaryKeysResp recv_GetPrimaryKeys() throws org.apache.thrift.TException + { + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + receiveBase(result, "GetPrimaryKeys"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetPrimaryKeys failed: unknown result"); + } + + public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException + { + send_GetCrossReference(req); + return recv_GetCrossReference(); + } + + public void send_GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException + { + GetCrossReference_args args = new GetCrossReference_args(); + args.setReq(req); + sendBase("GetCrossReference", args); + } + + public TGetCrossReferenceResp recv_GetCrossReference() throws org.apache.thrift.TException + { + GetCrossReference_result result = new GetCrossReference_result(); + receiveBase(result, "GetCrossReference"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCrossReference failed: unknown result"); + } + + public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException + { + send_GetOperationStatus(req); + return recv_GetOperationStatus(); + } + + public void send_GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException + { + GetOperationStatus_args args = new GetOperationStatus_args(); + args.setReq(req); + sendBase("GetOperationStatus", args); + } + + public TGetOperationStatusResp recv_GetOperationStatus() throws org.apache.thrift.TException + { + GetOperationStatus_result result = new GetOperationStatus_result(); + receiveBase(result, "GetOperationStatus"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetOperationStatus failed: unknown result"); + } + + public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException + { + send_CancelOperation(req); + return recv_CancelOperation(); + } + + public void send_CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException + { + CancelOperation_args args = new CancelOperation_args(); + args.setReq(req); + sendBase("CancelOperation", args); + } + + public TCancelOperationResp recv_CancelOperation() throws org.apache.thrift.TException + { + CancelOperation_result result = new CancelOperation_result(); + receiveBase(result, "CancelOperation"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelOperation failed: unknown result"); + } + + public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException + { + send_CloseOperation(req); + return recv_CloseOperation(); + } + + public void send_CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException + { + CloseOperation_args args = new CloseOperation_args(); + args.setReq(req); + sendBase("CloseOperation", args); + } + + public TCloseOperationResp recv_CloseOperation() throws org.apache.thrift.TException + { + CloseOperation_result result = new CloseOperation_result(); + receiveBase(result, "CloseOperation"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseOperation failed: unknown result"); + } + + public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException + { + send_GetResultSetMetadata(req); + return recv_GetResultSetMetadata(); + } + + public void send_GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException + { + GetResultSetMetadata_args args = new GetResultSetMetadata_args(); + args.setReq(req); + sendBase("GetResultSetMetadata", args); + } + + public TGetResultSetMetadataResp recv_GetResultSetMetadata() throws org.apache.thrift.TException + { + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + receiveBase(result, "GetResultSetMetadata"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetResultSetMetadata failed: unknown result"); + } + + public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException + { + send_FetchResults(req); + return recv_FetchResults(); + } + + public void send_FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException + { + FetchResults_args args = new FetchResults_args(); + args.setReq(req); + sendBase("FetchResults", args); + } + + public TFetchResultsResp recv_FetchResults() throws org.apache.thrift.TException + { + FetchResults_result result = new FetchResults_result(); + receiveBase(result, "FetchResults"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result"); + } + + public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException + { + send_GetDelegationToken(req); + return recv_GetDelegationToken(); + } + + public void send_GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException + { + GetDelegationToken_args args = new GetDelegationToken_args(); + args.setReq(req); + sendBase("GetDelegationToken", args); + } + + public TGetDelegationTokenResp recv_GetDelegationToken() throws org.apache.thrift.TException + { + GetDelegationToken_result result = new GetDelegationToken_result(); + receiveBase(result, "GetDelegationToken"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result"); + } + + public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException + { + send_CancelDelegationToken(req); + return recv_CancelDelegationToken(); + } + + public void send_CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException + { + CancelDelegationToken_args args = new CancelDelegationToken_args(); + args.setReq(req); + sendBase("CancelDelegationToken", args); + } + + public TCancelDelegationTokenResp recv_CancelDelegationToken() throws org.apache.thrift.TException + { + CancelDelegationToken_result result = new CancelDelegationToken_result(); + receiveBase(result, "CancelDelegationToken"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result"); + } + + public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException + { + send_RenewDelegationToken(req); + return recv_RenewDelegationToken(); + } + + public void send_RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException + { + RenewDelegationToken_args args = new RenewDelegationToken_args(); + args.setReq(req); + sendBase("RenewDelegationToken", args); + } + + public TRenewDelegationTokenResp recv_RenewDelegationToken() throws org.apache.thrift.TException + { + RenewDelegationToken_result result = new RenewDelegationToken_result(); + receiveBase(result, "RenewDelegationToken"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result"); + } + + public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException + { + send_GetQueryId(req); + return recv_GetQueryId(); + } + + public void send_GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException + { + GetQueryId_args args = new GetQueryId_args(); + args.setReq(req); + sendBase("GetQueryId", args); + } + + public TGetQueryIdResp recv_GetQueryId() throws org.apache.thrift.TException + { + GetQueryId_result result = new GetQueryId_result(); + receiveBase(result, "GetQueryId"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetQueryId failed: unknown result"); + } + + public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException + { + send_SetClientInfo(req); + return recv_SetClientInfo(); + } + + public void send_SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException + { + SetClientInfo_args args = new SetClientInfo_args(); + args.setReq(req); + sendBase("SetClientInfo", args); + } + + public TSetClientInfoResp recv_SetClientInfo() throws org.apache.thrift.TException + { + SetClientInfo_result result = new SetClientInfo_result(); + receiveBase(result, "SetClientInfo"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "SetClientInfo failed: unknown result"); + } + + } + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + OpenSession_call method_call = new OpenSession_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { + private TOpenSessionReq req; + public OpenSession_call(TOpenSessionReq 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("OpenSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); + OpenSession_args args = new OpenSession_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TOpenSessionResp 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_OpenSession(); + } + } + + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCloseSessionReq req; + public CloseSession_call(TCloseSessionReq 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("CloseSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CloseSession_args args = new CloseSession_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCloseSessionResp 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_CloseSession(); + } + } + + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetInfo_call method_call = new GetInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetInfoReq req; + public GetInfo_call(TGetInfoReq 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("GetInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetInfo_args args = new GetInfo_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetInfoResp 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_GetInfo(); + } + } + + public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + ExecuteStatement_call method_call = new ExecuteStatement_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { + private TExecuteStatementReq req; + public ExecuteStatement_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("ExecuteStatement", org.apache.thrift.protocol.TMessageType.CALL, 0)); + ExecuteStatement_args args = new ExecuteStatement_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TExecuteStatementResp 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_ExecuteStatement(); + } + } + + 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); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetTypeInfoReq req; + public GetTypeInfo_call(TGetTypeInfoReq 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("GetTypeInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetTypeInfo_args args = new GetTypeInfo_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetTypeInfoResp 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_GetTypeInfo(); + } + } + + public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetCatalogs_call method_call = new GetCatalogs_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetCatalogsReq req; + public GetCatalogs_call(TGetCatalogsReq 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("GetCatalogs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetCatalogs_args args = new GetCatalogs_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetCatalogsResp 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_GetCatalogs(); + } + } + + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetSchemas_call method_call = new GetSchemas_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetSchemasReq req; + public GetSchemas_call(TGetSchemasReq 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("GetSchemas", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetSchemas_args args = new GetSchemas_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetSchemasResp 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_GetSchemas(); + } + } + + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetTables_call method_call = new GetTables_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetTablesReq req; + public GetTables_call(TGetTablesReq 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("GetTables", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetTables_args args = new GetTables_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetTablesResp 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_GetTables(); + } + } + + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetTableTypes_call method_call = new GetTableTypes_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetTableTypesReq req; + public GetTableTypes_call(TGetTableTypesReq 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("GetTableTypes", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetTableTypes_args args = new GetTableTypes_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetTableTypesResp 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_GetTableTypes(); + } + } + + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetColumns_call method_call = new GetColumns_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetColumnsReq req; + public GetColumns_call(TGetColumnsReq 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("GetColumns", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetColumns_args args = new GetColumns_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetColumnsResp 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_GetColumns(); + } + } + + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetFunctions_call method_call = new GetFunctions_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetFunctionsReq req; + public GetFunctions_call(TGetFunctionsReq 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("GetFunctions", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetFunctions_args args = new GetFunctions_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetFunctionsResp 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_GetFunctions(); + } + } + + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetPrimaryKeys_call method_call = new GetPrimaryKeys_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetPrimaryKeysReq req; + public GetPrimaryKeys_call(TGetPrimaryKeysReq 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("GetPrimaryKeys", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetPrimaryKeys_args args = new GetPrimaryKeys_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetPrimaryKeysResp 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_GetPrimaryKeys(); + } + } + + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetCrossReference_call method_call = new GetCrossReference_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetCrossReferenceReq req; + public GetCrossReference_call(TGetCrossReferenceReq 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("GetCrossReference", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetCrossReference_args args = new GetCrossReference_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetCrossReferenceResp 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_GetCrossReference(); + } + } + + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetOperationStatus_call method_call = new GetOperationStatus_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetOperationStatusReq req; + public GetOperationStatus_call(TGetOperationStatusReq 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("GetOperationStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetOperationStatus_args args = new GetOperationStatus_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetOperationStatusResp 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_GetOperationStatus(); + } + } + + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CancelOperation_call method_call = new CancelOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCancelOperationReq req; + public CancelOperation_call(TCancelOperationReq 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("CancelOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CancelOperation_args args = new CancelOperation_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCancelOperationResp 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_CancelOperation(); + } + } + + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CloseOperation_call method_call = new CloseOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCloseOperationReq req; + public CloseOperation_call(TCloseOperationReq 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("CloseOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CloseOperation_args args = new CloseOperation_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCloseOperationResp 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_CloseOperation(); + } + } + + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetResultSetMetadata_call method_call = new GetResultSetMetadata_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetResultSetMetadataReq req; + public GetResultSetMetadata_call(TGetResultSetMetadataReq 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("GetResultSetMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetResultSetMetadata_args args = new GetResultSetMetadata_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetResultSetMetadataResp 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_GetResultSetMetadata(); + } + } + + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + FetchResults_call method_call = new FetchResults_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { + private TFetchResultsReq req; + public FetchResults_call(TFetchResultsReq 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("FetchResults", org.apache.thrift.protocol.TMessageType.CALL, 0)); + FetchResults_args args = new FetchResults_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TFetchResultsResp 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_FetchResults(); + } + } + + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetDelegationToken_call method_call = new GetDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetDelegationTokenReq req; + public GetDelegationToken_call(TGetDelegationTokenReq 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("GetDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetDelegationToken_args args = new GetDelegationToken_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetDelegationTokenResp 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_GetDelegationToken(); + } + } + + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CancelDelegationToken_call method_call = new CancelDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCancelDelegationTokenReq req; + public CancelDelegationToken_call(TCancelDelegationTokenReq 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("CancelDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CancelDelegationToken_args args = new CancelDelegationToken_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCancelDelegationTokenResp 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_CancelDelegationToken(); + } + } + + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + RenewDelegationToken_call method_call = new RenewDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + private TRenewDelegationTokenReq req; + public RenewDelegationToken_call(TRenewDelegationTokenReq 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("RenewDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); + RenewDelegationToken_args args = new RenewDelegationToken_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TRenewDelegationTokenResp 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_RenewDelegationToken(); + } + } + + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetQueryId_call method_call = new GetQueryId_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetQueryIdReq req; + public GetQueryId_call(TGetQueryIdReq 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("GetQueryId", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetQueryId_args args = new GetQueryId_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetQueryIdResp 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_GetQueryId(); + } + } + + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + SetClientInfo_call method_call = new SetClientInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private TSetClientInfoReq req; + public SetClientInfo_call(TSetClientInfoReq 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("SetClientInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + SetClientInfo_args args = new SetClientInfo_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TSetClientInfoResp 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_SetClientInfo(); + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected Processor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("OpenSession", new OpenSession()); + processMap.put("CloseSession", new CloseSession()); + processMap.put("GetInfo", new GetInfo()); + processMap.put("ExecuteStatement", new ExecuteStatement()); + processMap.put("GetTypeInfo", new GetTypeInfo()); + processMap.put("GetCatalogs", new GetCatalogs()); + processMap.put("GetSchemas", new GetSchemas()); + processMap.put("GetTables", new GetTables()); + processMap.put("GetTableTypes", new GetTableTypes()); + processMap.put("GetColumns", new GetColumns()); + processMap.put("GetFunctions", new GetFunctions()); + processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); + processMap.put("GetCrossReference", new GetCrossReference()); + processMap.put("GetOperationStatus", new GetOperationStatus()); + processMap.put("CancelOperation", new CancelOperation()); + processMap.put("CloseOperation", new CloseOperation()); + processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); + processMap.put("FetchResults", new FetchResults()); + processMap.put("GetDelegationToken", new GetDelegationToken()); + processMap.put("CancelDelegationToken", new CancelDelegationToken()); + processMap.put("RenewDelegationToken", new RenewDelegationToken()); + processMap.put("GetQueryId", new GetQueryId()); + processMap.put("SetClientInfo", new SetClientInfo()); + return processMap; + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession extends org.apache.thrift.ProcessFunction { + public OpenSession() { + super("OpenSession"); + } + + public OpenSession_args getEmptyArgsInstance() { + return new OpenSession_args(); + } + + protected boolean isOneway() { + return false; + } + + public OpenSession_result getResult(I iface, OpenSession_args args) throws org.apache.thrift.TException { + OpenSession_result result = new OpenSession_result(); + result.success = iface.OpenSession(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession extends org.apache.thrift.ProcessFunction { + public CloseSession() { + super("CloseSession"); + } + + public CloseSession_args getEmptyArgsInstance() { + return new CloseSession_args(); + } + + protected boolean isOneway() { + return false; + } + + public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { + CloseSession_result result = new CloseSession_result(); + result.success = iface.CloseSession(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo extends org.apache.thrift.ProcessFunction { + public GetInfo() { + super("GetInfo"); + } + + public GetInfo_args getEmptyArgsInstance() { + return new GetInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.thrift.TException { + GetInfo_result result = new GetInfo_result(); + result.success = iface.GetInfo(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement extends org.apache.thrift.ProcessFunction { + public ExecuteStatement() { + super("ExecuteStatement"); + } + + public ExecuteStatement_args getEmptyArgsInstance() { + return new ExecuteStatement_args(); + } + + protected boolean isOneway() { + return false; + } + + public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) throws org.apache.thrift.TException { + ExecuteStatement_result result = new ExecuteStatement_result(); + result.success = iface.ExecuteStatement(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { + public GetTypeInfo() { + super("GetTypeInfo"); + } + + public GetTypeInfo_args getEmptyArgsInstance() { + return new GetTypeInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.apache.thrift.TException { + GetTypeInfo_result result = new GetTypeInfo_result(); + result.success = iface.GetTypeInfo(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs extends org.apache.thrift.ProcessFunction { + public GetCatalogs() { + super("GetCatalogs"); + } + + public GetCatalogs_args getEmptyArgsInstance() { + return new GetCatalogs_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.apache.thrift.TException { + GetCatalogs_result result = new GetCatalogs_result(); + result.success = iface.GetCatalogs(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas extends org.apache.thrift.ProcessFunction { + public GetSchemas() { + super("GetSchemas"); + } + + public GetSchemas_args getEmptyArgsInstance() { + return new GetSchemas_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apache.thrift.TException { + GetSchemas_result result = new GetSchemas_result(); + result.success = iface.GetSchemas(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables extends org.apache.thrift.ProcessFunction { + public GetTables() { + super("GetTables"); + } + + public GetTables_args getEmptyArgsInstance() { + return new GetTables_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetTables_result getResult(I iface, GetTables_args args) throws org.apache.thrift.TException { + GetTables_result result = new GetTables_result(); + result.success = iface.GetTables(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes extends org.apache.thrift.ProcessFunction { + public GetTableTypes() { + super("GetTableTypes"); + } + + public GetTableTypes_args getEmptyArgsInstance() { + return new GetTableTypes_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws org.apache.thrift.TException { + GetTableTypes_result result = new GetTableTypes_result(); + result.success = iface.GetTableTypes(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns extends org.apache.thrift.ProcessFunction { + public GetColumns() { + super("GetColumns"); + } + + public GetColumns_args getEmptyArgsInstance() { + return new GetColumns_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apache.thrift.TException { + GetColumns_result result = new GetColumns_result(); + result.success = iface.GetColumns(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions extends org.apache.thrift.ProcessFunction { + public GetFunctions() { + super("GetFunctions"); + } + + public GetFunctions_args getEmptyArgsInstance() { + return new GetFunctions_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org.apache.thrift.TException { + GetFunctions_result result = new GetFunctions_result(); + result.success = iface.GetFunctions(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys extends org.apache.thrift.ProcessFunction { + public GetPrimaryKeys() { + super("GetPrimaryKeys"); + } + + public GetPrimaryKeys_args getEmptyArgsInstance() { + return new GetPrimaryKeys_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetPrimaryKeys_result getResult(I iface, GetPrimaryKeys_args args) throws org.apache.thrift.TException { + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + result.success = iface.GetPrimaryKeys(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference extends org.apache.thrift.ProcessFunction { + public GetCrossReference() { + super("GetCrossReference"); + } + + public GetCrossReference_args getEmptyArgsInstance() { + return new GetCrossReference_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetCrossReference_result getResult(I iface, GetCrossReference_args args) throws org.apache.thrift.TException { + GetCrossReference_result result = new GetCrossReference_result(); + result.success = iface.GetCrossReference(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus extends org.apache.thrift.ProcessFunction { + public GetOperationStatus() { + super("GetOperationStatus"); + } + + public GetOperationStatus_args getEmptyArgsInstance() { + return new GetOperationStatus_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args) throws org.apache.thrift.TException { + GetOperationStatus_result result = new GetOperationStatus_result(); + result.success = iface.GetOperationStatus(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation extends org.apache.thrift.ProcessFunction { + public CancelOperation() { + super("CancelOperation"); + } + + public CancelOperation_args getEmptyArgsInstance() { + return new CancelOperation_args(); + } + + protected boolean isOneway() { + return false; + } + + public CancelOperation_result getResult(I iface, CancelOperation_args args) throws org.apache.thrift.TException { + CancelOperation_result result = new CancelOperation_result(); + result.success = iface.CancelOperation(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation extends org.apache.thrift.ProcessFunction { + public CloseOperation() { + super("CloseOperation"); + } + + public CloseOperation_args getEmptyArgsInstance() { + return new CloseOperation_args(); + } + + protected boolean isOneway() { + return false; + } + + public CloseOperation_result getResult(I iface, CloseOperation_args args) throws org.apache.thrift.TException { + CloseOperation_result result = new CloseOperation_result(); + result.success = iface.CloseOperation(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata extends org.apache.thrift.ProcessFunction { + public GetResultSetMetadata() { + super("GetResultSetMetadata"); + } + + public GetResultSetMetadata_args getEmptyArgsInstance() { + return new GetResultSetMetadata_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args args) throws org.apache.thrift.TException { + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + result.success = iface.GetResultSetMetadata(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults extends org.apache.thrift.ProcessFunction { + public FetchResults() { + super("FetchResults"); + } + + public FetchResults_args getEmptyArgsInstance() { + return new FetchResults_args(); + } + + protected boolean isOneway() { + return false; + } + + public FetchResults_result getResult(I iface, FetchResults_args args) throws org.apache.thrift.TException { + FetchResults_result result = new FetchResults_result(); + result.success = iface.FetchResults(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken extends org.apache.thrift.ProcessFunction { + public GetDelegationToken() { + super("GetDelegationToken"); + } + + public GetDelegationToken_args getEmptyArgsInstance() { + return new GetDelegationToken_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args) throws org.apache.thrift.TException { + GetDelegationToken_result result = new GetDelegationToken_result(); + result.success = iface.GetDelegationToken(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken extends org.apache.thrift.ProcessFunction { + public CancelDelegationToken() { + super("CancelDelegationToken"); + } + + public CancelDelegationToken_args getEmptyArgsInstance() { + return new CancelDelegationToken_args(); + } + + protected boolean isOneway() { + return false; + } + + public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_args args) throws org.apache.thrift.TException { + CancelDelegationToken_result result = new CancelDelegationToken_result(); + result.success = iface.CancelDelegationToken(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken extends org.apache.thrift.ProcessFunction { + public RenewDelegationToken() { + super("RenewDelegationToken"); + } + + public RenewDelegationToken_args getEmptyArgsInstance() { + return new RenewDelegationToken_args(); + } + + protected boolean isOneway() { + return false; + } + + public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args args) throws org.apache.thrift.TException { + RenewDelegationToken_result result = new RenewDelegationToken_result(); + result.success = iface.RenewDelegationToken(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId extends org.apache.thrift.ProcessFunction { + public GetQueryId() { + super("GetQueryId"); + } + + public GetQueryId_args getEmptyArgsInstance() { + return new GetQueryId_args(); + } + + protected boolean isOneway() { + return false; + } + + public GetQueryId_result getResult(I iface, GetQueryId_args args) throws org.apache.thrift.TException { + GetQueryId_result result = new GetQueryId_result(); + result.success = iface.GetQueryId(args.req); + return result; + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo extends org.apache.thrift.ProcessFunction { + public SetClientInfo() { + super("SetClientInfo"); + } + + public SetClientInfo_args getEmptyArgsInstance() { + return new SetClientInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + public SetClientInfo_result getResult(I iface, SetClientInfo_args args) throws org.apache.thrift.TException { + SetClientInfo_result result = new SetClientInfo_result(); + result.success = iface.SetClientInfo(args.req); + return result; + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new HashMap>())); + } + + protected AsyncProcessor(I iface, Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static Map> getProcessMap(Map> processMap) { + processMap.put("OpenSession", new OpenSession()); + processMap.put("CloseSession", new CloseSession()); + processMap.put("GetInfo", new GetInfo()); + processMap.put("ExecuteStatement", new ExecuteStatement()); + processMap.put("GetTypeInfo", new GetTypeInfo()); + processMap.put("GetCatalogs", new GetCatalogs()); + processMap.put("GetSchemas", new GetSchemas()); + processMap.put("GetTables", new GetTables()); + processMap.put("GetTableTypes", new GetTableTypes()); + processMap.put("GetColumns", new GetColumns()); + processMap.put("GetFunctions", new GetFunctions()); + processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); + processMap.put("GetCrossReference", new GetCrossReference()); + processMap.put("GetOperationStatus", new GetOperationStatus()); + processMap.put("CancelOperation", new CancelOperation()); + processMap.put("CloseOperation", new CloseOperation()); + processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); + processMap.put("FetchResults", new FetchResults()); + processMap.put("GetDelegationToken", new GetDelegationToken()); + processMap.put("CancelDelegationToken", new CancelDelegationToken()); + processMap.put("RenewDelegationToken", new RenewDelegationToken()); + processMap.put("GetQueryId", new GetQueryId()); + processMap.put("SetClientInfo", new SetClientInfo()); + return processMap; + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession extends org.apache.thrift.AsyncProcessFunction { + public OpenSession() { + super("OpenSession"); + } + + public OpenSession_args getEmptyArgsInstance() { + return new OpenSession_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TOpenSessionResp o) { + OpenSession_result result = new OpenSession_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + OpenSession_result result = new OpenSession_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.OpenSession(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession extends org.apache.thrift.AsyncProcessFunction { + public CloseSession() { + super("CloseSession"); + } + + public CloseSession_args getEmptyArgsInstance() { + return new CloseSession_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TCloseSessionResp o) { + CloseSession_result result = new CloseSession_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + CloseSession_result result = new CloseSession_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.CloseSession(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo extends org.apache.thrift.AsyncProcessFunction { + public GetInfo() { + super("GetInfo"); + } + + public GetInfo_args getEmptyArgsInstance() { + return new GetInfo_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetInfoResp o) { + GetInfo_result result = new GetInfo_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetInfo_result result = new GetInfo_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetInfo(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement extends org.apache.thrift.AsyncProcessFunction { + public ExecuteStatement() { + super("ExecuteStatement"); + } + + public ExecuteStatement_args getEmptyArgsInstance() { + return new ExecuteStatement_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TExecuteStatementResp o) { + ExecuteStatement_result result = new ExecuteStatement_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + ExecuteStatement_result result = new ExecuteStatement_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.ExecuteStatement(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo extends org.apache.thrift.AsyncProcessFunction { + public GetTypeInfo() { + super("GetTypeInfo"); + } + + public GetTypeInfo_args getEmptyArgsInstance() { + return new GetTypeInfo_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetTypeInfoResp o) { + GetTypeInfo_result result = new GetTypeInfo_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetTypeInfo_result result = new GetTypeInfo_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetTypeInfo(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs extends org.apache.thrift.AsyncProcessFunction { + public GetCatalogs() { + super("GetCatalogs"); + } + + public GetCatalogs_args getEmptyArgsInstance() { + return new GetCatalogs_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetCatalogsResp o) { + GetCatalogs_result result = new GetCatalogs_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetCatalogs_result result = new GetCatalogs_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetCatalogs(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas extends org.apache.thrift.AsyncProcessFunction { + public GetSchemas() { + super("GetSchemas"); + } + + public GetSchemas_args getEmptyArgsInstance() { + return new GetSchemas_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetSchemasResp o) { + GetSchemas_result result = new GetSchemas_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetSchemas_result result = new GetSchemas_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetSchemas(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables extends org.apache.thrift.AsyncProcessFunction { + public GetTables() { + super("GetTables"); + } + + public GetTables_args getEmptyArgsInstance() { + return new GetTables_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetTablesResp o) { + GetTables_result result = new GetTables_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetTables_result result = new GetTables_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetTables(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes extends org.apache.thrift.AsyncProcessFunction { + public GetTableTypes() { + super("GetTableTypes"); + } + + public GetTableTypes_args getEmptyArgsInstance() { + return new GetTableTypes_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetTableTypesResp o) { + GetTableTypes_result result = new GetTableTypes_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetTableTypes_result result = new GetTableTypes_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetTableTypes(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns extends org.apache.thrift.AsyncProcessFunction { + public GetColumns() { + super("GetColumns"); + } + + public GetColumns_args getEmptyArgsInstance() { + return new GetColumns_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetColumnsResp o) { + GetColumns_result result = new GetColumns_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetColumns_result result = new GetColumns_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetColumns(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions extends org.apache.thrift.AsyncProcessFunction { + public GetFunctions() { + super("GetFunctions"); + } + + public GetFunctions_args getEmptyArgsInstance() { + return new GetFunctions_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetFunctionsResp o) { + GetFunctions_result result = new GetFunctions_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetFunctions_result result = new GetFunctions_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetFunctions(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys extends org.apache.thrift.AsyncProcessFunction { + public GetPrimaryKeys() { + super("GetPrimaryKeys"); + } + + public GetPrimaryKeys_args getEmptyArgsInstance() { + return new GetPrimaryKeys_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetPrimaryKeysResp o) { + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetPrimaryKeys(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference extends org.apache.thrift.AsyncProcessFunction { + public GetCrossReference() { + super("GetCrossReference"); + } + + public GetCrossReference_args getEmptyArgsInstance() { + return new GetCrossReference_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetCrossReferenceResp o) { + GetCrossReference_result result = new GetCrossReference_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetCrossReference_result result = new GetCrossReference_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetCrossReference(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus extends org.apache.thrift.AsyncProcessFunction { + public GetOperationStatus() { + super("GetOperationStatus"); + } + + public GetOperationStatus_args getEmptyArgsInstance() { + return new GetOperationStatus_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetOperationStatusResp o) { + GetOperationStatus_result result = new GetOperationStatus_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetOperationStatus_result result = new GetOperationStatus_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetOperationStatus(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation extends org.apache.thrift.AsyncProcessFunction { + public CancelOperation() { + super("CancelOperation"); + } + + public CancelOperation_args getEmptyArgsInstance() { + return new CancelOperation_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TCancelOperationResp o) { + CancelOperation_result result = new CancelOperation_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + CancelOperation_result result = new CancelOperation_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.CancelOperation(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation extends org.apache.thrift.AsyncProcessFunction { + public CloseOperation() { + super("CloseOperation"); + } + + public CloseOperation_args getEmptyArgsInstance() { + return new CloseOperation_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TCloseOperationResp o) { + CloseOperation_result result = new CloseOperation_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + CloseOperation_result result = new CloseOperation_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.CloseOperation(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata extends org.apache.thrift.AsyncProcessFunction { + public GetResultSetMetadata() { + super("GetResultSetMetadata"); + } + + public GetResultSetMetadata_args getEmptyArgsInstance() { + return new GetResultSetMetadata_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetResultSetMetadataResp o) { + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetResultSetMetadata(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults extends org.apache.thrift.AsyncProcessFunction { + public FetchResults() { + super("FetchResults"); + } + + public FetchResults_args getEmptyArgsInstance() { + return new FetchResults_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TFetchResultsResp o) { + FetchResults_result result = new FetchResults_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + FetchResults_result result = new FetchResults_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.FetchResults(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public GetDelegationToken() { + super("GetDelegationToken"); + } + + public GetDelegationToken_args getEmptyArgsInstance() { + return new GetDelegationToken_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetDelegationTokenResp o) { + GetDelegationToken_result result = new GetDelegationToken_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetDelegationToken_result result = new GetDelegationToken_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetDelegationToken(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public CancelDelegationToken() { + super("CancelDelegationToken"); + } + + public CancelDelegationToken_args getEmptyArgsInstance() { + return new CancelDelegationToken_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TCancelDelegationTokenResp o) { + CancelDelegationToken_result result = new CancelDelegationToken_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + CancelDelegationToken_result result = new CancelDelegationToken_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.CancelDelegationToken(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public RenewDelegationToken() { + super("RenewDelegationToken"); + } + + public RenewDelegationToken_args getEmptyArgsInstance() { + return new RenewDelegationToken_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TRenewDelegationTokenResp o) { + RenewDelegationToken_result result = new RenewDelegationToken_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + RenewDelegationToken_result result = new RenewDelegationToken_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.RenewDelegationToken(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId extends org.apache.thrift.AsyncProcessFunction { + public GetQueryId() { + super("GetQueryId"); + } + + public GetQueryId_args getEmptyArgsInstance() { + return new GetQueryId_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TGetQueryIdResp o) { + GetQueryId_result result = new GetQueryId_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + GetQueryId_result result = new GetQueryId_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetQueryId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.GetQueryId(args.req,resultHandler); + } + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo extends org.apache.thrift.AsyncProcessFunction { + public SetClientInfo() { + super("SetClientInfo"); + } + + public SetClientInfo_args getEmptyArgsInstance() { + return new SetClientInfo_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(TSetClientInfoResp o) { + SetClientInfo_result result = new SetClientInfo_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + SetClientInfo_result result = new SetClientInfo_result(); + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, SetClientInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.SetClientInfo(args.req,resultHandler); + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 OpenSession_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new OpenSession_argsTupleSchemeFactory()); + } + + private TOpenSessionReq 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, TOpenSessionReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_args.class, metaDataMap); + } + + public OpenSession_args() { + } + + public OpenSession_args( + TOpenSessionReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public OpenSession_args(OpenSession_args other) { + if (other.isSetReq()) { + this.req = new TOpenSessionReq(other.req); + } + } + + public OpenSession_args deepCopy() { + return new OpenSession_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TOpenSessionReq getReq() { + return this.req; + } + + public void setReq(TOpenSessionReq 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((TOpenSessionReq)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 OpenSession_args) + return this.equals((OpenSession_args)that); + return false; + } + + public boolean equals(OpenSession_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(OpenSession_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("OpenSession_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 OpenSession_argsStandardSchemeFactory implements SchemeFactory { + public OpenSession_argsStandardScheme getScheme() { + return new OpenSession_argsStandardScheme(); + } + } + + private static class OpenSession_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_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 TOpenSessionReq(); + 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, OpenSession_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 OpenSession_argsTupleSchemeFactory implements SchemeFactory { + public OpenSession_argsTupleScheme getScheme() { + return new OpenSession_argsTupleScheme(); + } + } + + private static class OpenSession_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_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, OpenSession_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TOpenSessionReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 OpenSession_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new OpenSession_resultTupleSchemeFactory()); + } + + private TOpenSessionResp 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, TOpenSessionResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_result.class, metaDataMap); + } + + public OpenSession_result() { + } + + public OpenSession_result( + TOpenSessionResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public OpenSession_result(OpenSession_result other) { + if (other.isSetSuccess()) { + this.success = new TOpenSessionResp(other.success); + } + } + + public OpenSession_result deepCopy() { + return new OpenSession_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TOpenSessionResp getSuccess() { + return this.success; + } + + public void setSuccess(TOpenSessionResp 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((TOpenSessionResp)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 OpenSession_result) + return this.equals((OpenSession_result)that); + return false; + } + + public boolean equals(OpenSession_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(OpenSession_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("OpenSession_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 OpenSession_resultStandardSchemeFactory implements SchemeFactory { + public OpenSession_resultStandardScheme getScheme() { + return new OpenSession_resultStandardScheme(); + } + } + + private static class OpenSession_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_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 TOpenSessionResp(); + 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, OpenSession_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 OpenSession_resultTupleSchemeFactory implements SchemeFactory { + public OpenSession_resultTupleScheme getScheme() { + return new OpenSession_resultTupleScheme(); + } + } + + private static class OpenSession_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_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, OpenSession_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TOpenSessionResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 CloseSession_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseSession_argsTupleSchemeFactory()); + } + + private TCloseSessionReq 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, TCloseSessionReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_args.class, metaDataMap); + } + + public CloseSession_args() { + } + + public CloseSession_args( + TCloseSessionReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CloseSession_args(CloseSession_args other) { + if (other.isSetReq()) { + this.req = new TCloseSessionReq(other.req); + } + } + + public CloseSession_args deepCopy() { + return new CloseSession_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TCloseSessionReq getReq() { + return this.req; + } + + public void setReq(TCloseSessionReq 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((TCloseSessionReq)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 CloseSession_args) + return this.equals((CloseSession_args)that); + return false; + } + + public boolean equals(CloseSession_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(CloseSession_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("CloseSession_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 CloseSession_argsStandardSchemeFactory implements SchemeFactory { + public CloseSession_argsStandardScheme getScheme() { + return new CloseSession_argsStandardScheme(); + } + } + + private static class CloseSession_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_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 TCloseSessionReq(); + 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, CloseSession_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 CloseSession_argsTupleSchemeFactory implements SchemeFactory { + public CloseSession_argsTupleScheme getScheme() { + return new CloseSession_argsTupleScheme(); + } + } + + private static class CloseSession_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_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, CloseSession_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCloseSessionReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 CloseSession_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseSession_resultTupleSchemeFactory()); + } + + private TCloseSessionResp 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, TCloseSessionResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_result.class, metaDataMap); + } + + public CloseSession_result() { + } + + public CloseSession_result( + TCloseSessionResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CloseSession_result(CloseSession_result other) { + if (other.isSetSuccess()) { + this.success = new TCloseSessionResp(other.success); + } + } + + public CloseSession_result deepCopy() { + return new CloseSession_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TCloseSessionResp getSuccess() { + return this.success; + } + + public void setSuccess(TCloseSessionResp 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((TCloseSessionResp)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 CloseSession_result) + return this.equals((CloseSession_result)that); + return false; + } + + public boolean equals(CloseSession_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(CloseSession_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("CloseSession_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 CloseSession_resultStandardSchemeFactory implements SchemeFactory { + public CloseSession_resultStandardScheme getScheme() { + return new CloseSession_resultStandardScheme(); + } + } + + private static class CloseSession_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_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 TCloseSessionResp(); + 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, CloseSession_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 CloseSession_resultTupleSchemeFactory implements SchemeFactory { + public CloseSession_resultTupleScheme getScheme() { + return new CloseSession_resultTupleScheme(); + } + } + + private static class CloseSession_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_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, CloseSession_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCloseSessionResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 GetInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetInfo_argsTupleSchemeFactory()); + } + + private TGetInfoReq 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, TGetInfoReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_args.class, metaDataMap); + } + + public GetInfo_args() { + } + + public GetInfo_args( + TGetInfoReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetInfo_args(GetInfo_args other) { + if (other.isSetReq()) { + this.req = new TGetInfoReq(other.req); + } + } + + public GetInfo_args deepCopy() { + return new GetInfo_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetInfoReq getReq() { + return this.req; + } + + public void setReq(TGetInfoReq 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((TGetInfoReq)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 GetInfo_args) + return this.equals((GetInfo_args)that); + return false; + } + + public boolean equals(GetInfo_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetInfo_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 GetInfo_argsStandardSchemeFactory implements SchemeFactory { + public GetInfo_argsStandardScheme getScheme() { + return new GetInfo_argsStandardScheme(); + } + } + + private static class GetInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_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 TGetInfoReq(); + 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, GetInfo_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 GetInfo_argsTupleSchemeFactory implements SchemeFactory { + public GetInfo_argsTupleScheme getScheme() { + return new GetInfo_argsTupleScheme(); + } + } + + private static class GetInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_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, GetInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetInfoReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 GetInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetInfo_resultTupleSchemeFactory()); + } + + private TGetInfoResp 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, TGetInfoResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_result.class, metaDataMap); + } + + public GetInfo_result() { + } + + public GetInfo_result( + TGetInfoResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetInfo_result(GetInfo_result other) { + if (other.isSetSuccess()) { + this.success = new TGetInfoResp(other.success); + } + } + + public GetInfo_result deepCopy() { + return new GetInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetInfoResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetInfoResp 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((TGetInfoResp)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 GetInfo_result) + return this.equals((GetInfo_result)that); + return false; + } + + public boolean equals(GetInfo_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetInfo_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 GetInfo_resultStandardSchemeFactory implements SchemeFactory { + public GetInfo_resultStandardScheme getScheme() { + return new GetInfo_resultStandardScheme(); + } + } + + private static class GetInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_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 TGetInfoResp(); + 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, GetInfo_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 GetInfo_resultTupleSchemeFactory implements SchemeFactory { + public GetInfo_resultTupleScheme getScheme() { + return new GetInfo_resultTupleScheme(); + } + } + + private static class GetInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_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, GetInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetInfoResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 ExecuteStatement_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ExecuteStatement_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(ExecuteStatement_args.class, metaDataMap); + } + + public ExecuteStatement_args() { + } + + public ExecuteStatement_args( + TExecuteStatementReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public ExecuteStatement_args(ExecuteStatement_args other) { + if (other.isSetReq()) { + this.req = new TExecuteStatementReq(other.req); + } + } + + public ExecuteStatement_args deepCopy() { + return new ExecuteStatement_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 ExecuteStatement_args) + return this.equals((ExecuteStatement_args)that); + return false; + } + + public boolean equals(ExecuteStatement_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(ExecuteStatement_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("ExecuteStatement_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 ExecuteStatement_argsStandardSchemeFactory implements SchemeFactory { + public ExecuteStatement_argsStandardScheme getScheme() { + return new ExecuteStatement_argsStandardScheme(); + } + } + + private static class ExecuteStatement_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_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, ExecuteStatement_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 ExecuteStatement_argsTupleSchemeFactory implements SchemeFactory { + public ExecuteStatement_argsTupleScheme getScheme() { + return new ExecuteStatement_argsTupleScheme(); + } + } + + private static class ExecuteStatement_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_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, ExecuteStatement_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); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 ExecuteStatement_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ExecuteStatement_resultTupleSchemeFactory()); + } + + private TExecuteStatementResp 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, TExecuteStatementResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_result.class, metaDataMap); + } + + public ExecuteStatement_result() { + } + + public ExecuteStatement_result( + TExecuteStatementResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public ExecuteStatement_result(ExecuteStatement_result other) { + if (other.isSetSuccess()) { + this.success = new TExecuteStatementResp(other.success); + } + } + + public ExecuteStatement_result deepCopy() { + return new ExecuteStatement_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TExecuteStatementResp getSuccess() { + return this.success; + } + + public void setSuccess(TExecuteStatementResp 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((TExecuteStatementResp)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 ExecuteStatement_result) + return this.equals((ExecuteStatement_result)that); + return false; + } + + public boolean equals(ExecuteStatement_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(ExecuteStatement_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("ExecuteStatement_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 ExecuteStatement_resultStandardSchemeFactory implements SchemeFactory { + public ExecuteStatement_resultStandardScheme getScheme() { + return new ExecuteStatement_resultStandardScheme(); + } + } + + private static class ExecuteStatement_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_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 TExecuteStatementResp(); + 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, ExecuteStatement_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 ExecuteStatement_resultTupleSchemeFactory implements SchemeFactory { + public ExecuteStatement_resultTupleScheme getScheme() { + return new ExecuteStatement_resultTupleScheme(); + } + } + + private static class ExecuteStatement_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_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, ExecuteStatement_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TExecuteStatementResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 GetTypeInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTypeInfo_argsTupleSchemeFactory()); + } + + private TGetTypeInfoReq 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, TGetTypeInfoReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_args.class, metaDataMap); + } + + public GetTypeInfo_args() { + } + + public GetTypeInfo_args( + TGetTypeInfoReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetTypeInfo_args(GetTypeInfo_args other) { + if (other.isSetReq()) { + this.req = new TGetTypeInfoReq(other.req); + } + } + + public GetTypeInfo_args deepCopy() { + return new GetTypeInfo_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetTypeInfoReq getReq() { + return this.req; + } + + public void setReq(TGetTypeInfoReq 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((TGetTypeInfoReq)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 GetTypeInfo_args) + return this.equals((GetTypeInfo_args)that); + return false; + } + + public boolean equals(GetTypeInfo_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetTypeInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetTypeInfo_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 GetTypeInfo_argsStandardSchemeFactory implements SchemeFactory { + public GetTypeInfo_argsStandardScheme getScheme() { + return new GetTypeInfo_argsStandardScheme(); + } + } + + private static class GetTypeInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_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 TGetTypeInfoReq(); + 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, GetTypeInfo_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 GetTypeInfo_argsTupleSchemeFactory implements SchemeFactory { + public GetTypeInfo_argsTupleScheme getScheme() { + return new GetTypeInfo_argsTupleScheme(); + } + } + + private static class GetTypeInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_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, GetTypeInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetTypeInfoReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 GetTypeInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTypeInfo_resultTupleSchemeFactory()); + } + + private TGetTypeInfoResp 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, TGetTypeInfoResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_result.class, metaDataMap); + } + + public GetTypeInfo_result() { + } + + public GetTypeInfo_result( + TGetTypeInfoResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetTypeInfo_result(GetTypeInfo_result other) { + if (other.isSetSuccess()) { + this.success = new TGetTypeInfoResp(other.success); + } + } + + public GetTypeInfo_result deepCopy() { + return new GetTypeInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetTypeInfoResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetTypeInfoResp 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((TGetTypeInfoResp)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 GetTypeInfo_result) + return this.equals((GetTypeInfo_result)that); + return false; + } + + public boolean equals(GetTypeInfo_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetTypeInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetTypeInfo_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 GetTypeInfo_resultStandardSchemeFactory implements SchemeFactory { + public GetTypeInfo_resultStandardScheme getScheme() { + return new GetTypeInfo_resultStandardScheme(); + } + } + + private static class GetTypeInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_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 TGetTypeInfoResp(); + 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, GetTypeInfo_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 GetTypeInfo_resultTupleSchemeFactory implements SchemeFactory { + public GetTypeInfo_resultTupleScheme getScheme() { + return new GetTypeInfo_resultTupleScheme(); + } + } + + private static class GetTypeInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_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, GetTypeInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetTypeInfoResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 GetCatalogs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCatalogs_argsTupleSchemeFactory()); + } + + private TGetCatalogsReq 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, TGetCatalogsReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_args.class, metaDataMap); + } + + public GetCatalogs_args() { + } + + public GetCatalogs_args( + TGetCatalogsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetCatalogs_args(GetCatalogs_args other) { + if (other.isSetReq()) { + this.req = new TGetCatalogsReq(other.req); + } + } + + public GetCatalogs_args deepCopy() { + return new GetCatalogs_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetCatalogsReq getReq() { + return this.req; + } + + public void setReq(TGetCatalogsReq 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((TGetCatalogsReq)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 GetCatalogs_args) + return this.equals((GetCatalogs_args)that); + return false; + } + + public boolean equals(GetCatalogs_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetCatalogs_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetCatalogs_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 GetCatalogs_argsStandardSchemeFactory implements SchemeFactory { + public GetCatalogs_argsStandardScheme getScheme() { + return new GetCatalogs_argsStandardScheme(); + } + } + + private static class GetCatalogs_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_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 TGetCatalogsReq(); + 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, GetCatalogs_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 GetCatalogs_argsTupleSchemeFactory implements SchemeFactory { + public GetCatalogs_argsTupleScheme getScheme() { + return new GetCatalogs_argsTupleScheme(); + } + } + + private static class GetCatalogs_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_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, GetCatalogs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetCatalogsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 GetCatalogs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCatalogs_resultTupleSchemeFactory()); + } + + private TGetCatalogsResp 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, TGetCatalogsResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_result.class, metaDataMap); + } + + public GetCatalogs_result() { + } + + public GetCatalogs_result( + TGetCatalogsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetCatalogs_result(GetCatalogs_result other) { + if (other.isSetSuccess()) { + this.success = new TGetCatalogsResp(other.success); + } + } + + public GetCatalogs_result deepCopy() { + return new GetCatalogs_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetCatalogsResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetCatalogsResp 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((TGetCatalogsResp)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 GetCatalogs_result) + return this.equals((GetCatalogs_result)that); + return false; + } + + public boolean equals(GetCatalogs_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetCatalogs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetCatalogs_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 GetCatalogs_resultStandardSchemeFactory implements SchemeFactory { + public GetCatalogs_resultStandardScheme getScheme() { + return new GetCatalogs_resultStandardScheme(); + } + } + + private static class GetCatalogs_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_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 TGetCatalogsResp(); + 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, GetCatalogs_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 GetCatalogs_resultTupleSchemeFactory implements SchemeFactory { + public GetCatalogs_resultTupleScheme getScheme() { + return new GetCatalogs_resultTupleScheme(); + } + } + + private static class GetCatalogs_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_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, GetCatalogs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetCatalogsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 GetSchemas_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetSchemas_argsTupleSchemeFactory()); + } + + private TGetSchemasReq 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, TGetSchemasReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_args.class, metaDataMap); + } + + public GetSchemas_args() { + } + + public GetSchemas_args( + TGetSchemasReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetSchemas_args(GetSchemas_args other) { + if (other.isSetReq()) { + this.req = new TGetSchemasReq(other.req); + } + } + + public GetSchemas_args deepCopy() { + return new GetSchemas_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetSchemasReq getReq() { + return this.req; + } + + public void setReq(TGetSchemasReq 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((TGetSchemasReq)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 GetSchemas_args) + return this.equals((GetSchemas_args)that); + return false; + } + + public boolean equals(GetSchemas_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetSchemas_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetSchemas_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 GetSchemas_argsStandardSchemeFactory implements SchemeFactory { + public GetSchemas_argsStandardScheme getScheme() { + return new GetSchemas_argsStandardScheme(); + } + } + + private static class GetSchemas_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_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 TGetSchemasReq(); + 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, GetSchemas_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 GetSchemas_argsTupleSchemeFactory implements SchemeFactory { + public GetSchemas_argsTupleScheme getScheme() { + return new GetSchemas_argsTupleScheme(); + } + } + + private static class GetSchemas_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_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, GetSchemas_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetSchemasReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 GetSchemas_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetSchemas_resultTupleSchemeFactory()); + } + + private TGetSchemasResp 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, TGetSchemasResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_result.class, metaDataMap); + } + + public GetSchemas_result() { + } + + public GetSchemas_result( + TGetSchemasResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetSchemas_result(GetSchemas_result other) { + if (other.isSetSuccess()) { + this.success = new TGetSchemasResp(other.success); + } + } + + public GetSchemas_result deepCopy() { + return new GetSchemas_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetSchemasResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetSchemasResp 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((TGetSchemasResp)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 GetSchemas_result) + return this.equals((GetSchemas_result)that); + return false; + } + + public boolean equals(GetSchemas_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetSchemas_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetSchemas_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 GetSchemas_resultStandardSchemeFactory implements SchemeFactory { + public GetSchemas_resultStandardScheme getScheme() { + return new GetSchemas_resultStandardScheme(); + } + } + + private static class GetSchemas_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_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 TGetSchemasResp(); + 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, GetSchemas_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 GetSchemas_resultTupleSchemeFactory implements SchemeFactory { + public GetSchemas_resultTupleScheme getScheme() { + return new GetSchemas_resultTupleScheme(); + } + } + + private static class GetSchemas_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_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, GetSchemas_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetSchemasResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 GetTables_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTables_argsTupleSchemeFactory()); + } + + private TGetTablesReq 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, TGetTablesReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_args.class, metaDataMap); + } + + public GetTables_args() { + } + + public GetTables_args( + TGetTablesReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetTables_args(GetTables_args other) { + if (other.isSetReq()) { + this.req = new TGetTablesReq(other.req); + } + } + + public GetTables_args deepCopy() { + return new GetTables_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetTablesReq getReq() { + return this.req; + } + + public void setReq(TGetTablesReq 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((TGetTablesReq)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 GetTables_args) + return this.equals((GetTables_args)that); + return false; + } + + public boolean equals(GetTables_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetTables_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetTables_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 GetTables_argsStandardSchemeFactory implements SchemeFactory { + public GetTables_argsStandardScheme getScheme() { + return new GetTables_argsStandardScheme(); + } + } + + private static class GetTables_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_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 TGetTablesReq(); + 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, GetTables_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 GetTables_argsTupleSchemeFactory implements SchemeFactory { + public GetTables_argsTupleScheme getScheme() { + return new GetTables_argsTupleScheme(); + } + } + + private static class GetTables_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_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, GetTables_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetTablesReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 GetTables_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTables_resultTupleSchemeFactory()); + } + + private TGetTablesResp 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, TGetTablesResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_result.class, metaDataMap); + } + + public GetTables_result() { + } + + public GetTables_result( + TGetTablesResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetTables_result(GetTables_result other) { + if (other.isSetSuccess()) { + this.success = new TGetTablesResp(other.success); + } + } + + public GetTables_result deepCopy() { + return new GetTables_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetTablesResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetTablesResp 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((TGetTablesResp)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 GetTables_result) + return this.equals((GetTables_result)that); + return false; + } + + public boolean equals(GetTables_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetTables_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetTables_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 GetTables_resultStandardSchemeFactory implements SchemeFactory { + public GetTables_resultStandardScheme getScheme() { + return new GetTables_resultStandardScheme(); + } + } + + private static class GetTables_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_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 TGetTablesResp(); + 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, GetTables_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 GetTables_resultTupleSchemeFactory implements SchemeFactory { + public GetTables_resultTupleScheme getScheme() { + return new GetTables_resultTupleScheme(); + } + } + + private static class GetTables_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_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, GetTables_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetTablesResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 GetTableTypes_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTableTypes_argsTupleSchemeFactory()); + } + + private TGetTableTypesReq 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, TGetTableTypesReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_args.class, metaDataMap); + } + + public GetTableTypes_args() { + } + + public GetTableTypes_args( + TGetTableTypesReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetTableTypes_args(GetTableTypes_args other) { + if (other.isSetReq()) { + this.req = new TGetTableTypesReq(other.req); + } + } + + public GetTableTypes_args deepCopy() { + return new GetTableTypes_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetTableTypesReq getReq() { + return this.req; + } + + public void setReq(TGetTableTypesReq 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((TGetTableTypesReq)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 GetTableTypes_args) + return this.equals((GetTableTypes_args)that); + return false; + } + + public boolean equals(GetTableTypes_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetTableTypes_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetTableTypes_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 GetTableTypes_argsStandardSchemeFactory implements SchemeFactory { + public GetTableTypes_argsStandardScheme getScheme() { + return new GetTableTypes_argsStandardScheme(); + } + } + + private static class GetTableTypes_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_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 TGetTableTypesReq(); + 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, GetTableTypes_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 GetTableTypes_argsTupleSchemeFactory implements SchemeFactory { + public GetTableTypes_argsTupleScheme getScheme() { + return new GetTableTypes_argsTupleScheme(); + } + } + + private static class GetTableTypes_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_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, GetTableTypes_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetTableTypesReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 GetTableTypes_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTableTypes_resultTupleSchemeFactory()); + } + + private TGetTableTypesResp 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, TGetTableTypesResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_result.class, metaDataMap); + } + + public GetTableTypes_result() { + } + + public GetTableTypes_result( + TGetTableTypesResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetTableTypes_result(GetTableTypes_result other) { + if (other.isSetSuccess()) { + this.success = new TGetTableTypesResp(other.success); + } + } + + public GetTableTypes_result deepCopy() { + return new GetTableTypes_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetTableTypesResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetTableTypesResp 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((TGetTableTypesResp)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 GetTableTypes_result) + return this.equals((GetTableTypes_result)that); + return false; + } + + public boolean equals(GetTableTypes_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetTableTypes_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetTableTypes_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 GetTableTypes_resultStandardSchemeFactory implements SchemeFactory { + public GetTableTypes_resultStandardScheme getScheme() { + return new GetTableTypes_resultStandardScheme(); + } + } + + private static class GetTableTypes_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_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 TGetTableTypesResp(); + 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, GetTableTypes_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 GetTableTypes_resultTupleSchemeFactory implements SchemeFactory { + public GetTableTypes_resultTupleScheme getScheme() { + return new GetTableTypes_resultTupleScheme(); + } + } + + private static class GetTableTypes_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_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, GetTableTypes_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetTableTypesResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 GetColumns_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetColumns_argsTupleSchemeFactory()); + } + + private TGetColumnsReq 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, TGetColumnsReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_args.class, metaDataMap); + } + + public GetColumns_args() { + } + + public GetColumns_args( + TGetColumnsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetColumns_args(GetColumns_args other) { + if (other.isSetReq()) { + this.req = new TGetColumnsReq(other.req); + } + } + + public GetColumns_args deepCopy() { + return new GetColumns_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetColumnsReq getReq() { + return this.req; + } + + public void setReq(TGetColumnsReq 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((TGetColumnsReq)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 GetColumns_args) + return this.equals((GetColumns_args)that); + return false; + } + + public boolean equals(GetColumns_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetColumns_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetColumns_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 GetColumns_argsStandardSchemeFactory implements SchemeFactory { + public GetColumns_argsStandardScheme getScheme() { + return new GetColumns_argsStandardScheme(); + } + } + + private static class GetColumns_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_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 TGetColumnsReq(); + 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, GetColumns_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 GetColumns_argsTupleSchemeFactory implements SchemeFactory { + public GetColumns_argsTupleScheme getScheme() { + return new GetColumns_argsTupleScheme(); + } + } + + private static class GetColumns_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_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, GetColumns_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetColumnsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 GetColumns_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetColumns_resultTupleSchemeFactory()); + } + + private TGetColumnsResp 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, TGetColumnsResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_result.class, metaDataMap); + } + + public GetColumns_result() { + } + + public GetColumns_result( + TGetColumnsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetColumns_result(GetColumns_result other) { + if (other.isSetSuccess()) { + this.success = new TGetColumnsResp(other.success); + } + } + + public GetColumns_result deepCopy() { + return new GetColumns_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetColumnsResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetColumnsResp 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((TGetColumnsResp)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 GetColumns_result) + return this.equals((GetColumns_result)that); + return false; + } + + public boolean equals(GetColumns_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetColumns_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetColumns_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 GetColumns_resultStandardSchemeFactory implements SchemeFactory { + public GetColumns_resultStandardScheme getScheme() { + return new GetColumns_resultStandardScheme(); + } + } + + private static class GetColumns_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_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 TGetColumnsResp(); + 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, GetColumns_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 GetColumns_resultTupleSchemeFactory implements SchemeFactory { + public GetColumns_resultTupleScheme getScheme() { + return new GetColumns_resultTupleScheme(); + } + } + + private static class GetColumns_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_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, GetColumns_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetColumnsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 GetFunctions_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetFunctions_argsTupleSchemeFactory()); + } + + private TGetFunctionsReq 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, TGetFunctionsReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_args.class, metaDataMap); + } + + public GetFunctions_args() { + } + + public GetFunctions_args( + TGetFunctionsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetFunctions_args(GetFunctions_args other) { + if (other.isSetReq()) { + this.req = new TGetFunctionsReq(other.req); + } + } + + public GetFunctions_args deepCopy() { + return new GetFunctions_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetFunctionsReq getReq() { + return this.req; + } + + public void setReq(TGetFunctionsReq 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((TGetFunctionsReq)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 GetFunctions_args) + return this.equals((GetFunctions_args)that); + return false; + } + + public boolean equals(GetFunctions_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetFunctions_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetFunctions_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 GetFunctions_argsStandardSchemeFactory implements SchemeFactory { + public GetFunctions_argsStandardScheme getScheme() { + return new GetFunctions_argsStandardScheme(); + } + } + + private static class GetFunctions_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_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 TGetFunctionsReq(); + 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, GetFunctions_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 GetFunctions_argsTupleSchemeFactory implements SchemeFactory { + public GetFunctions_argsTupleScheme getScheme() { + return new GetFunctions_argsTupleScheme(); + } + } + + private static class GetFunctions_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_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, GetFunctions_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetFunctionsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 GetFunctions_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetFunctions_resultTupleSchemeFactory()); + } + + private TGetFunctionsResp 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, TGetFunctionsResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_result.class, metaDataMap); + } + + public GetFunctions_result() { + } + + public GetFunctions_result( + TGetFunctionsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetFunctions_result(GetFunctions_result other) { + if (other.isSetSuccess()) { + this.success = new TGetFunctionsResp(other.success); + } + } + + public GetFunctions_result deepCopy() { + return new GetFunctions_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetFunctionsResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetFunctionsResp 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((TGetFunctionsResp)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 GetFunctions_result) + return this.equals((GetFunctions_result)that); + return false; + } + + public boolean equals(GetFunctions_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetFunctions_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetFunctions_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 GetFunctions_resultStandardSchemeFactory implements SchemeFactory { + public GetFunctions_resultStandardScheme getScheme() { + return new GetFunctions_resultStandardScheme(); + } + } + + private static class GetFunctions_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_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 TGetFunctionsResp(); + 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, GetFunctions_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 GetFunctions_resultTupleSchemeFactory implements SchemeFactory { + public GetFunctions_resultTupleScheme getScheme() { + return new GetFunctions_resultTupleScheme(); + } + } + + private static class GetFunctions_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_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, GetFunctions_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetFunctionsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 GetPrimaryKeys_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetPrimaryKeys_argsTupleSchemeFactory()); + } + + private TGetPrimaryKeysReq 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, TGetPrimaryKeysReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_args.class, metaDataMap); + } + + public GetPrimaryKeys_args() { + } + + public GetPrimaryKeys_args( + TGetPrimaryKeysReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetPrimaryKeys_args(GetPrimaryKeys_args other) { + if (other.isSetReq()) { + this.req = new TGetPrimaryKeysReq(other.req); + } + } + + public GetPrimaryKeys_args deepCopy() { + return new GetPrimaryKeys_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetPrimaryKeysReq getReq() { + return this.req; + } + + public void setReq(TGetPrimaryKeysReq 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((TGetPrimaryKeysReq)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 GetPrimaryKeys_args) + return this.equals((GetPrimaryKeys_args)that); + return false; + } + + public boolean equals(GetPrimaryKeys_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetPrimaryKeys_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetPrimaryKeys_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 GetPrimaryKeys_argsStandardSchemeFactory implements SchemeFactory { + public GetPrimaryKeys_argsStandardScheme getScheme() { + return new GetPrimaryKeys_argsStandardScheme(); + } + } + + private static class GetPrimaryKeys_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_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 TGetPrimaryKeysReq(); + 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, GetPrimaryKeys_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 GetPrimaryKeys_argsTupleSchemeFactory implements SchemeFactory { + public GetPrimaryKeys_argsTupleScheme getScheme() { + return new GetPrimaryKeys_argsTupleScheme(); + } + } + + private static class GetPrimaryKeys_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_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, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetPrimaryKeysReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 GetPrimaryKeys_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetPrimaryKeys_resultTupleSchemeFactory()); + } + + private TGetPrimaryKeysResp 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, TGetPrimaryKeysResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_result.class, metaDataMap); + } + + public GetPrimaryKeys_result() { + } + + public GetPrimaryKeys_result( + TGetPrimaryKeysResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetPrimaryKeys_result(GetPrimaryKeys_result other) { + if (other.isSetSuccess()) { + this.success = new TGetPrimaryKeysResp(other.success); + } + } + + public GetPrimaryKeys_result deepCopy() { + return new GetPrimaryKeys_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetPrimaryKeysResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetPrimaryKeysResp 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((TGetPrimaryKeysResp)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 GetPrimaryKeys_result) + return this.equals((GetPrimaryKeys_result)that); + return false; + } + + public boolean equals(GetPrimaryKeys_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetPrimaryKeys_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetPrimaryKeys_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 GetPrimaryKeys_resultStandardSchemeFactory implements SchemeFactory { + public GetPrimaryKeys_resultStandardScheme getScheme() { + return new GetPrimaryKeys_resultStandardScheme(); + } + } + + private static class GetPrimaryKeys_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_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 TGetPrimaryKeysResp(); + 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, GetPrimaryKeys_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 GetPrimaryKeys_resultTupleSchemeFactory implements SchemeFactory { + public GetPrimaryKeys_resultTupleScheme getScheme() { + return new GetPrimaryKeys_resultTupleScheme(); + } + } + + private static class GetPrimaryKeys_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_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, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetPrimaryKeysResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 GetCrossReference_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCrossReference_argsTupleSchemeFactory()); + } + + private TGetCrossReferenceReq 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, TGetCrossReferenceReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_args.class, metaDataMap); + } + + public GetCrossReference_args() { + } + + public GetCrossReference_args( + TGetCrossReferenceReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetCrossReference_args(GetCrossReference_args other) { + if (other.isSetReq()) { + this.req = new TGetCrossReferenceReq(other.req); + } + } + + public GetCrossReference_args deepCopy() { + return new GetCrossReference_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetCrossReferenceReq getReq() { + return this.req; + } + + public void setReq(TGetCrossReferenceReq 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((TGetCrossReferenceReq)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 GetCrossReference_args) + return this.equals((GetCrossReference_args)that); + return false; + } + + public boolean equals(GetCrossReference_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetCrossReference_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetCrossReference_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 GetCrossReference_argsStandardSchemeFactory implements SchemeFactory { + public GetCrossReference_argsStandardScheme getScheme() { + return new GetCrossReference_argsStandardScheme(); + } + } + + private static class GetCrossReference_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_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 TGetCrossReferenceReq(); + 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, GetCrossReference_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 GetCrossReference_argsTupleSchemeFactory implements SchemeFactory { + public GetCrossReference_argsTupleScheme getScheme() { + return new GetCrossReference_argsTupleScheme(); + } + } + + private static class GetCrossReference_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_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, GetCrossReference_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetCrossReferenceReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 GetCrossReference_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCrossReference_resultTupleSchemeFactory()); + } + + private TGetCrossReferenceResp 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, TGetCrossReferenceResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_result.class, metaDataMap); + } + + public GetCrossReference_result() { + } + + public GetCrossReference_result( + TGetCrossReferenceResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetCrossReference_result(GetCrossReference_result other) { + if (other.isSetSuccess()) { + this.success = new TGetCrossReferenceResp(other.success); + } + } + + public GetCrossReference_result deepCopy() { + return new GetCrossReference_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetCrossReferenceResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetCrossReferenceResp 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((TGetCrossReferenceResp)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 GetCrossReference_result) + return this.equals((GetCrossReference_result)that); + return false; + } + + public boolean equals(GetCrossReference_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetCrossReference_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetCrossReference_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 GetCrossReference_resultStandardSchemeFactory implements SchemeFactory { + public GetCrossReference_resultStandardScheme getScheme() { + return new GetCrossReference_resultStandardScheme(); + } + } + + private static class GetCrossReference_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_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 TGetCrossReferenceResp(); + 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, GetCrossReference_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 GetCrossReference_resultTupleSchemeFactory implements SchemeFactory { + public GetCrossReference_resultTupleScheme getScheme() { + return new GetCrossReference_resultTupleScheme(); + } + } + + private static class GetCrossReference_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_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, GetCrossReference_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetCrossReferenceResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 GetOperationStatus_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetOperationStatus_argsTupleSchemeFactory()); + } + + private TGetOperationStatusReq 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, TGetOperationStatusReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_args.class, metaDataMap); + } + + public GetOperationStatus_args() { + } + + public GetOperationStatus_args( + TGetOperationStatusReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetOperationStatus_args(GetOperationStatus_args other) { + if (other.isSetReq()) { + this.req = new TGetOperationStatusReq(other.req); + } + } + + public GetOperationStatus_args deepCopy() { + return new GetOperationStatus_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetOperationStatusReq getReq() { + return this.req; + } + + public void setReq(TGetOperationStatusReq 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((TGetOperationStatusReq)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 GetOperationStatus_args) + return this.equals((GetOperationStatus_args)that); + return false; + } + + public boolean equals(GetOperationStatus_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetOperationStatus_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetOperationStatus_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 GetOperationStatus_argsStandardSchemeFactory implements SchemeFactory { + public GetOperationStatus_argsStandardScheme getScheme() { + return new GetOperationStatus_argsStandardScheme(); + } + } + + private static class GetOperationStatus_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_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 TGetOperationStatusReq(); + 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, GetOperationStatus_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 GetOperationStatus_argsTupleSchemeFactory implements SchemeFactory { + public GetOperationStatus_argsTupleScheme getScheme() { + return new GetOperationStatus_argsTupleScheme(); + } + } + + private static class GetOperationStatus_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_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, GetOperationStatus_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetOperationStatusReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 GetOperationStatus_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetOperationStatus_resultTupleSchemeFactory()); + } + + private TGetOperationStatusResp 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, TGetOperationStatusResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_result.class, metaDataMap); + } + + public GetOperationStatus_result() { + } + + public GetOperationStatus_result( + TGetOperationStatusResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetOperationStatus_result(GetOperationStatus_result other) { + if (other.isSetSuccess()) { + this.success = new TGetOperationStatusResp(other.success); + } + } + + public GetOperationStatus_result deepCopy() { + return new GetOperationStatus_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetOperationStatusResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetOperationStatusResp 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((TGetOperationStatusResp)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 GetOperationStatus_result) + return this.equals((GetOperationStatus_result)that); + return false; + } + + public boolean equals(GetOperationStatus_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetOperationStatus_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetOperationStatus_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 GetOperationStatus_resultStandardSchemeFactory implements SchemeFactory { + public GetOperationStatus_resultStandardScheme getScheme() { + return new GetOperationStatus_resultStandardScheme(); + } + } + + private static class GetOperationStatus_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_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 TGetOperationStatusResp(); + 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, GetOperationStatus_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 GetOperationStatus_resultTupleSchemeFactory implements SchemeFactory { + public GetOperationStatus_resultTupleScheme getScheme() { + return new GetOperationStatus_resultTupleScheme(); + } + } + + private static class GetOperationStatus_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_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, GetOperationStatus_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetOperationStatusResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 CancelOperation_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelOperation_argsTupleSchemeFactory()); + } + + private TCancelOperationReq 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, TCancelOperationReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_args.class, metaDataMap); + } + + public CancelOperation_args() { + } + + public CancelOperation_args( + TCancelOperationReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CancelOperation_args(CancelOperation_args other) { + if (other.isSetReq()) { + this.req = new TCancelOperationReq(other.req); + } + } + + public CancelOperation_args deepCopy() { + return new CancelOperation_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TCancelOperationReq getReq() { + return this.req; + } + + public void setReq(TCancelOperationReq 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((TCancelOperationReq)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 CancelOperation_args) + return this.equals((CancelOperation_args)that); + return false; + } + + public boolean equals(CancelOperation_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(CancelOperation_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("CancelOperation_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 CancelOperation_argsStandardSchemeFactory implements SchemeFactory { + public CancelOperation_argsStandardScheme getScheme() { + return new CancelOperation_argsStandardScheme(); + } + } + + private static class CancelOperation_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_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 TCancelOperationReq(); + 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, CancelOperation_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 CancelOperation_argsTupleSchemeFactory implements SchemeFactory { + public CancelOperation_argsTupleScheme getScheme() { + return new CancelOperation_argsTupleScheme(); + } + } + + private static class CancelOperation_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_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, CancelOperation_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCancelOperationReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 CancelOperation_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelOperation_resultTupleSchemeFactory()); + } + + private TCancelOperationResp 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, TCancelOperationResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_result.class, metaDataMap); + } + + public CancelOperation_result() { + } + + public CancelOperation_result( + TCancelOperationResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CancelOperation_result(CancelOperation_result other) { + if (other.isSetSuccess()) { + this.success = new TCancelOperationResp(other.success); + } + } + + public CancelOperation_result deepCopy() { + return new CancelOperation_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TCancelOperationResp getSuccess() { + return this.success; + } + + public void setSuccess(TCancelOperationResp 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((TCancelOperationResp)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 CancelOperation_result) + return this.equals((CancelOperation_result)that); + return false; + } + + public boolean equals(CancelOperation_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(CancelOperation_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("CancelOperation_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 CancelOperation_resultStandardSchemeFactory implements SchemeFactory { + public CancelOperation_resultStandardScheme getScheme() { + return new CancelOperation_resultStandardScheme(); + } + } + + private static class CancelOperation_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_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 TCancelOperationResp(); + 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, CancelOperation_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 CancelOperation_resultTupleSchemeFactory implements SchemeFactory { + public CancelOperation_resultTupleScheme getScheme() { + return new CancelOperation_resultTupleScheme(); + } + } + + private static class CancelOperation_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_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, CancelOperation_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCancelOperationResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 CloseOperation_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseOperation_argsTupleSchemeFactory()); + } + + private TCloseOperationReq 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, TCloseOperationReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_args.class, metaDataMap); + } + + public CloseOperation_args() { + } + + public CloseOperation_args( + TCloseOperationReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CloseOperation_args(CloseOperation_args other) { + if (other.isSetReq()) { + this.req = new TCloseOperationReq(other.req); + } + } + + public CloseOperation_args deepCopy() { + return new CloseOperation_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TCloseOperationReq getReq() { + return this.req; + } + + public void setReq(TCloseOperationReq 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((TCloseOperationReq)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 CloseOperation_args) + return this.equals((CloseOperation_args)that); + return false; + } + + public boolean equals(CloseOperation_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(CloseOperation_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("CloseOperation_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 CloseOperation_argsStandardSchemeFactory implements SchemeFactory { + public CloseOperation_argsStandardScheme getScheme() { + return new CloseOperation_argsStandardScheme(); + } + } + + private static class CloseOperation_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_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 TCloseOperationReq(); + 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, CloseOperation_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 CloseOperation_argsTupleSchemeFactory implements SchemeFactory { + public CloseOperation_argsTupleScheme getScheme() { + return new CloseOperation_argsTupleScheme(); + } + } + + private static class CloseOperation_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_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, CloseOperation_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCloseOperationReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 CloseOperation_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseOperation_resultTupleSchemeFactory()); + } + + private TCloseOperationResp 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, TCloseOperationResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_result.class, metaDataMap); + } + + public CloseOperation_result() { + } + + public CloseOperation_result( + TCloseOperationResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CloseOperation_result(CloseOperation_result other) { + if (other.isSetSuccess()) { + this.success = new TCloseOperationResp(other.success); + } + } + + public CloseOperation_result deepCopy() { + return new CloseOperation_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TCloseOperationResp getSuccess() { + return this.success; + } + + public void setSuccess(TCloseOperationResp 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((TCloseOperationResp)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 CloseOperation_result) + return this.equals((CloseOperation_result)that); + return false; + } + + public boolean equals(CloseOperation_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(CloseOperation_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("CloseOperation_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 CloseOperation_resultStandardSchemeFactory implements SchemeFactory { + public CloseOperation_resultStandardScheme getScheme() { + return new CloseOperation_resultStandardScheme(); + } + } + + private static class CloseOperation_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_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 TCloseOperationResp(); + 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, CloseOperation_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 CloseOperation_resultTupleSchemeFactory implements SchemeFactory { + public CloseOperation_resultTupleScheme getScheme() { + return new CloseOperation_resultTupleScheme(); + } + } + + private static class CloseOperation_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_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, CloseOperation_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCloseOperationResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 GetResultSetMetadata_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetResultSetMetadata_argsTupleSchemeFactory()); + } + + private TGetResultSetMetadataReq 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, TGetResultSetMetadataReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_args.class, metaDataMap); + } + + public GetResultSetMetadata_args() { + } + + public GetResultSetMetadata_args( + TGetResultSetMetadataReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetResultSetMetadata_args(GetResultSetMetadata_args other) { + if (other.isSetReq()) { + this.req = new TGetResultSetMetadataReq(other.req); + } + } + + public GetResultSetMetadata_args deepCopy() { + return new GetResultSetMetadata_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetResultSetMetadataReq getReq() { + return this.req; + } + + public void setReq(TGetResultSetMetadataReq 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((TGetResultSetMetadataReq)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 GetResultSetMetadata_args) + return this.equals((GetResultSetMetadata_args)that); + return false; + } + + public boolean equals(GetResultSetMetadata_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetResultSetMetadata_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetResultSetMetadata_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 GetResultSetMetadata_argsStandardSchemeFactory implements SchemeFactory { + public GetResultSetMetadata_argsStandardScheme getScheme() { + return new GetResultSetMetadata_argsStandardScheme(); + } + } + + private static class GetResultSetMetadata_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_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 TGetResultSetMetadataReq(); + 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, GetResultSetMetadata_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 GetResultSetMetadata_argsTupleSchemeFactory implements SchemeFactory { + public GetResultSetMetadata_argsTupleScheme getScheme() { + return new GetResultSetMetadata_argsTupleScheme(); + } + } + + private static class GetResultSetMetadata_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_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, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetResultSetMetadataReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 GetResultSetMetadata_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetResultSetMetadata_resultTupleSchemeFactory()); + } + + private TGetResultSetMetadataResp 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, TGetResultSetMetadataResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_result.class, metaDataMap); + } + + public GetResultSetMetadata_result() { + } + + public GetResultSetMetadata_result( + TGetResultSetMetadataResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetResultSetMetadata_result(GetResultSetMetadata_result other) { + if (other.isSetSuccess()) { + this.success = new TGetResultSetMetadataResp(other.success); + } + } + + public GetResultSetMetadata_result deepCopy() { + return new GetResultSetMetadata_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetResultSetMetadataResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetResultSetMetadataResp 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((TGetResultSetMetadataResp)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 GetResultSetMetadata_result) + return this.equals((GetResultSetMetadata_result)that); + return false; + } + + public boolean equals(GetResultSetMetadata_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetResultSetMetadata_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetResultSetMetadata_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 GetResultSetMetadata_resultStandardSchemeFactory implements SchemeFactory { + public GetResultSetMetadata_resultStandardScheme getScheme() { + return new GetResultSetMetadata_resultStandardScheme(); + } + } + + private static class GetResultSetMetadata_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_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 TGetResultSetMetadataResp(); + 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, GetResultSetMetadata_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 GetResultSetMetadata_resultTupleSchemeFactory implements SchemeFactory { + public GetResultSetMetadata_resultTupleScheme getScheme() { + return new GetResultSetMetadata_resultTupleScheme(); + } + } + + private static class GetResultSetMetadata_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_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, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetResultSetMetadataResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 FetchResults_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new FetchResults_argsTupleSchemeFactory()); + } + + private TFetchResultsReq 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, TFetchResultsReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_args.class, metaDataMap); + } + + public FetchResults_args() { + } + + public FetchResults_args( + TFetchResultsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public FetchResults_args(FetchResults_args other) { + if (other.isSetReq()) { + this.req = new TFetchResultsReq(other.req); + } + } + + public FetchResults_args deepCopy() { + return new FetchResults_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TFetchResultsReq getReq() { + return this.req; + } + + public void setReq(TFetchResultsReq 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((TFetchResultsReq)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 FetchResults_args) + return this.equals((FetchResults_args)that); + return false; + } + + public boolean equals(FetchResults_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(FetchResults_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("FetchResults_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 FetchResults_argsStandardSchemeFactory implements SchemeFactory { + public FetchResults_argsStandardScheme getScheme() { + return new FetchResults_argsStandardScheme(); + } + } + + private static class FetchResults_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_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 TFetchResultsReq(); + 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, FetchResults_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 FetchResults_argsTupleSchemeFactory implements SchemeFactory { + public FetchResults_argsTupleScheme getScheme() { + return new FetchResults_argsTupleScheme(); + } + } + + private static class FetchResults_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_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, FetchResults_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TFetchResultsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 FetchResults_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new FetchResults_resultTupleSchemeFactory()); + } + + private TFetchResultsResp 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, TFetchResultsResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_result.class, metaDataMap); + } + + public FetchResults_result() { + } + + public FetchResults_result( + TFetchResultsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public FetchResults_result(FetchResults_result other) { + if (other.isSetSuccess()) { + this.success = new TFetchResultsResp(other.success); + } + } + + public FetchResults_result deepCopy() { + return new FetchResults_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TFetchResultsResp getSuccess() { + return this.success; + } + + public void setSuccess(TFetchResultsResp 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((TFetchResultsResp)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 FetchResults_result) + return this.equals((FetchResults_result)that); + return false; + } + + public boolean equals(FetchResults_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(FetchResults_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("FetchResults_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 FetchResults_resultStandardSchemeFactory implements SchemeFactory { + public FetchResults_resultStandardScheme getScheme() { + return new FetchResults_resultStandardScheme(); + } + } + + private static class FetchResults_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_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 TFetchResultsResp(); + 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, FetchResults_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 FetchResults_resultTupleSchemeFactory implements SchemeFactory { + public FetchResults_resultTupleScheme getScheme() { + return new FetchResults_resultTupleScheme(); + } + } + + private static class FetchResults_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_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, FetchResults_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TFetchResultsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 GetDelegationToken_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetDelegationToken_argsTupleSchemeFactory()); + } + + private TGetDelegationTokenReq 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, TGetDelegationTokenReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_args.class, metaDataMap); + } + + public GetDelegationToken_args() { + } + + public GetDelegationToken_args( + TGetDelegationTokenReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetDelegationToken_args(GetDelegationToken_args other) { + if (other.isSetReq()) { + this.req = new TGetDelegationTokenReq(other.req); + } + } + + public GetDelegationToken_args deepCopy() { + return new GetDelegationToken_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetDelegationTokenReq getReq() { + return this.req; + } + + public void setReq(TGetDelegationTokenReq 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((TGetDelegationTokenReq)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 GetDelegationToken_args) + return this.equals((GetDelegationToken_args)that); + return false; + } + + public boolean equals(GetDelegationToken_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetDelegationToken_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetDelegationToken_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 GetDelegationToken_argsStandardSchemeFactory implements SchemeFactory { + public GetDelegationToken_argsStandardScheme getScheme() { + return new GetDelegationToken_argsStandardScheme(); + } + } + + private static class GetDelegationToken_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_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 TGetDelegationTokenReq(); + 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, GetDelegationToken_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 GetDelegationToken_argsTupleSchemeFactory implements SchemeFactory { + public GetDelegationToken_argsTupleScheme getScheme() { + return new GetDelegationToken_argsTupleScheme(); + } + } + + private static class GetDelegationToken_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_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, GetDelegationToken_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetDelegationTokenReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 GetDelegationToken_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetDelegationToken_resultTupleSchemeFactory()); + } + + private TGetDelegationTokenResp 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, TGetDelegationTokenResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_result.class, metaDataMap); + } + + public GetDelegationToken_result() { + } + + public GetDelegationToken_result( + TGetDelegationTokenResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetDelegationToken_result(GetDelegationToken_result other) { + if (other.isSetSuccess()) { + this.success = new TGetDelegationTokenResp(other.success); + } + } + + public GetDelegationToken_result deepCopy() { + return new GetDelegationToken_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetDelegationTokenResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetDelegationTokenResp 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((TGetDelegationTokenResp)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 GetDelegationToken_result) + return this.equals((GetDelegationToken_result)that); + return false; + } + + public boolean equals(GetDelegationToken_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetDelegationToken_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetDelegationToken_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 GetDelegationToken_resultStandardSchemeFactory implements SchemeFactory { + public GetDelegationToken_resultStandardScheme getScheme() { + return new GetDelegationToken_resultStandardScheme(); + } + } + + private static class GetDelegationToken_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_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 TGetDelegationTokenResp(); + 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, GetDelegationToken_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 GetDelegationToken_resultTupleSchemeFactory implements SchemeFactory { + public GetDelegationToken_resultTupleScheme getScheme() { + return new GetDelegationToken_resultTupleScheme(); + } + } + + private static class GetDelegationToken_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_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, GetDelegationToken_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetDelegationTokenResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 CancelDelegationToken_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelDelegationToken_argsTupleSchemeFactory()); + } + + private TCancelDelegationTokenReq 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, TCancelDelegationTokenReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_args.class, metaDataMap); + } + + public CancelDelegationToken_args() { + } + + public CancelDelegationToken_args( + TCancelDelegationTokenReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CancelDelegationToken_args(CancelDelegationToken_args other) { + if (other.isSetReq()) { + this.req = new TCancelDelegationTokenReq(other.req); + } + } + + public CancelDelegationToken_args deepCopy() { + return new CancelDelegationToken_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TCancelDelegationTokenReq getReq() { + return this.req; + } + + public void setReq(TCancelDelegationTokenReq 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((TCancelDelegationTokenReq)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 CancelDelegationToken_args) + return this.equals((CancelDelegationToken_args)that); + return false; + } + + public boolean equals(CancelDelegationToken_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(CancelDelegationToken_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("CancelDelegationToken_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 CancelDelegationToken_argsStandardSchemeFactory implements SchemeFactory { + public CancelDelegationToken_argsStandardScheme getScheme() { + return new CancelDelegationToken_argsStandardScheme(); + } + } + + private static class CancelDelegationToken_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_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 TCancelDelegationTokenReq(); + 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, CancelDelegationToken_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 CancelDelegationToken_argsTupleSchemeFactory implements SchemeFactory { + public CancelDelegationToken_argsTupleScheme getScheme() { + return new CancelDelegationToken_argsTupleScheme(); + } + } + + private static class CancelDelegationToken_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_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, CancelDelegationToken_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCancelDelegationTokenReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 CancelDelegationToken_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelDelegationToken_resultTupleSchemeFactory()); + } + + private TCancelDelegationTokenResp 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, TCancelDelegationTokenResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_result.class, metaDataMap); + } + + public CancelDelegationToken_result() { + } + + public CancelDelegationToken_result( + TCancelDelegationTokenResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CancelDelegationToken_result(CancelDelegationToken_result other) { + if (other.isSetSuccess()) { + this.success = new TCancelDelegationTokenResp(other.success); + } + } + + public CancelDelegationToken_result deepCopy() { + return new CancelDelegationToken_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TCancelDelegationTokenResp getSuccess() { + return this.success; + } + + public void setSuccess(TCancelDelegationTokenResp 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((TCancelDelegationTokenResp)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 CancelDelegationToken_result) + return this.equals((CancelDelegationToken_result)that); + return false; + } + + public boolean equals(CancelDelegationToken_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(CancelDelegationToken_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("CancelDelegationToken_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 CancelDelegationToken_resultStandardSchemeFactory implements SchemeFactory { + public CancelDelegationToken_resultStandardScheme getScheme() { + return new CancelDelegationToken_resultStandardScheme(); + } + } + + private static class CancelDelegationToken_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_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 TCancelDelegationTokenResp(); + 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, CancelDelegationToken_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 CancelDelegationToken_resultTupleSchemeFactory implements SchemeFactory { + public CancelDelegationToken_resultTupleScheme getScheme() { + return new CancelDelegationToken_resultTupleScheme(); + } + } + + private static class CancelDelegationToken_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_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, CancelDelegationToken_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCancelDelegationTokenResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 RenewDelegationToken_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RenewDelegationToken_argsTupleSchemeFactory()); + } + + private TRenewDelegationTokenReq 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, TRenewDelegationTokenReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_args.class, metaDataMap); + } + + public RenewDelegationToken_args() { + } + + public RenewDelegationToken_args( + TRenewDelegationTokenReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public RenewDelegationToken_args(RenewDelegationToken_args other) { + if (other.isSetReq()) { + this.req = new TRenewDelegationTokenReq(other.req); + } + } + + public RenewDelegationToken_args deepCopy() { + return new RenewDelegationToken_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TRenewDelegationTokenReq getReq() { + return this.req; + } + + public void setReq(TRenewDelegationTokenReq 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((TRenewDelegationTokenReq)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 RenewDelegationToken_args) + return this.equals((RenewDelegationToken_args)that); + return false; + } + + public boolean equals(RenewDelegationToken_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(RenewDelegationToken_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("RenewDelegationToken_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 RenewDelegationToken_argsStandardSchemeFactory implements SchemeFactory { + public RenewDelegationToken_argsStandardScheme getScheme() { + return new RenewDelegationToken_argsStandardScheme(); + } + } + + private static class RenewDelegationToken_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_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 TRenewDelegationTokenReq(); + 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, RenewDelegationToken_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 RenewDelegationToken_argsTupleSchemeFactory implements SchemeFactory { + public RenewDelegationToken_argsTupleScheme getScheme() { + return new RenewDelegationToken_argsTupleScheme(); + } + } + + private static class RenewDelegationToken_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_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, RenewDelegationToken_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TRenewDelegationTokenReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 RenewDelegationToken_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RenewDelegationToken_resultTupleSchemeFactory()); + } + + private TRenewDelegationTokenResp 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, TRenewDelegationTokenResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_result.class, metaDataMap); + } + + public RenewDelegationToken_result() { + } + + public RenewDelegationToken_result( + TRenewDelegationTokenResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public RenewDelegationToken_result(RenewDelegationToken_result other) { + if (other.isSetSuccess()) { + this.success = new TRenewDelegationTokenResp(other.success); + } + } + + public RenewDelegationToken_result deepCopy() { + return new RenewDelegationToken_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TRenewDelegationTokenResp getSuccess() { + return this.success; + } + + public void setSuccess(TRenewDelegationTokenResp 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((TRenewDelegationTokenResp)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 RenewDelegationToken_result) + return this.equals((RenewDelegationToken_result)that); + return false; + } + + public boolean equals(RenewDelegationToken_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(RenewDelegationToken_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("RenewDelegationToken_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 RenewDelegationToken_resultStandardSchemeFactory implements SchemeFactory { + public RenewDelegationToken_resultStandardScheme getScheme() { + return new RenewDelegationToken_resultStandardScheme(); + } + } + + private static class RenewDelegationToken_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_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 TRenewDelegationTokenResp(); + 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, RenewDelegationToken_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 RenewDelegationToken_resultTupleSchemeFactory implements SchemeFactory { + public RenewDelegationToken_resultTupleScheme getScheme() { + return new RenewDelegationToken_resultTupleScheme(); + } + } + + private static class RenewDelegationToken_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_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, RenewDelegationToken_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TRenewDelegationTokenResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 GetQueryId_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetQueryId_argsTupleSchemeFactory()); + } + + private TGetQueryIdReq 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, TGetQueryIdReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_args.class, metaDataMap); + } + + public GetQueryId_args() { + } + + public GetQueryId_args( + TGetQueryIdReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetQueryId_args(GetQueryId_args other) { + if (other.isSetReq()) { + this.req = new TGetQueryIdReq(other.req); + } + } + + public GetQueryId_args deepCopy() { + return new GetQueryId_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TGetQueryIdReq getReq() { + return this.req; + } + + public void setReq(TGetQueryIdReq 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((TGetQueryIdReq)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 GetQueryId_args) + return this.equals((GetQueryId_args)that); + return false; + } + + public boolean equals(GetQueryId_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(GetQueryId_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("GetQueryId_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 GetQueryId_argsStandardSchemeFactory implements SchemeFactory { + public GetQueryId_argsStandardScheme getScheme() { + return new GetQueryId_argsStandardScheme(); + } + } + + private static class GetQueryId_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_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 TGetQueryIdReq(); + 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, GetQueryId_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 GetQueryId_argsTupleSchemeFactory implements SchemeFactory { + public GetQueryId_argsTupleScheme getScheme() { + return new GetQueryId_argsTupleScheme(); + } + } + + private static class GetQueryId_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_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, GetQueryId_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetQueryIdReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 GetQueryId_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetQueryId_resultTupleSchemeFactory()); + } + + private TGetQueryIdResp 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, TGetQueryIdResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_result.class, metaDataMap); + } + + public GetQueryId_result() { + } + + public GetQueryId_result( + TGetQueryIdResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetQueryId_result(GetQueryId_result other) { + if (other.isSetSuccess()) { + this.success = new TGetQueryIdResp(other.success); + } + } + + public GetQueryId_result deepCopy() { + return new GetQueryId_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TGetQueryIdResp getSuccess() { + return this.success; + } + + public void setSuccess(TGetQueryIdResp 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((TGetQueryIdResp)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 GetQueryId_result) + return this.equals((GetQueryId_result)that); + return false; + } + + public boolean equals(GetQueryId_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(GetQueryId_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("GetQueryId_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 GetQueryId_resultStandardSchemeFactory implements SchemeFactory { + public GetQueryId_resultStandardScheme getScheme() { + return new GetQueryId_resultStandardScheme(); + } + } + + private static class GetQueryId_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_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 TGetQueryIdResp(); + 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, GetQueryId_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 GetQueryId_resultTupleSchemeFactory implements SchemeFactory { + public GetQueryId_resultTupleScheme getScheme() { + return new GetQueryId_resultTupleScheme(); + } + } + + private static class GetQueryId_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_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, GetQueryId_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetQueryIdResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 SetClientInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SetClientInfo_argsTupleSchemeFactory()); + } + + private TSetClientInfoReq 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, TSetClientInfoReq.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_args.class, metaDataMap); + } + + public SetClientInfo_args() { + } + + public SetClientInfo_args( + TSetClientInfoReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public SetClientInfo_args(SetClientInfo_args other) { + if (other.isSetReq()) { + this.req = new TSetClientInfoReq(other.req); + } + } + + public SetClientInfo_args deepCopy() { + return new SetClientInfo_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + public TSetClientInfoReq getReq() { + return this.req; + } + + public void setReq(TSetClientInfoReq 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((TSetClientInfoReq)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 SetClientInfo_args) + return this.equals((SetClientInfo_args)that); + return false; + } + + public boolean equals(SetClientInfo_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() { + List list = new ArrayList(); + + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); + + return list.hashCode(); + } + + @Override + public int compareTo(SetClientInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.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("SetClientInfo_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 SetClientInfo_argsStandardSchemeFactory implements SchemeFactory { + public SetClientInfo_argsStandardScheme getScheme() { + return new SetClientInfo_argsStandardScheme(); + } + } + + private static class SetClientInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_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 TSetClientInfoReq(); + 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, SetClientInfo_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 SetClientInfo_argsTupleSchemeFactory implements SchemeFactory { + public SetClientInfo_argsTupleScheme getScheme() { + return new SetClientInfo_argsTupleScheme(); + } + } + + private static class SetClientInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_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, SetClientInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TSetClientInfoReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + } + + @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 SetClientInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SetClientInfo_resultTupleSchemeFactory()); + } + + private TSetClientInfoResp 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, TSetClientInfoResp.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_result.class, metaDataMap); + } + + public SetClientInfo_result() { + } + + public SetClientInfo_result( + TSetClientInfoResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public SetClientInfo_result(SetClientInfo_result other) { + if (other.isSetSuccess()) { + this.success = new TSetClientInfoResp(other.success); + } + } + + public SetClientInfo_result deepCopy() { + return new SetClientInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public TSetClientInfoResp getSuccess() { + return this.success; + } + + public void setSuccess(TSetClientInfoResp 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((TSetClientInfoResp)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 SetClientInfo_result) + return this.equals((SetClientInfo_result)that); + return false; + } + + public boolean equals(SetClientInfo_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() { + List list = new ArrayList(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + return list.hashCode(); + } + + @Override + public int compareTo(SetClientInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.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("SetClientInfo_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 SetClientInfo_resultStandardSchemeFactory implements SchemeFactory { + public SetClientInfo_resultStandardScheme getScheme() { + return new SetClientInfo_resultStandardScheme(); + } + } + + private static class SetClientInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_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 TSetClientInfoResp(); + 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, SetClientInfo_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 SetClientInfo_resultTupleSchemeFactory implements SchemeFactory { + public SetClientInfo_resultTupleScheme getScheme() { + return new SetClientInfo_resultTupleScheme(); + } + } + + private static class SetClientInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_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, SetClientInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TSetClientInfoResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + } + +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java new file mode 100644 index 000000000000..9503fd4708e0 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java @@ -0,0 +1,86 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +import java.util.Map; +import java.util.HashMap; +import java.util.Set; +import java.util.HashSet; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCLIServiceConstants { + + public static final Set PRIMITIVE_TYPES = new HashSet(); + static { + PRIMITIVE_TYPES.add(TTypeId.BOOLEAN_TYPE); + PRIMITIVE_TYPES.add(TTypeId.TINYINT_TYPE); + PRIMITIVE_TYPES.add(TTypeId.SMALLINT_TYPE); + PRIMITIVE_TYPES.add(TTypeId.INT_TYPE); + PRIMITIVE_TYPES.add(TTypeId.BIGINT_TYPE); + PRIMITIVE_TYPES.add(TTypeId.FLOAT_TYPE); + PRIMITIVE_TYPES.add(TTypeId.DOUBLE_TYPE); + PRIMITIVE_TYPES.add(TTypeId.STRING_TYPE); + PRIMITIVE_TYPES.add(TTypeId.TIMESTAMP_TYPE); + PRIMITIVE_TYPES.add(TTypeId.BINARY_TYPE); + PRIMITIVE_TYPES.add(TTypeId.DECIMAL_TYPE); + PRIMITIVE_TYPES.add(TTypeId.NULL_TYPE); + PRIMITIVE_TYPES.add(TTypeId.DATE_TYPE); + PRIMITIVE_TYPES.add(TTypeId.VARCHAR_TYPE); + PRIMITIVE_TYPES.add(TTypeId.CHAR_TYPE); + PRIMITIVE_TYPES.add(TTypeId.INTERVAL_YEAR_MONTH_TYPE); + PRIMITIVE_TYPES.add(TTypeId.INTERVAL_DAY_TIME_TYPE); + PRIMITIVE_TYPES.add(TTypeId.TIMESTAMPLOCALTZ_TYPE); + } + + public static final Set COMPLEX_TYPES = new HashSet(); + static { + COMPLEX_TYPES.add(TTypeId.ARRAY_TYPE); + COMPLEX_TYPES.add(TTypeId.MAP_TYPE); + COMPLEX_TYPES.add(TTypeId.STRUCT_TYPE); + COMPLEX_TYPES.add(TTypeId.UNION_TYPE); + COMPLEX_TYPES.add(TTypeId.USER_DEFINED_TYPE); + } + + public static final Set COLLECTION_TYPES = new HashSet(); + static { + COLLECTION_TYPES.add(TTypeId.ARRAY_TYPE); + COLLECTION_TYPES.add(TTypeId.MAP_TYPE); + } + + public static final Map TYPE_NAMES = new HashMap(); + static { + TYPE_NAMES.put(TTypeId.BOOLEAN_TYPE, "BOOLEAN"); + TYPE_NAMES.put(TTypeId.TINYINT_TYPE, "TINYINT"); + TYPE_NAMES.put(TTypeId.SMALLINT_TYPE, "SMALLINT"); + TYPE_NAMES.put(TTypeId.INT_TYPE, "INT"); + TYPE_NAMES.put(TTypeId.BIGINT_TYPE, "BIGINT"); + TYPE_NAMES.put(TTypeId.FLOAT_TYPE, "FLOAT"); + TYPE_NAMES.put(TTypeId.DOUBLE_TYPE, "DOUBLE"); + TYPE_NAMES.put(TTypeId.STRING_TYPE, "STRING"); + TYPE_NAMES.put(TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); + TYPE_NAMES.put(TTypeId.BINARY_TYPE, "BINARY"); + TYPE_NAMES.put(TTypeId.ARRAY_TYPE, "ARRAY"); + TYPE_NAMES.put(TTypeId.MAP_TYPE, "MAP"); + TYPE_NAMES.put(TTypeId.STRUCT_TYPE, "STRUCT"); + TYPE_NAMES.put(TTypeId.UNION_TYPE, "UNIONTYPE"); + TYPE_NAMES.put(TTypeId.DECIMAL_TYPE, "DECIMAL"); + TYPE_NAMES.put(TTypeId.NULL_TYPE, "NULL"); + TYPE_NAMES.put(TTypeId.DATE_TYPE, "DATE"); + TYPE_NAMES.put(TTypeId.VARCHAR_TYPE, "VARCHAR"); + TYPE_NAMES.put(TTypeId.CHAR_TYPE, "CHAR"); + TYPE_NAMES.put(TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); + TYPE_NAMES.put(TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); + TYPE_NAMES.put(TTypeId.TIMESTAMPLOCALTZ_TYPE, "TIMESTAMP WITH LOCAL TIME ZONE"); + } + + public static final String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; + + public static final String PRECISION = "precision"; + + public static final String SCALE = "scale"; + +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java new file mode 100644 index 000000000000..7cd0a6df9cd2 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java @@ -0,0 +1,484 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenReq"); + + 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelDelegationTokenReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelDelegationTokenReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String delegationToken; // 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"), + DELEGATION_TOKEN((short)2, "delegationToken"); + + 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: // DELEGATION_TOKEN + return DELEGATION_TOKEN; + 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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenReq.class, metaDataMap); + } + + public TCancelDelegationTokenReq() { + } + + public TCancelDelegationTokenReq( + TSessionHandle sessionHandle, + String delegationToken) + { + this(); + this.sessionHandle = sessionHandle; + this.delegationToken = delegationToken; + } + + /** + * Performs a deep copy on other. + */ + public TCancelDelegationTokenReq(TCancelDelegationTokenReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetDelegationToken()) { + this.delegationToken = other.delegationToken; + } + } + + public TCancelDelegationTokenReq deepCopy() { + return new TCancelDelegationTokenReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.delegationToken = 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 String getDelegationToken() { + return this.delegationToken; + } + + public void setDelegationToken(String delegationToken) { + this.delegationToken = delegationToken; + } + + public void unsetDelegationToken() { + this.delegationToken = null; + } + + /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ + public boolean isSetDelegationToken() { + return this.delegationToken != null; + } + + public void setDelegationTokenIsSet(boolean value) { + if (!value) { + this.delegationToken = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case DELEGATION_TOKEN: + if (value == null) { + unsetDelegationToken(); + } else { + setDelegationToken((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case DELEGATION_TOKEN: + return getDelegationToken(); + + } + 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 DELEGATION_TOKEN: + return isSetDelegationToken(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCancelDelegationTokenReq) + return this.equals((TCancelDelegationTokenReq)that); + return false; + } + + public boolean equals(TCancelDelegationTokenReq 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_delegationToken = true && this.isSetDelegationToken(); + boolean that_present_delegationToken = true && that.isSetDelegationToken(); + if (this_present_delegationToken || that_present_delegationToken) { + if (!(this_present_delegationToken && that_present_delegationToken)) + return false; + if (!this.delegationToken.equals(that.delegationToken)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_delegationToken = true && (isSetDelegationToken()); + list.add(present_delegationToken); + if (present_delegationToken) + list.add(delegationToken); + + return list.hashCode(); + } + + @Override + public int compareTo(TCancelDelegationTokenReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelegationToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); + 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("TCancelDelegationTokenReq("); + 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("delegationToken:"); + if (this.delegationToken == null) { + sb.append("null"); + } else { + sb.append(this.delegationToken); + } + 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 (!isSetDelegationToken()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TCancelDelegationTokenReqStandardSchemeFactory implements SchemeFactory { + public TCancelDelegationTokenReqStandardScheme getScheme() { + return new TCancelDelegationTokenReqStandardScheme(); + } + } + + private static class TCancelDelegationTokenReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenReq 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: // DELEGATION_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(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, TCancelDelegationTokenReq 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.delegationToken != null) { + oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); + oprot.writeString(struct.delegationToken); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelDelegationTokenReqTupleSchemeFactory implements SchemeFactory { + public TCancelDelegationTokenReqTupleScheme getScheme() { + return new TCancelDelegationTokenReqTupleScheme(); + } + } + + private static class TCancelDelegationTokenReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.delegationToken); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java new file mode 100644 index 000000000000..c8e0b5677bfc --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelDelegationTokenRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelDelegationTokenRespTupleSchemeFactory()); + } + + private TStatus status; // 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 { + STATUS((short)1, "status"); + + 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; + 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.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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap); + } + + public TCancelDelegationTokenResp() { + } + + public TCancelDelegationTokenResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCancelDelegationTokenResp(TCancelDelegationTokenResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCancelDelegationTokenResp deepCopy() { + return new TCancelDelegationTokenResp(this); + } + + @Override + public void clear() { + this.status = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCancelDelegationTokenResp) + return this.equals((TCancelDelegationTokenResp)that); + return false; + } + + public boolean equals(TCancelDelegationTokenResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + return list.hashCode(); + } + + @Override + public int compareTo(TCancelDelegationTokenResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + 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("TCancelDelegationTokenResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TCancelDelegationTokenRespStandardSchemeFactory implements SchemeFactory { + public TCancelDelegationTokenRespStandardScheme getScheme() { + return new TCancelDelegationTokenRespStandardScheme(); + } + } + + private static class TCancelDelegationTokenRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp 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; + 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, TCancelDelegationTokenResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelDelegationTokenRespTupleSchemeFactory implements SchemeFactory { + public TCancelDelegationTokenRespTupleScheme getScheme() { + return new TCancelDelegationTokenRespTupleScheme(); + } + } + + private static class TCancelDelegationTokenRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java new file mode 100644 index 000000000000..552721c0ff12 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq"); + + 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)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelOperationReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelOperationReqTupleSchemeFactory()); + } + + 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 { + OPERATION_HANDLE((short)1, "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: // 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.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(TCancelOperationReq.class, metaDataMap); + } + + public TCancelOperationReq() { + } + + public TCancelOperationReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TCancelOperationReq(TCancelOperationReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TCancelOperationReq deepCopy() { + return new TCancelOperationReq(this); + } + + @Override + public void clear() { + this.operationHandle = 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 OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + 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 OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCancelOperationReq) + return this.equals((TCancelOperationReq)that); + return false; + } + + public boolean equals(TCancelOperationReq that) { + if (that == null) + 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() { + List list = new ArrayList(); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TCancelOperationReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TCancelOperationReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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 TCancelOperationReqStandardSchemeFactory implements SchemeFactory { + public TCancelOperationReqStandardScheme getScheme() { + return new TCancelOperationReqStandardScheme(); + } + } + + private static class TCancelOperationReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq 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: // 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, TCancelOperationReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelOperationReqTupleSchemeFactory implements SchemeFactory { + public TCancelOperationReqTupleScheme getScheme() { + return new TCancelOperationReqTupleScheme(); + } + } + + private static class TCancelOperationReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java new file mode 100644 index 000000000000..83ef79c0d2e9 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelOperationRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelOperationRespTupleSchemeFactory()); + } + + private TStatus status; // 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 { + STATUS((short)1, "status"); + + 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; + 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.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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationResp.class, metaDataMap); + } + + public TCancelOperationResp() { + } + + public TCancelOperationResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCancelOperationResp(TCancelOperationResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCancelOperationResp deepCopy() { + return new TCancelOperationResp(this); + } + + @Override + public void clear() { + this.status = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCancelOperationResp) + return this.equals((TCancelOperationResp)that); + return false; + } + + public boolean equals(TCancelOperationResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + return list.hashCode(); + } + + @Override + public int compareTo(TCancelOperationResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + 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("TCancelOperationResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TCancelOperationRespStandardSchemeFactory implements SchemeFactory { + public TCancelOperationRespStandardScheme getScheme() { + return new TCancelOperationRespStandardScheme(); + } + } + + private static class TCancelOperationRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationResp 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; + 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, TCancelOperationResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelOperationRespTupleSchemeFactory implements SchemeFactory { + public TCancelOperationRespTupleScheme getScheme() { + return new TCancelOperationRespTupleScheme(); + } + } + + private static class TCancelOperationRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java new file mode 100644 index 000000000000..7e8e968c3960 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationReq"); + + 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)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseOperationReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseOperationReqTupleSchemeFactory()); + } + + 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 { + OPERATION_HANDLE((short)1, "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: // 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.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(TCloseOperationReq.class, metaDataMap); + } + + public TCloseOperationReq() { + } + + public TCloseOperationReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TCloseOperationReq(TCloseOperationReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TCloseOperationReq deepCopy() { + return new TCloseOperationReq(this); + } + + @Override + public void clear() { + this.operationHandle = 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 OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + 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 OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCloseOperationReq) + return this.equals((TCloseOperationReq)that); + return false; + } + + public boolean equals(TCloseOperationReq that) { + if (that == null) + 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() { + List list = new ArrayList(); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TCloseOperationReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TCloseOperationReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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 TCloseOperationReqStandardSchemeFactory implements SchemeFactory { + public TCloseOperationReqStandardScheme getScheme() { + return new TCloseOperationReqStandardScheme(); + } + } + + private static class TCloseOperationReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationReq 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: // 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, TCloseOperationReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseOperationReqTupleSchemeFactory implements SchemeFactory { + public TCloseOperationReqTupleScheme getScheme() { + return new TCloseOperationReqTupleScheme(); + } + } + + private static class TCloseOperationReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java new file mode 100644 index 000000000000..6d27642561ba --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseOperationRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseOperationRespTupleSchemeFactory()); + } + + private TStatus status; // 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 { + STATUS((short)1, "status"); + + 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; + 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.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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationResp.class, metaDataMap); + } + + public TCloseOperationResp() { + } + + public TCloseOperationResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCloseOperationResp(TCloseOperationResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCloseOperationResp deepCopy() { + return new TCloseOperationResp(this); + } + + @Override + public void clear() { + this.status = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCloseOperationResp) + return this.equals((TCloseOperationResp)that); + return false; + } + + public boolean equals(TCloseOperationResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + return list.hashCode(); + } + + @Override + public int compareTo(TCloseOperationResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + 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("TCloseOperationResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TCloseOperationRespStandardSchemeFactory implements SchemeFactory { + public TCloseOperationRespStandardScheme getScheme() { + return new TCloseOperationRespStandardScheme(); + } + } + + private static class TCloseOperationRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationResp 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; + 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, TCloseOperationResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseOperationRespTupleSchemeFactory implements SchemeFactory { + public TCloseOperationRespTupleScheme getScheme() { + return new TCloseOperationRespTupleScheme(); + } + } + + private static class TCloseOperationRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java new file mode 100644 index 000000000000..938a470901cd --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionReq"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseSessionReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseSessionReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // 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"); + + 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; + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionReq.class, metaDataMap); + } + + public TCloseSessionReq() { + } + + public TCloseSessionReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TCloseSessionReq(TCloseSessionReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TCloseSessionReq deepCopy() { + return new TCloseSessionReq(this); + } + + @Override + public void clear() { + this.sessionHandle = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCloseSessionReq) + return this.equals((TCloseSessionReq)that); + return false; + } + + public boolean equals(TCloseSessionReq 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TCloseSessionReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + 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("TCloseSessionReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TCloseSessionReqStandardSchemeFactory implements SchemeFactory { + public TCloseSessionReqStandardScheme getScheme() { + return new TCloseSessionReqStandardScheme(); + } + } + + private static class TCloseSessionReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionReq 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; + 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, TCloseSessionReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseSessionReqTupleSchemeFactory implements SchemeFactory { + public TCloseSessionReqTupleScheme getScheme() { + return new TCloseSessionReqTupleScheme(); + } + } + + private static class TCloseSessionReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java new file mode 100644 index 000000000000..c84013587594 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseSessionRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseSessionRespTupleSchemeFactory()); + } + + private TStatus status; // 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 { + STATUS((short)1, "status"); + + 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; + 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.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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionResp.class, metaDataMap); + } + + public TCloseSessionResp() { + } + + public TCloseSessionResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCloseSessionResp(TCloseSessionResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCloseSessionResp deepCopy() { + return new TCloseSessionResp(this); + } + + @Override + public void clear() { + this.status = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TCloseSessionResp) + return this.equals((TCloseSessionResp)that); + return false; + } + + public boolean equals(TCloseSessionResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + return list.hashCode(); + } + + @Override + public int compareTo(TCloseSessionResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + 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("TCloseSessionResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TCloseSessionRespStandardSchemeFactory implements SchemeFactory { + public TCloseSessionRespStandardScheme getScheme() { + return new TCloseSessionRespStandardScheme(); + } + } + + private static class TCloseSessionRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionResp 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; + 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, TCloseSessionResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseSessionRespTupleSchemeFactory implements SchemeFactory { + public TCloseSessionRespTupleScheme getScheme() { + return new TCloseSessionRespTupleScheme(); + } + } + + private static class TCloseSessionRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumn.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumn.java new file mode 100644 index 000000000000..02070f2f16b2 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumn.java @@ -0,0 +1,719 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +import org.apache.thrift.protocol.TProtocolException; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TColumn extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); + private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); + private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); + private static final org.apache.thrift.protocol.TField BINARY_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryVal", org.apache.thrift.protocol.TType.STRUCT, (short)8); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + BOOL_VAL((short)1, "boolVal"), + BYTE_VAL((short)2, "byteVal"), + I16_VAL((short)3, "i16Val"), + I32_VAL((short)4, "i32Val"), + I64_VAL((short)5, "i64Val"), + DOUBLE_VAL((short)6, "doubleVal"), + STRING_VAL((short)7, "stringVal"), + BINARY_VAL((short)8, "binaryVal"); + + 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: // BOOL_VAL + return BOOL_VAL; + case 2: // BYTE_VAL + return BYTE_VAL; + case 3: // I16_VAL + return I16_VAL; + case 4: // I32_VAL + return I32_VAL; + case 5: // I64_VAL + return I64_VAL; + case 6: // DOUBLE_VAL + return DOUBLE_VAL; + case 7: // STRING_VAL + return STRING_VAL; + case 8: // BINARY_VAL + return BINARY_VAL; + 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; + } + } + + 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.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolColumn.class))); + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteColumn.class))); + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Column.class))); + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Column.class))); + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Column.class))); + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleColumn.class))); + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringColumn.class))); + tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryColumn.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); + } + + public TColumn() { + super(); + } + + public TColumn(_Fields setField, Object value) { + super(setField, value); + } + + public TColumn(TColumn other) { + super(other); + } + public TColumn deepCopy() { + return new TColumn(this); + } + + public static TColumn boolVal(TBoolColumn value) { + TColumn x = new TColumn(); + x.setBoolVal(value); + return x; + } + + public static TColumn byteVal(TByteColumn value) { + TColumn x = new TColumn(); + x.setByteVal(value); + return x; + } + + public static TColumn i16Val(TI16Column value) { + TColumn x = new TColumn(); + x.setI16Val(value); + return x; + } + + public static TColumn i32Val(TI32Column value) { + TColumn x = new TColumn(); + x.setI32Val(value); + return x; + } + + public static TColumn i64Val(TI64Column value) { + TColumn x = new TColumn(); + x.setI64Val(value); + return x; + } + + public static TColumn doubleVal(TDoubleColumn value) { + TColumn x = new TColumn(); + x.setDoubleVal(value); + return x; + } + + public static TColumn stringVal(TStringColumn value) { + TColumn x = new TColumn(); + x.setStringVal(value); + return x; + } + + public static TColumn binaryVal(TBinaryColumn value) { + TColumn x = new TColumn(); + x.setBinaryVal(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case BOOL_VAL: + if (value instanceof TBoolColumn) { + break; + } + throw new ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); + case BYTE_VAL: + if (value instanceof TByteColumn) { + break; + } + throw new ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); + case I16_VAL: + if (value instanceof TI16Column) { + break; + } + throw new ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); + case I32_VAL: + if (value instanceof TI32Column) { + break; + } + throw new ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); + case I64_VAL: + if (value instanceof TI64Column) { + break; + } + throw new ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); + case DOUBLE_VAL: + if (value instanceof TDoubleColumn) { + break; + } + throw new ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); + case STRING_VAL: + if (value instanceof TStringColumn) { + break; + } + throw new ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); + case BINARY_VAL: + if (value instanceof TBinaryColumn) { + break; + } + throw new ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + if (field.type == BOOL_VAL_FIELD_DESC.type) { + TBoolColumn boolVal; + boolVal = new TBoolColumn(); + boolVal.read(iprot); + return boolVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BYTE_VAL: + if (field.type == BYTE_VAL_FIELD_DESC.type) { + TByteColumn byteVal; + byteVal = new TByteColumn(); + byteVal.read(iprot); + return byteVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I16_VAL: + if (field.type == I16_VAL_FIELD_DESC.type) { + TI16Column i16Val; + i16Val = new TI16Column(); + i16Val.read(iprot); + return i16Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I32_VAL: + if (field.type == I32_VAL_FIELD_DESC.type) { + TI32Column i32Val; + i32Val = new TI32Column(); + i32Val.read(iprot); + return i32Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I64_VAL: + if (field.type == I64_VAL_FIELD_DESC.type) { + TI64Column i64Val; + i64Val = new TI64Column(); + i64Val.read(iprot); + return i64Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case DOUBLE_VAL: + if (field.type == DOUBLE_VAL_FIELD_DESC.type) { + TDoubleColumn doubleVal; + doubleVal = new TDoubleColumn(); + doubleVal.read(iprot); + return doubleVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRING_VAL: + if (field.type == STRING_VAL_FIELD_DESC.type) { + TStringColumn stringVal; + stringVal = new TStringColumn(); + stringVal.read(iprot); + return stringVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BINARY_VAL: + if (field.type == BINARY_VAL_FIELD_DESC.type) { + TBinaryColumn binaryVal; + binaryVal = new TBinaryColumn(); + binaryVal.read(iprot); + return binaryVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolColumn boolVal = (TBoolColumn)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteColumn byteVal = (TByteColumn)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Column i16Val = (TI16Column)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Column i32Val = (TI32Column)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Column i64Val = (TI64Column)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleColumn doubleVal = (TDoubleColumn)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringColumn stringVal = (TStringColumn)value_; + stringVal.write(oprot); + return; + case BINARY_VAL: + TBinaryColumn binaryVal = (TBinaryColumn)value_; + binaryVal.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + TBoolColumn boolVal; + boolVal = new TBoolColumn(); + boolVal.read(iprot); + return boolVal; + case BYTE_VAL: + TByteColumn byteVal; + byteVal = new TByteColumn(); + byteVal.read(iprot); + return byteVal; + case I16_VAL: + TI16Column i16Val; + i16Val = new TI16Column(); + i16Val.read(iprot); + return i16Val; + case I32_VAL: + TI32Column i32Val; + i32Val = new TI32Column(); + i32Val.read(iprot); + return i32Val; + case I64_VAL: + TI64Column i64Val; + i64Val = new TI64Column(); + i64Val.read(iprot); + return i64Val; + case DOUBLE_VAL: + TDoubleColumn doubleVal; + doubleVal = new TDoubleColumn(); + doubleVal.read(iprot); + return doubleVal; + case STRING_VAL: + TStringColumn stringVal; + stringVal = new TStringColumn(); + stringVal.read(iprot); + return stringVal; + case BINARY_VAL: + TBinaryColumn binaryVal; + binaryVal = new TBinaryColumn(); + binaryVal.read(iprot); + return binaryVal; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolColumn boolVal = (TBoolColumn)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteColumn byteVal = (TByteColumn)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Column i16Val = (TI16Column)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Column i32Val = (TI32Column)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Column i64Val = (TI64Column)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleColumn doubleVal = (TDoubleColumn)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringColumn stringVal = (TStringColumn)value_; + stringVal.write(oprot); + return; + case BINARY_VAL: + TBinaryColumn binaryVal = (TBinaryColumn)value_; + binaryVal.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case BOOL_VAL: + return BOOL_VAL_FIELD_DESC; + case BYTE_VAL: + return BYTE_VAL_FIELD_DESC; + case I16_VAL: + return I16_VAL_FIELD_DESC; + case I32_VAL: + return I32_VAL_FIELD_DESC; + case I64_VAL: + return I64_VAL_FIELD_DESC; + case DOUBLE_VAL: + return DOUBLE_VAL_FIELD_DESC; + case STRING_VAL: + return STRING_VAL_FIELD_DESC; + case BINARY_VAL: + return BINARY_VAL_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public TBoolColumn getBoolVal() { + if (getSetField() == _Fields.BOOL_VAL) { + return (TBoolColumn)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBoolVal(TBoolColumn value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BOOL_VAL; + value_ = value; + } + + public TByteColumn getByteVal() { + if (getSetField() == _Fields.BYTE_VAL) { + return (TByteColumn)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setByteVal(TByteColumn value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BYTE_VAL; + value_ = value; + } + + public TI16Column getI16Val() { + if (getSetField() == _Fields.I16_VAL) { + return (TI16Column)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI16Val(TI16Column value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.I16_VAL; + value_ = value; + } + + public TI32Column getI32Val() { + if (getSetField() == _Fields.I32_VAL) { + return (TI32Column)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI32Val(TI32Column value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.I32_VAL; + value_ = value; + } + + public TI64Column getI64Val() { + if (getSetField() == _Fields.I64_VAL) { + return (TI64Column)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI64Val(TI64Column value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.I64_VAL; + value_ = value; + } + + public TDoubleColumn getDoubleVal() { + if (getSetField() == _Fields.DOUBLE_VAL) { + return (TDoubleColumn)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setDoubleVal(TDoubleColumn value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.DOUBLE_VAL; + value_ = value; + } + + public TStringColumn getStringVal() { + if (getSetField() == _Fields.STRING_VAL) { + return (TStringColumn)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringVal(TStringColumn value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.STRING_VAL; + value_ = value; + } + + public TBinaryColumn getBinaryVal() { + if (getSetField() == _Fields.BINARY_VAL) { + return (TBinaryColumn)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBinaryVal(TBinaryColumn value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BINARY_VAL; + value_ = value; + } + + public boolean isSetBoolVal() { + return setField_ == _Fields.BOOL_VAL; + } + + + public boolean isSetByteVal() { + return setField_ == _Fields.BYTE_VAL; + } + + + public boolean isSetI16Val() { + return setField_ == _Fields.I16_VAL; + } + + + public boolean isSetI32Val() { + return setField_ == _Fields.I32_VAL; + } + + + public boolean isSetI64Val() { + return setField_ == _Fields.I64_VAL; + } + + + public boolean isSetDoubleVal() { + return setField_ == _Fields.DOUBLE_VAL; + } + + + public boolean isSetStringVal() { + return setField_ == _Fields.STRING_VAL; + } + + + public boolean isSetBinaryVal() { + return setField_ == _Fields.BINARY_VAL; + } + + + public boolean equals(Object other) { + if (other instanceof TColumn) { + return equals((TColumn)other); + } else { + return false; + } + } + + public boolean equals(TColumn other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TColumn other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + List list = new ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnDesc.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnDesc.java new file mode 100644 index 000000000000..d9b230bdbd15 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnDesc.java @@ -0,0 +1,695 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnDesc"); + + private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TYPE_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("typeDesc", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField POSITION_FIELD_DESC = new org.apache.thrift.protocol.TField("position", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TColumnDescStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TColumnDescTupleSchemeFactory()); + } + + private String columnName; // required + private TTypeDesc typeDesc; // required + private int position; // required + private String comment; // 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 { + COLUMN_NAME((short)1, "columnName"), + TYPE_DESC((short)2, "typeDesc"), + POSITION((short)3, "position"), + COMMENT((short)4, "comment"); + + 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: // COLUMN_NAME + return COLUMN_NAME; + case 2: // TYPE_DESC + return TYPE_DESC; + case 3: // POSITION + return POSITION; + case 4: // COMMENT + return COMMENT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __POSITION_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.COMMENT}; + 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.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TYPE_DESC, new org.apache.thrift.meta_data.FieldMetaData("typeDesc", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeDesc.class))); + tmpMap.put(_Fields.POSITION, new org.apache.thrift.meta_data.FieldMetaData("position", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); + } + + public TColumnDesc() { + } + + public TColumnDesc( + String columnName, + TTypeDesc typeDesc, + int position) + { + this(); + this.columnName = columnName; + this.typeDesc = typeDesc; + this.position = position; + setPositionIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TColumnDesc(TColumnDesc other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetColumnName()) { + this.columnName = other.columnName; + } + if (other.isSetTypeDesc()) { + this.typeDesc = new TTypeDesc(other.typeDesc); + } + this.position = other.position; + if (other.isSetComment()) { + this.comment = other.comment; + } + } + + public TColumnDesc deepCopy() { + return new TColumnDesc(this); + } + + @Override + public void clear() { + this.columnName = null; + this.typeDesc = null; + setPositionIsSet(false); + this.position = 0; + this.comment = null; + } + + public String getColumnName() { + return this.columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public void unsetColumnName() { + this.columnName = null; + } + + /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnName() { + return this.columnName != null; + } + + public void setColumnNameIsSet(boolean value) { + if (!value) { + this.columnName = null; + } + } + + public TTypeDesc getTypeDesc() { + return this.typeDesc; + } + + public void setTypeDesc(TTypeDesc typeDesc) { + this.typeDesc = typeDesc; + } + + public void unsetTypeDesc() { + this.typeDesc = null; + } + + /** Returns true if field typeDesc is set (has been assigned a value) and false otherwise */ + public boolean isSetTypeDesc() { + return this.typeDesc != null; + } + + public void setTypeDescIsSet(boolean value) { + if (!value) { + this.typeDesc = null; + } + } + + public int getPosition() { + return this.position; + } + + public void setPosition(int position) { + this.position = position; + setPositionIsSet(true); + } + + public void unsetPosition() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); + } + + /** Returns true if field position is set (has been assigned a value) and false otherwise */ + public boolean isSetPosition() { + return EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); + } + + public void setPositionIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); + } + + public String getComment() { + return this.comment; + } + + public void setComment(String comment) { + this.comment = comment; + } + + public void unsetComment() { + this.comment = null; + } + + /** Returns true if field comment is set (has been assigned a value) and false otherwise */ + public boolean isSetComment() { + return this.comment != null; + } + + public void setCommentIsSet(boolean value) { + if (!value) { + this.comment = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case COLUMN_NAME: + if (value == null) { + unsetColumnName(); + } else { + setColumnName((String)value); + } + break; + + case TYPE_DESC: + if (value == null) { + unsetTypeDesc(); + } else { + setTypeDesc((TTypeDesc)value); + } + break; + + case POSITION: + if (value == null) { + unsetPosition(); + } else { + setPosition((Integer)value); + } + break; + + case COMMENT: + if (value == null) { + unsetComment(); + } else { + setComment((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case COLUMN_NAME: + return getColumnName(); + + case TYPE_DESC: + return getTypeDesc(); + + case POSITION: + return getPosition(); + + case COMMENT: + return getComment(); + + } + 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 COLUMN_NAME: + return isSetColumnName(); + case TYPE_DESC: + return isSetTypeDesc(); + case POSITION: + return isSetPosition(); + case COMMENT: + return isSetComment(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TColumnDesc) + return this.equals((TColumnDesc)that); + return false; + } + + public boolean equals(TColumnDesc that) { + if (that == null) + return false; + + boolean this_present_columnName = true && this.isSetColumnName(); + boolean that_present_columnName = true && that.isSetColumnName(); + if (this_present_columnName || that_present_columnName) { + if (!(this_present_columnName && that_present_columnName)) + return false; + if (!this.columnName.equals(that.columnName)) + return false; + } + + boolean this_present_typeDesc = true && this.isSetTypeDesc(); + boolean that_present_typeDesc = true && that.isSetTypeDesc(); + if (this_present_typeDesc || that_present_typeDesc) { + if (!(this_present_typeDesc && that_present_typeDesc)) + return false; + if (!this.typeDesc.equals(that.typeDesc)) + return false; + } + + boolean this_present_position = true; + boolean that_present_position = true; + if (this_present_position || that_present_position) { + if (!(this_present_position && that_present_position)) + return false; + if (this.position != that.position) + return false; + } + + boolean this_present_comment = true && this.isSetComment(); + boolean that_present_comment = true && that.isSetComment(); + if (this_present_comment || that_present_comment) { + if (!(this_present_comment && that_present_comment)) + return false; + if (!this.comment.equals(that.comment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_columnName = true && (isSetColumnName()); + list.add(present_columnName); + if (present_columnName) + list.add(columnName); + + boolean present_typeDesc = true && (isSetTypeDesc()); + list.add(present_typeDesc); + if (present_typeDesc) + list.add(typeDesc); + + boolean present_position = true; + list.add(present_position); + if (present_position) + list.add(position); + + boolean present_comment = true && (isSetComment()); + list.add(present_comment); + if (present_comment) + list.add(comment); + + return list.hashCode(); + } + + @Override + public int compareTo(TColumnDesc other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypeDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeDesc, other.typeDesc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPosition()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.position, other.position); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetComment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment); + 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("TColumnDesc("); + boolean first = true; + + sb.append("columnName:"); + if (this.columnName == null) { + sb.append("null"); + } else { + sb.append(this.columnName); + } + first = false; + if (!first) sb.append(", "); + sb.append("typeDesc:"); + if (this.typeDesc == null) { + sb.append("null"); + } else { + sb.append(this.typeDesc); + } + first = false; + if (!first) sb.append(", "); + sb.append("position:"); + sb.append(this.position); + first = false; + if (isSetComment()) { + if (!first) sb.append(", "); + sb.append("comment:"); + if (this.comment == null) { + sb.append("null"); + } else { + sb.append(this.comment); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetColumnName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnName' is unset! Struct:" + toString()); + } + + if (!isSetTypeDesc()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeDesc' is unset! Struct:" + toString()); + } + + if (!isSetPosition()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'position' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (typeDesc != null) { + typeDesc.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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TColumnDescStandardSchemeFactory implements SchemeFactory { + public TColumnDescStandardScheme getScheme() { + return new TColumnDescStandardScheme(); + } + } + + private static class TColumnDescStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc 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: // COLUMN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TYPE_DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.typeDesc = new TTypeDesc(); + struct.typeDesc.read(iprot); + struct.setTypeDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // POSITION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.position = iprot.readI32(); + struct.setPositionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COMMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(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, TColumnDesc struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.columnName != null) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeString(struct.columnName); + oprot.writeFieldEnd(); + } + if (struct.typeDesc != null) { + oprot.writeFieldBegin(TYPE_DESC_FIELD_DESC); + struct.typeDesc.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(POSITION_FIELD_DESC); + oprot.writeI32(struct.position); + oprot.writeFieldEnd(); + if (struct.comment != null) { + if (struct.isSetComment()) { + oprot.writeFieldBegin(COMMENT_FIELD_DESC); + oprot.writeString(struct.comment); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TColumnDescTupleSchemeFactory implements SchemeFactory { + public TColumnDescTupleScheme getScheme() { + return new TColumnDescTupleScheme(); + } + } + + private static class TColumnDescTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.columnName); + struct.typeDesc.write(oprot); + oprot.writeI32(struct.position); + BitSet optionals = new BitSet(); + if (struct.isSetComment()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetComment()) { + oprot.writeString(struct.comment); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(true); + struct.typeDesc = new TTypeDesc(); + struct.typeDesc.read(iprot); + struct.setTypeDescIsSet(true); + struct.position = iprot.readI32(); + struct.setPositionIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnValue.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnValue.java new file mode 100644 index 000000000000..f20773c6da49 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnValue.java @@ -0,0 +1,658 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +import org.apache.thrift.protocol.TProtocolException; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TColumnValue extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); + private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); + private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + BOOL_VAL((short)1, "boolVal"), + BYTE_VAL((short)2, "byteVal"), + I16_VAL((short)3, "i16Val"), + I32_VAL((short)4, "i32Val"), + I64_VAL((short)5, "i64Val"), + DOUBLE_VAL((short)6, "doubleVal"), + STRING_VAL((short)7, "stringVal"); + + 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: // BOOL_VAL + return BOOL_VAL; + case 2: // BYTE_VAL + return BYTE_VAL; + case 3: // I16_VAL + return I16_VAL; + case 4: // I32_VAL + return I32_VAL; + case 5: // I64_VAL + return I64_VAL; + case 6: // DOUBLE_VAL + return DOUBLE_VAL; + case 7: // STRING_VAL + return STRING_VAL; + 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; + } + } + + 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.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolValue.class))); + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteValue.class))); + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Value.class))); + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Value.class))); + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Value.class))); + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); + } + + public TColumnValue() { + super(); + } + + public TColumnValue(_Fields setField, Object value) { + super(setField, value); + } + + public TColumnValue(TColumnValue other) { + super(other); + } + public TColumnValue deepCopy() { + return new TColumnValue(this); + } + + public static TColumnValue boolVal(TBoolValue value) { + TColumnValue x = new TColumnValue(); + x.setBoolVal(value); + return x; + } + + public static TColumnValue byteVal(TByteValue value) { + TColumnValue x = new TColumnValue(); + x.setByteVal(value); + return x; + } + + public static TColumnValue i16Val(TI16Value value) { + TColumnValue x = new TColumnValue(); + x.setI16Val(value); + return x; + } + + public static TColumnValue i32Val(TI32Value value) { + TColumnValue x = new TColumnValue(); + x.setI32Val(value); + return x; + } + + public static TColumnValue i64Val(TI64Value value) { + TColumnValue x = new TColumnValue(); + x.setI64Val(value); + return x; + } + + public static TColumnValue doubleVal(TDoubleValue value) { + TColumnValue x = new TColumnValue(); + x.setDoubleVal(value); + return x; + } + + public static TColumnValue stringVal(TStringValue value) { + TColumnValue x = new TColumnValue(); + x.setStringVal(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case BOOL_VAL: + if (value instanceof TBoolValue) { + break; + } + throw new ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); + case BYTE_VAL: + if (value instanceof TByteValue) { + break; + } + throw new ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); + case I16_VAL: + if (value instanceof TI16Value) { + break; + } + throw new ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); + case I32_VAL: + if (value instanceof TI32Value) { + break; + } + throw new ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); + case I64_VAL: + if (value instanceof TI64Value) { + break; + } + throw new ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); + case DOUBLE_VAL: + if (value instanceof TDoubleValue) { + break; + } + throw new ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); + case STRING_VAL: + if (value instanceof TStringValue) { + break; + } + throw new ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + if (field.type == BOOL_VAL_FIELD_DESC.type) { + TBoolValue boolVal; + boolVal = new TBoolValue(); + boolVal.read(iprot); + return boolVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BYTE_VAL: + if (field.type == BYTE_VAL_FIELD_DESC.type) { + TByteValue byteVal; + byteVal = new TByteValue(); + byteVal.read(iprot); + return byteVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I16_VAL: + if (field.type == I16_VAL_FIELD_DESC.type) { + TI16Value i16Val; + i16Val = new TI16Value(); + i16Val.read(iprot); + return i16Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I32_VAL: + if (field.type == I32_VAL_FIELD_DESC.type) { + TI32Value i32Val; + i32Val = new TI32Value(); + i32Val.read(iprot); + return i32Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I64_VAL: + if (field.type == I64_VAL_FIELD_DESC.type) { + TI64Value i64Val; + i64Val = new TI64Value(); + i64Val.read(iprot); + return i64Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case DOUBLE_VAL: + if (field.type == DOUBLE_VAL_FIELD_DESC.type) { + TDoubleValue doubleVal; + doubleVal = new TDoubleValue(); + doubleVal.read(iprot); + return doubleVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRING_VAL: + if (field.type == STRING_VAL_FIELD_DESC.type) { + TStringValue stringVal; + stringVal = new TStringValue(); + stringVal.read(iprot); + return stringVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolValue boolVal = (TBoolValue)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteValue byteVal = (TByteValue)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Value i16Val = (TI16Value)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Value i32Val = (TI32Value)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Value i64Val = (TI64Value)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleValue doubleVal = (TDoubleValue)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringValue stringVal = (TStringValue)value_; + stringVal.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + TBoolValue boolVal; + boolVal = new TBoolValue(); + boolVal.read(iprot); + return boolVal; + case BYTE_VAL: + TByteValue byteVal; + byteVal = new TByteValue(); + byteVal.read(iprot); + return byteVal; + case I16_VAL: + TI16Value i16Val; + i16Val = new TI16Value(); + i16Val.read(iprot); + return i16Val; + case I32_VAL: + TI32Value i32Val; + i32Val = new TI32Value(); + i32Val.read(iprot); + return i32Val; + case I64_VAL: + TI64Value i64Val; + i64Val = new TI64Value(); + i64Val.read(iprot); + return i64Val; + case DOUBLE_VAL: + TDoubleValue doubleVal; + doubleVal = new TDoubleValue(); + doubleVal.read(iprot); + return doubleVal; + case STRING_VAL: + TStringValue stringVal; + stringVal = new TStringValue(); + stringVal.read(iprot); + return stringVal; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolValue boolVal = (TBoolValue)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteValue byteVal = (TByteValue)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Value i16Val = (TI16Value)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Value i32Val = (TI32Value)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Value i64Val = (TI64Value)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleValue doubleVal = (TDoubleValue)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringValue stringVal = (TStringValue)value_; + stringVal.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case BOOL_VAL: + return BOOL_VAL_FIELD_DESC; + case BYTE_VAL: + return BYTE_VAL_FIELD_DESC; + case I16_VAL: + return I16_VAL_FIELD_DESC; + case I32_VAL: + return I32_VAL_FIELD_DESC; + case I64_VAL: + return I64_VAL_FIELD_DESC; + case DOUBLE_VAL: + return DOUBLE_VAL_FIELD_DESC; + case STRING_VAL: + return STRING_VAL_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public TBoolValue getBoolVal() { + if (getSetField() == _Fields.BOOL_VAL) { + return (TBoolValue)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBoolVal(TBoolValue value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BOOL_VAL; + value_ = value; + } + + public TByteValue getByteVal() { + if (getSetField() == _Fields.BYTE_VAL) { + return (TByteValue)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setByteVal(TByteValue value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.BYTE_VAL; + value_ = value; + } + + public TI16Value getI16Val() { + if (getSetField() == _Fields.I16_VAL) { + return (TI16Value)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI16Val(TI16Value value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.I16_VAL; + value_ = value; + } + + public TI32Value getI32Val() { + if (getSetField() == _Fields.I32_VAL) { + return (TI32Value)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI32Val(TI32Value value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.I32_VAL; + value_ = value; + } + + public TI64Value getI64Val() { + if (getSetField() == _Fields.I64_VAL) { + return (TI64Value)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI64Val(TI64Value value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.I64_VAL; + value_ = value; + } + + public TDoubleValue getDoubleVal() { + if (getSetField() == _Fields.DOUBLE_VAL) { + return (TDoubleValue)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setDoubleVal(TDoubleValue value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.DOUBLE_VAL; + value_ = value; + } + + public TStringValue getStringVal() { + if (getSetField() == _Fields.STRING_VAL) { + return (TStringValue)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringVal(TStringValue value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.STRING_VAL; + value_ = value; + } + + public boolean isSetBoolVal() { + return setField_ == _Fields.BOOL_VAL; + } + + + public boolean isSetByteVal() { + return setField_ == _Fields.BYTE_VAL; + } + + + public boolean isSetI16Val() { + return setField_ == _Fields.I16_VAL; + } + + + public boolean isSetI32Val() { + return setField_ == _Fields.I32_VAL; + } + + + public boolean isSetI64Val() { + return setField_ == _Fields.I64_VAL; + } + + + public boolean isSetDoubleVal() { + return setField_ == _Fields.DOUBLE_VAL; + } + + + public boolean isSetStringVal() { + return setField_ == _Fields.STRING_VAL; + } + + + public boolean equals(Object other) { + if (other instanceof TColumnValue) { + return equals((TColumnValue)other); + } else { + return false; + } + } + + public boolean equals(TColumnValue other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TColumnValue other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + List list = new ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleColumn.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleColumn.java new file mode 100644 index 000000000000..e81d388da487 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleColumn.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TDoubleColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TDoubleColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleColumn.class, metaDataMap); + } + + public TDoubleColumn() { + } + + public TDoubleColumn( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TDoubleColumn(TDoubleColumn other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TDoubleColumn deepCopy() { + return new TDoubleColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(double elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TDoubleColumn) + return this.equals((TDoubleColumn)that); + return false; + } + + public boolean equals(TDoubleColumn that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TDoubleColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TDoubleColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TDoubleColumnStandardSchemeFactory implements SchemeFactory { + public TDoubleColumnStandardScheme getScheme() { + return new TDoubleColumnStandardScheme(); + } + } + + private static class TDoubleColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); + struct.values = new ArrayList(_list94.size); + double _elem95; + for (int _i96 = 0; _i96 < _list94.size; ++_i96) + { + _elem95 = iprot.readDouble(); + struct.values.add(_elem95); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TDoubleColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, struct.values.size())); + for (double _iter97 : struct.values) + { + oprot.writeDouble(_iter97); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TDoubleColumnTupleSchemeFactory implements SchemeFactory { + public TDoubleColumnTupleScheme getScheme() { + return new TDoubleColumnTupleScheme(); + } + } + + private static class TDoubleColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (double _iter98 : struct.values) + { + oprot.writeDouble(_iter98); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); + struct.values = new ArrayList(_list99.size); + double _elem100; + for (int _i101 = 0; _i101 < _list99.size; ++_i101) + { + _elem100 = iprot.readDouble(); + struct.values.add(_elem100); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleValue.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleValue.java new file mode 100644 index 000000000000..31b02f11ab40 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleValue.java @@ -0,0 +1,381 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TDoubleValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TDoubleValueTupleSchemeFactory()); + } + + private double value; // 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 { + VALUE((short)1, "value"); + + 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: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleValue.class, metaDataMap); + } + + public TDoubleValue() { + } + + /** + * Performs a deep copy on other. + */ + public TDoubleValue(TDoubleValue other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TDoubleValue deepCopy() { + return new TDoubleValue(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0.0; + } + + public double getValue() { + return this.value; + } + + public void setValue(double value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((Double)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + 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 VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TDoubleValue) + return this.equals((TDoubleValue)that); + return false; + } + + public boolean equals(TDoubleValue that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(TDoubleValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("TDoubleValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TDoubleValueStandardSchemeFactory implements SchemeFactory { + public TDoubleValueStandardScheme getScheme() { + return new TDoubleValueStandardScheme(); + } + } + + private static class TDoubleValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.value = iprot.readDouble(); + struct.setValueIsSet(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, TDoubleValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeDouble(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TDoubleValueTupleSchemeFactory implements SchemeFactory { + public TDoubleValueTupleScheme getScheme() { + return new TDoubleValueTupleScheme(); + } + } + + private static class TDoubleValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeDouble(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readDouble(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java new file mode 100644 index 000000000000..796b0b57d367 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java @@ -0,0 +1,854 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq"); + + 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 STATEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("statement", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CONF_OVERLAY_FIELD_DESC = new org.apache.thrift.protocol.TField("confOverlay", org.apache.thrift.protocol.TType.MAP, (short)3); + private static final org.apache.thrift.protocol.TField RUN_ASYNC_FIELD_DESC = new org.apache.thrift.protocol.TField("runAsync", org.apache.thrift.protocol.TType.BOOL, (short)4); + private static final org.apache.thrift.protocol.TField QUERY_TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("queryTimeout", org.apache.thrift.protocol.TType.I64, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TExecuteStatementReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TExecuteStatementReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String statement; // required + private Map confOverlay; // optional + private boolean runAsync; // optional + private long queryTimeout; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + STATEMENT((short)2, "statement"), + CONF_OVERLAY((short)3, "confOverlay"), + RUN_ASYNC((short)4, "runAsync"), + QUERY_TIMEOUT((short)5, "queryTimeout"); + + 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: // STATEMENT + return STATEMENT; + case 3: // CONF_OVERLAY + return CONF_OVERLAY; + case 4: // RUN_ASYNC + return RUN_ASYNC; + case 5: // QUERY_TIMEOUT + return QUERY_TIMEOUT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __RUNASYNC_ISSET_ID = 0; + private static final int __QUERYTIMEOUT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC,_Fields.QUERY_TIMEOUT}; + 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.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CONF_OVERLAY, new org.apache.thrift.meta_data.FieldMetaData("confOverlay", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.RUN_ASYNC, new org.apache.thrift.meta_data.FieldMetaData("runAsync", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.QUERY_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("queryTimeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap); + } + + public TExecuteStatementReq() { + this.runAsync = false; + + this.queryTimeout = 0L; + + } + + public TExecuteStatementReq( + TSessionHandle sessionHandle, + String statement) + { + this(); + this.sessionHandle = sessionHandle; + this.statement = statement; + } + + /** + * Performs a deep copy on other. + */ + public TExecuteStatementReq(TExecuteStatementReq other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetStatement()) { + this.statement = other.statement; + } + if (other.isSetConfOverlay()) { + Map __this__confOverlay = new HashMap(other.confOverlay); + this.confOverlay = __this__confOverlay; + } + this.runAsync = other.runAsync; + this.queryTimeout = other.queryTimeout; + } + + public TExecuteStatementReq deepCopy() { + return new TExecuteStatementReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.statement = null; + this.confOverlay = null; + this.runAsync = false; + + this.queryTimeout = 0L; + + } + + 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 String getStatement() { + return this.statement; + } + + public void setStatement(String statement) { + this.statement = statement; + } + + public void unsetStatement() { + this.statement = null; + } + + /** Returns true if field statement is set (has been assigned a value) and false otherwise */ + public boolean isSetStatement() { + return this.statement != null; + } + + public void setStatementIsSet(boolean value) { + if (!value) { + this.statement = null; + } + } + + public int getConfOverlaySize() { + return (this.confOverlay == null) ? 0 : this.confOverlay.size(); + } + + public void putToConfOverlay(String key, String val) { + if (this.confOverlay == null) { + this.confOverlay = new HashMap(); + } + this.confOverlay.put(key, val); + } + + public Map getConfOverlay() { + return this.confOverlay; + } + + public void setConfOverlay(Map confOverlay) { + this.confOverlay = confOverlay; + } + + public void unsetConfOverlay() { + this.confOverlay = null; + } + + /** Returns true if field confOverlay is set (has been assigned a value) and false otherwise */ + public boolean isSetConfOverlay() { + return this.confOverlay != null; + } + + public void setConfOverlayIsSet(boolean value) { + if (!value) { + this.confOverlay = null; + } + } + + public boolean isRunAsync() { + return this.runAsync; + } + + public void setRunAsync(boolean runAsync) { + this.runAsync = runAsync; + setRunAsyncIsSet(true); + } + + public void unsetRunAsync() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + } + + /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */ + public boolean isSetRunAsync() { + return EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + } + + public void setRunAsyncIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); + } + + public long getQueryTimeout() { + return this.queryTimeout; + } + + public void setQueryTimeout(long queryTimeout) { + this.queryTimeout = queryTimeout; + setQueryTimeoutIsSet(true); + } + + public void unsetQueryTimeout() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + } + + /** Returns true if field queryTimeout is set (has been assigned a value) and false otherwise */ + public boolean isSetQueryTimeout() { + return EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + } + + public void setQueryTimeoutIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case STATEMENT: + if (value == null) { + unsetStatement(); + } else { + setStatement((String)value); + } + break; + + case CONF_OVERLAY: + if (value == null) { + unsetConfOverlay(); + } else { + setConfOverlay((Map)value); + } + break; + + case RUN_ASYNC: + if (value == null) { + unsetRunAsync(); + } else { + setRunAsync((Boolean)value); + } + break; + + case QUERY_TIMEOUT: + if (value == null) { + unsetQueryTimeout(); + } else { + setQueryTimeout((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case STATEMENT: + return getStatement(); + + case CONF_OVERLAY: + return getConfOverlay(); + + case RUN_ASYNC: + return isRunAsync(); + + case QUERY_TIMEOUT: + return getQueryTimeout(); + + } + 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 STATEMENT: + return isSetStatement(); + case CONF_OVERLAY: + return isSetConfOverlay(); + case RUN_ASYNC: + return isSetRunAsync(); + case QUERY_TIMEOUT: + return isSetQueryTimeout(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TExecuteStatementReq) + return this.equals((TExecuteStatementReq)that); + return false; + } + + public boolean equals(TExecuteStatementReq 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_statement = true && this.isSetStatement(); + boolean that_present_statement = true && that.isSetStatement(); + if (this_present_statement || that_present_statement) { + if (!(this_present_statement && that_present_statement)) + return false; + if (!this.statement.equals(that.statement)) + return false; + } + + boolean this_present_confOverlay = true && this.isSetConfOverlay(); + boolean that_present_confOverlay = true && that.isSetConfOverlay(); + if (this_present_confOverlay || that_present_confOverlay) { + if (!(this_present_confOverlay && that_present_confOverlay)) + return false; + if (!this.confOverlay.equals(that.confOverlay)) + return false; + } + + boolean this_present_runAsync = true && this.isSetRunAsync(); + boolean that_present_runAsync = true && that.isSetRunAsync(); + if (this_present_runAsync || that_present_runAsync) { + if (!(this_present_runAsync && that_present_runAsync)) + return false; + if (this.runAsync != that.runAsync) + return false; + } + + boolean this_present_queryTimeout = true && this.isSetQueryTimeout(); + boolean that_present_queryTimeout = true && that.isSetQueryTimeout(); + if (this_present_queryTimeout || that_present_queryTimeout) { + if (!(this_present_queryTimeout && that_present_queryTimeout)) + return false; + if (this.queryTimeout != that.queryTimeout) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_statement = true && (isSetStatement()); + list.add(present_statement); + if (present_statement) + list.add(statement); + + boolean present_confOverlay = true && (isSetConfOverlay()); + list.add(present_confOverlay); + if (present_confOverlay) + list.add(confOverlay); + + boolean present_runAsync = true && (isSetRunAsync()); + list.add(present_runAsync); + if (present_runAsync) + list.add(runAsync); + + boolean present_queryTimeout = true && (isSetQueryTimeout()); + list.add(present_queryTimeout); + if (present_queryTimeout) + list.add(queryTimeout); + + return list.hashCode(); + } + + @Override + public int compareTo(TExecuteStatementReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatement()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statement, other.statement); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfOverlay()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.confOverlay, other.confOverlay); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRunAsync()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runAsync, other.runAsync); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryTimeout()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryTimeout, other.queryTimeout); + 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("TExecuteStatementReq("); + 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("statement:"); + if (this.statement == null) { + sb.append("null"); + } else { + sb.append(this.statement); + } + first = false; + if (isSetConfOverlay()) { + if (!first) sb.append(", "); + sb.append("confOverlay:"); + if (this.confOverlay == null) { + sb.append("null"); + } else { + sb.append(this.confOverlay); + } + first = false; + } + if (isSetRunAsync()) { + if (!first) sb.append(", "); + sb.append("runAsync:"); + sb.append(this.runAsync); + first = false; + } + if (isSetQueryTimeout()) { + if (!first) sb.append(", "); + sb.append("queryTimeout:"); + sb.append(this.queryTimeout); + 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 (!isSetStatement()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TExecuteStatementReqStandardSchemeFactory implements SchemeFactory { + public TExecuteStatementReqStandardScheme getScheme() { + return new TExecuteStatementReqStandardScheme(); + } + } + + private static class TExecuteStatementReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq 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: // STATEMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.statement = iprot.readString(); + struct.setStatementIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CONF_OVERLAY + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map172 = iprot.readMapBegin(); + struct.confOverlay = new HashMap(2*_map172.size); + String _key173; + String _val174; + for (int _i175 = 0; _i175 < _map172.size; ++_i175) + { + _key173 = iprot.readString(); + _val174 = iprot.readString(); + struct.confOverlay.put(_key173, _val174); + } + iprot.readMapEnd(); + } + struct.setConfOverlayIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // RUN_ASYNC + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.runAsync = iprot.readBool(); + struct.setRunAsyncIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // QUERY_TIMEOUT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.queryTimeout = iprot.readI64(); + struct.setQueryTimeoutIsSet(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, TExecuteStatementReq 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.statement != null) { + oprot.writeFieldBegin(STATEMENT_FIELD_DESC); + oprot.writeString(struct.statement); + oprot.writeFieldEnd(); + } + if (struct.confOverlay != null) { + if (struct.isSetConfOverlay()) { + oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); + for (Map.Entry _iter176 : struct.confOverlay.entrySet()) + { + oprot.writeString(_iter176.getKey()); + oprot.writeString(_iter176.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetRunAsync()) { + oprot.writeFieldBegin(RUN_ASYNC_FIELD_DESC); + oprot.writeBool(struct.runAsync); + oprot.writeFieldEnd(); + } + if (struct.isSetQueryTimeout()) { + oprot.writeFieldBegin(QUERY_TIMEOUT_FIELD_DESC); + oprot.writeI64(struct.queryTimeout); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TExecuteStatementReqTupleSchemeFactory implements SchemeFactory { + public TExecuteStatementReqTupleScheme getScheme() { + return new TExecuteStatementReqTupleScheme(); + } + } + + private static class TExecuteStatementReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.statement); + BitSet optionals = new BitSet(); + if (struct.isSetConfOverlay()) { + optionals.set(0); + } + if (struct.isSetRunAsync()) { + optionals.set(1); + } + if (struct.isSetQueryTimeout()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetConfOverlay()) { + { + oprot.writeI32(struct.confOverlay.size()); + for (Map.Entry _iter177 : struct.confOverlay.entrySet()) + { + oprot.writeString(_iter177.getKey()); + oprot.writeString(_iter177.getValue()); + } + } + } + if (struct.isSetRunAsync()) { + oprot.writeBool(struct.runAsync); + } + if (struct.isSetQueryTimeout()) { + oprot.writeI64(struct.queryTimeout); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.statement = iprot.readString(); + struct.setStatementIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.confOverlay = new HashMap(2*_map178.size); + String _key179; + String _val180; + for (int _i181 = 0; _i181 < _map178.size; ++_i181) + { + _key179 = iprot.readString(); + _val180 = iprot.readString(); + struct.confOverlay.put(_key179, _val180); + } + } + struct.setConfOverlayIsSet(true); + } + if (incoming.get(1)) { + struct.runAsync = iprot.readBool(); + struct.setRunAsyncIsSet(true); + } + if (incoming.get(2)) { + struct.queryTimeout = iprot.readI64(); + struct.setQueryTimeoutIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java new file mode 100644 index 000000000000..3045f0d0c6c2 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TExecuteStatementRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TExecuteStatementRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TExecuteStatementResp.class, metaDataMap); + } + + public TExecuteStatementResp() { + } + + public TExecuteStatementResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TExecuteStatementResp(TExecuteStatementResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TExecuteStatementResp deepCopy() { + return new TExecuteStatementResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TExecuteStatementResp) + return this.equals((TExecuteStatementResp)that); + return false; + } + + public boolean equals(TExecuteStatementResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TExecuteStatementResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TExecuteStatementResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TExecuteStatementRespStandardSchemeFactory implements SchemeFactory { + public TExecuteStatementRespStandardScheme getScheme() { + return new TExecuteStatementRespStandardScheme(); + } + } + + private static class TExecuteStatementRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementResp 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; + 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, TExecuteStatementResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TExecuteStatementRespTupleSchemeFactory implements SchemeFactory { + public TExecuteStatementRespTupleScheme getScheme() { + return new TExecuteStatementRespTupleScheme(); + } + } + + private static class TExecuteStatementRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchOrientation.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchOrientation.java new file mode 100644 index 000000000000..aaef3d072e65 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchOrientation.java @@ -0,0 +1,53 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TFetchOrientation implements org.apache.thrift.TEnum { + FETCH_NEXT(0), + FETCH_PRIOR(1), + FETCH_RELATIVE(2), + FETCH_ABSOLUTE(3), + FETCH_FIRST(4), + FETCH_LAST(5); + + private final int value; + + private TFetchOrientation(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TFetchOrientation findByValue(int value) { + switch (value) { + case 0: + return FETCH_NEXT; + case 1: + return FETCH_PRIOR; + case 2: + return FETCH_RELATIVE; + case 3: + return FETCH_ABSOLUTE; + case 4: + return FETCH_FIRST; + case 5: + return FETCH_LAST; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java new file mode 100644 index 000000000000..5dd0ebb37f04 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java @@ -0,0 +1,705 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq"); + + 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)1); + private static final org.apache.thrift.protocol.TField ORIENTATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orientation", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRows", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField FETCH_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchType", org.apache.thrift.protocol.TType.I16, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TFetchResultsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TFetchResultsReqTupleSchemeFactory()); + } + + private TOperationHandle operationHandle; // required + private TFetchOrientation orientation; // required + private long maxRows; // required + private short fetchType; // 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 { + OPERATION_HANDLE((short)1, "operationHandle"), + /** + * + * @see TFetchOrientation + */ + ORIENTATION((short)2, "orientation"), + MAX_ROWS((short)3, "maxRows"), + FETCH_TYPE((short)4, "fetchType"); + + 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: // OPERATION_HANDLE + return OPERATION_HANDLE; + case 2: // ORIENTATION + return ORIENTATION; + case 3: // MAX_ROWS + return MAX_ROWS; + case 4: // FETCH_TYPE + return FETCH_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __MAXROWS_ISSET_ID = 0; + private static final int __FETCHTYPE_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.FETCH_TYPE}; + 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.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.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFetchOrientation.class))); + tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("maxRows", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap); + } + + public TFetchResultsReq() { + this.orientation = TFetchOrientation.FETCH_NEXT; + + this.fetchType = (short)0; + + } + + public TFetchResultsReq( + TOperationHandle operationHandle, + TFetchOrientation orientation, + long maxRows) + { + this(); + this.operationHandle = operationHandle; + this.orientation = orientation; + this.maxRows = maxRows; + setMaxRowsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TFetchResultsReq(TFetchResultsReq other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + if (other.isSetOrientation()) { + this.orientation = other.orientation; + } + this.maxRows = other.maxRows; + this.fetchType = other.fetchType; + } + + public TFetchResultsReq deepCopy() { + return new TFetchResultsReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + this.orientation = TFetchOrientation.FETCH_NEXT; + + setMaxRowsIsSet(false); + this.maxRows = 0; + this.fetchType = (short)0; + + } + + 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; + } + } + + /** + * + * @see TFetchOrientation + */ + public TFetchOrientation getOrientation() { + return this.orientation; + } + + /** + * + * @see TFetchOrientation + */ + public void setOrientation(TFetchOrientation orientation) { + this.orientation = orientation; + } + + public void unsetOrientation() { + this.orientation = null; + } + + /** Returns true if field orientation is set (has been assigned a value) and false otherwise */ + public boolean isSetOrientation() { + return this.orientation != null; + } + + public void setOrientationIsSet(boolean value) { + if (!value) { + this.orientation = null; + } + } + + public long getMaxRows() { + return this.maxRows; + } + + public void setMaxRows(long maxRows) { + this.maxRows = maxRows; + setMaxRowsIsSet(true); + } + + public void unsetMaxRows() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); + } + + /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxRows() { + return EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); + } + + public void setMaxRowsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); + } + + public short getFetchType() { + return this.fetchType; + } + + public void setFetchType(short fetchType) { + this.fetchType = fetchType; + setFetchTypeIsSet(true); + } + + public void unsetFetchType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + } + + /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */ + public boolean isSetFetchType() { + return EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + } + + public void setFetchTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + case ORIENTATION: + if (value == null) { + unsetOrientation(); + } else { + setOrientation((TFetchOrientation)value); + } + break; + + case MAX_ROWS: + if (value == null) { + unsetMaxRows(); + } else { + setMaxRows((Long)value); + } + break; + + case FETCH_TYPE: + if (value == null) { + unsetFetchType(); + } else { + setFetchType((Short)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + case ORIENTATION: + return getOrientation(); + + case MAX_ROWS: + return getMaxRows(); + + case FETCH_TYPE: + return getFetchType(); + + } + 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 OPERATION_HANDLE: + return isSetOperationHandle(); + case ORIENTATION: + return isSetOrientation(); + case MAX_ROWS: + return isSetMaxRows(); + case FETCH_TYPE: + return isSetFetchType(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TFetchResultsReq) + return this.equals((TFetchResultsReq)that); + return false; + } + + public boolean equals(TFetchResultsReq that) { + if (that == null) + 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_orientation = true && this.isSetOrientation(); + boolean that_present_orientation = true && that.isSetOrientation(); + if (this_present_orientation || that_present_orientation) { + if (!(this_present_orientation && that_present_orientation)) + return false; + if (!this.orientation.equals(that.orientation)) + return false; + } + + boolean this_present_maxRows = true; + boolean that_present_maxRows = true; + if (this_present_maxRows || that_present_maxRows) { + if (!(this_present_maxRows && that_present_maxRows)) + return false; + if (this.maxRows != that.maxRows) + return false; + } + + boolean this_present_fetchType = true && this.isSetFetchType(); + boolean that_present_fetchType = true && that.isSetFetchType(); + if (this_present_fetchType || that_present_fetchType) { + if (!(this_present_fetchType && that_present_fetchType)) + return false; + if (this.fetchType != that.fetchType) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + boolean present_orientation = true && (isSetOrientation()); + list.add(present_orientation); + if (present_orientation) + list.add(orientation.getValue()); + + boolean present_maxRows = true; + list.add(present_maxRows); + if (present_maxRows) + list.add(maxRows); + + boolean present_fetchType = true && (isSetFetchType()); + list.add(present_fetchType); + if (present_fetchType) + list.add(fetchType); + + return list.hashCode(); + } + + @Override + public int compareTo(TFetchResultsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOrientation()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orientation, other.orientation); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRows, other.maxRows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFetchType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchType, other.fetchType); + 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("TFetchResultsReq("); + boolean first = true; + + sb.append("operationHandle:"); + if (this.operationHandle == null) { + sb.append("null"); + } else { + sb.append(this.operationHandle); + } + first = false; + if (!first) sb.append(", "); + sb.append("orientation:"); + if (this.orientation == null) { + sb.append("null"); + } else { + sb.append(this.orientation); + } + first = false; + if (!first) sb.append(", "); + sb.append("maxRows:"); + sb.append(this.maxRows); + first = false; + if (isSetFetchType()) { + if (!first) sb.append(", "); + sb.append("fetchType:"); + sb.append(this.fetchType); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + if (!isSetOrientation()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'orientation' is unset! Struct:" + toString()); + } + + if (!isSetMaxRows()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'maxRows' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TFetchResultsReqStandardSchemeFactory implements SchemeFactory { + public TFetchResultsReqStandardScheme getScheme() { + return new TFetchResultsReqStandardScheme(); + } + } + + private static class TFetchResultsReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq 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: // 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 2: // ORIENTATION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.orientation = TFetchOrientation.findByValue(iprot.readI32()); + struct.setOrientationIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // MAX_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.maxRows = iprot.readI64(); + struct.setMaxRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // FETCH_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.fetchType = iprot.readI16(); + struct.setFetchTypeIsSet(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, TFetchResultsReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.orientation != null) { + oprot.writeFieldBegin(ORIENTATION_FIELD_DESC); + oprot.writeI32(struct.orientation.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC); + oprot.writeI64(struct.maxRows); + oprot.writeFieldEnd(); + if (struct.isSetFetchType()) { + oprot.writeFieldBegin(FETCH_TYPE_FIELD_DESC); + oprot.writeI16(struct.fetchType); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TFetchResultsReqTupleSchemeFactory implements SchemeFactory { + public TFetchResultsReqTupleScheme getScheme() { + return new TFetchResultsReqTupleScheme(); + } + } + + private static class TFetchResultsReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.operationHandle.write(oprot); + oprot.writeI32(struct.orientation.getValue()); + oprot.writeI64(struct.maxRows); + BitSet optionals = new BitSet(); + if (struct.isSetFetchType()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFetchType()) { + oprot.writeI16(struct.fetchType); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + struct.orientation = TFetchOrientation.findByValue(iprot.readI32()); + struct.setOrientationIsSet(true); + struct.maxRows = iprot.readI64(); + struct.setMaxRowsIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fetchType = iprot.readI16(); + struct.setFetchTypeIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java new file mode 100644 index 000000000000..ea15d1d86eb1 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java @@ -0,0 +1,603 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsResp"); + + 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 HAS_MORE_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMoreRows", org.apache.thrift.protocol.TType.BOOL, (short)2); + private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TFetchResultsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TFetchResultsRespTupleSchemeFactory()); + } + + private TStatus status; // required + private boolean hasMoreRows; // optional + private TRowSet results; // 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"), + HAS_MORE_ROWS((short)2, "hasMoreRows"), + RESULTS((short)3, "results"); + + 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: // HAS_MORE_ROWS + return HAS_MORE_ROWS; + case 3: // RESULTS + return RESULTS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __HASMOREROWS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.HAS_MORE_ROWS,_Fields.RESULTS}; + 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.HAS_MORE_ROWS, new org.apache.thrift.meta_data.FieldMetaData("hasMoreRows", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsResp.class, metaDataMap); + } + + public TFetchResultsResp() { + } + + public TFetchResultsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TFetchResultsResp(TFetchResultsResp other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + this.hasMoreRows = other.hasMoreRows; + if (other.isSetResults()) { + this.results = new TRowSet(other.results); + } + } + + public TFetchResultsResp deepCopy() { + return new TFetchResultsResp(this); + } + + @Override + public void clear() { + this.status = null; + setHasMoreRowsIsSet(false); + this.hasMoreRows = false; + this.results = 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 boolean isHasMoreRows() { + return this.hasMoreRows; + } + + public void setHasMoreRows(boolean hasMoreRows) { + this.hasMoreRows = hasMoreRows; + setHasMoreRowsIsSet(true); + } + + public void unsetHasMoreRows() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + } + + /** Returns true if field hasMoreRows is set (has been assigned a value) and false otherwise */ + public boolean isSetHasMoreRows() { + return EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + } + + public void setHasMoreRowsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); + } + + public TRowSet getResults() { + return this.results; + } + + public void setResults(TRowSet results) { + this.results = results; + } + + public void unsetResults() { + this.results = null; + } + + /** Returns true if field results is set (has been assigned a value) and false otherwise */ + public boolean isSetResults() { + return this.results != null; + } + + public void setResultsIsSet(boolean value) { + if (!value) { + this.results = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case HAS_MORE_ROWS: + if (value == null) { + unsetHasMoreRows(); + } else { + setHasMoreRows((Boolean)value); + } + break; + + case RESULTS: + if (value == null) { + unsetResults(); + } else { + setResults((TRowSet)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case HAS_MORE_ROWS: + return isHasMoreRows(); + + case RESULTS: + return getResults(); + + } + 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 HAS_MORE_ROWS: + return isSetHasMoreRows(); + case RESULTS: + return isSetResults(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TFetchResultsResp) + return this.equals((TFetchResultsResp)that); + return false; + } + + public boolean equals(TFetchResultsResp 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_hasMoreRows = true && this.isSetHasMoreRows(); + boolean that_present_hasMoreRows = true && that.isSetHasMoreRows(); + if (this_present_hasMoreRows || that_present_hasMoreRows) { + if (!(this_present_hasMoreRows && that_present_hasMoreRows)) + return false; + if (this.hasMoreRows != that.hasMoreRows) + return false; + } + + boolean this_present_results = true && this.isSetResults(); + boolean that_present_results = true && that.isSetResults(); + if (this_present_results || that_present_results) { + if (!(this_present_results && that_present_results)) + return false; + if (!this.results.equals(that.results)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_hasMoreRows = true && (isSetHasMoreRows()); + list.add(present_hasMoreRows); + if (present_hasMoreRows) + list.add(hasMoreRows); + + boolean present_results = true && (isSetResults()); + list.add(present_results); + if (present_results) + list.add(results); + + return list.hashCode(); + } + + @Override + public int compareTo(TFetchResultsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasMoreRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMoreRows, other.hasMoreRows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetResults()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.results, other.results); + 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("TFetchResultsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetHasMoreRows()) { + if (!first) sb.append(", "); + sb.append("hasMoreRows:"); + sb.append(this.hasMoreRows); + first = false; + } + if (isSetResults()) { + if (!first) sb.append(", "); + sb.append("results:"); + if (this.results == null) { + sb.append("null"); + } else { + sb.append(this.results); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (results != null) { + results.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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TFetchResultsRespStandardSchemeFactory implements SchemeFactory { + public TFetchResultsRespStandardScheme getScheme() { + return new TFetchResultsRespStandardScheme(); + } + } + + private static class TFetchResultsRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsResp 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: // HAS_MORE_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasMoreRows = iprot.readBool(); + struct.setHasMoreRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RESULTS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.results = new TRowSet(); + struct.results.read(iprot); + struct.setResultsIsSet(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, TFetchResultsResp 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.isSetHasMoreRows()) { + oprot.writeFieldBegin(HAS_MORE_ROWS_FIELD_DESC); + oprot.writeBool(struct.hasMoreRows); + oprot.writeFieldEnd(); + } + if (struct.results != null) { + if (struct.isSetResults()) { + oprot.writeFieldBegin(RESULTS_FIELD_DESC); + struct.results.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TFetchResultsRespTupleSchemeFactory implements SchemeFactory { + public TFetchResultsRespTupleScheme getScheme() { + return new TFetchResultsRespTupleScheme(); + } + } + + private static class TFetchResultsRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetHasMoreRows()) { + optionals.set(0); + } + if (struct.isSetResults()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetHasMoreRows()) { + oprot.writeBool(struct.hasMoreRows); + } + if (struct.isSetResults()) { + struct.results.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.hasMoreRows = iprot.readBool(); + struct.setHasMoreRowsIsSet(true); + } + if (incoming.get(1)) { + struct.results = new TRowSet(); + struct.results.read(iprot); + struct.setResultsIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java new file mode 100644 index 000000000000..d53c22e20949 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsReq"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCatalogsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCatalogsReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // 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"); + + 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; + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsReq.class, metaDataMap); + } + + public TGetCatalogsReq() { + } + + public TGetCatalogsReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetCatalogsReq(TGetCatalogsReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TGetCatalogsReq deepCopy() { + return new TGetCatalogsReq(this); + } + + @Override + public void clear() { + this.sessionHandle = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetCatalogsReq) + return this.equals((TGetCatalogsReq)that); + return false; + } + + public boolean equals(TGetCatalogsReq 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetCatalogsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + 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("TGetCatalogsReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetCatalogsReqStandardSchemeFactory implements SchemeFactory { + public TGetCatalogsReqStandardScheme getScheme() { + return new TGetCatalogsReqStandardScheme(); + } + } + + private static class TGetCatalogsReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsReq 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; + 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, TGetCatalogsReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCatalogsReqTupleSchemeFactory implements SchemeFactory { + public TGetCatalogsReqTupleScheme getScheme() { + return new TGetCatalogsReqTupleScheme(); + } + } + + private static class TGetCatalogsReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java new file mode 100644 index 000000000000..0f89dc4545e9 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCatalogsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCatalogsRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetCatalogsResp.class, metaDataMap); + } + + public TGetCatalogsResp() { + } + + public TGetCatalogsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetCatalogsResp(TGetCatalogsResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetCatalogsResp deepCopy() { + return new TGetCatalogsResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetCatalogsResp) + return this.equals((TGetCatalogsResp)that); + return false; + } + + public boolean equals(TGetCatalogsResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetCatalogsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetCatalogsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetCatalogsRespStandardSchemeFactory implements SchemeFactory { + public TGetCatalogsRespStandardScheme getScheme() { + return new TGetCatalogsRespStandardScheme(); + } + } + + private static class TGetCatalogsRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsResp 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; + 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, TGetCatalogsResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCatalogsRespTupleSchemeFactory implements SchemeFactory { + public TGetCatalogsRespTupleScheme getScheme() { + return new TGetCatalogsRespTupleScheme(); + } + } + + private static class TGetCatalogsRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java new file mode 100644 index 000000000000..1b7d6cd97711 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java @@ -0,0 +1,812 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetColumnsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetColumnsReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String tableName; // optional + private String columnName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + TABLE_NAME((short)4, "tableName"), + COLUMN_NAME((short)5, "columnName"); + + 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: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // TABLE_NAME + return TABLE_NAME; + case 5: // COLUMN_NAME + return COLUMN_NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME}; + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap); + } + + public TGetColumnsReq() { + } + + public TGetColumnsReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetColumnsReq(TGetColumnsReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetColumnName()) { + this.columnName = other.columnName; + } + } + + public TGetColumnsReq deepCopy() { + return new TGetColumnsReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.tableName = null; + this.columnName = 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 String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + public String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + public String getTableName() { + return this.tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public void unsetTableName() { + this.tableName = null; + } + + /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableName() { + return this.tableName != null; + } + + public void setTableNameIsSet(boolean value) { + if (!value) { + this.tableName = null; + } + } + + public String getColumnName() { + return this.columnName; + } + + public void setColumnName(String columnName) { + this.columnName = columnName; + } + + public void unsetColumnName() { + this.columnName = null; + } + + /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnName() { + return this.columnName != null; + } + + public void setColumnNameIsSet(boolean value) { + if (!value) { + this.columnName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((String)value); + } + break; + + case COLUMN_NAME: + if (value == null) { + unsetColumnName(); + } else { + setColumnName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case TABLE_NAME: + return getTableName(); + + case COLUMN_NAME: + return getColumnName(); + + } + 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 CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case TABLE_NAME: + return isSetTableName(); + case COLUMN_NAME: + return isSetColumnName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetColumnsReq) + return this.equals((TGetColumnsReq)that); + return false; + } + + public boolean equals(TGetColumnsReq 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_tableName = true && this.isSetTableName(); + boolean that_present_tableName = true && that.isSetTableName(); + if (this_present_tableName || that_present_tableName) { + if (!(this_present_tableName && that_present_tableName)) + return false; + if (!this.tableName.equals(that.tableName)) + return false; + } + + boolean this_present_columnName = true && this.isSetColumnName(); + boolean that_present_columnName = true && that.isSetColumnName(); + if (this_present_columnName || that_present_columnName) { + if (!(this_present_columnName && that_present_columnName)) + return false; + if (!this.columnName.equals(that.columnName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); + + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_columnName = true && (isSetColumnName()); + list.add(present_columnName); + if (present_columnName) + list.add(columnName); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetColumnsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); + 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("TGetColumnsReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (isSetTableName()) { + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + sb.append(this.tableName); + } + first = false; + } + if (isSetColumnName()) { + if (!first) sb.append(", "); + sb.append("columnName:"); + if (this.columnName == null) { + sb.append("null"); + } else { + sb.append(this.columnName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetColumnsReqStandardSchemeFactory implements SchemeFactory { + public TGetColumnsReqStandardScheme getScheme() { + return new TGetColumnsReqStandardScheme(); + } + } + + private static class TGetColumnsReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COLUMN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(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, TGetColumnsReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.tableName != null) { + if (struct.isSetTableName()) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.tableName); + oprot.writeFieldEnd(); + } + } + if (struct.columnName != null) { + if (struct.isSetColumnName()) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeString(struct.columnName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetColumnsReqTupleSchemeFactory implements SchemeFactory { + public TGetColumnsReqTupleScheme getScheme() { + return new TGetColumnsReqTupleScheme(); + } + } + + private static class TGetColumnsReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + if (struct.isSetTableName()) { + optionals.set(2); + } + if (struct.isSetColumnName()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + if (struct.isSetTableName()) { + oprot.writeString(struct.tableName); + } + if (struct.isSetColumnName()) { + oprot.writeString(struct.columnName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } + if (incoming.get(3)) { + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java new file mode 100644 index 000000000000..953e57ba4ec7 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetColumnsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetColumnsRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetColumnsResp.class, metaDataMap); + } + + public TGetColumnsResp() { + } + + public TGetColumnsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetColumnsResp(TGetColumnsResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetColumnsResp deepCopy() { + return new TGetColumnsResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetColumnsResp) + return this.equals((TGetColumnsResp)that); + return false; + } + + public boolean equals(TGetColumnsResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetColumnsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetColumnsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetColumnsRespStandardSchemeFactory implements SchemeFactory { + public TGetColumnsRespStandardScheme getScheme() { + return new TGetColumnsRespStandardScheme(); + } + } + + private static class TGetColumnsRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsResp 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; + 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, TGetColumnsResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetColumnsRespTupleSchemeFactory implements SchemeFactory { + public TGetColumnsRespTupleScheme getScheme() { + return new TGetColumnsRespTupleScheme(); + } + } + + private static class TGetColumnsRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java new file mode 100644 index 000000000000..d91a032b8837 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java @@ -0,0 +1,1024 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCrossReferenceReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceReq"); + + 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 PARENT_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentCatalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PARENT_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentSchemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField PARENT_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentTableName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField FOREIGN_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignCatalogName", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField FOREIGN_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignSchemaName", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField FOREIGN_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignTableName", org.apache.thrift.protocol.TType.STRING, (short)7); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCrossReferenceReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCrossReferenceReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String parentCatalogName; // optional + private String parentSchemaName; // optional + private String parentTableName; // optional + private String foreignCatalogName; // optional + private String foreignSchemaName; // optional + private String foreignTableName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + PARENT_CATALOG_NAME((short)2, "parentCatalogName"), + PARENT_SCHEMA_NAME((short)3, "parentSchemaName"), + PARENT_TABLE_NAME((short)4, "parentTableName"), + FOREIGN_CATALOG_NAME((short)5, "foreignCatalogName"), + FOREIGN_SCHEMA_NAME((short)6, "foreignSchemaName"), + FOREIGN_TABLE_NAME((short)7, "foreignTableName"); + + 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: // PARENT_CATALOG_NAME + return PARENT_CATALOG_NAME; + case 3: // PARENT_SCHEMA_NAME + return PARENT_SCHEMA_NAME; + case 4: // PARENT_TABLE_NAME + return PARENT_TABLE_NAME; + case 5: // FOREIGN_CATALOG_NAME + return FOREIGN_CATALOG_NAME; + case 6: // FOREIGN_SCHEMA_NAME + return FOREIGN_SCHEMA_NAME; + case 7: // FOREIGN_TABLE_NAME + return FOREIGN_TABLE_NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.PARENT_CATALOG_NAME,_Fields.PARENT_SCHEMA_NAME,_Fields.PARENT_TABLE_NAME,_Fields.FOREIGN_CATALOG_NAME,_Fields.FOREIGN_SCHEMA_NAME,_Fields.FOREIGN_TABLE_NAME}; + 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.PARENT_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.PARENT_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.PARENT_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.FOREIGN_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.FOREIGN_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.FOREIGN_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceReq.class, metaDataMap); + } + + public TGetCrossReferenceReq() { + } + + public TGetCrossReferenceReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetCrossReferenceReq(TGetCrossReferenceReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetParentCatalogName()) { + this.parentCatalogName = other.parentCatalogName; + } + if (other.isSetParentSchemaName()) { + this.parentSchemaName = other.parentSchemaName; + } + if (other.isSetParentTableName()) { + this.parentTableName = other.parentTableName; + } + if (other.isSetForeignCatalogName()) { + this.foreignCatalogName = other.foreignCatalogName; + } + if (other.isSetForeignSchemaName()) { + this.foreignSchemaName = other.foreignSchemaName; + } + if (other.isSetForeignTableName()) { + this.foreignTableName = other.foreignTableName; + } + } + + public TGetCrossReferenceReq deepCopy() { + return new TGetCrossReferenceReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.parentCatalogName = null; + this.parentSchemaName = null; + this.parentTableName = null; + this.foreignCatalogName = null; + this.foreignSchemaName = null; + this.foreignTableName = 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 String getParentCatalogName() { + return this.parentCatalogName; + } + + public void setParentCatalogName(String parentCatalogName) { + this.parentCatalogName = parentCatalogName; + } + + public void unsetParentCatalogName() { + this.parentCatalogName = null; + } + + /** Returns true if field parentCatalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetParentCatalogName() { + return this.parentCatalogName != null; + } + + public void setParentCatalogNameIsSet(boolean value) { + if (!value) { + this.parentCatalogName = null; + } + } + + public String getParentSchemaName() { + return this.parentSchemaName; + } + + public void setParentSchemaName(String parentSchemaName) { + this.parentSchemaName = parentSchemaName; + } + + public void unsetParentSchemaName() { + this.parentSchemaName = null; + } + + /** Returns true if field parentSchemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetParentSchemaName() { + return this.parentSchemaName != null; + } + + public void setParentSchemaNameIsSet(boolean value) { + if (!value) { + this.parentSchemaName = null; + } + } + + public String getParentTableName() { + return this.parentTableName; + } + + public void setParentTableName(String parentTableName) { + this.parentTableName = parentTableName; + } + + public void unsetParentTableName() { + this.parentTableName = null; + } + + /** Returns true if field parentTableName is set (has been assigned a value) and false otherwise */ + public boolean isSetParentTableName() { + return this.parentTableName != null; + } + + public void setParentTableNameIsSet(boolean value) { + if (!value) { + this.parentTableName = null; + } + } + + public String getForeignCatalogName() { + return this.foreignCatalogName; + } + + public void setForeignCatalogName(String foreignCatalogName) { + this.foreignCatalogName = foreignCatalogName; + } + + public void unsetForeignCatalogName() { + this.foreignCatalogName = null; + } + + /** Returns true if field foreignCatalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetForeignCatalogName() { + return this.foreignCatalogName != null; + } + + public void setForeignCatalogNameIsSet(boolean value) { + if (!value) { + this.foreignCatalogName = null; + } + } + + public String getForeignSchemaName() { + return this.foreignSchemaName; + } + + public void setForeignSchemaName(String foreignSchemaName) { + this.foreignSchemaName = foreignSchemaName; + } + + public void unsetForeignSchemaName() { + this.foreignSchemaName = null; + } + + /** Returns true if field foreignSchemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetForeignSchemaName() { + return this.foreignSchemaName != null; + } + + public void setForeignSchemaNameIsSet(boolean value) { + if (!value) { + this.foreignSchemaName = null; + } + } + + public String getForeignTableName() { + return this.foreignTableName; + } + + public void setForeignTableName(String foreignTableName) { + this.foreignTableName = foreignTableName; + } + + public void unsetForeignTableName() { + this.foreignTableName = null; + } + + /** Returns true if field foreignTableName is set (has been assigned a value) and false otherwise */ + public boolean isSetForeignTableName() { + return this.foreignTableName != null; + } + + public void setForeignTableNameIsSet(boolean value) { + if (!value) { + this.foreignTableName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case PARENT_CATALOG_NAME: + if (value == null) { + unsetParentCatalogName(); + } else { + setParentCatalogName((String)value); + } + break; + + case PARENT_SCHEMA_NAME: + if (value == null) { + unsetParentSchemaName(); + } else { + setParentSchemaName((String)value); + } + break; + + case PARENT_TABLE_NAME: + if (value == null) { + unsetParentTableName(); + } else { + setParentTableName((String)value); + } + break; + + case FOREIGN_CATALOG_NAME: + if (value == null) { + unsetForeignCatalogName(); + } else { + setForeignCatalogName((String)value); + } + break; + + case FOREIGN_SCHEMA_NAME: + if (value == null) { + unsetForeignSchemaName(); + } else { + setForeignSchemaName((String)value); + } + break; + + case FOREIGN_TABLE_NAME: + if (value == null) { + unsetForeignTableName(); + } else { + setForeignTableName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case PARENT_CATALOG_NAME: + return getParentCatalogName(); + + case PARENT_SCHEMA_NAME: + return getParentSchemaName(); + + case PARENT_TABLE_NAME: + return getParentTableName(); + + case FOREIGN_CATALOG_NAME: + return getForeignCatalogName(); + + case FOREIGN_SCHEMA_NAME: + return getForeignSchemaName(); + + case FOREIGN_TABLE_NAME: + return getForeignTableName(); + + } + 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 PARENT_CATALOG_NAME: + return isSetParentCatalogName(); + case PARENT_SCHEMA_NAME: + return isSetParentSchemaName(); + case PARENT_TABLE_NAME: + return isSetParentTableName(); + case FOREIGN_CATALOG_NAME: + return isSetForeignCatalogName(); + case FOREIGN_SCHEMA_NAME: + return isSetForeignSchemaName(); + case FOREIGN_TABLE_NAME: + return isSetForeignTableName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetCrossReferenceReq) + return this.equals((TGetCrossReferenceReq)that); + return false; + } + + public boolean equals(TGetCrossReferenceReq 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_parentCatalogName = true && this.isSetParentCatalogName(); + boolean that_present_parentCatalogName = true && that.isSetParentCatalogName(); + if (this_present_parentCatalogName || that_present_parentCatalogName) { + if (!(this_present_parentCatalogName && that_present_parentCatalogName)) + return false; + if (!this.parentCatalogName.equals(that.parentCatalogName)) + return false; + } + + boolean this_present_parentSchemaName = true && this.isSetParentSchemaName(); + boolean that_present_parentSchemaName = true && that.isSetParentSchemaName(); + if (this_present_parentSchemaName || that_present_parentSchemaName) { + if (!(this_present_parentSchemaName && that_present_parentSchemaName)) + return false; + if (!this.parentSchemaName.equals(that.parentSchemaName)) + return false; + } + + boolean this_present_parentTableName = true && this.isSetParentTableName(); + boolean that_present_parentTableName = true && that.isSetParentTableName(); + if (this_present_parentTableName || that_present_parentTableName) { + if (!(this_present_parentTableName && that_present_parentTableName)) + return false; + if (!this.parentTableName.equals(that.parentTableName)) + return false; + } + + boolean this_present_foreignCatalogName = true && this.isSetForeignCatalogName(); + boolean that_present_foreignCatalogName = true && that.isSetForeignCatalogName(); + if (this_present_foreignCatalogName || that_present_foreignCatalogName) { + if (!(this_present_foreignCatalogName && that_present_foreignCatalogName)) + return false; + if (!this.foreignCatalogName.equals(that.foreignCatalogName)) + return false; + } + + boolean this_present_foreignSchemaName = true && this.isSetForeignSchemaName(); + boolean that_present_foreignSchemaName = true && that.isSetForeignSchemaName(); + if (this_present_foreignSchemaName || that_present_foreignSchemaName) { + if (!(this_present_foreignSchemaName && that_present_foreignSchemaName)) + return false; + if (!this.foreignSchemaName.equals(that.foreignSchemaName)) + return false; + } + + boolean this_present_foreignTableName = true && this.isSetForeignTableName(); + boolean that_present_foreignTableName = true && that.isSetForeignTableName(); + if (this_present_foreignTableName || that_present_foreignTableName) { + if (!(this_present_foreignTableName && that_present_foreignTableName)) + return false; + if (!this.foreignTableName.equals(that.foreignTableName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_parentCatalogName = true && (isSetParentCatalogName()); + list.add(present_parentCatalogName); + if (present_parentCatalogName) + list.add(parentCatalogName); + + boolean present_parentSchemaName = true && (isSetParentSchemaName()); + list.add(present_parentSchemaName); + if (present_parentSchemaName) + list.add(parentSchemaName); + + boolean present_parentTableName = true && (isSetParentTableName()); + list.add(present_parentTableName); + if (present_parentTableName) + list.add(parentTableName); + + boolean present_foreignCatalogName = true && (isSetForeignCatalogName()); + list.add(present_foreignCatalogName); + if (present_foreignCatalogName) + list.add(foreignCatalogName); + + boolean present_foreignSchemaName = true && (isSetForeignSchemaName()); + list.add(present_foreignSchemaName); + if (present_foreignSchemaName) + list.add(foreignSchemaName); + + boolean present_foreignTableName = true && (isSetForeignTableName()); + list.add(present_foreignTableName); + if (present_foreignTableName) + list.add(foreignTableName); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetCrossReferenceReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentCatalogName, other.parentCatalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentSchemaName, other.parentSchemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentTableName, other.parentTableName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetForeignCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignCatalogName, other.foreignCatalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetForeignSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignSchemaName, other.foreignSchemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetForeignTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignTableName, other.foreignTableName); + 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("TGetCrossReferenceReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetParentCatalogName()) { + if (!first) sb.append(", "); + sb.append("parentCatalogName:"); + if (this.parentCatalogName == null) { + sb.append("null"); + } else { + sb.append(this.parentCatalogName); + } + first = false; + } + if (isSetParentSchemaName()) { + if (!first) sb.append(", "); + sb.append("parentSchemaName:"); + if (this.parentSchemaName == null) { + sb.append("null"); + } else { + sb.append(this.parentSchemaName); + } + first = false; + } + if (isSetParentTableName()) { + if (!first) sb.append(", "); + sb.append("parentTableName:"); + if (this.parentTableName == null) { + sb.append("null"); + } else { + sb.append(this.parentTableName); + } + first = false; + } + if (isSetForeignCatalogName()) { + if (!first) sb.append(", "); + sb.append("foreignCatalogName:"); + if (this.foreignCatalogName == null) { + sb.append("null"); + } else { + sb.append(this.foreignCatalogName); + } + first = false; + } + if (isSetForeignSchemaName()) { + if (!first) sb.append(", "); + sb.append("foreignSchemaName:"); + if (this.foreignSchemaName == null) { + sb.append("null"); + } else { + sb.append(this.foreignSchemaName); + } + first = false; + } + if (isSetForeignTableName()) { + if (!first) sb.append(", "); + sb.append("foreignTableName:"); + if (this.foreignTableName == null) { + sb.append("null"); + } else { + sb.append(this.foreignTableName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetCrossReferenceReqStandardSchemeFactory implements SchemeFactory { + public TGetCrossReferenceReqStandardScheme getScheme() { + return new TGetCrossReferenceReqStandardScheme(); + } + } + + private static class TGetCrossReferenceReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceReq 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: // PARENT_CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentCatalogName = iprot.readString(); + struct.setParentCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PARENT_SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentSchemaName = iprot.readString(); + struct.setParentSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // PARENT_TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentTableName = iprot.readString(); + struct.setParentTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // FOREIGN_CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.foreignCatalogName = iprot.readString(); + struct.setForeignCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // FOREIGN_SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.foreignSchemaName = iprot.readString(); + struct.setForeignSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // FOREIGN_TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.foreignTableName = iprot.readString(); + struct.setForeignTableNameIsSet(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, TGetCrossReferenceReq 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.parentCatalogName != null) { + if (struct.isSetParentCatalogName()) { + oprot.writeFieldBegin(PARENT_CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.parentCatalogName); + oprot.writeFieldEnd(); + } + } + if (struct.parentSchemaName != null) { + if (struct.isSetParentSchemaName()) { + oprot.writeFieldBegin(PARENT_SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.parentSchemaName); + oprot.writeFieldEnd(); + } + } + if (struct.parentTableName != null) { + if (struct.isSetParentTableName()) { + oprot.writeFieldBegin(PARENT_TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.parentTableName); + oprot.writeFieldEnd(); + } + } + if (struct.foreignCatalogName != null) { + if (struct.isSetForeignCatalogName()) { + oprot.writeFieldBegin(FOREIGN_CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.foreignCatalogName); + oprot.writeFieldEnd(); + } + } + if (struct.foreignSchemaName != null) { + if (struct.isSetForeignSchemaName()) { + oprot.writeFieldBegin(FOREIGN_SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.foreignSchemaName); + oprot.writeFieldEnd(); + } + } + if (struct.foreignTableName != null) { + if (struct.isSetForeignTableName()) { + oprot.writeFieldBegin(FOREIGN_TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.foreignTableName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCrossReferenceReqTupleSchemeFactory implements SchemeFactory { + public TGetCrossReferenceReqTupleScheme getScheme() { + return new TGetCrossReferenceReqTupleScheme(); + } + } + + private static class TGetCrossReferenceReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetParentCatalogName()) { + optionals.set(0); + } + if (struct.isSetParentSchemaName()) { + optionals.set(1); + } + if (struct.isSetParentTableName()) { + optionals.set(2); + } + if (struct.isSetForeignCatalogName()) { + optionals.set(3); + } + if (struct.isSetForeignSchemaName()) { + optionals.set(4); + } + if (struct.isSetForeignTableName()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetParentCatalogName()) { + oprot.writeString(struct.parentCatalogName); + } + if (struct.isSetParentSchemaName()) { + oprot.writeString(struct.parentSchemaName); + } + if (struct.isSetParentTableName()) { + oprot.writeString(struct.parentTableName); + } + if (struct.isSetForeignCatalogName()) { + oprot.writeString(struct.foreignCatalogName); + } + if (struct.isSetForeignSchemaName()) { + oprot.writeString(struct.foreignSchemaName); + } + if (struct.isSetForeignTableName()) { + oprot.writeString(struct.foreignTableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.parentCatalogName = iprot.readString(); + struct.setParentCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.parentSchemaName = iprot.readString(); + struct.setParentSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.parentTableName = iprot.readString(); + struct.setParentTableNameIsSet(true); + } + if (incoming.get(3)) { + struct.foreignCatalogName = iprot.readString(); + struct.setForeignCatalogNameIsSet(true); + } + if (incoming.get(4)) { + struct.foreignSchemaName = iprot.readString(); + struct.setForeignSchemaNameIsSet(true); + } + if (incoming.get(5)) { + struct.foreignTableName = iprot.readString(); + struct.setForeignTableNameIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java new file mode 100644 index 000000000000..df989dc73957 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCrossReferenceResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCrossReferenceRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCrossReferenceRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetCrossReferenceResp.class, metaDataMap); + } + + public TGetCrossReferenceResp() { + } + + public TGetCrossReferenceResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetCrossReferenceResp(TGetCrossReferenceResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetCrossReferenceResp deepCopy() { + return new TGetCrossReferenceResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetCrossReferenceResp) + return this.equals((TGetCrossReferenceResp)that); + return false; + } + + public boolean equals(TGetCrossReferenceResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetCrossReferenceResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetCrossReferenceResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetCrossReferenceRespStandardSchemeFactory implements SchemeFactory { + public TGetCrossReferenceRespStandardScheme getScheme() { + return new TGetCrossReferenceRespStandardScheme(); + } + } + + private static class TGetCrossReferenceRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceResp 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; + 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, TGetCrossReferenceResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCrossReferenceRespTupleSchemeFactory implements SchemeFactory { + public TGetCrossReferenceRespTupleScheme getScheme() { + return new TGetCrossReferenceRespTupleScheme(); + } + } + + private static class TGetCrossReferenceRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java new file mode 100644 index 000000000000..5769aafc36c5 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java @@ -0,0 +1,585 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq"); + + 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 OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField RENEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("renewer", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetDelegationTokenReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetDelegationTokenReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String owner; // required + private String renewer; // 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"), + OWNER((short)2, "owner"), + RENEWER((short)3, "renewer"); + + 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: // OWNER + return OWNER; + case 3: // RENEWER + return RENEWER; + 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.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap); + } + + public TGetDelegationTokenReq() { + } + + public TGetDelegationTokenReq( + TSessionHandle sessionHandle, + String owner, + String renewer) + { + this(); + this.sessionHandle = sessionHandle; + this.owner = owner; + this.renewer = renewer; + } + + /** + * Performs a deep copy on other. + */ + public TGetDelegationTokenReq(TGetDelegationTokenReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetOwner()) { + this.owner = other.owner; + } + if (other.isSetRenewer()) { + this.renewer = other.renewer; + } + } + + public TGetDelegationTokenReq deepCopy() { + return new TGetDelegationTokenReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.owner = null; + this.renewer = 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 String getOwner() { + return this.owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public void unsetOwner() { + this.owner = null; + } + + /** Returns true if field owner is set (has been assigned a value) and false otherwise */ + public boolean isSetOwner() { + return this.owner != null; + } + + public void setOwnerIsSet(boolean value) { + if (!value) { + this.owner = null; + } + } + + public String getRenewer() { + return this.renewer; + } + + public void setRenewer(String renewer) { + this.renewer = renewer; + } + + public void unsetRenewer() { + this.renewer = null; + } + + /** Returns true if field renewer is set (has been assigned a value) and false otherwise */ + public boolean isSetRenewer() { + return this.renewer != null; + } + + public void setRenewerIsSet(boolean value) { + if (!value) { + this.renewer = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case OWNER: + if (value == null) { + unsetOwner(); + } else { + setOwner((String)value); + } + break; + + case RENEWER: + if (value == null) { + unsetRenewer(); + } else { + setRenewer((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case OWNER: + return getOwner(); + + case RENEWER: + return getRenewer(); + + } + 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 OWNER: + return isSetOwner(); + case RENEWER: + return isSetRenewer(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetDelegationTokenReq) + return this.equals((TGetDelegationTokenReq)that); + return false; + } + + public boolean equals(TGetDelegationTokenReq 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_owner = true && this.isSetOwner(); + boolean that_present_owner = true && that.isSetOwner(); + if (this_present_owner || that_present_owner) { + if (!(this_present_owner && that_present_owner)) + return false; + if (!this.owner.equals(that.owner)) + return false; + } + + boolean this_present_renewer = true && this.isSetRenewer(); + boolean that_present_renewer = true && that.isSetRenewer(); + if (this_present_renewer || that_present_renewer) { + if (!(this_present_renewer && that_present_renewer)) + return false; + if (!this.renewer.equals(that.renewer)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_owner = true && (isSetOwner()); + list.add(present_owner); + if (present_owner) + list.add(owner); + + boolean present_renewer = true && (isSetRenewer()); + list.add(present_renewer); + if (present_renewer) + list.add(renewer); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetDelegationTokenReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOwner()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRenewer()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.renewer, other.renewer); + 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("TGetDelegationTokenReq("); + 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("owner:"); + if (this.owner == null) { + sb.append("null"); + } else { + sb.append(this.owner); + } + first = false; + if (!first) sb.append(", "); + sb.append("renewer:"); + if (this.renewer == null) { + sb.append("null"); + } else { + sb.append(this.renewer); + } + 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 (!isSetOwner()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'owner' is unset! Struct:" + toString()); + } + + if (!isSetRenewer()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'renewer' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetDelegationTokenReqStandardSchemeFactory implements SchemeFactory { + public TGetDelegationTokenReqStandardScheme getScheme() { + return new TGetDelegationTokenReqStandardScheme(); + } + } + + private static class TGetDelegationTokenReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq 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: // OWNER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.owner = iprot.readString(); + struct.setOwnerIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RENEWER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.renewer = iprot.readString(); + struct.setRenewerIsSet(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, TGetDelegationTokenReq 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.owner != null) { + oprot.writeFieldBegin(OWNER_FIELD_DESC); + oprot.writeString(struct.owner); + oprot.writeFieldEnd(); + } + if (struct.renewer != null) { + oprot.writeFieldBegin(RENEWER_FIELD_DESC); + oprot.writeString(struct.renewer); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetDelegationTokenReqTupleSchemeFactory implements SchemeFactory { + public TGetDelegationTokenReqTupleScheme getScheme() { + return new TGetDelegationTokenReqTupleScheme(); + } + } + + private static class TGetDelegationTokenReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.owner); + oprot.writeString(struct.renewer); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.owner = iprot.readString(); + struct.setOwnerIsSet(true); + struct.renewer = iprot.readString(); + struct.setRenewerIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java new file mode 100644 index 000000000000..a5574a1ffff1 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java @@ -0,0 +1,494 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenResp"); + + 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetDelegationTokenRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetDelegationTokenRespTupleSchemeFactory()); + } + + private TStatus status; // required + private String delegationToken; // 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"), + DELEGATION_TOKEN((short)2, "delegationToken"); + + 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: // DELEGATION_TOKEN + return DELEGATION_TOKEN; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.DELEGATION_TOKEN}; + 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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenResp.class, metaDataMap); + } + + public TGetDelegationTokenResp() { + } + + public TGetDelegationTokenResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetDelegationTokenResp(TGetDelegationTokenResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetDelegationToken()) { + this.delegationToken = other.delegationToken; + } + } + + public TGetDelegationTokenResp deepCopy() { + return new TGetDelegationTokenResp(this); + } + + @Override + public void clear() { + this.status = null; + this.delegationToken = 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 String getDelegationToken() { + return this.delegationToken; + } + + public void setDelegationToken(String delegationToken) { + this.delegationToken = delegationToken; + } + + public void unsetDelegationToken() { + this.delegationToken = null; + } + + /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ + public boolean isSetDelegationToken() { + return this.delegationToken != null; + } + + public void setDelegationTokenIsSet(boolean value) { + if (!value) { + this.delegationToken = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case DELEGATION_TOKEN: + if (value == null) { + unsetDelegationToken(); + } else { + setDelegationToken((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case DELEGATION_TOKEN: + return getDelegationToken(); + + } + 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 DELEGATION_TOKEN: + return isSetDelegationToken(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetDelegationTokenResp) + return this.equals((TGetDelegationTokenResp)that); + return false; + } + + public boolean equals(TGetDelegationTokenResp 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_delegationToken = true && this.isSetDelegationToken(); + boolean that_present_delegationToken = true && that.isSetDelegationToken(); + if (this_present_delegationToken || that_present_delegationToken) { + if (!(this_present_delegationToken && that_present_delegationToken)) + return false; + if (!this.delegationToken.equals(that.delegationToken)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_delegationToken = true && (isSetDelegationToken()); + list.add(present_delegationToken); + if (present_delegationToken) + list.add(delegationToken); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetDelegationTokenResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelegationToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); + 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("TGetDelegationTokenResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetDelegationToken()) { + if (!first) sb.append(", "); + sb.append("delegationToken:"); + if (this.delegationToken == null) { + sb.append("null"); + } else { + sb.append(this.delegationToken); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetDelegationTokenRespStandardSchemeFactory implements SchemeFactory { + public TGetDelegationTokenRespStandardScheme getScheme() { + return new TGetDelegationTokenRespStandardScheme(); + } + } + + private static class TGetDelegationTokenRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenResp 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: // DELEGATION_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(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, TGetDelegationTokenResp 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.delegationToken != null) { + if (struct.isSetDelegationToken()) { + oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); + oprot.writeString(struct.delegationToken); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetDelegationTokenRespTupleSchemeFactory implements SchemeFactory { + public TGetDelegationTokenRespTupleScheme getScheme() { + return new TGetDelegationTokenRespTupleScheme(); + } + } + + private static class TGetDelegationTokenRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetDelegationToken()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetDelegationToken()) { + oprot.writeString(struct.delegationToken); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java new file mode 100644 index 000000000000..68b533ba893c --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java @@ -0,0 +1,701 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetFunctionsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetFunctionsReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String functionName; // 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"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + FUNCTION_NAME((short)4, "functionName"); + + 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: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // FUNCTION_NAME + return FUNCTION_NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsReq.class, metaDataMap); + } + + public TGetFunctionsReq() { + } + + public TGetFunctionsReq( + TSessionHandle sessionHandle, + String functionName) + { + this(); + this.sessionHandle = sessionHandle; + this.functionName = functionName; + } + + /** + * Performs a deep copy on other. + */ + public TGetFunctionsReq(TGetFunctionsReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetFunctionName()) { + this.functionName = other.functionName; + } + } + + public TGetFunctionsReq deepCopy() { + return new TGetFunctionsReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.functionName = 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 String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + public String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + public String getFunctionName() { + return this.functionName; + } + + public void setFunctionName(String functionName) { + this.functionName = functionName; + } + + public void unsetFunctionName() { + this.functionName = null; + } + + /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ + public boolean isSetFunctionName() { + return this.functionName != null; + } + + public void setFunctionNameIsSet(boolean value) { + if (!value) { + this.functionName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((String)value); + } + break; + + case FUNCTION_NAME: + if (value == null) { + unsetFunctionName(); + } else { + setFunctionName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case FUNCTION_NAME: + return getFunctionName(); + + } + 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 CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case FUNCTION_NAME: + return isSetFunctionName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetFunctionsReq) + return this.equals((TGetFunctionsReq)that); + return false; + } + + public boolean equals(TGetFunctionsReq 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_functionName = true && this.isSetFunctionName(); + boolean that_present_functionName = true && that.isSetFunctionName(); + if (this_present_functionName || that_present_functionName) { + if (!(this_present_functionName && that_present_functionName)) + return false; + if (!this.functionName.equals(that.functionName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); + + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); + + boolean present_functionName = true && (isSetFunctionName()); + list.add(present_functionName); + if (present_functionName) + list.add(functionName); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetFunctionsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFunctionName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, other.functionName); + 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("TGetFunctionsReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (!first) sb.append(", "); + sb.append("functionName:"); + if (this.functionName == null) { + sb.append("null"); + } else { + sb.append(this.functionName); + } + 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 (!isSetFunctionName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'functionName' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetFunctionsReqStandardSchemeFactory implements SchemeFactory { + public TGetFunctionsReqStandardScheme getScheme() { + return new TGetFunctionsReqStandardScheme(); + } + } + + private static class TGetFunctionsReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // FUNCTION_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.functionName = iprot.readString(); + struct.setFunctionNameIsSet(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, TGetFunctionsReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.functionName != null) { + oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); + oprot.writeString(struct.functionName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetFunctionsReqTupleSchemeFactory implements SchemeFactory { + public TGetFunctionsReqTupleScheme getScheme() { + return new TGetFunctionsReqTupleScheme(); + } + } + + private static class TGetFunctionsReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.functionName); + BitSet optionals = new BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.functionName = iprot.readString(); + struct.setFunctionNameIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java new file mode 100644 index 000000000000..af1a30ceb44e --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetFunctionsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetFunctionsRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetFunctionsResp.class, metaDataMap); + } + + public TGetFunctionsResp() { + } + + public TGetFunctionsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetFunctionsResp(TGetFunctionsResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetFunctionsResp deepCopy() { + return new TGetFunctionsResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetFunctionsResp) + return this.equals((TGetFunctionsResp)that); + return false; + } + + public boolean equals(TGetFunctionsResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetFunctionsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetFunctionsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetFunctionsRespStandardSchemeFactory implements SchemeFactory { + public TGetFunctionsRespStandardScheme getScheme() { + return new TGetFunctionsRespStandardScheme(); + } + } + + private static class TGetFunctionsRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsResp 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; + 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, TGetFunctionsResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetFunctionsRespTupleSchemeFactory implements SchemeFactory { + public TGetFunctionsRespTupleScheme getScheme() { + return new TGetFunctionsRespTupleScheme(); + } + } + + private static class TGetFunctionsRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoReq.java new file mode 100644 index 000000000000..9fe4a2228111 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoReq.java @@ -0,0 +1,496 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoReq"); + + 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 INFO_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoType", org.apache.thrift.protocol.TType.I32, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetInfoReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetInfoReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private TGetInfoType infoType; // 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"), + /** + * + * @see TGetInfoType + */ + INFO_TYPE((short)2, "infoType"); + + 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: // INFO_TYPE + return INFO_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, 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.INFO_TYPE, new org.apache.thrift.meta_data.FieldMetaData("infoType", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGetInfoType.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoReq.class, metaDataMap); + } + + public TGetInfoReq() { + } + + public TGetInfoReq( + TSessionHandle sessionHandle, + TGetInfoType infoType) + { + this(); + this.sessionHandle = sessionHandle; + this.infoType = infoType; + } + + /** + * Performs a deep copy on other. + */ + public TGetInfoReq(TGetInfoReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetInfoType()) { + this.infoType = other.infoType; + } + } + + public TGetInfoReq deepCopy() { + return new TGetInfoReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.infoType = 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; + } + } + + /** + * + * @see TGetInfoType + */ + public TGetInfoType getInfoType() { + return this.infoType; + } + + /** + * + * @see TGetInfoType + */ + public void setInfoType(TGetInfoType infoType) { + this.infoType = infoType; + } + + public void unsetInfoType() { + this.infoType = null; + } + + /** Returns true if field infoType is set (has been assigned a value) and false otherwise */ + public boolean isSetInfoType() { + return this.infoType != null; + } + + public void setInfoTypeIsSet(boolean value) { + if (!value) { + this.infoType = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case INFO_TYPE: + if (value == null) { + unsetInfoType(); + } else { + setInfoType((TGetInfoType)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case INFO_TYPE: + return getInfoType(); + + } + 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 INFO_TYPE: + return isSetInfoType(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetInfoReq) + return this.equals((TGetInfoReq)that); + return false; + } + + public boolean equals(TGetInfoReq 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_infoType = true && this.isSetInfoType(); + boolean that_present_infoType = true && that.isSetInfoType(); + if (this_present_infoType || that_present_infoType) { + if (!(this_present_infoType && that_present_infoType)) + return false; + if (!this.infoType.equals(that.infoType)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_infoType = true && (isSetInfoType()); + list.add(present_infoType); + if (present_infoType) + list.add(infoType.getValue()); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetInfoReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInfoType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoType, other.infoType); + 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("TGetInfoReq("); + 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("infoType:"); + if (this.infoType == null) { + sb.append("null"); + } else { + sb.append(this.infoType); + } + 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 (!isSetInfoType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoType' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetInfoReqStandardSchemeFactory implements SchemeFactory { + public TGetInfoReqStandardScheme getScheme() { + return new TGetInfoReqStandardScheme(); + } + } + + private static class TGetInfoReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq 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: // INFO_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.infoType = TGetInfoType.findByValue(iprot.readI32()); + struct.setInfoTypeIsSet(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, TGetInfoReq 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.infoType != null) { + oprot.writeFieldBegin(INFO_TYPE_FIELD_DESC); + oprot.writeI32(struct.infoType.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetInfoReqTupleSchemeFactory implements SchemeFactory { + public TGetInfoReqTupleScheme getScheme() { + return new TGetInfoReqTupleScheme(); + } + } + + private static class TGetInfoReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeI32(struct.infoType.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.infoType = TGetInfoType.findByValue(iprot.readI32()); + struct.setInfoTypeIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoResp.java new file mode 100644 index 000000000000..0cc5e3a744d4 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoResp.java @@ -0,0 +1,486 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp"); + + 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 INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetInfoRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetInfoRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TGetInfoValue infoValue; // 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 { + STATUS((short)1, "status"), + INFO_VALUE((short)2, "infoValue"); + + 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: // INFO_VALUE + return INFO_VALUE; + 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.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.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap); + } + + public TGetInfoResp() { + } + + public TGetInfoResp( + TStatus status, + TGetInfoValue infoValue) + { + this(); + this.status = status; + this.infoValue = infoValue; + } + + /** + * Performs a deep copy on other. + */ + public TGetInfoResp(TGetInfoResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetInfoValue()) { + this.infoValue = new TGetInfoValue(other.infoValue); + } + } + + public TGetInfoResp deepCopy() { + return new TGetInfoResp(this); + } + + @Override + public void clear() { + this.status = null; + this.infoValue = 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 TGetInfoValue getInfoValue() { + return this.infoValue; + } + + public void setInfoValue(TGetInfoValue infoValue) { + this.infoValue = infoValue; + } + + public void unsetInfoValue() { + this.infoValue = null; + } + + /** Returns true if field infoValue is set (has been assigned a value) and false otherwise */ + public boolean isSetInfoValue() { + return this.infoValue != null; + } + + public void setInfoValueIsSet(boolean value) { + if (!value) { + this.infoValue = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case INFO_VALUE: + if (value == null) { + unsetInfoValue(); + } else { + setInfoValue((TGetInfoValue)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case INFO_VALUE: + return getInfoValue(); + + } + 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 INFO_VALUE: + return isSetInfoValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetInfoResp) + return this.equals((TGetInfoResp)that); + return false; + } + + public boolean equals(TGetInfoResp 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_infoValue = true && this.isSetInfoValue(); + boolean that_present_infoValue = true && that.isSetInfoValue(); + if (this_present_infoValue || that_present_infoValue) { + if (!(this_present_infoValue && that_present_infoValue)) + return false; + if (!this.infoValue.equals(that.infoValue)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_infoValue = true && (isSetInfoValue()); + list.add(present_infoValue); + if (present_infoValue) + list.add(infoValue); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetInfoResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInfoValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoValue, other.infoValue); + 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("TGetInfoResp("); + 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("infoValue:"); + if (this.infoValue == null) { + sb.append("null"); + } else { + sb.append(this.infoValue); + } + 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 (!isSetInfoValue()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoValue' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetInfoRespStandardSchemeFactory implements SchemeFactory { + public TGetInfoRespStandardScheme getScheme() { + return new TGetInfoRespStandardScheme(); + } + } + + private static class TGetInfoRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp 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: // INFO_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.infoValue = new TGetInfoValue(); + struct.infoValue.read(iprot); + struct.setInfoValueIsSet(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, TGetInfoResp 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.infoValue != null) { + oprot.writeFieldBegin(INFO_VALUE_FIELD_DESC); + struct.infoValue.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetInfoRespTupleSchemeFactory implements SchemeFactory { + public TGetInfoRespTupleScheme getScheme() { + return new TGetInfoRespTupleScheme(); + } + } + + private static class TGetInfoRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + struct.infoValue.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + struct.infoValue = new TGetInfoValue(); + struct.infoValue.read(iprot); + struct.setInfoValueIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoType.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoType.java new file mode 100644 index 000000000000..053c78c99b8d --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoType.java @@ -0,0 +1,179 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TGetInfoType implements org.apache.thrift.TEnum { + CLI_MAX_DRIVER_CONNECTIONS(0), + CLI_MAX_CONCURRENT_ACTIVITIES(1), + CLI_DATA_SOURCE_NAME(2), + CLI_FETCH_DIRECTION(8), + CLI_SERVER_NAME(13), + CLI_SEARCH_PATTERN_ESCAPE(14), + CLI_DBMS_NAME(17), + CLI_DBMS_VER(18), + CLI_ACCESSIBLE_TABLES(19), + CLI_ACCESSIBLE_PROCEDURES(20), + CLI_CURSOR_COMMIT_BEHAVIOR(23), + CLI_DATA_SOURCE_READ_ONLY(25), + CLI_DEFAULT_TXN_ISOLATION(26), + CLI_IDENTIFIER_CASE(28), + CLI_IDENTIFIER_QUOTE_CHAR(29), + CLI_MAX_COLUMN_NAME_LEN(30), + CLI_MAX_CURSOR_NAME_LEN(31), + CLI_MAX_SCHEMA_NAME_LEN(32), + CLI_MAX_CATALOG_NAME_LEN(34), + CLI_MAX_TABLE_NAME_LEN(35), + CLI_SCROLL_CONCURRENCY(43), + CLI_TXN_CAPABLE(46), + CLI_USER_NAME(47), + CLI_TXN_ISOLATION_OPTION(72), + CLI_INTEGRITY(73), + CLI_GETDATA_EXTENSIONS(81), + CLI_NULL_COLLATION(85), + CLI_ALTER_TABLE(86), + CLI_ORDER_BY_COLUMNS_IN_SELECT(90), + CLI_SPECIAL_CHARACTERS(94), + CLI_MAX_COLUMNS_IN_GROUP_BY(97), + CLI_MAX_COLUMNS_IN_INDEX(98), + CLI_MAX_COLUMNS_IN_ORDER_BY(99), + CLI_MAX_COLUMNS_IN_SELECT(100), + CLI_MAX_COLUMNS_IN_TABLE(101), + CLI_MAX_INDEX_SIZE(102), + CLI_MAX_ROW_SIZE(104), + CLI_MAX_STATEMENT_LEN(105), + CLI_MAX_TABLES_IN_SELECT(106), + CLI_MAX_USER_NAME_LEN(107), + CLI_OJ_CAPABILITIES(115), + CLI_XOPEN_CLI_YEAR(10000), + CLI_CURSOR_SENSITIVITY(10001), + CLI_DESCRIBE_PARAMETER(10002), + CLI_CATALOG_NAME(10003), + CLI_COLLATION_SEQ(10004), + CLI_MAX_IDENTIFIER_LEN(10005), + CLI_ODBC_KEYWORDS(10006); + + private final int value; + + private TGetInfoType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TGetInfoType findByValue(int value) { + switch (value) { + case 0: + return CLI_MAX_DRIVER_CONNECTIONS; + case 1: + return CLI_MAX_CONCURRENT_ACTIVITIES; + case 2: + return CLI_DATA_SOURCE_NAME; + case 8: + return CLI_FETCH_DIRECTION; + case 13: + return CLI_SERVER_NAME; + case 14: + return CLI_SEARCH_PATTERN_ESCAPE; + case 17: + return CLI_DBMS_NAME; + case 18: + return CLI_DBMS_VER; + case 19: + return CLI_ACCESSIBLE_TABLES; + case 20: + return CLI_ACCESSIBLE_PROCEDURES; + case 23: + return CLI_CURSOR_COMMIT_BEHAVIOR; + case 25: + return CLI_DATA_SOURCE_READ_ONLY; + case 26: + return CLI_DEFAULT_TXN_ISOLATION; + case 28: + return CLI_IDENTIFIER_CASE; + case 29: + return CLI_IDENTIFIER_QUOTE_CHAR; + case 30: + return CLI_MAX_COLUMN_NAME_LEN; + case 31: + return CLI_MAX_CURSOR_NAME_LEN; + case 32: + return CLI_MAX_SCHEMA_NAME_LEN; + case 34: + return CLI_MAX_CATALOG_NAME_LEN; + case 35: + return CLI_MAX_TABLE_NAME_LEN; + case 43: + return CLI_SCROLL_CONCURRENCY; + case 46: + return CLI_TXN_CAPABLE; + case 47: + return CLI_USER_NAME; + case 72: + return CLI_TXN_ISOLATION_OPTION; + case 73: + return CLI_INTEGRITY; + case 81: + return CLI_GETDATA_EXTENSIONS; + case 85: + return CLI_NULL_COLLATION; + case 86: + return CLI_ALTER_TABLE; + case 90: + return CLI_ORDER_BY_COLUMNS_IN_SELECT; + case 94: + return CLI_SPECIAL_CHARACTERS; + case 97: + return CLI_MAX_COLUMNS_IN_GROUP_BY; + case 98: + return CLI_MAX_COLUMNS_IN_INDEX; + case 99: + return CLI_MAX_COLUMNS_IN_ORDER_BY; + case 100: + return CLI_MAX_COLUMNS_IN_SELECT; + case 101: + return CLI_MAX_COLUMNS_IN_TABLE; + case 102: + return CLI_MAX_INDEX_SIZE; + case 104: + return CLI_MAX_ROW_SIZE; + case 105: + return CLI_MAX_STATEMENT_LEN; + case 106: + return CLI_MAX_TABLES_IN_SELECT; + case 107: + return CLI_MAX_USER_NAME_LEN; + case 115: + return CLI_OJ_CAPABILITIES; + case 10000: + return CLI_XOPEN_CLI_YEAR; + case 10001: + return CLI_CURSOR_SENSITIVITY; + case 10002: + return CLI_DESCRIBE_PARAMETER; + case 10003: + return CLI_CATALOG_NAME; + case 10004: + return CLI_COLLATION_SEQ; + case 10005: + return CLI_MAX_IDENTIFIER_LEN; + case 10006: + return CLI_ODBC_KEYWORDS; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoValue.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoValue.java new file mode 100644 index 000000000000..f1ae085f3b47 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoValue.java @@ -0,0 +1,580 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +import org.apache.thrift.protocol.TProtocolException; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetInfoValue extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoValue"); + private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SMALL_INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("smallIntValue", org.apache.thrift.protocol.TType.I16, (short)2); + private static final org.apache.thrift.protocol.TField INTEGER_BITMASK_FIELD_DESC = new org.apache.thrift.protocol.TField("integerBitmask", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField INTEGER_FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("integerFlag", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField BINARY_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryValue", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField LEN_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("lenValue", org.apache.thrift.protocol.TType.I64, (short)6); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + STRING_VALUE((short)1, "stringValue"), + SMALL_INT_VALUE((short)2, "smallIntValue"), + INTEGER_BITMASK((short)3, "integerBitmask"), + INTEGER_FLAG((short)4, "integerFlag"), + BINARY_VALUE((short)5, "binaryValue"), + LEN_VALUE((short)6, "lenValue"); + + 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: // STRING_VALUE + return STRING_VALUE; + case 2: // SMALL_INT_VALUE + return SMALL_INT_VALUE; + case 3: // INTEGER_BITMASK + return INTEGER_BITMASK; + case 4: // INTEGER_FLAG + return INTEGER_FLAG; + case 5: // BINARY_VALUE + return BINARY_VALUE; + case 6: // LEN_VALUE + return LEN_VALUE; + 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; + } + } + + 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.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoValue.class, metaDataMap); + } + + public TGetInfoValue() { + super(); + } + + public TGetInfoValue(_Fields setField, Object value) { + super(setField, value); + } + + public TGetInfoValue(TGetInfoValue other) { + super(other); + } + public TGetInfoValue deepCopy() { + return new TGetInfoValue(this); + } + + public static TGetInfoValue stringValue(String value) { + TGetInfoValue x = new TGetInfoValue(); + x.setStringValue(value); + return x; + } + + public static TGetInfoValue smallIntValue(short value) { + TGetInfoValue x = new TGetInfoValue(); + x.setSmallIntValue(value); + return x; + } + + public static TGetInfoValue integerBitmask(int value) { + TGetInfoValue x = new TGetInfoValue(); + x.setIntegerBitmask(value); + return x; + } + + public static TGetInfoValue integerFlag(int value) { + TGetInfoValue x = new TGetInfoValue(); + x.setIntegerFlag(value); + return x; + } + + public static TGetInfoValue binaryValue(int value) { + TGetInfoValue x = new TGetInfoValue(); + x.setBinaryValue(value); + return x; + } + + public static TGetInfoValue lenValue(long value) { + TGetInfoValue x = new TGetInfoValue(); + x.setLenValue(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case STRING_VALUE: + if (value instanceof String) { + break; + } + throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); + case SMALL_INT_VALUE: + if (value instanceof Short) { + break; + } + throw new ClassCastException("Was expecting value of type Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); + case INTEGER_BITMASK: + if (value instanceof Integer) { + break; + } + throw new ClassCastException("Was expecting value of type Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); + case INTEGER_FLAG: + if (value instanceof Integer) { + break; + } + throw new ClassCastException("Was expecting value of type Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); + case BINARY_VALUE: + if (value instanceof Integer) { + break; + } + throw new ClassCastException("Was expecting value of type Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); + case LEN_VALUE: + if (value instanceof Long) { + break; + } + throw new ClassCastException("Was expecting value of type Long for field 'lenValue', but got " + value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case STRING_VALUE: + if (field.type == STRING_VALUE_FIELD_DESC.type) { + String stringValue; + stringValue = iprot.readString(); + return stringValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case SMALL_INT_VALUE: + if (field.type == SMALL_INT_VALUE_FIELD_DESC.type) { + Short smallIntValue; + smallIntValue = iprot.readI16(); + return smallIntValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case INTEGER_BITMASK: + if (field.type == INTEGER_BITMASK_FIELD_DESC.type) { + Integer integerBitmask; + integerBitmask = iprot.readI32(); + return integerBitmask; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case INTEGER_FLAG: + if (field.type == INTEGER_FLAG_FIELD_DESC.type) { + Integer integerFlag; + integerFlag = iprot.readI32(); + return integerFlag; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BINARY_VALUE: + if (field.type == BINARY_VALUE_FIELD_DESC.type) { + Integer binaryValue; + binaryValue = iprot.readI32(); + return binaryValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case LEN_VALUE: + if (field.type == LEN_VALUE_FIELD_DESC.type) { + Long lenValue; + lenValue = iprot.readI64(); + return lenValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case STRING_VALUE: + String stringValue = (String)value_; + oprot.writeString(stringValue); + return; + case SMALL_INT_VALUE: + Short smallIntValue = (Short)value_; + oprot.writeI16(smallIntValue); + return; + case INTEGER_BITMASK: + Integer integerBitmask = (Integer)value_; + oprot.writeI32(integerBitmask); + return; + case INTEGER_FLAG: + Integer integerFlag = (Integer)value_; + oprot.writeI32(integerFlag); + return; + case BINARY_VALUE: + Integer binaryValue = (Integer)value_; + oprot.writeI32(binaryValue); + return; + case LEN_VALUE: + Long lenValue = (Long)value_; + oprot.writeI64(lenValue); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case STRING_VALUE: + String stringValue; + stringValue = iprot.readString(); + return stringValue; + case SMALL_INT_VALUE: + Short smallIntValue; + smallIntValue = iprot.readI16(); + return smallIntValue; + case INTEGER_BITMASK: + Integer integerBitmask; + integerBitmask = iprot.readI32(); + return integerBitmask; + case INTEGER_FLAG: + Integer integerFlag; + integerFlag = iprot.readI32(); + return integerFlag; + case BINARY_VALUE: + Integer binaryValue; + binaryValue = iprot.readI32(); + return binaryValue; + case LEN_VALUE: + Long lenValue; + lenValue = iprot.readI64(); + return lenValue; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case STRING_VALUE: + String stringValue = (String)value_; + oprot.writeString(stringValue); + return; + case SMALL_INT_VALUE: + Short smallIntValue = (Short)value_; + oprot.writeI16(smallIntValue); + return; + case INTEGER_BITMASK: + Integer integerBitmask = (Integer)value_; + oprot.writeI32(integerBitmask); + return; + case INTEGER_FLAG: + Integer integerFlag = (Integer)value_; + oprot.writeI32(integerFlag); + return; + case BINARY_VALUE: + Integer binaryValue = (Integer)value_; + oprot.writeI32(binaryValue); + return; + case LEN_VALUE: + Long lenValue = (Long)value_; + oprot.writeI64(lenValue); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case STRING_VALUE: + return STRING_VALUE_FIELD_DESC; + case SMALL_INT_VALUE: + return SMALL_INT_VALUE_FIELD_DESC; + case INTEGER_BITMASK: + return INTEGER_BITMASK_FIELD_DESC; + case INTEGER_FLAG: + return INTEGER_FLAG_FIELD_DESC; + case BINARY_VALUE: + return BINARY_VALUE_FIELD_DESC; + case LEN_VALUE: + return LEN_VALUE_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public String getStringValue() { + if (getSetField() == _Fields.STRING_VALUE) { + return (String)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringValue(String value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.STRING_VALUE; + value_ = value; + } + + public short getSmallIntValue() { + if (getSetField() == _Fields.SMALL_INT_VALUE) { + return (Short)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setSmallIntValue(short value) { + setField_ = _Fields.SMALL_INT_VALUE; + value_ = value; + } + + public int getIntegerBitmask() { + if (getSetField() == _Fields.INTEGER_BITMASK) { + return (Integer)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setIntegerBitmask(int value) { + setField_ = _Fields.INTEGER_BITMASK; + value_ = value; + } + + public int getIntegerFlag() { + if (getSetField() == _Fields.INTEGER_FLAG) { + return (Integer)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setIntegerFlag(int value) { + setField_ = _Fields.INTEGER_FLAG; + value_ = value; + } + + public int getBinaryValue() { + if (getSetField() == _Fields.BINARY_VALUE) { + return (Integer)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBinaryValue(int value) { + setField_ = _Fields.BINARY_VALUE; + value_ = value; + } + + public long getLenValue() { + if (getSetField() == _Fields.LEN_VALUE) { + return (Long)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setLenValue(long value) { + setField_ = _Fields.LEN_VALUE; + value_ = value; + } + + public boolean isSetStringValue() { + return setField_ == _Fields.STRING_VALUE; + } + + + public boolean isSetSmallIntValue() { + return setField_ == _Fields.SMALL_INT_VALUE; + } + + + public boolean isSetIntegerBitmask() { + return setField_ == _Fields.INTEGER_BITMASK; + } + + + public boolean isSetIntegerFlag() { + return setField_ == _Fields.INTEGER_FLAG; + } + + + public boolean isSetBinaryValue() { + return setField_ == _Fields.BINARY_VALUE; + } + + + public boolean isSetLenValue() { + return setField_ == _Fields.LEN_VALUE; + } + + + public boolean equals(Object other) { + if (other instanceof TGetInfoValue) { + return equals((TGetInfoValue)other); + } else { + return false; + } + } + + public boolean equals(TGetInfoValue other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TGetInfoValue other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + List list = new ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java new file mode 100644 index 000000000000..9a1a03840229 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java @@ -0,0 +1,492 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusReq"); + + 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)1); + private static final org.apache.thrift.protocol.TField GET_PROGRESS_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("getProgressUpdate", org.apache.thrift.protocol.TType.BOOL, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetOperationStatusReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetOperationStatusReqTupleSchemeFactory()); + } + + private TOperationHandle operationHandle; // required + private boolean getProgressUpdate; // 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 { + OPERATION_HANDLE((short)1, "operationHandle"), + GET_PROGRESS_UPDATE((short)2, "getProgressUpdate"); + + 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: // OPERATION_HANDLE + return OPERATION_HANDLE; + case 2: // GET_PROGRESS_UPDATE + return GET_PROGRESS_UPDATE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __GETPROGRESSUPDATE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.GET_PROGRESS_UPDATE}; + 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.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.GET_PROGRESS_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("getProgressUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusReq.class, metaDataMap); + } + + public TGetOperationStatusReq() { + } + + public TGetOperationStatusReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetOperationStatusReq(TGetOperationStatusReq other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + this.getProgressUpdate = other.getProgressUpdate; + } + + public TGetOperationStatusReq deepCopy() { + return new TGetOperationStatusReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + setGetProgressUpdateIsSet(false); + this.getProgressUpdate = false; + } + + 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 boolean isGetProgressUpdate() { + return this.getProgressUpdate; + } + + public void setGetProgressUpdate(boolean getProgressUpdate) { + this.getProgressUpdate = getProgressUpdate; + setGetProgressUpdateIsSet(true); + } + + public void unsetGetProgressUpdate() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + } + + /** Returns true if field getProgressUpdate is set (has been assigned a value) and false otherwise */ + public boolean isSetGetProgressUpdate() { + return EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + } + + public void setGetProgressUpdateIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + case GET_PROGRESS_UPDATE: + if (value == null) { + unsetGetProgressUpdate(); + } else { + setGetProgressUpdate((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + case GET_PROGRESS_UPDATE: + return isGetProgressUpdate(); + + } + 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 OPERATION_HANDLE: + return isSetOperationHandle(); + case GET_PROGRESS_UPDATE: + return isSetGetProgressUpdate(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetOperationStatusReq) + return this.equals((TGetOperationStatusReq)that); + return false; + } + + public boolean equals(TGetOperationStatusReq that) { + if (that == null) + 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_getProgressUpdate = true && this.isSetGetProgressUpdate(); + boolean that_present_getProgressUpdate = true && that.isSetGetProgressUpdate(); + if (this_present_getProgressUpdate || that_present_getProgressUpdate) { + if (!(this_present_getProgressUpdate && that_present_getProgressUpdate)) + return false; + if (this.getProgressUpdate != that.getProgressUpdate) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + boolean present_getProgressUpdate = true && (isSetGetProgressUpdate()); + list.add(present_getProgressUpdate); + if (present_getProgressUpdate) + list.add(getProgressUpdate); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetOperationStatusReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGetProgressUpdate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.getProgressUpdate, other.getProgressUpdate); + 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("TGetOperationStatusReq("); + boolean first = true; + + sb.append("operationHandle:"); + if (this.operationHandle == null) { + sb.append("null"); + } else { + sb.append(this.operationHandle); + } + first = false; + if (isSetGetProgressUpdate()) { + if (!first) sb.append(", "); + sb.append("getProgressUpdate:"); + sb.append(this.getProgressUpdate); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TGetOperationStatusReqStandardSchemeFactory implements SchemeFactory { + public TGetOperationStatusReqStandardScheme getScheme() { + return new TGetOperationStatusReqStandardScheme(); + } + } + + private static class TGetOperationStatusReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusReq 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: // 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 2: // GET_PROGRESS_UPDATE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.getProgressUpdate = iprot.readBool(); + struct.setGetProgressUpdateIsSet(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, TGetOperationStatusReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.isSetGetProgressUpdate()) { + oprot.writeFieldBegin(GET_PROGRESS_UPDATE_FIELD_DESC); + oprot.writeBool(struct.getProgressUpdate); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetOperationStatusReqTupleSchemeFactory implements SchemeFactory { + public TGetOperationStatusReqTupleScheme getScheme() { + return new TGetOperationStatusReqTupleScheme(); + } + } + + private static class TGetOperationStatusReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.operationHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetGetProgressUpdate()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetGetProgressUpdate()) { + oprot.writeBool(struct.getProgressUpdate); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.getProgressUpdate = iprot.readBool(); + struct.setGetProgressUpdateIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java new file mode 100644 index 000000000000..fad75ca5fb54 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java @@ -0,0 +1,1333 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusResp"); + + 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_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationState", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField TASK_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStatus", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField OPERATION_STARTED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationStarted", org.apache.thrift.protocol.TType.I64, (short)7); + private static final org.apache.thrift.protocol.TField OPERATION_COMPLETED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationCompleted", org.apache.thrift.protocol.TType.I64, (short)8); + private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)9); + private static final org.apache.thrift.protocol.TField PROGRESS_UPDATE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressUpdateResponse", org.apache.thrift.protocol.TType.STRUCT, (short)10); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetOperationStatusRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetOperationStatusRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationState operationState; // optional + private String sqlState; // optional + private int errorCode; // optional + private String errorMessage; // optional + private String taskStatus; // optional + private long operationStarted; // optional + private long operationCompleted; // optional + private boolean hasResultSet; // optional + private TProgressUpdateResp progressUpdateResponse; // 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"), + /** + * + * @see TOperationState + */ + OPERATION_STATE((short)2, "operationState"), + SQL_STATE((short)3, "sqlState"), + ERROR_CODE((short)4, "errorCode"), + ERROR_MESSAGE((short)5, "errorMessage"), + TASK_STATUS((short)6, "taskStatus"), + OPERATION_STARTED((short)7, "operationStarted"), + OPERATION_COMPLETED((short)8, "operationCompleted"), + HAS_RESULT_SET((short)9, "hasResultSet"), + PROGRESS_UPDATE_RESPONSE((short)10, "progressUpdateResponse"); + + 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_STATE + return OPERATION_STATE; + case 3: // SQL_STATE + return SQL_STATE; + case 4: // ERROR_CODE + return ERROR_CODE; + case 5: // ERROR_MESSAGE + return ERROR_MESSAGE; + case 6: // TASK_STATUS + return TASK_STATUS; + case 7: // OPERATION_STARTED + return OPERATION_STARTED; + case 8: // OPERATION_COMPLETED + return OPERATION_COMPLETED; + case 9: // HAS_RESULT_SET + return HAS_RESULT_SET; + case 10: // PROGRESS_UPDATE_RESPONSE + return PROGRESS_UPDATE_RESPONSE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERRORCODE_ISSET_ID = 0; + private static final int __OPERATIONSTARTED_ISSET_ID = 1; + private static final int __OPERATIONCOMPLETED_ISSET_ID = 2; + private static final int __HASRESULTSET_ISSET_ID = 3; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET,_Fields.PROGRESS_UPDATE_RESPONSE}; + 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_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationState.class))); + tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TASK_STATUS, new org.apache.thrift.meta_data.FieldMetaData("taskStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OPERATION_STARTED, new org.apache.thrift.meta_data.FieldMetaData("operationStarted", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.OPERATION_COMPLETED, new org.apache.thrift.meta_data.FieldMetaData("operationCompleted", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.PROGRESS_UPDATE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("progressUpdateResponse", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TProgressUpdateResp"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap); + } + + public TGetOperationStatusResp() { + } + + public TGetOperationStatusResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetOperationStatusResp(TGetOperationStatusResp other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationState()) { + this.operationState = other.operationState; + } + if (other.isSetSqlState()) { + this.sqlState = other.sqlState; + } + this.errorCode = other.errorCode; + if (other.isSetErrorMessage()) { + this.errorMessage = other.errorMessage; + } + if (other.isSetTaskStatus()) { + this.taskStatus = other.taskStatus; + } + this.operationStarted = other.operationStarted; + this.operationCompleted = other.operationCompleted; + this.hasResultSet = other.hasResultSet; + if (other.isSetProgressUpdateResponse()) { + this.progressUpdateResponse = other.progressUpdateResponse; + } + } + + public TGetOperationStatusResp deepCopy() { + return new TGetOperationStatusResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationState = null; + this.sqlState = null; + setErrorCodeIsSet(false); + this.errorCode = 0; + this.errorMessage = null; + this.taskStatus = null; + setOperationStartedIsSet(false); + this.operationStarted = 0; + setOperationCompletedIsSet(false); + this.operationCompleted = 0; + setHasResultSetIsSet(false); + this.hasResultSet = false; + this.progressUpdateResponse = 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; + } + } + + /** + * + * @see TOperationState + */ + public TOperationState getOperationState() { + return this.operationState; + } + + /** + * + * @see TOperationState + */ + public void setOperationState(TOperationState operationState) { + this.operationState = operationState; + } + + public void unsetOperationState() { + this.operationState = null; + } + + /** Returns true if field operationState is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationState() { + return this.operationState != null; + } + + public void setOperationStateIsSet(boolean value) { + if (!value) { + this.operationState = null; + } + } + + public String getSqlState() { + return this.sqlState; + } + + public void setSqlState(String sqlState) { + this.sqlState = sqlState; + } + + public void unsetSqlState() { + this.sqlState = null; + } + + /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ + public boolean isSetSqlState() { + return this.sqlState != null; + } + + public void setSqlStateIsSet(boolean value) { + if (!value) { + this.sqlState = null; + } + } + + public int getErrorCode() { + return this.errorCode; + } + + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + setErrorCodeIsSet(true); + } + + public void unsetErrorCode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorCode() { + return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + public void setErrorCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + } + + public String getErrorMessage() { + return this.errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public void unsetErrorMessage() { + this.errorMessage = null; + } + + /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorMessage() { + return this.errorMessage != null; + } + + public void setErrorMessageIsSet(boolean value) { + if (!value) { + this.errorMessage = null; + } + } + + public String getTaskStatus() { + return this.taskStatus; + } + + public void setTaskStatus(String taskStatus) { + this.taskStatus = taskStatus; + } + + public void unsetTaskStatus() { + this.taskStatus = null; + } + + /** Returns true if field taskStatus is set (has been assigned a value) and false otherwise */ + public boolean isSetTaskStatus() { + return this.taskStatus != null; + } + + public void setTaskStatusIsSet(boolean value) { + if (!value) { + this.taskStatus = null; + } + } + + public long getOperationStarted() { + return this.operationStarted; + } + + public void setOperationStarted(long operationStarted) { + this.operationStarted = operationStarted; + setOperationStartedIsSet(true); + } + + public void unsetOperationStarted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + } + + /** Returns true if field operationStarted is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationStarted() { + return EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + } + + public void setOperationStartedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); + } + + public long getOperationCompleted() { + return this.operationCompleted; + } + + public void setOperationCompleted(long operationCompleted) { + this.operationCompleted = operationCompleted; + setOperationCompletedIsSet(true); + } + + public void unsetOperationCompleted() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + } + + /** Returns true if field operationCompleted is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationCompleted() { + return EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + } + + public void setOperationCompletedIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); + } + + public boolean isHasResultSet() { + return this.hasResultSet; + } + + public void setHasResultSet(boolean hasResultSet) { + this.hasResultSet = hasResultSet; + setHasResultSetIsSet(true); + } + + public void unsetHasResultSet() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ + public boolean isSetHasResultSet() { + return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + public void setHasResultSetIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + } + + public TProgressUpdateResp getProgressUpdateResponse() { + return this.progressUpdateResponse; + } + + public void setProgressUpdateResponse(TProgressUpdateResp progressUpdateResponse) { + this.progressUpdateResponse = progressUpdateResponse; + } + + public void unsetProgressUpdateResponse() { + this.progressUpdateResponse = null; + } + + /** Returns true if field progressUpdateResponse is set (has been assigned a value) and false otherwise */ + public boolean isSetProgressUpdateResponse() { + return this.progressUpdateResponse != null; + } + + public void setProgressUpdateResponseIsSet(boolean value) { + if (!value) { + this.progressUpdateResponse = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case OPERATION_STATE: + if (value == null) { + unsetOperationState(); + } else { + setOperationState((TOperationState)value); + } + break; + + case SQL_STATE: + if (value == null) { + unsetSqlState(); + } else { + setSqlState((String)value); + } + break; + + case ERROR_CODE: + if (value == null) { + unsetErrorCode(); + } else { + setErrorCode((Integer)value); + } + break; + + case ERROR_MESSAGE: + if (value == null) { + unsetErrorMessage(); + } else { + setErrorMessage((String)value); + } + break; + + case TASK_STATUS: + if (value == null) { + unsetTaskStatus(); + } else { + setTaskStatus((String)value); + } + break; + + case OPERATION_STARTED: + if (value == null) { + unsetOperationStarted(); + } else { + setOperationStarted((Long)value); + } + break; + + case OPERATION_COMPLETED: + if (value == null) { + unsetOperationCompleted(); + } else { + setOperationCompleted((Long)value); + } + break; + + case HAS_RESULT_SET: + if (value == null) { + unsetHasResultSet(); + } else { + setHasResultSet((Boolean)value); + } + break; + + case PROGRESS_UPDATE_RESPONSE: + if (value == null) { + unsetProgressUpdateResponse(); + } else { + setProgressUpdateResponse((TProgressUpdateResp)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_STATE: + return getOperationState(); + + case SQL_STATE: + return getSqlState(); + + case ERROR_CODE: + return getErrorCode(); + + case ERROR_MESSAGE: + return getErrorMessage(); + + case TASK_STATUS: + return getTaskStatus(); + + case OPERATION_STARTED: + return getOperationStarted(); + + case OPERATION_COMPLETED: + return getOperationCompleted(); + + case HAS_RESULT_SET: + return isHasResultSet(); + + case PROGRESS_UPDATE_RESPONSE: + return getProgressUpdateResponse(); + + } + 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_STATE: + return isSetOperationState(); + case SQL_STATE: + return isSetSqlState(); + case ERROR_CODE: + return isSetErrorCode(); + case ERROR_MESSAGE: + return isSetErrorMessage(); + case TASK_STATUS: + return isSetTaskStatus(); + case OPERATION_STARTED: + return isSetOperationStarted(); + case OPERATION_COMPLETED: + return isSetOperationCompleted(); + case HAS_RESULT_SET: + return isSetHasResultSet(); + case PROGRESS_UPDATE_RESPONSE: + return isSetProgressUpdateResponse(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetOperationStatusResp) + return this.equals((TGetOperationStatusResp)that); + return false; + } + + public boolean equals(TGetOperationStatusResp 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_operationState = true && this.isSetOperationState(); + boolean that_present_operationState = true && that.isSetOperationState(); + if (this_present_operationState || that_present_operationState) { + if (!(this_present_operationState && that_present_operationState)) + return false; + if (!this.operationState.equals(that.operationState)) + return false; + } + + boolean this_present_sqlState = true && this.isSetSqlState(); + boolean that_present_sqlState = true && that.isSetSqlState(); + if (this_present_sqlState || that_present_sqlState) { + if (!(this_present_sqlState && that_present_sqlState)) + return false; + if (!this.sqlState.equals(that.sqlState)) + return false; + } + + boolean this_present_errorCode = true && this.isSetErrorCode(); + boolean that_present_errorCode = true && that.isSetErrorCode(); + if (this_present_errorCode || that_present_errorCode) { + if (!(this_present_errorCode && that_present_errorCode)) + return false; + if (this.errorCode != that.errorCode) + return false; + } + + boolean this_present_errorMessage = true && this.isSetErrorMessage(); + boolean that_present_errorMessage = true && that.isSetErrorMessage(); + if (this_present_errorMessage || that_present_errorMessage) { + if (!(this_present_errorMessage && that_present_errorMessage)) + return false; + if (!this.errorMessage.equals(that.errorMessage)) + return false; + } + + boolean this_present_taskStatus = true && this.isSetTaskStatus(); + boolean that_present_taskStatus = true && that.isSetTaskStatus(); + if (this_present_taskStatus || that_present_taskStatus) { + if (!(this_present_taskStatus && that_present_taskStatus)) + return false; + if (!this.taskStatus.equals(that.taskStatus)) + return false; + } + + boolean this_present_operationStarted = true && this.isSetOperationStarted(); + boolean that_present_operationStarted = true && that.isSetOperationStarted(); + if (this_present_operationStarted || that_present_operationStarted) { + if (!(this_present_operationStarted && that_present_operationStarted)) + return false; + if (this.operationStarted != that.operationStarted) + return false; + } + + boolean this_present_operationCompleted = true && this.isSetOperationCompleted(); + boolean that_present_operationCompleted = true && that.isSetOperationCompleted(); + if (this_present_operationCompleted || that_present_operationCompleted) { + if (!(this_present_operationCompleted && that_present_operationCompleted)) + return false; + if (this.operationCompleted != that.operationCompleted) + return false; + } + + boolean this_present_hasResultSet = true && this.isSetHasResultSet(); + boolean that_present_hasResultSet = true && that.isSetHasResultSet(); + if (this_present_hasResultSet || that_present_hasResultSet) { + if (!(this_present_hasResultSet && that_present_hasResultSet)) + return false; + if (this.hasResultSet != that.hasResultSet) + return false; + } + + boolean this_present_progressUpdateResponse = true && this.isSetProgressUpdateResponse(); + boolean that_present_progressUpdateResponse = true && that.isSetProgressUpdateResponse(); + if (this_present_progressUpdateResponse || that_present_progressUpdateResponse) { + if (!(this_present_progressUpdateResponse && that_present_progressUpdateResponse)) + return false; + if (!this.progressUpdateResponse.equals(that.progressUpdateResponse)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationState = true && (isSetOperationState()); + list.add(present_operationState); + if (present_operationState) + list.add(operationState.getValue()); + + boolean present_sqlState = true && (isSetSqlState()); + list.add(present_sqlState); + if (present_sqlState) + list.add(sqlState); + + boolean present_errorCode = true && (isSetErrorCode()); + list.add(present_errorCode); + if (present_errorCode) + list.add(errorCode); + + boolean present_errorMessage = true && (isSetErrorMessage()); + list.add(present_errorMessage); + if (present_errorMessage) + list.add(errorMessage); + + boolean present_taskStatus = true && (isSetTaskStatus()); + list.add(present_taskStatus); + if (present_taskStatus) + list.add(taskStatus); + + boolean present_operationStarted = true && (isSetOperationStarted()); + list.add(present_operationStarted); + if (present_operationStarted) + list.add(operationStarted); + + boolean present_operationCompleted = true && (isSetOperationCompleted()); + list.add(present_operationCompleted); + if (present_operationCompleted) + list.add(operationCompleted); + + boolean present_hasResultSet = true && (isSetHasResultSet()); + list.add(present_hasResultSet); + if (present_hasResultSet) + list.add(hasResultSet); + + boolean present_progressUpdateResponse = true && (isSetProgressUpdateResponse()); + list.add(present_progressUpdateResponse); + if (present_progressUpdateResponse) + list.add(progressUpdateResponse); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetOperationStatusResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationState, other.operationState); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSqlState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTaskStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStatus, other.taskStatus); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationStarted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationStarted, other.operationStarted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationCompleted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationCompleted, other.operationCompleted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasResultSet()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProgressUpdateResponse()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressUpdateResponse, other.progressUpdateResponse); + 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("TGetOperationStatusResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationState()) { + if (!first) sb.append(", "); + sb.append("operationState:"); + if (this.operationState == null) { + sb.append("null"); + } else { + sb.append(this.operationState); + } + first = false; + } + if (isSetSqlState()) { + if (!first) sb.append(", "); + sb.append("sqlState:"); + if (this.sqlState == null) { + sb.append("null"); + } else { + sb.append(this.sqlState); + } + first = false; + } + if (isSetErrorCode()) { + if (!first) sb.append(", "); + sb.append("errorCode:"); + sb.append(this.errorCode); + first = false; + } + if (isSetErrorMessage()) { + if (!first) sb.append(", "); + sb.append("errorMessage:"); + if (this.errorMessage == null) { + sb.append("null"); + } else { + sb.append(this.errorMessage); + } + first = false; + } + if (isSetTaskStatus()) { + if (!first) sb.append(", "); + sb.append("taskStatus:"); + if (this.taskStatus == null) { + sb.append("null"); + } else { + sb.append(this.taskStatus); + } + first = false; + } + if (isSetOperationStarted()) { + if (!first) sb.append(", "); + sb.append("operationStarted:"); + sb.append(this.operationStarted); + first = false; + } + if (isSetOperationCompleted()) { + if (!first) sb.append(", "); + sb.append("operationCompleted:"); + sb.append(this.operationCompleted); + first = false; + } + if (isSetHasResultSet()) { + if (!first) sb.append(", "); + sb.append("hasResultSet:"); + sb.append(this.hasResultSet); + first = false; + } + if (isSetProgressUpdateResponse()) { + if (!first) sb.append(", "); + sb.append("progressUpdateResponse:"); + if (this.progressUpdateResponse == null) { + sb.append("null"); + } else { + sb.append(this.progressUpdateResponse); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TGetOperationStatusRespStandardSchemeFactory implements SchemeFactory { + public TGetOperationStatusRespStandardScheme getScheme() { + return new TGetOperationStatusRespStandardScheme(); + } + } + + private static class TGetOperationStatusRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusResp 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_STATE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.operationState = TOperationState.findByValue(iprot.readI32()); + struct.setOperationStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SQL_STATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ERROR_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ERROR_MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // TASK_STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.taskStatus = iprot.readString(); + struct.setTaskStatusIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // OPERATION_STARTED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.operationStarted = iprot.readI64(); + struct.setOperationStartedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // OPERATION_COMPLETED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.operationCompleted = iprot.readI64(); + struct.setOperationCompletedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // HAS_RESULT_SET + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // PROGRESS_UPDATE_RESPONSE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.progressUpdateResponse = new TProgressUpdateResp(); + struct.progressUpdateResponse.read(iprot); + struct.setProgressUpdateResponseIsSet(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, TGetOperationStatusResp 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.operationState != null) { + if (struct.isSetOperationState()) { + oprot.writeFieldBegin(OPERATION_STATE_FIELD_DESC); + oprot.writeI32(struct.operationState.getValue()); + oprot.writeFieldEnd(); + } + } + if (struct.sqlState != null) { + if (struct.isSetSqlState()) { + oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); + oprot.writeString(struct.sqlState); + oprot.writeFieldEnd(); + } + } + if (struct.isSetErrorCode()) { + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(struct.errorCode); + oprot.writeFieldEnd(); + } + if (struct.errorMessage != null) { + if (struct.isSetErrorMessage()) { + oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); + oprot.writeString(struct.errorMessage); + oprot.writeFieldEnd(); + } + } + if (struct.taskStatus != null) { + if (struct.isSetTaskStatus()) { + oprot.writeFieldBegin(TASK_STATUS_FIELD_DESC); + oprot.writeString(struct.taskStatus); + oprot.writeFieldEnd(); + } + } + if (struct.isSetOperationStarted()) { + oprot.writeFieldBegin(OPERATION_STARTED_FIELD_DESC); + oprot.writeI64(struct.operationStarted); + oprot.writeFieldEnd(); + } + if (struct.isSetOperationCompleted()) { + oprot.writeFieldBegin(OPERATION_COMPLETED_FIELD_DESC); + oprot.writeI64(struct.operationCompleted); + oprot.writeFieldEnd(); + } + if (struct.isSetHasResultSet()) { + oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); + oprot.writeBool(struct.hasResultSet); + oprot.writeFieldEnd(); + } + if (struct.progressUpdateResponse != null) { + if (struct.isSetProgressUpdateResponse()) { + oprot.writeFieldBegin(PROGRESS_UPDATE_RESPONSE_FIELD_DESC); + struct.progressUpdateResponse.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetOperationStatusRespTupleSchemeFactory implements SchemeFactory { + public TGetOperationStatusRespTupleScheme getScheme() { + return new TGetOperationStatusRespTupleScheme(); + } + } + + private static class TGetOperationStatusRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationState()) { + optionals.set(0); + } + if (struct.isSetSqlState()) { + optionals.set(1); + } + if (struct.isSetErrorCode()) { + optionals.set(2); + } + if (struct.isSetErrorMessage()) { + optionals.set(3); + } + if (struct.isSetTaskStatus()) { + optionals.set(4); + } + if (struct.isSetOperationStarted()) { + optionals.set(5); + } + if (struct.isSetOperationCompleted()) { + optionals.set(6); + } + if (struct.isSetHasResultSet()) { + optionals.set(7); + } + if (struct.isSetProgressUpdateResponse()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetOperationState()) { + oprot.writeI32(struct.operationState.getValue()); + } + if (struct.isSetSqlState()) { + oprot.writeString(struct.sqlState); + } + if (struct.isSetErrorCode()) { + oprot.writeI32(struct.errorCode); + } + if (struct.isSetErrorMessage()) { + oprot.writeString(struct.errorMessage); + } + if (struct.isSetTaskStatus()) { + oprot.writeString(struct.taskStatus); + } + if (struct.isSetOperationStarted()) { + oprot.writeI64(struct.operationStarted); + } + if (struct.isSetOperationCompleted()) { + oprot.writeI64(struct.operationCompleted); + } + if (struct.isSetHasResultSet()) { + oprot.writeBool(struct.hasResultSet); + } + if (struct.isSetProgressUpdateResponse()) { + struct.progressUpdateResponse.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(9); + if (incoming.get(0)) { + struct.operationState = TOperationState.findByValue(iprot.readI32()); + struct.setOperationStateIsSet(true); + } + if (incoming.get(1)) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } + if (incoming.get(2)) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } + if (incoming.get(3)) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(true); + } + if (incoming.get(4)) { + struct.taskStatus = iprot.readString(); + struct.setTaskStatusIsSet(true); + } + if (incoming.get(5)) { + struct.operationStarted = iprot.readI64(); + struct.setOperationStartedIsSet(true); + } + if (incoming.get(6)) { + struct.operationCompleted = iprot.readI64(); + struct.setOperationCompletedIsSet(true); + } + if (incoming.get(7)) { + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + } + if (incoming.get(8)) { + struct.progressUpdateResponse = new TProgressUpdateResp(); + struct.progressUpdateResponse.read(iprot); + struct.setProgressUpdateResponseIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java new file mode 100644 index 000000000000..eb8f5e41018a --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java @@ -0,0 +1,706 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetPrimaryKeysReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetPrimaryKeysReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String tableName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + TABLE_NAME((short)4, "tableName"); + + 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: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // TABLE_NAME + return TABLE_NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME}; + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysReq.class, metaDataMap); + } + + public TGetPrimaryKeysReq() { + } + + public TGetPrimaryKeysReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetPrimaryKeysReq(TGetPrimaryKeysReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public TGetPrimaryKeysReq deepCopy() { + return new TGetPrimaryKeysReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.tableName = 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 String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + public String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + public String getTableName() { + return this.tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public void unsetTableName() { + this.tableName = null; + } + + /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableName() { + return this.tableName != null; + } + + public void setTableNameIsSet(boolean value) { + if (!value) { + this.tableName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case TABLE_NAME: + return getTableName(); + + } + 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 CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case TABLE_NAME: + return isSetTableName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetPrimaryKeysReq) + return this.equals((TGetPrimaryKeysReq)that); + return false; + } + + public boolean equals(TGetPrimaryKeysReq 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_tableName = true && this.isSetTableName(); + boolean that_present_tableName = true && that.isSetTableName(); + if (this_present_tableName || that_present_tableName) { + if (!(this_present_tableName && that_present_tableName)) + return false; + if (!this.tableName.equals(that.tableName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); + + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetPrimaryKeysReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); + 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("TGetPrimaryKeysReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (isSetTableName()) { + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + sb.append(this.tableName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetPrimaryKeysReqStandardSchemeFactory implements SchemeFactory { + public TGetPrimaryKeysReqStandardScheme getScheme() { + return new TGetPrimaryKeysReqStandardScheme(); + } + } + + private static class TGetPrimaryKeysReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(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, TGetPrimaryKeysReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.tableName != null) { + if (struct.isSetTableName()) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.tableName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetPrimaryKeysReqTupleSchemeFactory implements SchemeFactory { + public TGetPrimaryKeysReqTupleScheme getScheme() { + return new TGetPrimaryKeysReqTupleScheme(); + } + } + + private static class TGetPrimaryKeysReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + if (struct.isSetTableName()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + if (struct.isSetTableName()) { + oprot.writeString(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java new file mode 100644 index 000000000000..825ac6523d82 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetPrimaryKeysResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetPrimaryKeysRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetPrimaryKeysRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetPrimaryKeysResp.class, metaDataMap); + } + + public TGetPrimaryKeysResp() { + } + + public TGetPrimaryKeysResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetPrimaryKeysResp(TGetPrimaryKeysResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetPrimaryKeysResp deepCopy() { + return new TGetPrimaryKeysResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetPrimaryKeysResp) + return this.equals((TGetPrimaryKeysResp)that); + return false; + } + + public boolean equals(TGetPrimaryKeysResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetPrimaryKeysResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetPrimaryKeysResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetPrimaryKeysRespStandardSchemeFactory implements SchemeFactory { + public TGetPrimaryKeysRespStandardScheme getScheme() { + return new TGetPrimaryKeysRespStandardScheme(); + } + } + + private static class TGetPrimaryKeysRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysResp 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; + 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, TGetPrimaryKeysResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetPrimaryKeysRespTupleSchemeFactory implements SchemeFactory { + public TGetPrimaryKeysRespTupleScheme getScheme() { + return new TGetPrimaryKeysRespTupleScheme(); + } + } + + private static class TGetPrimaryKeysRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java new file mode 100644 index 000000000000..15ed94626ffa --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetQueryIdReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdReq"); + + 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)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetQueryIdReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetQueryIdReqTupleSchemeFactory()); + } + + 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 { + OPERATION_HANDLE((short)1, "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: // 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.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(TGetQueryIdReq.class, metaDataMap); + } + + public TGetQueryIdReq() { + } + + public TGetQueryIdReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetQueryIdReq(TGetQueryIdReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetQueryIdReq deepCopy() { + return new TGetQueryIdReq(this); + } + + @Override + public void clear() { + this.operationHandle = 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 OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + 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 OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetQueryIdReq) + return this.equals((TGetQueryIdReq)that); + return false; + } + + public boolean equals(TGetQueryIdReq that) { + if (that == null) + 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() { + List list = new ArrayList(); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetQueryIdReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetQueryIdReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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 TGetQueryIdReqStandardSchemeFactory implements SchemeFactory { + public TGetQueryIdReqStandardScheme getScheme() { + return new TGetQueryIdReqStandardScheme(); + } + } + + private static class TGetQueryIdReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdReq 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: // 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, TGetQueryIdReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetQueryIdReqTupleSchemeFactory implements SchemeFactory { + public TGetQueryIdReqTupleScheme getScheme() { + return new TGetQueryIdReqTupleScheme(); + } + } + + private static class TGetQueryIdReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java new file mode 100644 index 000000000000..575d91e4b6a2 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java @@ -0,0 +1,378 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetQueryIdResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdResp"); + + private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetQueryIdRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetQueryIdRespTupleSchemeFactory()); + } + + private String queryId; // 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 { + QUERY_ID((short)1, "queryId"); + + 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: // QUERY_ID + return QUERY_ID; + 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.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdResp.class, metaDataMap); + } + + public TGetQueryIdResp() { + } + + public TGetQueryIdResp( + String queryId) + { + this(); + this.queryId = queryId; + } + + /** + * Performs a deep copy on other. + */ + public TGetQueryIdResp(TGetQueryIdResp other) { + if (other.isSetQueryId()) { + this.queryId = other.queryId; + } + } + + public TGetQueryIdResp deepCopy() { + return new TGetQueryIdResp(this); + } + + @Override + public void clear() { + this.queryId = null; + } + + public String getQueryId() { + return this.queryId; + } + + public void setQueryId(String queryId) { + this.queryId = queryId; + } + + public void unsetQueryId() { + this.queryId = null; + } + + /** Returns true if field queryId is set (has been assigned a value) and false otherwise */ + public boolean isSetQueryId() { + return this.queryId != null; + } + + public void setQueryIdIsSet(boolean value) { + if (!value) { + this.queryId = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case QUERY_ID: + if (value == null) { + unsetQueryId(); + } else { + setQueryId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case QUERY_ID: + return getQueryId(); + + } + 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 QUERY_ID: + return isSetQueryId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetQueryIdResp) + return this.equals((TGetQueryIdResp)that); + return false; + } + + public boolean equals(TGetQueryIdResp that) { + if (that == null) + return false; + + boolean this_present_queryId = true && this.isSetQueryId(); + boolean that_present_queryId = true && that.isSetQueryId(); + if (this_present_queryId || that_present_queryId) { + if (!(this_present_queryId && that_present_queryId)) + return false; + if (!this.queryId.equals(that.queryId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_queryId = true && (isSetQueryId()); + list.add(present_queryId); + if (present_queryId) + list.add(queryId); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetQueryIdResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetQueryId()).compareTo(other.isSetQueryId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryId, other.queryId); + 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("TGetQueryIdResp("); + boolean first = true; + + sb.append("queryId:"); + if (this.queryId == null) { + sb.append("null"); + } else { + sb.append(this.queryId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetQueryId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'queryId' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TGetQueryIdRespStandardSchemeFactory implements SchemeFactory { + public TGetQueryIdRespStandardScheme getScheme() { + return new TGetQueryIdRespStandardScheme(); + } + } + + private static class TGetQueryIdRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdResp 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: // QUERY_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.queryId = iprot.readString(); + struct.setQueryIdIsSet(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, TGetQueryIdResp struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.queryId != null) { + oprot.writeFieldBegin(QUERY_ID_FIELD_DESC); + oprot.writeString(struct.queryId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetQueryIdRespTupleSchemeFactory implements SchemeFactory { + public TGetQueryIdRespTupleScheme getScheme() { + return new TGetQueryIdRespTupleScheme(); + } + } + + private static class TGetQueryIdRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.queryId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.queryId = iprot.readString(); + struct.setQueryIdIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java new file mode 100644 index 000000000000..d6d12215e5ea --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataReq"); + + 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)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetResultSetMetadataReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetResultSetMetadataReqTupleSchemeFactory()); + } + + 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 { + OPERATION_HANDLE((short)1, "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: // 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.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(TGetResultSetMetadataReq.class, metaDataMap); + } + + public TGetResultSetMetadataReq() { + } + + public TGetResultSetMetadataReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetResultSetMetadataReq(TGetResultSetMetadataReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetResultSetMetadataReq deepCopy() { + return new TGetResultSetMetadataReq(this); + } + + @Override + public void clear() { + this.operationHandle = 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 OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + 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 OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetResultSetMetadataReq) + return this.equals((TGetResultSetMetadataReq)that); + return false; + } + + public boolean equals(TGetResultSetMetadataReq that) { + if (that == null) + 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() { + List list = new ArrayList(); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetResultSetMetadataReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetResultSetMetadataReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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 TGetResultSetMetadataReqStandardSchemeFactory implements SchemeFactory { + public TGetResultSetMetadataReqStandardScheme getScheme() { + return new TGetResultSetMetadataReqStandardScheme(); + } + } + + private static class TGetResultSetMetadataReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataReq 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: // 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, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetResultSetMetadataReqTupleSchemeFactory implements SchemeFactory { + public TGetResultSetMetadataReqTupleScheme getScheme() { + return new TGetResultSetMetadataReqTupleScheme(); + } + } + + private static class TGetResultSetMetadataReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java new file mode 100644 index 000000000000..46563acebd8d --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataResp"); + + 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 SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetResultSetMetadataRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetResultSetMetadataRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TTableSchema schema; // 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"), + SCHEMA((short)2, "schema"); + + 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: // SCHEMA + return SCHEMA; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.SCHEMA}; + 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.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableSchema.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataResp.class, metaDataMap); + } + + public TGetResultSetMetadataResp() { + } + + public TGetResultSetMetadataResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetResultSetMetadataResp(TGetResultSetMetadataResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetSchema()) { + this.schema = new TTableSchema(other.schema); + } + } + + public TGetResultSetMetadataResp deepCopy() { + return new TGetResultSetMetadataResp(this); + } + + @Override + public void clear() { + this.status = null; + this.schema = 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 TTableSchema getSchema() { + return this.schema; + } + + public void setSchema(TTableSchema schema) { + this.schema = schema; + } + + public void unsetSchema() { + this.schema = null; + } + + /** Returns true if field schema is set (has been assigned a value) and false otherwise */ + public boolean isSetSchema() { + return this.schema != null; + } + + public void setSchemaIsSet(boolean value) { + if (!value) { + this.schema = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case SCHEMA: + if (value == null) { + unsetSchema(); + } else { + setSchema((TTableSchema)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case SCHEMA: + return getSchema(); + + } + 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 SCHEMA: + return isSetSchema(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetResultSetMetadataResp) + return this.equals((TGetResultSetMetadataResp)that); + return false; + } + + public boolean equals(TGetResultSetMetadataResp 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_schema = true && this.isSetSchema(); + boolean that_present_schema = true && that.isSetSchema(); + if (this_present_schema || that_present_schema) { + if (!(this_present_schema && that_present_schema)) + return false; + if (!this.schema.equals(that.schema)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_schema = true && (isSetSchema()); + list.add(present_schema); + if (present_schema) + list.add(schema); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetResultSetMetadataResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchema()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, other.schema); + 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("TGetResultSetMetadataResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetSchema()) { + if (!first) sb.append(", "); + sb.append("schema:"); + if (this.schema == null) { + sb.append("null"); + } else { + sb.append(this.schema); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (schema != null) { + schema.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 TGetResultSetMetadataRespStandardSchemeFactory implements SchemeFactory { + public TGetResultSetMetadataRespStandardScheme getScheme() { + return new TGetResultSetMetadataRespStandardScheme(); + } + } + + private static class TGetResultSetMetadataRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataResp 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: // SCHEMA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.schema = new TTableSchema(); + struct.schema.read(iprot); + struct.setSchemaIsSet(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, TGetResultSetMetadataResp 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.schema != null) { + if (struct.isSetSchema()) { + oprot.writeFieldBegin(SCHEMA_FIELD_DESC); + struct.schema.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetResultSetMetadataRespTupleSchemeFactory implements SchemeFactory { + public TGetResultSetMetadataRespTupleScheme getScheme() { + return new TGetResultSetMetadataRespTupleScheme(); + } + } + + private static class TGetResultSetMetadataRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetSchema()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSchema()) { + struct.schema.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.schema = new TTableSchema(); + struct.schema.read(iprot); + struct.setSchemaIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java new file mode 100644 index 000000000000..e0e59666a818 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java @@ -0,0 +1,600 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetSchemasReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetSchemasReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"); + + 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: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasReq.class, metaDataMap); + } + + public TGetSchemasReq() { + } + + public TGetSchemasReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetSchemasReq(TGetSchemasReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + } + + public TGetSchemasReq deepCopy() { + return new TGetSchemasReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = 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 String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + public String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + } + 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 CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetSchemasReq) + return this.equals((TGetSchemasReq)that); + return false; + } + + public boolean equals(TGetSchemasReq 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); + + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetSchemasReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + 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("TGetSchemasReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetSchemasReqStandardSchemeFactory implements SchemeFactory { + public TGetSchemasReqStandardScheme getScheme() { + return new TGetSchemasReqStandardScheme(); + } + } + + private static class TGetSchemasReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(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, TGetSchemasReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetSchemasReqTupleSchemeFactory implements SchemeFactory { + public TGetSchemasReqTupleScheme getScheme() { + return new TGetSchemasReqTupleScheme(); + } + } + + private static class TGetSchemasReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java new file mode 100644 index 000000000000..9b301bd956fb --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetSchemasRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetSchemasRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetSchemasResp.class, metaDataMap); + } + + public TGetSchemasResp() { + } + + public TGetSchemasResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetSchemasResp(TGetSchemasResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetSchemasResp deepCopy() { + return new TGetSchemasResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetSchemasResp) + return this.equals((TGetSchemasResp)that); + return false; + } + + public boolean equals(TGetSchemasResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetSchemasResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetSchemasResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetSchemasRespStandardSchemeFactory implements SchemeFactory { + public TGetSchemasRespStandardScheme getScheme() { + return new TGetSchemasRespStandardScheme(); + } + } + + private static class TGetSchemasRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasResp 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; + 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, TGetSchemasResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetSchemasRespTupleSchemeFactory implements SchemeFactory { + public TGetSchemasRespTupleScheme getScheme() { + return new TGetSchemasRespTupleScheme(); + } + } + + private static class TGetSchemasRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java new file mode 100644 index 000000000000..effd683ca631 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesReq"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTableTypesReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTableTypesReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // 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"); + + 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; + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesReq.class, metaDataMap); + } + + public TGetTableTypesReq() { + } + + public TGetTableTypesReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetTableTypesReq(TGetTableTypesReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TGetTableTypesReq deepCopy() { + return new TGetTableTypesReq(this); + } + + @Override + public void clear() { + this.sessionHandle = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetTableTypesReq) + return this.equals((TGetTableTypesReq)that); + return false; + } + + public boolean equals(TGetTableTypesReq 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetTableTypesReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + 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("TGetTableTypesReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetTableTypesReqStandardSchemeFactory implements SchemeFactory { + public TGetTableTypesReqStandardScheme getScheme() { + return new TGetTableTypesReqStandardScheme(); + } + } + + private static class TGetTableTypesReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesReq 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; + 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, TGetTableTypesReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTableTypesReqTupleSchemeFactory implements SchemeFactory { + public TGetTableTypesReqTupleScheme getScheme() { + return new TGetTableTypesReqTupleScheme(); + } + } + + private static class TGetTableTypesReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java new file mode 100644 index 000000000000..83793a149c4a --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTableTypesRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTableTypesRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetTableTypesResp.class, metaDataMap); + } + + public TGetTableTypesResp() { + } + + public TGetTableTypesResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetTableTypesResp(TGetTableTypesResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetTableTypesResp deepCopy() { + return new TGetTableTypesResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetTableTypesResp) + return this.equals((TGetTableTypesResp)that); + return false; + } + + public boolean equals(TGetTableTypesResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetTableTypesResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetTableTypesResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetTableTypesRespStandardSchemeFactory implements SchemeFactory { + public TGetTableTypesRespStandardScheme getScheme() { + return new TGetTableTypesRespStandardScheme(); + } + } + + private static class TGetTableTypesRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesResp 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; + 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, TGetTableTypesResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTableTypesRespTupleSchemeFactory implements SchemeFactory { + public TGetTableTypesRespTupleScheme getScheme() { + return new TGetTableTypesRespTupleScheme(); + } + } + + private static class TGetTableTypesRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesReq.java new file mode 100644 index 000000000000..fda1e2d93c01 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesReq.java @@ -0,0 +1,861 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField TABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("tableTypes", org.apache.thrift.protocol.TType.LIST, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTablesReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTablesReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String tableName; // optional + private List tableTypes; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + TABLE_NAME((short)4, "tableName"), + TABLE_TYPES((short)5, "tableTypes"); + + 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: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // TABLE_NAME + return TABLE_NAME; + case 5: // TABLE_TYPES + return TABLE_TYPES; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.TABLE_TYPES}; + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap); + } + + public TGetTablesReq() { + } + + public TGetTablesReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetTablesReq(TGetTablesReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetTableTypes()) { + List __this__tableTypes = new ArrayList(other.tableTypes); + this.tableTypes = __this__tableTypes; + } + } + + public TGetTablesReq deepCopy() { + return new TGetTablesReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.tableName = null; + this.tableTypes = 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 String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + public String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + public String getTableName() { + return this.tableName; + } + + public void setTableName(String tableName) { + this.tableName = tableName; + } + + public void unsetTableName() { + this.tableName = null; + } + + /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableName() { + return this.tableName != null; + } + + public void setTableNameIsSet(boolean value) { + if (!value) { + this.tableName = null; + } + } + + public int getTableTypesSize() { + return (this.tableTypes == null) ? 0 : this.tableTypes.size(); + } + + public java.util.Iterator getTableTypesIterator() { + return (this.tableTypes == null) ? null : this.tableTypes.iterator(); + } + + public void addToTableTypes(String elem) { + if (this.tableTypes == null) { + this.tableTypes = new ArrayList(); + } + this.tableTypes.add(elem); + } + + public List getTableTypes() { + return this.tableTypes; + } + + public void setTableTypes(List tableTypes) { + this.tableTypes = tableTypes; + } + + public void unsetTableTypes() { + this.tableTypes = null; + } + + /** Returns true if field tableTypes is set (has been assigned a value) and false otherwise */ + public boolean isSetTableTypes() { + return this.tableTypes != null; + } + + public void setTableTypesIsSet(boolean value) { + if (!value) { + this.tableTypes = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((String)value); + } + break; + + case TABLE_TYPES: + if (value == null) { + unsetTableTypes(); + } else { + setTableTypes((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case TABLE_NAME: + return getTableName(); + + case TABLE_TYPES: + return getTableTypes(); + + } + 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 CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case TABLE_NAME: + return isSetTableName(); + case TABLE_TYPES: + return isSetTableTypes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetTablesReq) + return this.equals((TGetTablesReq)that); + return false; + } + + public boolean equals(TGetTablesReq 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_tableName = true && this.isSetTableName(); + boolean that_present_tableName = true && that.isSetTableName(); + if (this_present_tableName || that_present_tableName) { + if (!(this_present_tableName && that_present_tableName)) + return false; + if (!this.tableName.equals(that.tableName)) + return false; + } + + boolean this_present_tableTypes = true && this.isSetTableTypes(); + boolean that_present_tableTypes = true && that.isSetTableTypes(); + if (this_present_tableTypes || that_present_tableTypes) { + if (!(this_present_tableTypes && that_present_tableTypes)) + return false; + if (!this.tableTypes.equals(that.tableTypes)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); + + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); + + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); + + boolean present_tableTypes = true && (isSetTableTypes()); + list.add(present_tableTypes); + if (present_tableTypes) + list.add(tableTypes); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetTablesReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableTypes()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableTypes, other.tableTypes); + 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("TGetTablesReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (isSetTableName()) { + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + sb.append(this.tableName); + } + first = false; + } + if (isSetTableTypes()) { + if (!first) sb.append(", "); + sb.append("tableTypes:"); + if (this.tableTypes == null) { + sb.append("null"); + } else { + sb.append(this.tableTypes); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetTablesReqStandardSchemeFactory implements SchemeFactory { + public TGetTablesReqStandardScheme getScheme() { + return new TGetTablesReqStandardScheme(); + } + } + + private static class TGetTablesReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // TABLE_TYPES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(); + struct.tableTypes = new ArrayList(_list182.size); + String _elem183; + for (int _i184 = 0; _i184 < _list182.size; ++_i184) + { + _elem183 = iprot.readString(); + struct.tableTypes.add(_elem183); + } + iprot.readListEnd(); + } + struct.setTableTypesIsSet(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, TGetTablesReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.tableName != null) { + if (struct.isSetTableName()) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.tableName); + oprot.writeFieldEnd(); + } + } + if (struct.tableTypes != null) { + if (struct.isSetTableTypes()) { + oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); + for (String _iter185 : struct.tableTypes) + { + oprot.writeString(_iter185); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTablesReqTupleSchemeFactory implements SchemeFactory { + public TGetTablesReqTupleScheme getScheme() { + return new TGetTablesReqTupleScheme(); + } + } + + private static class TGetTablesReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + if (struct.isSetTableName()) { + optionals.set(2); + } + if (struct.isSetTableTypes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + if (struct.isSetTableName()) { + oprot.writeString(struct.tableName); + } + if (struct.isSetTableTypes()) { + { + oprot.writeI32(struct.tableTypes.size()); + for (String _iter186 : struct.tableTypes) + { + oprot.writeString(_iter186); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tableTypes = new ArrayList(_list187.size); + String _elem188; + for (int _i189 = 0; _i189 < _list187.size; ++_i189) + { + _elem188 = iprot.readString(); + struct.tableTypes.add(_elem188); + } + } + struct.setTableTypesIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesResp.java new file mode 100644 index 000000000000..4a4685572ece --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTablesRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTablesRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetTablesResp.class, metaDataMap); + } + + public TGetTablesResp() { + } + + public TGetTablesResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetTablesResp(TGetTablesResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetTablesResp deepCopy() { + return new TGetTablesResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetTablesResp) + return this.equals((TGetTablesResp)that); + return false; + } + + public boolean equals(TGetTablesResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetTablesResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetTablesResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetTablesRespStandardSchemeFactory implements SchemeFactory { + public TGetTablesRespStandardScheme getScheme() { + return new TGetTablesRespStandardScheme(); + } + } + + private static class TGetTablesRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesResp 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; + 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, TGetTablesResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTablesRespTupleSchemeFactory implements SchemeFactory { + public TGetTablesRespTupleScheme getScheme() { + return new TGetTablesRespTupleScheme(); + } + } + + private static class TGetTablesRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java new file mode 100644 index 000000000000..67f6ff3f8022 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoReq"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTypeInfoReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTypeInfoReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // 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"); + + 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; + 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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoReq.class, metaDataMap); + } + + public TGetTypeInfoReq() { + } + + public TGetTypeInfoReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetTypeInfoReq(TGetTypeInfoReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TGetTypeInfoReq deepCopy() { + return new TGetTypeInfoReq(this); + } + + @Override + public void clear() { + this.sessionHandle = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetTypeInfoReq) + return this.equals((TGetTypeInfoReq)that); + return false; + } + + public boolean equals(TGetTypeInfoReq 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetTypeInfoReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + 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("TGetTypeInfoReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TGetTypeInfoReqStandardSchemeFactory implements SchemeFactory { + public TGetTypeInfoReqStandardScheme getScheme() { + return new TGetTypeInfoReqStandardScheme(); + } + } + + private static class TGetTypeInfoReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoReq 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; + 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, TGetTypeInfoReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTypeInfoReqTupleSchemeFactory implements SchemeFactory { + public TGetTypeInfoReqTupleScheme getScheme() { + return new TGetTypeInfoReqTupleScheme(); + } + } + + private static class TGetTypeInfoReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java new file mode 100644 index 000000000000..045d415f9509 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTypeInfoRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTypeInfoRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); + + 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; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + 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.OPTIONAL, + 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(TGetTypeInfoResp.class, metaDataMap); + } + + public TGetTypeInfoResp() { + } + + public TGetTypeInfoResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetTypeInfoResp(TGetTypeInfoResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetTypeInfoResp deepCopy() { + return new TGetTypeInfoResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = 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 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + 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 STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TGetTypeInfoResp) + return this.equals((TGetTypeInfoResp)that); + return false; + } + + public boolean equals(TGetTypeInfoResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); + + return list.hashCode(); + } + + @Override + public int compareTo(TGetTypeInfoResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.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("TGetTypeInfoResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TGetTypeInfoRespStandardSchemeFactory implements SchemeFactory { + public TGetTypeInfoRespStandardScheme getScheme() { + return new TGetTypeInfoRespStandardScheme(); + } + } + + private static class TGetTypeInfoRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoResp 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; + 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, TGetTypeInfoResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTypeInfoRespTupleSchemeFactory implements SchemeFactory { + public TGetTypeInfoRespTupleScheme getScheme() { + return new TGetTypeInfoRespTupleScheme(); + } + } + + private static class TGetTypeInfoRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/THandleIdentifier.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/THandleIdentifier.java new file mode 100644 index 000000000000..a77785f0dbcf --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/THandleIdentifier.java @@ -0,0 +1,499 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THandleIdentifier"); + + private static final org.apache.thrift.protocol.TField GUID_FIELD_DESC = new org.apache.thrift.protocol.TField("guid", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("secret", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new THandleIdentifierStandardSchemeFactory()); + schemes.put(TupleScheme.class, new THandleIdentifierTupleSchemeFactory()); + } + + private ByteBuffer guid; // required + private ByteBuffer secret; // 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 { + GUID((short)1, "guid"), + SECRET((short)2, "secret"); + + 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: // GUID + return GUID; + case 2: // SECRET + return SECRET; + 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.GUID, new org.apache.thrift.meta_data.FieldMetaData("guid", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THandleIdentifier.class, metaDataMap); + } + + public THandleIdentifier() { + } + + public THandleIdentifier( + ByteBuffer guid, + ByteBuffer secret) + { + this(); + this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); + this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); + } + + /** + * Performs a deep copy on other. + */ + public THandleIdentifier(THandleIdentifier other) { + if (other.isSetGuid()) { + this.guid = org.apache.thrift.TBaseHelper.copyBinary(other.guid); + } + if (other.isSetSecret()) { + this.secret = org.apache.thrift.TBaseHelper.copyBinary(other.secret); + } + } + + public THandleIdentifier deepCopy() { + return new THandleIdentifier(this); + } + + @Override + public void clear() { + this.guid = null; + this.secret = null; + } + + public byte[] getGuid() { + setGuid(org.apache.thrift.TBaseHelper.rightSize(guid)); + return guid == null ? null : guid.array(); + } + + public ByteBuffer bufferForGuid() { + return org.apache.thrift.TBaseHelper.copyBinary(guid); + } + + public void setGuid(byte[] guid) { + this.guid = guid == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(guid, guid.length)); + } + + public void setGuid(ByteBuffer guid) { + this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); + } + + public void unsetGuid() { + this.guid = null; + } + + /** Returns true if field guid is set (has been assigned a value) and false otherwise */ + public boolean isSetGuid() { + return this.guid != null; + } + + public void setGuidIsSet(boolean value) { + if (!value) { + this.guid = null; + } + } + + public byte[] getSecret() { + setSecret(org.apache.thrift.TBaseHelper.rightSize(secret)); + return secret == null ? null : secret.array(); + } + + public ByteBuffer bufferForSecret() { + return org.apache.thrift.TBaseHelper.copyBinary(secret); + } + + public void setSecret(byte[] secret) { + this.secret = secret == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(secret, secret.length)); + } + + public void setSecret(ByteBuffer secret) { + this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); + } + + public void unsetSecret() { + this.secret = null; + } + + /** Returns true if field secret is set (has been assigned a value) and false otherwise */ + public boolean isSetSecret() { + return this.secret != null; + } + + public void setSecretIsSet(boolean value) { + if (!value) { + this.secret = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case GUID: + if (value == null) { + unsetGuid(); + } else { + setGuid((ByteBuffer)value); + } + break; + + case SECRET: + if (value == null) { + unsetSecret(); + } else { + setSecret((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case GUID: + return getGuid(); + + case SECRET: + return getSecret(); + + } + 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 GUID: + return isSetGuid(); + case SECRET: + return isSetSecret(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof THandleIdentifier) + return this.equals((THandleIdentifier)that); + return false; + } + + public boolean equals(THandleIdentifier that) { + if (that == null) + return false; + + boolean this_present_guid = true && this.isSetGuid(); + boolean that_present_guid = true && that.isSetGuid(); + if (this_present_guid || that_present_guid) { + if (!(this_present_guid && that_present_guid)) + return false; + if (!this.guid.equals(that.guid)) + return false; + } + + boolean this_present_secret = true && this.isSetSecret(); + boolean that_present_secret = true && that.isSetSecret(); + if (this_present_secret || that_present_secret) { + if (!(this_present_secret && that_present_secret)) + return false; + if (!this.secret.equals(that.secret)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_guid = true && (isSetGuid()); + list.add(present_guid); + if (present_guid) + list.add(guid); + + boolean present_secret = true && (isSetSecret()); + list.add(present_secret); + if (present_secret) + list.add(secret); + + return list.hashCode(); + } + + @Override + public int compareTo(THandleIdentifier other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGuid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.guid, other.guid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSecret()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secret, other.secret); + 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("THandleIdentifier("); + boolean first = true; + + sb.append("guid:"); + if (this.guid == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.guid, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("secret:"); + if (this.secret == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.secret, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetGuid()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'guid' is unset! Struct:" + toString()); + } + + if (!isSetSecret()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'secret' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 THandleIdentifierStandardSchemeFactory implements SchemeFactory { + public THandleIdentifierStandardScheme getScheme() { + return new THandleIdentifierStandardScheme(); + } + } + + private static class THandleIdentifierStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, THandleIdentifier 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: // GUID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.guid = iprot.readBinary(); + struct.setGuidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SECRET + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.secret = iprot.readBinary(); + struct.setSecretIsSet(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, THandleIdentifier struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.guid != null) { + oprot.writeFieldBegin(GUID_FIELD_DESC); + oprot.writeBinary(struct.guid); + oprot.writeFieldEnd(); + } + if (struct.secret != null) { + oprot.writeFieldBegin(SECRET_FIELD_DESC); + oprot.writeBinary(struct.secret); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class THandleIdentifierTupleSchemeFactory implements SchemeFactory { + public THandleIdentifierTupleScheme getScheme() { + return new THandleIdentifierTupleScheme(); + } + } + + private static class THandleIdentifierTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeBinary(struct.guid); + oprot.writeBinary(struct.secret); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.guid = iprot.readBinary(); + struct.setGuidIsSet(true); + struct.secret = iprot.readBinary(); + struct.setSecretIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Column.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Column.java new file mode 100644 index 000000000000..d8c406e82b28 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Column.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Column"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI16ColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI16ColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Column.class, metaDataMap); + } + + public TI16Column() { + } + + public TI16Column( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TI16Column(TI16Column other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TI16Column deepCopy() { + return new TI16Column(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(short elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TI16Column) + return this.equals((TI16Column)that); + return false; + } + + public boolean equals(TI16Column that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TI16Column other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TI16Column("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TI16ColumnStandardSchemeFactory implements SchemeFactory { + public TI16ColumnStandardScheme getScheme() { + return new TI16ColumnStandardScheme(); + } + } + + private static class TI16ColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); + struct.values = new ArrayList(_list70.size); + short _elem71; + for (int _i72 = 0; _i72 < _list70.size; ++_i72) + { + _elem71 = iprot.readI16(); + struct.values.add(_elem71); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TI16Column struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.values.size())); + for (short _iter73 : struct.values) + { + oprot.writeI16(_iter73); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI16ColumnTupleSchemeFactory implements SchemeFactory { + public TI16ColumnTupleScheme getScheme() { + return new TI16ColumnTupleScheme(); + } + } + + private static class TI16ColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (short _iter74 : struct.values) + { + oprot.writeI16(_iter74); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); + struct.values = new ArrayList(_list75.size); + short _elem76; + for (int _i77 = 0; _i77 < _list75.size; ++_i77) + { + _elem76 = iprot.readI16(); + struct.values.add(_elem76); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Value.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Value.java new file mode 100644 index 000000000000..922c772b1be7 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Value.java @@ -0,0 +1,381 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Value"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI16ValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI16ValueTupleSchemeFactory()); + } + + private short value; // 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 { + VALUE((short)1, "value"); + + 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: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Value.class, metaDataMap); + } + + public TI16Value() { + } + + /** + * Performs a deep copy on other. + */ + public TI16Value(TI16Value other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TI16Value deepCopy() { + return new TI16Value(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public short getValue() { + return this.value; + } + + public void setValue(short value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((Short)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + 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 VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TI16Value) + return this.equals((TI16Value)that); + return false; + } + + public boolean equals(TI16Value that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(TI16Value other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("TI16Value("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TI16ValueStandardSchemeFactory implements SchemeFactory { + public TI16ValueStandardScheme getScheme() { + return new TI16ValueStandardScheme(); + } + } + + private static class TI16ValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.value = iprot.readI16(); + struct.setValueIsSet(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, TI16Value struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI16(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI16ValueTupleSchemeFactory implements SchemeFactory { + public TI16ValueTupleScheme getScheme() { + return new TI16ValueTupleScheme(); + } + } + + private static class TI16ValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeI16(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readI16(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Column.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Column.java new file mode 100644 index 000000000000..af3fb009de2f --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Column.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Column"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI32ColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI32ColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Column.class, metaDataMap); + } + + public TI32Column() { + } + + public TI32Column( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TI32Column(TI32Column other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TI32Column deepCopy() { + return new TI32Column(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(int elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TI32Column) + return this.equals((TI32Column)that); + return false; + } + + public boolean equals(TI32Column that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TI32Column other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TI32Column("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TI32ColumnStandardSchemeFactory implements SchemeFactory { + public TI32ColumnStandardScheme getScheme() { + return new TI32ColumnStandardScheme(); + } + } + + private static class TI32ColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); + struct.values = new ArrayList(_list78.size); + int _elem79; + for (int _i80 = 0; _i80 < _list78.size; ++_i80) + { + _elem79 = iprot.readI32(); + struct.values.add(_elem79); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TI32Column struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.values.size())); + for (int _iter81 : struct.values) + { + oprot.writeI32(_iter81); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI32ColumnTupleSchemeFactory implements SchemeFactory { + public TI32ColumnTupleScheme getScheme() { + return new TI32ColumnTupleScheme(); + } + } + + private static class TI32ColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (int _iter82 : struct.values) + { + oprot.writeI32(_iter82); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.values = new ArrayList(_list83.size); + int _elem84; + for (int _i85 = 0; _i85 < _list83.size; ++_i85) + { + _elem84 = iprot.readI32(); + struct.values.add(_elem84); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Value.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Value.java new file mode 100644 index 000000000000..dd99282ee842 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Value.java @@ -0,0 +1,381 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Value"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI32ValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI32ValueTupleSchemeFactory()); + } + + private int value; // 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 { + VALUE((short)1, "value"); + + 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: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Value.class, metaDataMap); + } + + public TI32Value() { + } + + /** + * Performs a deep copy on other. + */ + public TI32Value(TI32Value other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TI32Value deepCopy() { + return new TI32Value(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public int getValue() { + return this.value; + } + + public void setValue(int value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + 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 VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TI32Value) + return this.equals((TI32Value)that); + return false; + } + + public boolean equals(TI32Value that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(TI32Value other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("TI32Value("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TI32ValueStandardSchemeFactory implements SchemeFactory { + public TI32ValueStandardScheme getScheme() { + return new TI32ValueStandardScheme(); + } + } + + private static class TI32ValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.value = iprot.readI32(); + struct.setValueIsSet(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, TI32Value struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI32(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI32ValueTupleSchemeFactory implements SchemeFactory { + public TI32ValueTupleScheme getScheme() { + return new TI32ValueTupleScheme(); + } + } + + private static class TI32ValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeI32(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readI32(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Column.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Column.java new file mode 100644 index 000000000000..b58f2cd2b3d4 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Column.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Column"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI64ColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI64ColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Column.class, metaDataMap); + } + + public TI64Column() { + } + + public TI64Column( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TI64Column(TI64Column other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TI64Column deepCopy() { + return new TI64Column(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(long elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TI64Column) + return this.equals((TI64Column)that); + return false; + } + + public boolean equals(TI64Column that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TI64Column other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TI64Column("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TI64ColumnStandardSchemeFactory implements SchemeFactory { + public TI64ColumnStandardScheme getScheme() { + return new TI64ColumnStandardScheme(); + } + } + + private static class TI64ColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); + struct.values = new ArrayList(_list86.size); + long _elem87; + for (int _i88 = 0; _i88 < _list86.size; ++_i88) + { + _elem87 = iprot.readI64(); + struct.values.add(_elem87); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TI64Column struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.values.size())); + for (long _iter89 : struct.values) + { + oprot.writeI64(_iter89); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI64ColumnTupleSchemeFactory implements SchemeFactory { + public TI64ColumnTupleScheme getScheme() { + return new TI64ColumnTupleScheme(); + } + } + + private static class TI64ColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (long _iter90 : struct.values) + { + oprot.writeI64(_iter90); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.values = new ArrayList(_list91.size); + long _elem92; + for (int _i93 = 0; _i93 < _list91.size; ++_i93) + { + _elem92 = iprot.readI64(); + struct.values.add(_elem92); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Value.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Value.java new file mode 100644 index 000000000000..b5e70a6485e0 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Value.java @@ -0,0 +1,381 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Value"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI64ValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI64ValueTupleSchemeFactory()); + } + + private long value; // 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 { + VALUE((short)1, "value"); + + 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: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Value.class, metaDataMap); + } + + public TI64Value() { + } + + /** + * Performs a deep copy on other. + */ + public TI64Value(TI64Value other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TI64Value deepCopy() { + return new TI64Value(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public long getValue() { + return this.value; + } + + public void setValue(long value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + 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 VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TI64Value) + return this.equals((TI64Value)that); + return false; + } + + public boolean equals(TI64Value that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(TI64Value other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("TI64Value("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TI64ValueStandardSchemeFactory implements SchemeFactory { + public TI64ValueStandardScheme getScheme() { + return new TI64ValueStandardScheme(); + } + } + + private static class TI64ValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.value = iprot.readI64(); + struct.setValueIsSet(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, TI64Value struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI64(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI64ValueTupleSchemeFactory implements SchemeFactory { + public TI64ValueTupleScheme getScheme() { + return new TI64ValueTupleScheme(); + } + } + + private static class TI64ValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeI64(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readI64(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java new file mode 100644 index 000000000000..94092b13a42f --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java @@ -0,0 +1,44 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TJobExecutionStatus implements org.apache.thrift.TEnum { + IN_PROGRESS(0), + COMPLETE(1), + NOT_AVAILABLE(2); + + private final int value; + + private TJobExecutionStatus(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TJobExecutionStatus findByValue(int value) { + switch (value) { + case 0: + return IN_PROGRESS; + case 1: + return COMPLETE; + case 2: + return NOT_AVAILABLE; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java new file mode 100644 index 000000000000..df91742c32f4 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java @@ -0,0 +1,472 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapTypeEntry"); + + private static final org.apache.thrift.protocol.TField KEY_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("keyTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField VALUE_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypePtr", org.apache.thrift.protocol.TType.I32, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TMapTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TMapTypeEntryTupleSchemeFactory()); + } + + private int keyTypePtr; // required + private int valueTypePtr; // 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 { + KEY_TYPE_PTR((short)1, "keyTypePtr"), + VALUE_TYPE_PTR((short)2, "valueTypePtr"); + + 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: // KEY_TYPE_PTR + return KEY_TYPE_PTR; + case 2: // VALUE_TYPE_PTR + return VALUE_TYPE_PTR; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __KEYTYPEPTR_ISSET_ID = 0; + private static final int __VALUETYPEPTR_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.KEY_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("keyTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); + tmpMap.put(_Fields.VALUE_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("valueTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapTypeEntry.class, metaDataMap); + } + + public TMapTypeEntry() { + } + + public TMapTypeEntry( + int keyTypePtr, + int valueTypePtr) + { + this(); + this.keyTypePtr = keyTypePtr; + setKeyTypePtrIsSet(true); + this.valueTypePtr = valueTypePtr; + setValueTypePtrIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TMapTypeEntry(TMapTypeEntry other) { + __isset_bitfield = other.__isset_bitfield; + this.keyTypePtr = other.keyTypePtr; + this.valueTypePtr = other.valueTypePtr; + } + + public TMapTypeEntry deepCopy() { + return new TMapTypeEntry(this); + } + + @Override + public void clear() { + setKeyTypePtrIsSet(false); + this.keyTypePtr = 0; + setValueTypePtrIsSet(false); + this.valueTypePtr = 0; + } + + public int getKeyTypePtr() { + return this.keyTypePtr; + } + + public void setKeyTypePtr(int keyTypePtr) { + this.keyTypePtr = keyTypePtr; + setKeyTypePtrIsSet(true); + } + + public void unsetKeyTypePtr() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + } + + /** Returns true if field keyTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetKeyTypePtr() { + return EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + } + + public void setKeyTypePtrIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); + } + + public int getValueTypePtr() { + return this.valueTypePtr; + } + + public void setValueTypePtr(int valueTypePtr) { + this.valueTypePtr = valueTypePtr; + setValueTypePtrIsSet(true); + } + + public void unsetValueTypePtr() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + } + + /** Returns true if field valueTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetValueTypePtr() { + return EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + } + + public void setValueTypePtrIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case KEY_TYPE_PTR: + if (value == null) { + unsetKeyTypePtr(); + } else { + setKeyTypePtr((Integer)value); + } + break; + + case VALUE_TYPE_PTR: + if (value == null) { + unsetValueTypePtr(); + } else { + setValueTypePtr((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case KEY_TYPE_PTR: + return getKeyTypePtr(); + + case VALUE_TYPE_PTR: + return getValueTypePtr(); + + } + 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 KEY_TYPE_PTR: + return isSetKeyTypePtr(); + case VALUE_TYPE_PTR: + return isSetValueTypePtr(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TMapTypeEntry) + return this.equals((TMapTypeEntry)that); + return false; + } + + public boolean equals(TMapTypeEntry that) { + if (that == null) + return false; + + boolean this_present_keyTypePtr = true; + boolean that_present_keyTypePtr = true; + if (this_present_keyTypePtr || that_present_keyTypePtr) { + if (!(this_present_keyTypePtr && that_present_keyTypePtr)) + return false; + if (this.keyTypePtr != that.keyTypePtr) + return false; + } + + boolean this_present_valueTypePtr = true; + boolean that_present_valueTypePtr = true; + if (this_present_valueTypePtr || that_present_valueTypePtr) { + if (!(this_present_valueTypePtr && that_present_valueTypePtr)) + return false; + if (this.valueTypePtr != that.valueTypePtr) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_keyTypePtr = true; + list.add(present_keyTypePtr); + if (present_keyTypePtr) + list.add(keyTypePtr); + + boolean present_valueTypePtr = true; + list.add(present_valueTypePtr); + if (present_valueTypePtr) + list.add(valueTypePtr); + + return list.hashCode(); + } + + @Override + public int compareTo(TMapTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeyTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyTypePtr, other.keyTypePtr); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValueTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueTypePtr, other.valueTypePtr); + 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("TMapTypeEntry("); + boolean first = true; + + sb.append("keyTypePtr:"); + sb.append(this.keyTypePtr); + first = false; + if (!first) sb.append(", "); + sb.append("valueTypePtr:"); + sb.append(this.valueTypePtr); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetKeyTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyTypePtr' is unset! Struct:" + toString()); + } + + if (!isSetValueTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'valueTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TMapTypeEntryStandardSchemeFactory implements SchemeFactory { + public TMapTypeEntryStandardScheme getScheme() { + return new TMapTypeEntryStandardScheme(); + } + } + + private static class TMapTypeEntryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TMapTypeEntry 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: // KEY_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.keyTypePtr = iprot.readI32(); + struct.setKeyTypePtrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUE_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.valueTypePtr = iprot.readI32(); + struct.setValueTypePtrIsSet(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, TMapTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(KEY_TYPE_PTR_FIELD_DESC); + oprot.writeI32(struct.keyTypePtr); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(VALUE_TYPE_PTR_FIELD_DESC); + oprot.writeI32(struct.valueTypePtr); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TMapTypeEntryTupleSchemeFactory implements SchemeFactory { + public TMapTypeEntryTupleScheme getScheme() { + return new TMapTypeEntryTupleScheme(); + } + } + + private static class TMapTypeEntryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.keyTypePtr); + oprot.writeI32(struct.valueTypePtr); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.keyTypePtr = iprot.readI32(); + struct.setKeyTypePtrIsSet(true); + struct.valueTypePtr = iprot.readI32(); + struct.setValueTypePtrIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java new file mode 100644 index 000000000000..7ac70e897507 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java @@ -0,0 +1,768 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq"); + + private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TOpenSessionReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TOpenSessionReqTupleSchemeFactory()); + } + + private TProtocolVersion client_protocol; // required + private String username; // optional + private String password; // optional + private Map configuration; // 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 { + /** + * + * @see TProtocolVersion + */ + CLIENT_PROTOCOL((short)1, "client_protocol"), + USERNAME((short)2, "username"), + PASSWORD((short)3, "password"), + CONFIGURATION((short)4, "configuration"); + + 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: // CLIENT_PROTOCOL + return CLIENT_PROTOCOL; + case 2: // USERNAME + return USERNAME; + case 3: // PASSWORD + return PASSWORD; + case 4: // CONFIGURATION + return CONFIGURATION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; + 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.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); + tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap); + } + + public TOpenSessionReq() { + this.client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + } + + public TOpenSessionReq( + TProtocolVersion client_protocol) + { + this(); + this.client_protocol = client_protocol; + } + + /** + * Performs a deep copy on other. + */ + public TOpenSessionReq(TOpenSessionReq other) { + if (other.isSetClient_protocol()) { + this.client_protocol = other.client_protocol; + } + if (other.isSetUsername()) { + this.username = other.username; + } + if (other.isSetPassword()) { + this.password = other.password; + } + if (other.isSetConfiguration()) { + Map __this__configuration = new HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TOpenSessionReq deepCopy() { + return new TOpenSessionReq(this); + } + + @Override + public void clear() { + this.client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + this.username = null; + this.password = null; + this.configuration = null; + } + + /** + * + * @see TProtocolVersion + */ + public TProtocolVersion getClient_protocol() { + return this.client_protocol; + } + + /** + * + * @see TProtocolVersion + */ + public void setClient_protocol(TProtocolVersion client_protocol) { + this.client_protocol = client_protocol; + } + + public void unsetClient_protocol() { + this.client_protocol = null; + } + + /** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */ + public boolean isSetClient_protocol() { + return this.client_protocol != null; + } + + public void setClient_protocolIsSet(boolean value) { + if (!value) { + this.client_protocol = null; + } + } + + public String getUsername() { + return this.username; + } + + public void setUsername(String username) { + this.username = username; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + public String getPassword() { + return this.password; + } + + public void setPassword(String password) { + this.password = password; + } + + public void unsetPassword() { + this.password = null; + } + + /** Returns true if field password is set (has been assigned a value) and false otherwise */ + public boolean isSetPassword() { + return this.password != null; + } + + public void setPasswordIsSet(boolean value) { + if (!value) { + this.password = null; + } + } + + public int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(String key, String val) { + if (this.configuration == null) { + this.configuration = new HashMap(); + } + this.configuration.put(key, val); + } + + public Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case CLIENT_PROTOCOL: + if (value == null) { + unsetClient_protocol(); + } else { + setClient_protocol((TProtocolVersion)value); + } + break; + + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((String)value); + } + break; + + case PASSWORD: + if (value == null) { + unsetPassword(); + } else { + setPassword((String)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case CLIENT_PROTOCOL: + return getClient_protocol(); + + case USERNAME: + return getUsername(); + + case PASSWORD: + return getPassword(); + + case CONFIGURATION: + return getConfiguration(); + + } + 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 CLIENT_PROTOCOL: + return isSetClient_protocol(); + case USERNAME: + return isSetUsername(); + case PASSWORD: + return isSetPassword(); + case CONFIGURATION: + return isSetConfiguration(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TOpenSessionReq) + return this.equals((TOpenSessionReq)that); + return false; + } + + public boolean equals(TOpenSessionReq that) { + if (that == null) + return false; + + boolean this_present_client_protocol = true && this.isSetClient_protocol(); + boolean that_present_client_protocol = true && that.isSetClient_protocol(); + if (this_present_client_protocol || that_present_client_protocol) { + if (!(this_present_client_protocol && that_present_client_protocol)) + return false; + if (!this.client_protocol.equals(that.client_protocol)) + return false; + } + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + boolean this_present_password = true && this.isSetPassword(); + boolean that_present_password = true && that.isSetPassword(); + if (this_present_password || that_present_password) { + if (!(this_present_password && that_present_password)) + return false; + if (!this.password.equals(that.password)) + return false; + } + + boolean this_present_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_client_protocol = true && (isSetClient_protocol()); + list.add(present_client_protocol); + if (present_client_protocol) + list.add(client_protocol.getValue()); + + boolean present_username = true && (isSetUsername()); + list.add(present_username); + if (present_username) + list.add(username); + + boolean present_password = true && (isSetPassword()); + list.add(present_password); + if (present_password) + list.add(password); + + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); + + return list.hashCode(); + } + + @Override + public int compareTo(TOpenSessionReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClient_protocol()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, other.client_protocol); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPassword()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + 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("TOpenSessionReq("); + boolean first = true; + + sb.append("client_protocol:"); + if (this.client_protocol == null) { + sb.append("null"); + } else { + sb.append(this.client_protocol); + } + first = false; + if (isSetUsername()) { + if (!first) sb.append(", "); + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + } + if (isSetPassword()) { + if (!first) sb.append(", "); + sb.append("password:"); + if (this.password == null) { + sb.append("null"); + } else { + sb.append(this.password); + } + first = false; + } + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetClient_protocol()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TOpenSessionReqStandardSchemeFactory implements SchemeFactory { + public TOpenSessionReqStandardScheme getScheme() { + return new TOpenSessionReqStandardScheme(); + } + } + + private static class TOpenSessionReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq 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: // CLIENT_PROTOCOL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32()); + struct.setClient_protocolIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PASSWORD + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map142.size); + String _key143; + String _val144; + for (int _i145 = 0; _i145 < _map142.size; ++_i145) + { + _key143 = iprot.readString(); + _val144 = iprot.readString(); + struct.configuration.put(_key143, _val144); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(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, TOpenSessionReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.client_protocol != null) { + oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC); + oprot.writeI32(struct.client_protocol.getValue()); + oprot.writeFieldEnd(); + } + if (struct.username != null) { + if (struct.isSetUsername()) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + } + if (struct.password != null) { + if (struct.isSetPassword()) { + oprot.writeFieldBegin(PASSWORD_FIELD_DESC); + oprot.writeString(struct.password); + oprot.writeFieldEnd(); + } + } + if (struct.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (Map.Entry _iter146 : struct.configuration.entrySet()) + { + oprot.writeString(_iter146.getKey()); + oprot.writeString(_iter146.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TOpenSessionReqTupleSchemeFactory implements SchemeFactory { + public TOpenSessionReqTupleScheme getScheme() { + return new TOpenSessionReqTupleScheme(); + } + } + + private static class TOpenSessionReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.client_protocol.getValue()); + BitSet optionals = new BitSet(); + if (struct.isSetUsername()) { + optionals.set(0); + } + if (struct.isSetPassword()) { + optionals.set(1); + } + if (struct.isSetConfiguration()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUsername()) { + oprot.writeString(struct.username); + } + if (struct.isSetPassword()) { + oprot.writeString(struct.password); + } + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (Map.Entry _iter147 : struct.configuration.entrySet()) + { + oprot.writeString(_iter147.getKey()); + oprot.writeString(_iter147.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32()); + struct.setClient_protocolIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + if (incoming.get(1)) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new HashMap(2*_map148.size); + String _key149; + String _val150; + for (int _i151 = 0; _i151 < _map148.size; ++_i151) + { + _key149 = iprot.readString(); + _val150 = iprot.readString(); + struct.configuration.put(_key149, _val150); + } + } + struct.setConfigurationIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java new file mode 100644 index 000000000000..d2c613c1bcd8 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java @@ -0,0 +1,773 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp"); + + 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 SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2); + 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)3); + private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TOpenSessionRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TOpenSessionRespTupleSchemeFactory()); + } + + private TStatus status; // required + private TProtocolVersion serverProtocolVersion; // required + private TSessionHandle sessionHandle; // optional + private Map configuration; // 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"), + /** + * + * @see TProtocolVersion + */ + SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"), + SESSION_HANDLE((short)3, "sessionHandle"), + CONFIGURATION((short)4, "configuration"); + + 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: // SERVER_PROTOCOL_VERSION + return SERVER_PROTOCOL_VERSION; + case 3: // SESSION_HANDLE + return SESSION_HANDLE; + case 4: // CONFIGURATION + return CONFIGURATION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; + 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.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); + tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); + tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap); + } + + public TOpenSessionResp() { + this.serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + } + + public TOpenSessionResp( + TStatus status, + TProtocolVersion serverProtocolVersion) + { + this(); + this.status = status; + this.serverProtocolVersion = serverProtocolVersion; + } + + /** + * Performs a deep copy on other. + */ + public TOpenSessionResp(TOpenSessionResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetServerProtocolVersion()) { + this.serverProtocolVersion = other.serverProtocolVersion; + } + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetConfiguration()) { + Map __this__configuration = new HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TOpenSessionResp deepCopy() { + return new TOpenSessionResp(this); + } + + @Override + public void clear() { + this.status = null; + this.serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + this.sessionHandle = null; + this.configuration = 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; + } + } + + /** + * + * @see TProtocolVersion + */ + public TProtocolVersion getServerProtocolVersion() { + return this.serverProtocolVersion; + } + + /** + * + * @see TProtocolVersion + */ + public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) { + this.serverProtocolVersion = serverProtocolVersion; + } + + public void unsetServerProtocolVersion() { + this.serverProtocolVersion = null; + } + + /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */ + public boolean isSetServerProtocolVersion() { + return this.serverProtocolVersion != null; + } + + public void setServerProtocolVersionIsSet(boolean value) { + if (!value) { + this.serverProtocolVersion = 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 int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(String key, String val) { + if (this.configuration == null) { + this.configuration = new HashMap(); + } + this.configuration.put(key, val); + } + + public Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case SERVER_PROTOCOL_VERSION: + if (value == null) { + unsetServerProtocolVersion(); + } else { + setServerProtocolVersion((TProtocolVersion)value); + } + break; + + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case SERVER_PROTOCOL_VERSION: + return getServerProtocolVersion(); + + case SESSION_HANDLE: + return getSessionHandle(); + + case CONFIGURATION: + return getConfiguration(); + + } + 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 SERVER_PROTOCOL_VERSION: + return isSetServerProtocolVersion(); + case SESSION_HANDLE: + return isSetSessionHandle(); + case CONFIGURATION: + return isSetConfiguration(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TOpenSessionResp) + return this.equals((TOpenSessionResp)that); + return false; + } + + public boolean equals(TOpenSessionResp 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_serverProtocolVersion = true && this.isSetServerProtocolVersion(); + boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion(); + if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) { + if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion)) + return false; + if (!this.serverProtocolVersion.equals(that.serverProtocolVersion)) + 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_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion()); + list.add(present_serverProtocolVersion); + if (present_serverProtocolVersion) + list.add(serverProtocolVersion.getValue()); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); + + return list.hashCode(); + } + + @Override + public int compareTo(TOpenSessionResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerProtocolVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, other.serverProtocolVersion); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + 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("TOpenSessionResp("); + 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("serverProtocolVersion:"); + if (this.serverProtocolVersion == null) { + sb.append("null"); + } else { + sb.append(this.serverProtocolVersion); + } + first = false; + if (isSetSessionHandle()) { + if (!first) sb.append(", "); + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + } + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + 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 (!isSetServerProtocolVersion()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (sessionHandle != null) { + sessionHandle.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 TOpenSessionRespStandardSchemeFactory implements SchemeFactory { + public TOpenSessionRespStandardScheme getScheme() { + return new TOpenSessionRespStandardScheme(); + } + } + + private static class TOpenSessionRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp 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: // SERVER_PROTOCOL_VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32()); + struct.setServerProtocolVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // 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 4: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map152.size); + String _key153; + String _val154; + for (int _i155 = 0; _i155 < _map152.size; ++_i155) + { + _key153 = iprot.readString(); + _val154 = iprot.readString(); + struct.configuration.put(_key153, _val154); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(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, TOpenSessionResp 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.serverProtocolVersion != null) { + oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC); + oprot.writeI32(struct.serverProtocolVersion.getValue()); + oprot.writeFieldEnd(); + } + if (struct.sessionHandle != null) { + if (struct.isSetSessionHandle()) { + oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); + struct.sessionHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (Map.Entry _iter156 : struct.configuration.entrySet()) + { + oprot.writeString(_iter156.getKey()); + oprot.writeString(_iter156.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TOpenSessionRespTupleSchemeFactory implements SchemeFactory { + public TOpenSessionRespTupleScheme getScheme() { + return new TOpenSessionRespTupleScheme(); + } + } + + private static class TOpenSessionRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + oprot.writeI32(struct.serverProtocolVersion.getValue()); + BitSet optionals = new BitSet(); + if (struct.isSetSessionHandle()) { + optionals.set(0); + } + if (struct.isSetConfiguration()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSessionHandle()) { + struct.sessionHandle.write(oprot); + } + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (Map.Entry _iter157 : struct.configuration.entrySet()) + { + oprot.writeString(_iter157.getKey()); + oprot.writeString(_iter157.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32()); + struct.setServerProtocolVersionIsSet(true); + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new HashMap(2*_map158.size); + String _key159; + String _val160; + for (int _i161 = 0; _i161 < _map158.size; ++_i161) + { + _key159 = iprot.readString(); + _val160 = iprot.readString(); + struct.configuration.put(_key159, _val160); + } + } + struct.setConfigurationIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationHandle.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationHandle.java new file mode 100644 index 000000000000..df524485b721 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationHandle.java @@ -0,0 +1,700 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle"); + + private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3); + private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TOperationHandleStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TOperationHandleTupleSchemeFactory()); + } + + private THandleIdentifier operationId; // required + private TOperationType operationType; // required + private boolean hasResultSet; // required + private double modifiedRowCount; // 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 { + OPERATION_ID((short)1, "operationId"), + /** + * + * @see TOperationType + */ + OPERATION_TYPE((short)2, "operationType"), + HAS_RESULT_SET((short)3, "hasResultSet"), + MODIFIED_ROW_COUNT((short)4, "modifiedRowCount"); + + 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: // OPERATION_ID + return OPERATION_ID; + case 2: // OPERATION_TYPE + return OPERATION_TYPE; + case 3: // HAS_RESULT_SET + return HAS_RESULT_SET; + case 4: // MODIFIED_ROW_COUNT + return MODIFIED_ROW_COUNT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __HASRESULTSET_ISSET_ID = 0; + private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT}; + 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.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); + tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationType.class))); + tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap); + } + + public TOperationHandle() { + } + + public TOperationHandle( + THandleIdentifier operationId, + TOperationType operationType, + boolean hasResultSet) + { + this(); + this.operationId = operationId; + this.operationType = operationType; + this.hasResultSet = hasResultSet; + setHasResultSetIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TOperationHandle(TOperationHandle other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetOperationId()) { + this.operationId = new THandleIdentifier(other.operationId); + } + if (other.isSetOperationType()) { + this.operationType = other.operationType; + } + this.hasResultSet = other.hasResultSet; + this.modifiedRowCount = other.modifiedRowCount; + } + + public TOperationHandle deepCopy() { + return new TOperationHandle(this); + } + + @Override + public void clear() { + this.operationId = null; + this.operationType = null; + setHasResultSetIsSet(false); + this.hasResultSet = false; + setModifiedRowCountIsSet(false); + this.modifiedRowCount = 0.0; + } + + public THandleIdentifier getOperationId() { + return this.operationId; + } + + public void setOperationId(THandleIdentifier operationId) { + this.operationId = operationId; + } + + public void unsetOperationId() { + this.operationId = null; + } + + /** Returns true if field operationId is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationId() { + return this.operationId != null; + } + + public void setOperationIdIsSet(boolean value) { + if (!value) { + this.operationId = null; + } + } + + /** + * + * @see TOperationType + */ + public TOperationType getOperationType() { + return this.operationType; + } + + /** + * + * @see TOperationType + */ + public void setOperationType(TOperationType operationType) { + this.operationType = operationType; + } + + public void unsetOperationType() { + this.operationType = null; + } + + /** Returns true if field operationType is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationType() { + return this.operationType != null; + } + + public void setOperationTypeIsSet(boolean value) { + if (!value) { + this.operationType = null; + } + } + + public boolean isHasResultSet() { + return this.hasResultSet; + } + + public void setHasResultSet(boolean hasResultSet) { + this.hasResultSet = hasResultSet; + setHasResultSetIsSet(true); + } + + public void unsetHasResultSet() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ + public boolean isSetHasResultSet() { + return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + public void setHasResultSetIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + } + + public double getModifiedRowCount() { + return this.modifiedRowCount; + } + + public void setModifiedRowCount(double modifiedRowCount) { + this.modifiedRowCount = modifiedRowCount; + setModifiedRowCountIsSet(true); + } + + public void unsetModifiedRowCount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + } + + /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */ + public boolean isSetModifiedRowCount() { + return EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + } + + public void setModifiedRowCountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case OPERATION_ID: + if (value == null) { + unsetOperationId(); + } else { + setOperationId((THandleIdentifier)value); + } + break; + + case OPERATION_TYPE: + if (value == null) { + unsetOperationType(); + } else { + setOperationType((TOperationType)value); + } + break; + + case HAS_RESULT_SET: + if (value == null) { + unsetHasResultSet(); + } else { + setHasResultSet((Boolean)value); + } + break; + + case MODIFIED_ROW_COUNT: + if (value == null) { + unsetModifiedRowCount(); + } else { + setModifiedRowCount((Double)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_ID: + return getOperationId(); + + case OPERATION_TYPE: + return getOperationType(); + + case HAS_RESULT_SET: + return isHasResultSet(); + + case MODIFIED_ROW_COUNT: + return getModifiedRowCount(); + + } + 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 OPERATION_ID: + return isSetOperationId(); + case OPERATION_TYPE: + return isSetOperationType(); + case HAS_RESULT_SET: + return isSetHasResultSet(); + case MODIFIED_ROW_COUNT: + return isSetModifiedRowCount(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TOperationHandle) + return this.equals((TOperationHandle)that); + return false; + } + + public boolean equals(TOperationHandle that) { + if (that == null) + return false; + + boolean this_present_operationId = true && this.isSetOperationId(); + boolean that_present_operationId = true && that.isSetOperationId(); + if (this_present_operationId || that_present_operationId) { + if (!(this_present_operationId && that_present_operationId)) + return false; + if (!this.operationId.equals(that.operationId)) + return false; + } + + boolean this_present_operationType = true && this.isSetOperationType(); + boolean that_present_operationType = true && that.isSetOperationType(); + if (this_present_operationType || that_present_operationType) { + if (!(this_present_operationType && that_present_operationType)) + return false; + if (!this.operationType.equals(that.operationType)) + return false; + } + + boolean this_present_hasResultSet = true; + boolean that_present_hasResultSet = true; + if (this_present_hasResultSet || that_present_hasResultSet) { + if (!(this_present_hasResultSet && that_present_hasResultSet)) + return false; + if (this.hasResultSet != that.hasResultSet) + return false; + } + + boolean this_present_modifiedRowCount = true && this.isSetModifiedRowCount(); + boolean that_present_modifiedRowCount = true && that.isSetModifiedRowCount(); + if (this_present_modifiedRowCount || that_present_modifiedRowCount) { + if (!(this_present_modifiedRowCount && that_present_modifiedRowCount)) + return false; + if (this.modifiedRowCount != that.modifiedRowCount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_operationId = true && (isSetOperationId()); + list.add(present_operationId); + if (present_operationId) + list.add(operationId); + + boolean present_operationType = true && (isSetOperationType()); + list.add(present_operationType); + if (present_operationType) + list.add(operationType.getValue()); + + boolean present_hasResultSet = true; + list.add(present_hasResultSet); + if (present_hasResultSet) + list.add(hasResultSet); + + boolean present_modifiedRowCount = true && (isSetModifiedRowCount()); + list.add(present_modifiedRowCount); + if (present_modifiedRowCount) + list.add(modifiedRowCount); + + return list.hashCode(); + } + + @Override + public int compareTo(TOperationHandle other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationId, other.operationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationType, other.operationType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasResultSet()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetModifiedRowCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modifiedRowCount, other.modifiedRowCount); + 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("TOperationHandle("); + boolean first = true; + + sb.append("operationId:"); + if (this.operationId == null) { + sb.append("null"); + } else { + sb.append(this.operationId); + } + first = false; + if (!first) sb.append(", "); + sb.append("operationType:"); + if (this.operationType == null) { + sb.append("null"); + } else { + sb.append(this.operationType); + } + first = false; + if (!first) sb.append(", "); + sb.append("hasResultSet:"); + sb.append(this.hasResultSet); + first = false; + if (isSetModifiedRowCount()) { + if (!first) sb.append(", "); + sb.append("modifiedRowCount:"); + sb.append(this.modifiedRowCount); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetOperationId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' is unset! Struct:" + toString()); + } + + if (!isSetOperationType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationType' is unset! Struct:" + toString()); + } + + if (!isSetHasResultSet()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (operationId != null) { + operationId.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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TOperationHandleStandardSchemeFactory implements SchemeFactory { + public TOperationHandleStandardScheme getScheme() { + return new TOperationHandleStandardScheme(); + } + } + + private static class TOperationHandleStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle 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: // OPERATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.operationId = new THandleIdentifier(); + struct.operationId.read(iprot); + struct.setOperationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OPERATION_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.operationType = TOperationType.findByValue(iprot.readI32()); + struct.setOperationTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // HAS_RESULT_SET + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // MODIFIED_ROW_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.modifiedRowCount = iprot.readDouble(); + struct.setModifiedRowCountIsSet(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, TOperationHandle struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationId != null) { + oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC); + struct.operationId.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.operationType != null) { + oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC); + oprot.writeI32(struct.operationType.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); + oprot.writeBool(struct.hasResultSet); + oprot.writeFieldEnd(); + if (struct.isSetModifiedRowCount()) { + oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC); + oprot.writeDouble(struct.modifiedRowCount); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TOperationHandleTupleSchemeFactory implements SchemeFactory { + public TOperationHandleTupleScheme getScheme() { + return new TOperationHandleTupleScheme(); + } + } + + private static class TOperationHandleTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.operationId.write(oprot); + oprot.writeI32(struct.operationType.getValue()); + oprot.writeBool(struct.hasResultSet); + BitSet optionals = new BitSet(); + if (struct.isSetModifiedRowCount()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetModifiedRowCount()) { + oprot.writeDouble(struct.modifiedRowCount); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.operationId = new THandleIdentifier(); + struct.operationId.read(iprot); + struct.setOperationIdIsSet(true); + struct.operationType = TOperationType.findByValue(iprot.readI32()); + struct.setOperationTypeIsSet(true); + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.modifiedRowCount = iprot.readDouble(); + struct.setModifiedRowCountIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationState.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationState.java new file mode 100644 index 000000000000..7f62bdd1f282 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationState.java @@ -0,0 +1,62 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TOperationState implements org.apache.thrift.TEnum { + INITIALIZED_STATE(0), + RUNNING_STATE(1), + FINISHED_STATE(2), + CANCELED_STATE(3), + CLOSED_STATE(4), + ERROR_STATE(5), + UKNOWN_STATE(6), + PENDING_STATE(7), + TIMEDOUT_STATE(8); + + private final int value; + + private TOperationState(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TOperationState findByValue(int value) { + switch (value) { + case 0: + return INITIALIZED_STATE; + case 1: + return RUNNING_STATE; + case 2: + return FINISHED_STATE; + case 3: + return CANCELED_STATE; + case 4: + return CLOSED_STATE; + case 5: + return ERROR_STATE; + case 6: + return UKNOWN_STATE; + case 7: + return PENDING_STATE; + case 8: + return TIMEDOUT_STATE; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationType.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationType.java new file mode 100644 index 000000000000..ceb39742c3ae --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationType.java @@ -0,0 +1,62 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TOperationType implements org.apache.thrift.TEnum { + EXECUTE_STATEMENT(0), + GET_TYPE_INFO(1), + GET_CATALOGS(2), + GET_SCHEMAS(3), + GET_TABLES(4), + GET_TABLE_TYPES(5), + GET_COLUMNS(6), + GET_FUNCTIONS(7), + UNKNOWN(8); + + private final int value; + + private TOperationType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TOperationType findByValue(int value) { + switch (value) { + case 0: + return EXECUTE_STATEMENT; + case 1: + return GET_TYPE_INFO; + case 2: + return GET_CATALOGS; + case 3: + return GET_SCHEMAS; + case 4: + return GET_TABLES; + case 5: + return GET_TABLE_TYPES; + case 6: + return GET_COLUMNS; + case 7: + return GET_FUNCTIONS; + case 8: + return UNKNOWN; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java new file mode 100644 index 000000000000..27e17265b473 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java @@ -0,0 +1,506 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry"); + + private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPrimitiveTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPrimitiveTypeEntryTupleSchemeFactory()); + } + + private TTypeId type; // required + private TTypeQualifiers typeQualifiers; // 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 { + /** + * + * @see TTypeId + */ + TYPE((short)1, "type"), + TYPE_QUALIFIERS((short)2, "typeQualifiers"); + + 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: // TYPE + return TYPE; + case 2: // TYPE_QUALIFIERS + return TYPE_QUALIFIERS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.TYPE_QUALIFIERS}; + 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.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class))); + tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap); + } + + public TPrimitiveTypeEntry() { + } + + public TPrimitiveTypeEntry( + TTypeId type) + { + this(); + this.type = type; + } + + /** + * Performs a deep copy on other. + */ + public TPrimitiveTypeEntry(TPrimitiveTypeEntry other) { + if (other.isSetType()) { + this.type = other.type; + } + if (other.isSetTypeQualifiers()) { + this.typeQualifiers = new TTypeQualifiers(other.typeQualifiers); + } + } + + public TPrimitiveTypeEntry deepCopy() { + return new TPrimitiveTypeEntry(this); + } + + @Override + public void clear() { + this.type = null; + this.typeQualifiers = null; + } + + /** + * + * @see TTypeId + */ + public TTypeId getType() { + return this.type; + } + + /** + * + * @see TTypeId + */ + public void setType(TTypeId type) { + this.type = type; + } + + public void unsetType() { + this.type = null; + } + + /** Returns true if field type is set (has been assigned a value) and false otherwise */ + public boolean isSetType() { + return this.type != null; + } + + public void setTypeIsSet(boolean value) { + if (!value) { + this.type = null; + } + } + + public TTypeQualifiers getTypeQualifiers() { + return this.typeQualifiers; + } + + public void setTypeQualifiers(TTypeQualifiers typeQualifiers) { + this.typeQualifiers = typeQualifiers; + } + + public void unsetTypeQualifiers() { + this.typeQualifiers = null; + } + + /** Returns true if field typeQualifiers is set (has been assigned a value) and false otherwise */ + public boolean isSetTypeQualifiers() { + return this.typeQualifiers != null; + } + + public void setTypeQualifiersIsSet(boolean value) { + if (!value) { + this.typeQualifiers = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((TTypeId)value); + } + break; + + case TYPE_QUALIFIERS: + if (value == null) { + unsetTypeQualifiers(); + } else { + setTypeQualifiers((TTypeQualifiers)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TYPE: + return getType(); + + case TYPE_QUALIFIERS: + return getTypeQualifiers(); + + } + 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 TYPE: + return isSetType(); + case TYPE_QUALIFIERS: + return isSetTypeQualifiers(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPrimitiveTypeEntry) + return this.equals((TPrimitiveTypeEntry)that); + return false; + } + + public boolean equals(TPrimitiveTypeEntry that) { + if (that == null) + return false; + + boolean this_present_type = true && this.isSetType(); + boolean that_present_type = true && that.isSetType(); + if (this_present_type || that_present_type) { + if (!(this_present_type && that_present_type)) + return false; + if (!this.type.equals(that.type)) + return false; + } + + boolean this_present_typeQualifiers = true && this.isSetTypeQualifiers(); + boolean that_present_typeQualifiers = true && that.isSetTypeQualifiers(); + if (this_present_typeQualifiers || that_present_typeQualifiers) { + if (!(this_present_typeQualifiers && that_present_typeQualifiers)) + return false; + if (!this.typeQualifiers.equals(that.typeQualifiers)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_type = true && (isSetType()); + list.add(present_type); + if (present_type) + list.add(type.getValue()); + + boolean present_typeQualifiers = true && (isSetTypeQualifiers()); + list.add(present_typeQualifiers); + if (present_typeQualifiers) + list.add(typeQualifiers); + + return list.hashCode(); + } + + @Override + public int compareTo(TPrimitiveTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypeQualifiers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeQualifiers, other.typeQualifiers); + 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("TPrimitiveTypeEntry("); + boolean first = true; + + sb.append("type:"); + if (this.type == null) { + sb.append("null"); + } else { + sb.append(this.type); + } + first = false; + if (isSetTypeQualifiers()) { + if (!first) sb.append(", "); + sb.append("typeQualifiers:"); + if (this.typeQualifiers == null) { + sb.append("null"); + } else { + sb.append(this.typeQualifiers); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (typeQualifiers != null) { + typeQualifiers.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 TPrimitiveTypeEntryStandardSchemeFactory implements SchemeFactory { + public TPrimitiveTypeEntryStandardScheme getScheme() { + return new TPrimitiveTypeEntryStandardScheme(); + } + } + + private static class TPrimitiveTypeEntryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry 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: // TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.type = TTypeId.findByValue(iprot.readI32()); + struct.setTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TYPE_QUALIFIERS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.typeQualifiers = new TTypeQualifiers(); + struct.typeQualifiers.read(iprot); + struct.setTypeQualifiersIsSet(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, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeI32(struct.type.getValue()); + oprot.writeFieldEnd(); + } + if (struct.typeQualifiers != null) { + if (struct.isSetTypeQualifiers()) { + oprot.writeFieldBegin(TYPE_QUALIFIERS_FIELD_DESC); + struct.typeQualifiers.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPrimitiveTypeEntryTupleSchemeFactory implements SchemeFactory { + public TPrimitiveTypeEntryTupleScheme getScheme() { + return new TPrimitiveTypeEntryTupleScheme(); + } + } + + private static class TPrimitiveTypeEntryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.type.getValue()); + BitSet optionals = new BitSet(); + if (struct.isSetTypeQualifiers()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTypeQualifiers()) { + struct.typeQualifiers.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.type = TTypeId.findByValue(iprot.readI32()); + struct.setTypeIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.typeQualifiers = new TTypeQualifiers(); + struct.typeQualifiers.read(iprot); + struct.setTypeQualifiersIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java new file mode 100644 index 000000000000..c8910d1ad190 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java @@ -0,0 +1,1023 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TProgressUpdateResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TProgressUpdateResp"); + + private static final org.apache.thrift.protocol.TField HEADER_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("headerNames", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField PROGRESSED_PERCENTAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressedPercentage", org.apache.thrift.protocol.TType.DOUBLE, (short)3); + private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField FOOTER_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("footerSummary", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)6); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TProgressUpdateRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TProgressUpdateRespTupleSchemeFactory()); + } + + private List headerNames; // required + private List> rows; // required + private double progressedPercentage; // required + private TJobExecutionStatus status; // required + private String footerSummary; // required + private long startTime; // 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 { + HEADER_NAMES((short)1, "headerNames"), + ROWS((short)2, "rows"), + PROGRESSED_PERCENTAGE((short)3, "progressedPercentage"), + /** + * + * @see TJobExecutionStatus + */ + STATUS((short)4, "status"), + FOOTER_SUMMARY((short)5, "footerSummary"), + START_TIME((short)6, "startTime"); + + 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: // HEADER_NAMES + return HEADER_NAMES; + case 2: // ROWS + return ROWS; + case 3: // PROGRESSED_PERCENTAGE + return PROGRESSED_PERCENTAGE; + case 4: // STATUS + return STATUS; + case 5: // FOOTER_SUMMARY + return FOOTER_SUMMARY; + case 6: // START_TIME + return START_TIME; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __PROGRESSEDPERCENTAGE_ISSET_ID = 0; + private static final int __STARTTIME_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.HEADER_NAMES, new org.apache.thrift.meta_data.FieldMetaData("headerNames", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); + tmpMap.put(_Fields.PROGRESSED_PERCENTAGE, new org.apache.thrift.meta_data.FieldMetaData("progressedPercentage", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TJobExecutionStatus.class))); + tmpMap.put(_Fields.FOOTER_SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("footerSummary", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TProgressUpdateResp.class, metaDataMap); + } + + public TProgressUpdateResp() { + } + + public TProgressUpdateResp( + List headerNames, + List> rows, + double progressedPercentage, + TJobExecutionStatus status, + String footerSummary, + long startTime) + { + this(); + this.headerNames = headerNames; + this.rows = rows; + this.progressedPercentage = progressedPercentage; + setProgressedPercentageIsSet(true); + this.status = status; + this.footerSummary = footerSummary; + this.startTime = startTime; + setStartTimeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TProgressUpdateResp(TProgressUpdateResp other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetHeaderNames()) { + List __this__headerNames = new ArrayList(other.headerNames); + this.headerNames = __this__headerNames; + } + if (other.isSetRows()) { + List> __this__rows = new ArrayList>(other.rows.size()); + for (List other_element : other.rows) { + List __this__rows_copy = new ArrayList(other_element); + __this__rows.add(__this__rows_copy); + } + this.rows = __this__rows; + } + this.progressedPercentage = other.progressedPercentage; + if (other.isSetStatus()) { + this.status = other.status; + } + if (other.isSetFooterSummary()) { + this.footerSummary = other.footerSummary; + } + this.startTime = other.startTime; + } + + public TProgressUpdateResp deepCopy() { + return new TProgressUpdateResp(this); + } + + @Override + public void clear() { + this.headerNames = null; + this.rows = null; + setProgressedPercentageIsSet(false); + this.progressedPercentage = 0.0; + this.status = null; + this.footerSummary = null; + setStartTimeIsSet(false); + this.startTime = 0; + } + + public int getHeaderNamesSize() { + return (this.headerNames == null) ? 0 : this.headerNames.size(); + } + + public java.util.Iterator getHeaderNamesIterator() { + return (this.headerNames == null) ? null : this.headerNames.iterator(); + } + + public void addToHeaderNames(String elem) { + if (this.headerNames == null) { + this.headerNames = new ArrayList(); + } + this.headerNames.add(elem); + } + + public List getHeaderNames() { + return this.headerNames; + } + + public void setHeaderNames(List headerNames) { + this.headerNames = headerNames; + } + + public void unsetHeaderNames() { + this.headerNames = null; + } + + /** Returns true if field headerNames is set (has been assigned a value) and false otherwise */ + public boolean isSetHeaderNames() { + return this.headerNames != null; + } + + public void setHeaderNamesIsSet(boolean value) { + if (!value) { + this.headerNames = null; + } + } + + public int getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + public java.util.Iterator> getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(List elem) { + if (this.rows == null) { + this.rows = new ArrayList>(); + } + this.rows.add(elem); + } + + public List> getRows() { + return this.rows; + } + + public void setRows(List> rows) { + this.rows = rows; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = null; + } + } + + public double getProgressedPercentage() { + return this.progressedPercentage; + } + + public void setProgressedPercentage(double progressedPercentage) { + this.progressedPercentage = progressedPercentage; + setProgressedPercentageIsSet(true); + } + + public void unsetProgressedPercentage() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + } + + /** Returns true if field progressedPercentage is set (has been assigned a value) and false otherwise */ + public boolean isSetProgressedPercentage() { + return EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + } + + public void setProgressedPercentageIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); + } + + /** + * + * @see TJobExecutionStatus + */ + public TJobExecutionStatus getStatus() { + return this.status; + } + + /** + * + * @see TJobExecutionStatus + */ + public void setStatus(TJobExecutionStatus 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 String getFooterSummary() { + return this.footerSummary; + } + + public void setFooterSummary(String footerSummary) { + this.footerSummary = footerSummary; + } + + public void unsetFooterSummary() { + this.footerSummary = null; + } + + /** Returns true if field footerSummary is set (has been assigned a value) and false otherwise */ + public boolean isSetFooterSummary() { + return this.footerSummary != null; + } + + public void setFooterSummaryIsSet(boolean value) { + if (!value) { + this.footerSummary = null; + } + } + + public long getStartTime() { + return this.startTime; + } + + public void setStartTime(long startTime) { + this.startTime = startTime; + setStartTimeIsSet(true); + } + + public void unsetStartTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ + public boolean isSetStartTime() { + return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + public void setStartTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case HEADER_NAMES: + if (value == null) { + unsetHeaderNames(); + } else { + setHeaderNames((List)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((List>)value); + } + break; + + case PROGRESSED_PERCENTAGE: + if (value == null) { + unsetProgressedPercentage(); + } else { + setProgressedPercentage((Double)value); + } + break; + + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TJobExecutionStatus)value); + } + break; + + case FOOTER_SUMMARY: + if (value == null) { + unsetFooterSummary(); + } else { + setFooterSummary((String)value); + } + break; + + case START_TIME: + if (value == null) { + unsetStartTime(); + } else { + setStartTime((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case HEADER_NAMES: + return getHeaderNames(); + + case ROWS: + return getRows(); + + case PROGRESSED_PERCENTAGE: + return getProgressedPercentage(); + + case STATUS: + return getStatus(); + + case FOOTER_SUMMARY: + return getFooterSummary(); + + case START_TIME: + return getStartTime(); + + } + 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 HEADER_NAMES: + return isSetHeaderNames(); + case ROWS: + return isSetRows(); + case PROGRESSED_PERCENTAGE: + return isSetProgressedPercentage(); + case STATUS: + return isSetStatus(); + case FOOTER_SUMMARY: + return isSetFooterSummary(); + case START_TIME: + return isSetStartTime(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TProgressUpdateResp) + return this.equals((TProgressUpdateResp)that); + return false; + } + + public boolean equals(TProgressUpdateResp that) { + if (that == null) + return false; + + boolean this_present_headerNames = true && this.isSetHeaderNames(); + boolean that_present_headerNames = true && that.isSetHeaderNames(); + if (this_present_headerNames || that_present_headerNames) { + if (!(this_present_headerNames && that_present_headerNames)) + return false; + if (!this.headerNames.equals(that.headerNames)) + return false; + } + + boolean this_present_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + return false; + } + + boolean this_present_progressedPercentage = true; + boolean that_present_progressedPercentage = true; + if (this_present_progressedPercentage || that_present_progressedPercentage) { + if (!(this_present_progressedPercentage && that_present_progressedPercentage)) + return false; + if (this.progressedPercentage != that.progressedPercentage) + 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_footerSummary = true && this.isSetFooterSummary(); + boolean that_present_footerSummary = true && that.isSetFooterSummary(); + if (this_present_footerSummary || that_present_footerSummary) { + if (!(this_present_footerSummary && that_present_footerSummary)) + return false; + if (!this.footerSummary.equals(that.footerSummary)) + return false; + } + + boolean this_present_startTime = true; + boolean that_present_startTime = true; + if (this_present_startTime || that_present_startTime) { + if (!(this_present_startTime && that_present_startTime)) + return false; + if (this.startTime != that.startTime) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_headerNames = true && (isSetHeaderNames()); + list.add(present_headerNames); + if (present_headerNames) + list.add(headerNames); + + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); + + boolean present_progressedPercentage = true; + list.add(present_progressedPercentage); + if (present_progressedPercentage) + list.add(progressedPercentage); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status.getValue()); + + boolean present_footerSummary = true && (isSetFooterSummary()); + list.add(present_footerSummary); + if (present_footerSummary) + list.add(footerSummary); + + boolean present_startTime = true; + list.add(present_startTime); + if (present_startTime) + list.add(startTime); + + return list.hashCode(); + } + + @Override + public int compareTo(TProgressUpdateResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHeaderNames()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.headerNames, other.headerNames); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProgressedPercentage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressedPercentage, other.progressedPercentage); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFooterSummary()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.footerSummary, other.footerSummary); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime); + 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("TProgressUpdateResp("); + boolean first = true; + + sb.append("headerNames:"); + if (this.headerNames == null) { + sb.append("null"); + } else { + sb.append(this.headerNames); + } + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + sb.append(this.rows); + } + first = false; + if (!first) sb.append(", "); + sb.append("progressedPercentage:"); + sb.append(this.progressedPercentage); + first = false; + if (!first) sb.append(", "); + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (!first) sb.append(", "); + sb.append("footerSummary:"); + if (this.footerSummary == null) { + sb.append("null"); + } else { + sb.append(this.footerSummary); + } + first = false; + if (!first) sb.append(", "); + sb.append("startTime:"); + sb.append(this.startTime); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetHeaderNames()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'headerNames' is unset! Struct:" + toString()); + } + + if (!isSetRows()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); + } + + if (!isSetProgressedPercentage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'progressedPercentage' is unset! Struct:" + toString()); + } + + if (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + if (!isSetFooterSummary()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'footerSummary' is unset! Struct:" + toString()); + } + + if (!isSetStartTime()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'startTime' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TProgressUpdateRespStandardSchemeFactory implements SchemeFactory { + public TProgressUpdateRespStandardScheme getScheme() { + return new TProgressUpdateRespStandardScheme(); + } + } + + private static class TProgressUpdateRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp 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: // HEADER_NAMES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(); + struct.headerNames = new ArrayList(_list190.size); + String _elem191; + for (int _i192 = 0; _i192 < _list190.size; ++_i192) + { + _elem191 = iprot.readString(); + struct.headerNames.add(_elem191); + } + iprot.readListEnd(); + } + struct.setHeaderNamesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list193 = iprot.readListBegin(); + struct.rows = new ArrayList>(_list193.size); + List _elem194; + for (int _i195 = 0; _i195 < _list193.size; ++_i195) + { + { + org.apache.thrift.protocol.TList _list196 = iprot.readListBegin(); + _elem194 = new ArrayList(_list196.size); + String _elem197; + for (int _i198 = 0; _i198 < _list196.size; ++_i198) + { + _elem197 = iprot.readString(); + _elem194.add(_elem197); + } + iprot.readListEnd(); + } + struct.rows.add(_elem194); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PROGRESSED_PERCENTAGE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.progressedPercentage = iprot.readDouble(); + struct.setProgressedPercentageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.status = TJobExecutionStatus.findByValue(iprot.readI32()); + struct.setStatusIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // FOOTER_SUMMARY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.footerSummary = iprot.readString(); + struct.setFooterSummaryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(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, TProgressUpdateResp struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.headerNames != null) { + oprot.writeFieldBegin(HEADER_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.headerNames.size())); + for (String _iter199 : struct.headerNames) + { + oprot.writeString(_iter199); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.rows.size())); + for (List _iter200 : struct.rows) + { + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter200.size())); + for (String _iter201 : _iter200) + { + oprot.writeString(_iter201); + } + oprot.writeListEnd(); + } + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(PROGRESSED_PERCENTAGE_FIELD_DESC); + oprot.writeDouble(struct.progressedPercentage); + oprot.writeFieldEnd(); + if (struct.status != null) { + oprot.writeFieldBegin(STATUS_FIELD_DESC); + oprot.writeI32(struct.status.getValue()); + oprot.writeFieldEnd(); + } + if (struct.footerSummary != null) { + oprot.writeFieldBegin(FOOTER_SUMMARY_FIELD_DESC); + oprot.writeString(struct.footerSummary); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(START_TIME_FIELD_DESC); + oprot.writeI64(struct.startTime); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TProgressUpdateRespTupleSchemeFactory implements SchemeFactory { + public TProgressUpdateRespTupleScheme getScheme() { + return new TProgressUpdateRespTupleScheme(); + } + } + + private static class TProgressUpdateRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.headerNames.size()); + for (String _iter202 : struct.headerNames) + { + oprot.writeString(_iter202); + } + } + { + oprot.writeI32(struct.rows.size()); + for (List _iter203 : struct.rows) + { + { + oprot.writeI32(_iter203.size()); + for (String _iter204 : _iter203) + { + oprot.writeString(_iter204); + } + } + } + } + oprot.writeDouble(struct.progressedPercentage); + oprot.writeI32(struct.status.getValue()); + oprot.writeString(struct.footerSummary); + oprot.writeI64(struct.startTime); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list205 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.headerNames = new ArrayList(_list205.size); + String _elem206; + for (int _i207 = 0; _i207 < _list205.size; ++_i207) + { + _elem206 = iprot.readString(); + struct.headerNames.add(_elem206); + } + } + struct.setHeaderNamesIsSet(true); + { + org.apache.thrift.protocol.TList _list208 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.rows = new ArrayList>(_list208.size); + List _elem209; + for (int _i210 = 0; _i210 < _list208.size; ++_i210) + { + { + org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + _elem209 = new ArrayList(_list211.size); + String _elem212; + for (int _i213 = 0; _i213 < _list211.size; ++_i213) + { + _elem212 = iprot.readString(); + _elem209.add(_elem212); + } + } + struct.rows.add(_elem209); + } + } + struct.setRowsIsSet(true); + struct.progressedPercentage = iprot.readDouble(); + struct.setProgressedPercentageIsSet(true); + struct.status = TJobExecutionStatus.findByValue(iprot.readI32()); + struct.setStatusIsSet(true); + struct.footerSummary = iprot.readString(); + struct.setFooterSummaryIsSet(true); + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProtocolVersion.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProtocolVersion.java new file mode 100644 index 000000000000..de8792888b66 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProtocolVersion.java @@ -0,0 +1,68 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TProtocolVersion implements org.apache.thrift.TEnum { + HIVE_CLI_SERVICE_PROTOCOL_V1(0), + HIVE_CLI_SERVICE_PROTOCOL_V2(1), + HIVE_CLI_SERVICE_PROTOCOL_V3(2), + HIVE_CLI_SERVICE_PROTOCOL_V4(3), + HIVE_CLI_SERVICE_PROTOCOL_V5(4), + HIVE_CLI_SERVICE_PROTOCOL_V6(5), + HIVE_CLI_SERVICE_PROTOCOL_V7(6), + HIVE_CLI_SERVICE_PROTOCOL_V8(7), + HIVE_CLI_SERVICE_PROTOCOL_V9(8), + HIVE_CLI_SERVICE_PROTOCOL_V10(9), + HIVE_CLI_SERVICE_PROTOCOL_V11(10); + + private final int value; + + private TProtocolVersion(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TProtocolVersion findByValue(int value) { + switch (value) { + case 0: + return HIVE_CLI_SERVICE_PROTOCOL_V1; + case 1: + return HIVE_CLI_SERVICE_PROTOCOL_V2; + case 2: + return HIVE_CLI_SERVICE_PROTOCOL_V3; + case 3: + return HIVE_CLI_SERVICE_PROTOCOL_V4; + case 4: + return HIVE_CLI_SERVICE_PROTOCOL_V5; + case 5: + return HIVE_CLI_SERVICE_PROTOCOL_V6; + case 6: + return HIVE_CLI_SERVICE_PROTOCOL_V7; + case 7: + return HIVE_CLI_SERVICE_PROTOCOL_V8; + case 8: + return HIVE_CLI_SERVICE_PROTOCOL_V9; + case 9: + return HIVE_CLI_SERVICE_PROTOCOL_V10; + case 10: + return HIVE_CLI_SERVICE_PROTOCOL_V11; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java new file mode 100644 index 000000000000..9be39d344981 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java @@ -0,0 +1,484 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenReq"); + + 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRenewDelegationTokenReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRenewDelegationTokenReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private String delegationToken; // 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"), + DELEGATION_TOKEN((short)2, "delegationToken"); + + 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: // DELEGATION_TOKEN + return DELEGATION_TOKEN; + 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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenReq.class, metaDataMap); + } + + public TRenewDelegationTokenReq() { + } + + public TRenewDelegationTokenReq( + TSessionHandle sessionHandle, + String delegationToken) + { + this(); + this.sessionHandle = sessionHandle; + this.delegationToken = delegationToken; + } + + /** + * Performs a deep copy on other. + */ + public TRenewDelegationTokenReq(TRenewDelegationTokenReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetDelegationToken()) { + this.delegationToken = other.delegationToken; + } + } + + public TRenewDelegationTokenReq deepCopy() { + return new TRenewDelegationTokenReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.delegationToken = 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 String getDelegationToken() { + return this.delegationToken; + } + + public void setDelegationToken(String delegationToken) { + this.delegationToken = delegationToken; + } + + public void unsetDelegationToken() { + this.delegationToken = null; + } + + /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ + public boolean isSetDelegationToken() { + return this.delegationToken != null; + } + + public void setDelegationTokenIsSet(boolean value) { + if (!value) { + this.delegationToken = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case DELEGATION_TOKEN: + if (value == null) { + unsetDelegationToken(); + } else { + setDelegationToken((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case DELEGATION_TOKEN: + return getDelegationToken(); + + } + 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 DELEGATION_TOKEN: + return isSetDelegationToken(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRenewDelegationTokenReq) + return this.equals((TRenewDelegationTokenReq)that); + return false; + } + + public boolean equals(TRenewDelegationTokenReq 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_delegationToken = true && this.isSetDelegationToken(); + boolean that_present_delegationToken = true && that.isSetDelegationToken(); + if (this_present_delegationToken || that_present_delegationToken) { + if (!(this_present_delegationToken && that_present_delegationToken)) + return false; + if (!this.delegationToken.equals(that.delegationToken)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_delegationToken = true && (isSetDelegationToken()); + list.add(present_delegationToken); + if (present_delegationToken) + list.add(delegationToken); + + return list.hashCode(); + } + + @Override + public int compareTo(TRenewDelegationTokenReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelegationToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); + 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("TRenewDelegationTokenReq("); + 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("delegationToken:"); + if (this.delegationToken == null) { + sb.append("null"); + } else { + sb.append(this.delegationToken); + } + 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 (!isSetDelegationToken()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TRenewDelegationTokenReqStandardSchemeFactory implements SchemeFactory { + public TRenewDelegationTokenReqStandardScheme getScheme() { + return new TRenewDelegationTokenReqStandardScheme(); + } + } + + private static class TRenewDelegationTokenReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenReq 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: // DELEGATION_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(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, TRenewDelegationTokenReq 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.delegationToken != null) { + oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); + oprot.writeString(struct.delegationToken); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRenewDelegationTokenReqTupleSchemeFactory implements SchemeFactory { + public TRenewDelegationTokenReqTupleScheme getScheme() { + return new TRenewDelegationTokenReqTupleScheme(); + } + } + + private static class TRenewDelegationTokenReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.delegationToken); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java new file mode 100644 index 000000000000..35af8a6c17f0 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRenewDelegationTokenRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRenewDelegationTokenRespTupleSchemeFactory()); + } + + private TStatus status; // 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 { + STATUS((short)1, "status"); + + 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; + 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.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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenResp.class, metaDataMap); + } + + public TRenewDelegationTokenResp() { + } + + public TRenewDelegationTokenResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TRenewDelegationTokenResp(TRenewDelegationTokenResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TRenewDelegationTokenResp deepCopy() { + return new TRenewDelegationTokenResp(this); + } + + @Override + public void clear() { + this.status = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRenewDelegationTokenResp) + return this.equals((TRenewDelegationTokenResp)that); + return false; + } + + public boolean equals(TRenewDelegationTokenResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + return list.hashCode(); + } + + @Override + public int compareTo(TRenewDelegationTokenResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + 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("TRenewDelegationTokenResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TRenewDelegationTokenRespStandardSchemeFactory implements SchemeFactory { + public TRenewDelegationTokenRespStandardScheme getScheme() { + return new TRenewDelegationTokenRespStandardScheme(); + } + } + + private static class TRenewDelegationTokenRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenResp 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; + 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, TRenewDelegationTokenResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRenewDelegationTokenRespTupleSchemeFactory implements SchemeFactory { + public TRenewDelegationTokenRespTupleScheme getScheme() { + return new TRenewDelegationTokenRespTupleScheme(); + } + } + + private static class TRenewDelegationTokenRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRow.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRow.java new file mode 100644 index 000000000000..74518ac9f615 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRow.java @@ -0,0 +1,432 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); + + private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRowStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRowTupleSchemeFactory()); + } + + private List colVals; // 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 { + COL_VALS((short)1, "colVals"); + + 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: // COL_VALS + return COL_VALS; + 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.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); + } + + public TRow() { + } + + public TRow( + List colVals) + { + this(); + this.colVals = colVals; + } + + /** + * Performs a deep copy on other. + */ + public TRow(TRow other) { + if (other.isSetColVals()) { + List __this__colVals = new ArrayList(other.colVals.size()); + for (TColumnValue other_element : other.colVals) { + __this__colVals.add(new TColumnValue(other_element)); + } + this.colVals = __this__colVals; + } + } + + public TRow deepCopy() { + return new TRow(this); + } + + @Override + public void clear() { + this.colVals = null; + } + + public int getColValsSize() { + return (this.colVals == null) ? 0 : this.colVals.size(); + } + + public java.util.Iterator getColValsIterator() { + return (this.colVals == null) ? null : this.colVals.iterator(); + } + + public void addToColVals(TColumnValue elem) { + if (this.colVals == null) { + this.colVals = new ArrayList(); + } + this.colVals.add(elem); + } + + public List getColVals() { + return this.colVals; + } + + public void setColVals(List colVals) { + this.colVals = colVals; + } + + public void unsetColVals() { + this.colVals = null; + } + + /** Returns true if field colVals is set (has been assigned a value) and false otherwise */ + public boolean isSetColVals() { + return this.colVals != null; + } + + public void setColValsIsSet(boolean value) { + if (!value) { + this.colVals = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case COL_VALS: + if (value == null) { + unsetColVals(); + } else { + setColVals((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case COL_VALS: + return getColVals(); + + } + 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 COL_VALS: + return isSetColVals(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRow) + return this.equals((TRow)that); + return false; + } + + public boolean equals(TRow that) { + if (that == null) + return false; + + boolean this_present_colVals = true && this.isSetColVals(); + boolean that_present_colVals = true && that.isSetColVals(); + if (this_present_colVals || that_present_colVals) { + if (!(this_present_colVals && that_present_colVals)) + return false; + if (!this.colVals.equals(that.colVals)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_colVals = true && (isSetColVals()); + list.add(present_colVals); + if (present_colVals) + list.add(colVals); + + return list.hashCode(); + } + + @Override + public int compareTo(TRow other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColVals()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVals, other.colVals); + 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("TRow("); + boolean first = true; + + sb.append("colVals:"); + if (this.colVals == null) { + sb.append("null"); + } else { + sb.append(this.colVals); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetColVals()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'colVals' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TRowStandardSchemeFactory implements SchemeFactory { + public TRowStandardScheme getScheme() { + return new TRowStandardScheme(); + } + } + + private static class TRowStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRow 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: // COL_VALS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); + struct.colVals = new ArrayList(_list46.size); + TColumnValue _elem47; + for (int _i48 = 0; _i48 < _list46.size; ++_i48) + { + _elem47 = new TColumnValue(); + _elem47.read(iprot); + struct.colVals.add(_elem47); + } + iprot.readListEnd(); + } + struct.setColValsIsSet(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, TRow struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.colVals != null) { + oprot.writeFieldBegin(COL_VALS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.colVals.size())); + for (TColumnValue _iter49 : struct.colVals) + { + _iter49.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRowTupleSchemeFactory implements SchemeFactory { + public TRowTupleScheme getScheme() { + return new TRowTupleScheme(); + } + } + + private static class TRowTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.colVals.size()); + for (TColumnValue _iter50 : struct.colVals) + { + _iter50.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.colVals = new ArrayList(_list51.size); + TColumnValue _elem52; + for (int _i53 = 0; _i53 < _list51.size; ++_i53) + { + _elem52 = new TColumnValue(); + _elem52.read(iprot); + struct.colVals.add(_elem52); + } + } + struct.setColValsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRowSet.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRowSet.java new file mode 100644 index 000000000000..e9fc50bebbc6 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRowSet.java @@ -0,0 +1,913 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); + + private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField BINARY_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumns", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField COLUMN_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("columnCount", org.apache.thrift.protocol.TType.I32, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRowSetStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRowSetTupleSchemeFactory()); + } + + private long startRowOffset; // required + private List rows; // required + private List columns; // optional + private ByteBuffer binaryColumns; // optional + private int columnCount; // 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 { + START_ROW_OFFSET((short)1, "startRowOffset"), + ROWS((short)2, "rows"), + COLUMNS((short)3, "columns"), + BINARY_COLUMNS((short)4, "binaryColumns"), + COLUMN_COUNT((short)5, "columnCount"); + + 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: // START_ROW_OFFSET + return START_ROW_OFFSET; + case 2: // ROWS + return ROWS; + case 3: // COLUMNS + return COLUMNS; + case 4: // BINARY_COLUMNS + return BINARY_COLUMNS; + case 5: // COLUMN_COUNT + return COLUMN_COUNT; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __STARTROWOFFSET_ISSET_ID = 0; + private static final int __COLUMNCOUNT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.BINARY_COLUMNS,_Fields.COLUMN_COUNT}; + 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.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRow.class)))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class)))); + tmpMap.put(_Fields.BINARY_COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("binaryColumns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.COLUMN_COUNT, new org.apache.thrift.meta_data.FieldMetaData("columnCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); + } + + public TRowSet() { + } + + public TRowSet( + long startRowOffset, + List rows) + { + this(); + this.startRowOffset = startRowOffset; + setStartRowOffsetIsSet(true); + this.rows = rows; + } + + /** + * Performs a deep copy on other. + */ + public TRowSet(TRowSet other) { + __isset_bitfield = other.__isset_bitfield; + this.startRowOffset = other.startRowOffset; + if (other.isSetRows()) { + List __this__rows = new ArrayList(other.rows.size()); + for (TRow other_element : other.rows) { + __this__rows.add(new TRow(other_element)); + } + this.rows = __this__rows; + } + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (TColumn other_element : other.columns) { + __this__columns.add(new TColumn(other_element)); + } + this.columns = __this__columns; + } + if (other.isSetBinaryColumns()) { + this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(other.binaryColumns); + } + this.columnCount = other.columnCount; + } + + public TRowSet deepCopy() { + return new TRowSet(this); + } + + @Override + public void clear() { + setStartRowOffsetIsSet(false); + this.startRowOffset = 0; + this.rows = null; + this.columns = null; + this.binaryColumns = null; + setColumnCountIsSet(false); + this.columnCount = 0; + } + + public long getStartRowOffset() { + return this.startRowOffset; + } + + public void setStartRowOffset(long startRowOffset) { + this.startRowOffset = startRowOffset; + setStartRowOffsetIsSet(true); + } + + public void unsetStartRowOffset() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + } + + /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRowOffset() { + return EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + } + + public void setStartRowOffsetIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); + } + + public int getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + public java.util.Iterator getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(TRow elem) { + if (this.rows == null) { + this.rows = new ArrayList(); + } + this.rows.add(elem); + } + + public List getRows() { + return this.rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumn elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + public void unsetColumns() { + this.columns = null; + } + + /** Returns true if field columns is set (has been assigned a value) and false otherwise */ + public boolean isSetColumns() { + return this.columns != null; + } + + public void setColumnsIsSet(boolean value) { + if (!value) { + this.columns = null; + } + } + + public byte[] getBinaryColumns() { + setBinaryColumns(org.apache.thrift.TBaseHelper.rightSize(binaryColumns)); + return binaryColumns == null ? null : binaryColumns.array(); + } + + public ByteBuffer bufferForBinaryColumns() { + return org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); + } + + public void setBinaryColumns(byte[] binaryColumns) { + this.binaryColumns = binaryColumns == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(binaryColumns, binaryColumns.length)); + } + + public void setBinaryColumns(ByteBuffer binaryColumns) { + this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); + } + + public void unsetBinaryColumns() { + this.binaryColumns = null; + } + + /** Returns true if field binaryColumns is set (has been assigned a value) and false otherwise */ + public boolean isSetBinaryColumns() { + return this.binaryColumns != null; + } + + public void setBinaryColumnsIsSet(boolean value) { + if (!value) { + this.binaryColumns = null; + } + } + + public int getColumnCount() { + return this.columnCount; + } + + public void setColumnCount(int columnCount) { + this.columnCount = columnCount; + setColumnCountIsSet(true); + } + + public void unsetColumnCount() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + } + + /** Returns true if field columnCount is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnCount() { + return EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + } + + public void setColumnCountIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case START_ROW_OFFSET: + if (value == null) { + unsetStartRowOffset(); + } else { + setStartRowOffset((Long)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((List)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + case BINARY_COLUMNS: + if (value == null) { + unsetBinaryColumns(); + } else { + setBinaryColumns((ByteBuffer)value); + } + break; + + case COLUMN_COUNT: + if (value == null) { + unsetColumnCount(); + } else { + setColumnCount((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case START_ROW_OFFSET: + return getStartRowOffset(); + + case ROWS: + return getRows(); + + case COLUMNS: + return getColumns(); + + case BINARY_COLUMNS: + return getBinaryColumns(); + + case COLUMN_COUNT: + return getColumnCount(); + + } + 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 START_ROW_OFFSET: + return isSetStartRowOffset(); + case ROWS: + return isSetRows(); + case COLUMNS: + return isSetColumns(); + case BINARY_COLUMNS: + return isSetBinaryColumns(); + case COLUMN_COUNT: + return isSetColumnCount(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TRowSet) + return this.equals((TRowSet)that); + return false; + } + + public boolean equals(TRowSet that) { + if (that == null) + return false; + + boolean this_present_startRowOffset = true; + boolean that_present_startRowOffset = true; + if (this_present_startRowOffset || that_present_startRowOffset) { + if (!(this_present_startRowOffset && that_present_startRowOffset)) + return false; + if (this.startRowOffset != that.startRowOffset) + return false; + } + + boolean this_present_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + return false; + } + + boolean this_present_columns = true && this.isSetColumns(); + boolean that_present_columns = true && that.isSetColumns(); + if (this_present_columns || that_present_columns) { + if (!(this_present_columns && that_present_columns)) + return false; + if (!this.columns.equals(that.columns)) + return false; + } + + boolean this_present_binaryColumns = true && this.isSetBinaryColumns(); + boolean that_present_binaryColumns = true && that.isSetBinaryColumns(); + if (this_present_binaryColumns || that_present_binaryColumns) { + if (!(this_present_binaryColumns && that_present_binaryColumns)) + return false; + if (!this.binaryColumns.equals(that.binaryColumns)) + return false; + } + + boolean this_present_columnCount = true && this.isSetColumnCount(); + boolean that_present_columnCount = true && that.isSetColumnCount(); + if (this_present_columnCount || that_present_columnCount) { + if (!(this_present_columnCount && that_present_columnCount)) + return false; + if (this.columnCount != that.columnCount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_startRowOffset = true; + list.add(present_startRowOffset); + if (present_startRowOffset) + list.add(startRowOffset); + + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + boolean present_binaryColumns = true && (isSetBinaryColumns()); + list.add(present_binaryColumns); + if (present_binaryColumns) + list.add(binaryColumns); + + boolean present_columnCount = true && (isSetColumnCount()); + list.add(present_columnCount); + if (present_columnCount) + list.add(columnCount); + + return list.hashCode(); + } + + @Override + public int compareTo(TRowSet other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRowOffset()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, other.startRowOffset); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBinaryColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryColumns, other.binaryColumns); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnCount, other.columnCount); + 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("TRowSet("); + boolean first = true; + + sb.append("startRowOffset:"); + sb.append(this.startRowOffset); + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + sb.append(this.rows); + } + first = false; + if (isSetColumns()) { + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + sb.append(this.columns); + } + first = false; + } + if (isSetBinaryColumns()) { + if (!first) sb.append(", "); + sb.append("binaryColumns:"); + if (this.binaryColumns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.binaryColumns, sb); + } + first = false; + } + if (isSetColumnCount()) { + if (!first) sb.append(", "); + sb.append("columnCount:"); + sb.append(this.columnCount); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetStartRowOffset()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'startRowOffset' is unset! Struct:" + toString()); + } + + if (!isSetRows()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TRowSetStandardSchemeFactory implements SchemeFactory { + public TRowSetStandardScheme getScheme() { + return new TRowSetStandardScheme(); + } + } + + private static class TRowSetStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet 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: // START_ROW_OFFSET + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startRowOffset = iprot.readI64(); + struct.setStartRowOffsetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); + struct.rows = new ArrayList(_list118.size); + TRow _elem119; + for (int _i120 = 0; _i120 < _list118.size; ++_i120) + { + _elem119 = new TRow(); + _elem119.read(iprot); + struct.rows.add(_elem119); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); + struct.columns = new ArrayList(_list121.size); + TColumn _elem122; + for (int _i123 = 0; _i123 < _list121.size; ++_i123) + { + _elem122 = new TColumn(); + _elem122.read(iprot); + struct.columns.add(_elem122); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // BINARY_COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.binaryColumns = iprot.readBinary(); + struct.setBinaryColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COLUMN_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.columnCount = iprot.readI32(); + struct.setColumnCountIsSet(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, TRowSet struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC); + oprot.writeI64(struct.startRowOffset); + oprot.writeFieldEnd(); + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); + for (TRow _iter124 : struct.rows) + { + _iter124.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + if (struct.isSetColumns()) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (TColumn _iter125 : struct.columns) + { + _iter125.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.binaryColumns != null) { + if (struct.isSetBinaryColumns()) { + oprot.writeFieldBegin(BINARY_COLUMNS_FIELD_DESC); + oprot.writeBinary(struct.binaryColumns); + oprot.writeFieldEnd(); + } + } + if (struct.isSetColumnCount()) { + oprot.writeFieldBegin(COLUMN_COUNT_FIELD_DESC); + oprot.writeI32(struct.columnCount); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRowSetTupleSchemeFactory implements SchemeFactory { + public TRowSetTupleScheme getScheme() { + return new TRowSetTupleScheme(); + } + } + + private static class TRowSetTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI64(struct.startRowOffset); + { + oprot.writeI32(struct.rows.size()); + for (TRow _iter126 : struct.rows) + { + _iter126.write(oprot); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetColumns()) { + optionals.set(0); + } + if (struct.isSetBinaryColumns()) { + optionals.set(1); + } + if (struct.isSetColumnCount()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (TColumn _iter127 : struct.columns) + { + _iter127.write(oprot); + } + } + } + if (struct.isSetBinaryColumns()) { + oprot.writeBinary(struct.binaryColumns); + } + if (struct.isSetColumnCount()) { + oprot.writeI32(struct.columnCount); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.startRowOffset = iprot.readI64(); + struct.setStartRowOffsetIsSet(true); + { + org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.rows = new ArrayList(_list128.size); + TRow _elem129; + for (int _i130 = 0; _i130 < _list128.size; ++_i130) + { + _elem129 = new TRow(); + _elem129.read(iprot); + struct.rows.add(_elem129); + } + } + struct.setRowsIsSet(true); + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list131.size); + TColumn _elem132; + for (int _i133 = 0; _i133 < _list131.size; ++_i133) + { + _elem132 = new TColumn(); + _elem132.read(iprot); + struct.columns.add(_elem132); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(1)) { + struct.binaryColumns = iprot.readBinary(); + struct.setBinaryColumnsIsSet(true); + } + if (incoming.get(2)) { + struct.columnCount = iprot.readI32(); + struct.setColumnCountIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSessionHandle.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSessionHandle.java new file mode 100644 index 000000000000..ec092b46dcfd --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSessionHandle.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionHandle"); + + private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TSessionHandleStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TSessionHandleTupleSchemeFactory()); + } + + private THandleIdentifier sessionId; // 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_ID((short)1, "sessionId"); + + 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_ID + return SESSION_ID; + 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_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionHandle.class, metaDataMap); + } + + public TSessionHandle() { + } + + public TSessionHandle( + THandleIdentifier sessionId) + { + this(); + this.sessionId = sessionId; + } + + /** + * Performs a deep copy on other. + */ + public TSessionHandle(TSessionHandle other) { + if (other.isSetSessionId()) { + this.sessionId = new THandleIdentifier(other.sessionId); + } + } + + public TSessionHandle deepCopy() { + return new TSessionHandle(this); + } + + @Override + public void clear() { + this.sessionId = null; + } + + public THandleIdentifier getSessionId() { + return this.sessionId; + } + + public void setSessionId(THandleIdentifier sessionId) { + this.sessionId = sessionId; + } + + public void unsetSessionId() { + this.sessionId = null; + } + + /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionId() { + return this.sessionId != null; + } + + public void setSessionIdIsSet(boolean value) { + if (!value) { + this.sessionId = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_ID: + if (value == null) { + unsetSessionId(); + } else { + setSessionId((THandleIdentifier)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_ID: + return getSessionId(); + + } + 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_ID: + return isSetSessionId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TSessionHandle) + return this.equals((TSessionHandle)that); + return false; + } + + public boolean equals(TSessionHandle that) { + if (that == null) + return false; + + boolean this_present_sessionId = true && this.isSetSessionId(); + boolean that_present_sessionId = true && that.isSetSessionId(); + if (this_present_sessionId || that_present_sessionId) { + if (!(this_present_sessionId && that_present_sessionId)) + return false; + if (!this.sessionId.equals(that.sessionId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionId = true && (isSetSessionId()); + list.add(present_sessionId); + if (present_sessionId) + list.add(sessionId); + + return list.hashCode(); + } + + @Override + public int compareTo(TSessionHandle other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId); + 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("TSessionHandle("); + boolean first = true; + + sb.append("sessionId:"); + if (this.sessionId == null) { + sb.append("null"); + } else { + sb.append(this.sessionId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetSessionId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionId' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionId != null) { + sessionId.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 TSessionHandleStandardSchemeFactory implements SchemeFactory { + public TSessionHandleStandardScheme getScheme() { + return new TSessionHandleStandardScheme(); + } + } + + private static class TSessionHandleStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionHandle 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_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sessionId = new THandleIdentifier(); + struct.sessionId.read(iprot); + struct.setSessionIdIsSet(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, TSessionHandle struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.sessionId != null) { + oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); + struct.sessionId.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TSessionHandleTupleSchemeFactory implements SchemeFactory { + public TSessionHandleTupleScheme getScheme() { + return new TSessionHandleTupleScheme(); + } + } + + private static class TSessionHandleTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionId.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionId = new THandleIdentifier(); + struct.sessionId.read(iprot); + struct.setSessionIdIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java new file mode 100644 index 000000000000..665e6dfe5ab8 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java @@ -0,0 +1,546 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TSetClientInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoReq"); + + 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 CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TSetClientInfoReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TSetClientInfoReqTupleSchemeFactory()); + } + + private TSessionHandle sessionHandle; // required + private Map configuration; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CONFIGURATION((short)2, "configuration"); + + 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: // CONFIGURATION + return CONFIGURATION; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CONFIGURATION}; + 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.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoReq.class, metaDataMap); + } + + public TSetClientInfoReq() { + } + + public TSetClientInfoReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TSetClientInfoReq(TSetClientInfoReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetConfiguration()) { + Map __this__configuration = new HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TSetClientInfoReq deepCopy() { + return new TSetClientInfoReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.configuration = 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 int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(String key, String val) { + if (this.configuration == null) { + this.configuration = new HashMap(); + } + this.configuration.put(key, val); + } + + public Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CONFIGURATION: + return getConfiguration(); + + } + 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 CONFIGURATION: + return isSetConfiguration(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TSetClientInfoReq) + return this.equals((TSetClientInfoReq)that); + return false; + } + + public boolean equals(TSetClientInfoReq 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_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); + + return list.hashCode(); + } + + @Override + public int compareTo(TSetClientInfoReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + 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("TSetClientInfoReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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 TSetClientInfoReqStandardSchemeFactory implements SchemeFactory { + public TSetClientInfoReqStandardScheme getScheme() { + return new TSetClientInfoReqStandardScheme(); + } + } + + private static class TSetClientInfoReqStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoReq 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: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); + struct.configuration = new HashMap(2*_map162.size); + String _key163; + String _val164; + for (int _i165 = 0; _i165 < _map162.size; ++_i165) + { + _key163 = iprot.readString(); + _val164 = iprot.readString(); + struct.configuration.put(_key163, _val164); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(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, TSetClientInfoReq 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.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (Map.Entry _iter166 : struct.configuration.entrySet()) + { + oprot.writeString(_iter166.getKey()); + oprot.writeString(_iter166.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TSetClientInfoReqTupleSchemeFactory implements SchemeFactory { + public TSetClientInfoReqTupleScheme getScheme() { + return new TSetClientInfoReqTupleScheme(); + } + } + + private static class TSetClientInfoReqTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + BitSet optionals = new BitSet(); + if (struct.isSetConfiguration()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (Map.Entry _iter167 : struct.configuration.entrySet()) + { + oprot.writeString(_iter167.getKey()); + oprot.writeString(_iter167.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new HashMap(2*_map168.size); + String _key169; + String _val170; + for (int _i171 = 0; _i171 < _map168.size; ++_i171) + { + _key169 = iprot.readString(); + _val170 = iprot.readString(); + struct.configuration.put(_key169, _val170); + } + } + struct.setConfigurationIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java new file mode 100644 index 000000000000..633a4be94a30 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TSetClientInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoResp"); + + 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TSetClientInfoRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TSetClientInfoRespTupleSchemeFactory()); + } + + private TStatus status; // 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 { + STATUS((short)1, "status"); + + 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; + 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.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))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoResp.class, metaDataMap); + } + + public TSetClientInfoResp() { + } + + public TSetClientInfoResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TSetClientInfoResp(TSetClientInfoResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TSetClientInfoResp deepCopy() { + return new TSetClientInfoResp(this); + } + + @Override + public void clear() { + this.status = 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 void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + 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(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TSetClientInfoResp) + return this.equals((TSetClientInfoResp)that); + return false; + } + + public boolean equals(TSetClientInfoResp 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; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); + + return list.hashCode(); + } + + @Override + public int compareTo(TSetClientInfoResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + 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("TSetClientInfoResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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 TSetClientInfoRespStandardSchemeFactory implements SchemeFactory { + public TSetClientInfoRespStandardScheme getScheme() { + return new TSetClientInfoRespStandardScheme(); + } + } + + private static class TSetClientInfoRespStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoResp 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; + 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, TSetClientInfoResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TSetClientInfoRespTupleSchemeFactory implements SchemeFactory { + public TSetClientInfoRespTupleScheme getScheme() { + return new TSetClientInfoRespTupleScheme(); + } + } + + private static class TSetClientInfoRespTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatus.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatus.java new file mode 100644 index 000000000000..70d6ab1321a4 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatus.java @@ -0,0 +1,866 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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.EncodingUtils; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus"); + + private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField INFO_MESSAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("infoMessages", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStatusStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStatusTupleSchemeFactory()); + } + + private TStatusCode statusCode; // required + private List infoMessages; // optional + private String sqlState; // optional + private int errorCode; // optional + private String errorMessage; // 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 { + /** + * + * @see TStatusCode + */ + STATUS_CODE((short)1, "statusCode"), + INFO_MESSAGES((short)2, "infoMessages"), + SQL_STATE((short)3, "sqlState"), + ERROR_CODE((short)4, "errorCode"), + ERROR_MESSAGE((short)5, "errorMessage"); + + 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_CODE + return STATUS_CODE; + case 2: // INFO_MESSAGES + return INFO_MESSAGES; + case 3: // SQL_STATE + return SQL_STATE; + case 4: // ERROR_CODE + return ERROR_CODE; + case 5: // ERROR_MESSAGE + return ERROR_MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERRORCODE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; + 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_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class))); + tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap); + } + + public TStatus() { + } + + public TStatus( + TStatusCode statusCode) + { + this(); + this.statusCode = statusCode; + } + + /** + * Performs a deep copy on other. + */ + public TStatus(TStatus other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStatusCode()) { + this.statusCode = other.statusCode; + } + if (other.isSetInfoMessages()) { + List __this__infoMessages = new ArrayList(other.infoMessages); + this.infoMessages = __this__infoMessages; + } + if (other.isSetSqlState()) { + this.sqlState = other.sqlState; + } + this.errorCode = other.errorCode; + if (other.isSetErrorMessage()) { + this.errorMessage = other.errorMessage; + } + } + + public TStatus deepCopy() { + return new TStatus(this); + } + + @Override + public void clear() { + this.statusCode = null; + this.infoMessages = null; + this.sqlState = null; + setErrorCodeIsSet(false); + this.errorCode = 0; + this.errorMessage = null; + } + + /** + * + * @see TStatusCode + */ + public TStatusCode getStatusCode() { + return this.statusCode; + } + + /** + * + * @see TStatusCode + */ + public void setStatusCode(TStatusCode statusCode) { + this.statusCode = statusCode; + } + + public void unsetStatusCode() { + this.statusCode = null; + } + + /** Returns true if field statusCode is set (has been assigned a value) and false otherwise */ + public boolean isSetStatusCode() { + return this.statusCode != null; + } + + public void setStatusCodeIsSet(boolean value) { + if (!value) { + this.statusCode = null; + } + } + + public int getInfoMessagesSize() { + return (this.infoMessages == null) ? 0 : this.infoMessages.size(); + } + + public java.util.Iterator getInfoMessagesIterator() { + return (this.infoMessages == null) ? null : this.infoMessages.iterator(); + } + + public void addToInfoMessages(String elem) { + if (this.infoMessages == null) { + this.infoMessages = new ArrayList(); + } + this.infoMessages.add(elem); + } + + public List getInfoMessages() { + return this.infoMessages; + } + + public void setInfoMessages(List infoMessages) { + this.infoMessages = infoMessages; + } + + public void unsetInfoMessages() { + this.infoMessages = null; + } + + /** Returns true if field infoMessages is set (has been assigned a value) and false otherwise */ + public boolean isSetInfoMessages() { + return this.infoMessages != null; + } + + public void setInfoMessagesIsSet(boolean value) { + if (!value) { + this.infoMessages = null; + } + } + + public String getSqlState() { + return this.sqlState; + } + + public void setSqlState(String sqlState) { + this.sqlState = sqlState; + } + + public void unsetSqlState() { + this.sqlState = null; + } + + /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ + public boolean isSetSqlState() { + return this.sqlState != null; + } + + public void setSqlStateIsSet(boolean value) { + if (!value) { + this.sqlState = null; + } + } + + public int getErrorCode() { + return this.errorCode; + } + + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + setErrorCodeIsSet(true); + } + + public void unsetErrorCode() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorCode() { + return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + public void setErrorCodeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + } + + public String getErrorMessage() { + return this.errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public void unsetErrorMessage() { + this.errorMessage = null; + } + + /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorMessage() { + return this.errorMessage != null; + } + + public void setErrorMessageIsSet(boolean value) { + if (!value) { + this.errorMessage = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case STATUS_CODE: + if (value == null) { + unsetStatusCode(); + } else { + setStatusCode((TStatusCode)value); + } + break; + + case INFO_MESSAGES: + if (value == null) { + unsetInfoMessages(); + } else { + setInfoMessages((List)value); + } + break; + + case SQL_STATE: + if (value == null) { + unsetSqlState(); + } else { + setSqlState((String)value); + } + break; + + case ERROR_CODE: + if (value == null) { + unsetErrorCode(); + } else { + setErrorCode((Integer)value); + } + break; + + case ERROR_MESSAGE: + if (value == null) { + unsetErrorMessage(); + } else { + setErrorMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case STATUS_CODE: + return getStatusCode(); + + case INFO_MESSAGES: + return getInfoMessages(); + + case SQL_STATE: + return getSqlState(); + + case ERROR_CODE: + return getErrorCode(); + + case ERROR_MESSAGE: + return getErrorMessage(); + + } + 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_CODE: + return isSetStatusCode(); + case INFO_MESSAGES: + return isSetInfoMessages(); + case SQL_STATE: + return isSetSqlState(); + case ERROR_CODE: + return isSetErrorCode(); + case ERROR_MESSAGE: + return isSetErrorMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TStatus) + return this.equals((TStatus)that); + return false; + } + + public boolean equals(TStatus that) { + if (that == null) + return false; + + boolean this_present_statusCode = true && this.isSetStatusCode(); + boolean that_present_statusCode = true && that.isSetStatusCode(); + if (this_present_statusCode || that_present_statusCode) { + if (!(this_present_statusCode && that_present_statusCode)) + return false; + if (!this.statusCode.equals(that.statusCode)) + return false; + } + + boolean this_present_infoMessages = true && this.isSetInfoMessages(); + boolean that_present_infoMessages = true && that.isSetInfoMessages(); + if (this_present_infoMessages || that_present_infoMessages) { + if (!(this_present_infoMessages && that_present_infoMessages)) + return false; + if (!this.infoMessages.equals(that.infoMessages)) + return false; + } + + boolean this_present_sqlState = true && this.isSetSqlState(); + boolean that_present_sqlState = true && that.isSetSqlState(); + if (this_present_sqlState || that_present_sqlState) { + if (!(this_present_sqlState && that_present_sqlState)) + return false; + if (!this.sqlState.equals(that.sqlState)) + return false; + } + + boolean this_present_errorCode = true && this.isSetErrorCode(); + boolean that_present_errorCode = true && that.isSetErrorCode(); + if (this_present_errorCode || that_present_errorCode) { + if (!(this_present_errorCode && that_present_errorCode)) + return false; + if (this.errorCode != that.errorCode) + return false; + } + + boolean this_present_errorMessage = true && this.isSetErrorMessage(); + boolean that_present_errorMessage = true && that.isSetErrorMessage(); + if (this_present_errorMessage || that_present_errorMessage) { + if (!(this_present_errorMessage && that_present_errorMessage)) + return false; + if (!this.errorMessage.equals(that.errorMessage)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_statusCode = true && (isSetStatusCode()); + list.add(present_statusCode); + if (present_statusCode) + list.add(statusCode.getValue()); + + boolean present_infoMessages = true && (isSetInfoMessages()); + list.add(present_infoMessages); + if (present_infoMessages) + list.add(infoMessages); + + boolean present_sqlState = true && (isSetSqlState()); + list.add(present_sqlState); + if (present_sqlState) + list.add(sqlState); + + boolean present_errorCode = true && (isSetErrorCode()); + list.add(present_errorCode); + if (present_errorCode) + list.add(errorCode); + + boolean present_errorMessage = true && (isSetErrorMessage()); + list.add(present_errorMessage); + if (present_errorMessage) + list.add(errorMessage); + + return list.hashCode(); + } + + @Override + public int compareTo(TStatus other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatusCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusCode, other.statusCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInfoMessages()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoMessages, other.infoMessages); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSqlState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); + 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("TStatus("); + boolean first = true; + + sb.append("statusCode:"); + if (this.statusCode == null) { + sb.append("null"); + } else { + sb.append(this.statusCode); + } + first = false; + if (isSetInfoMessages()) { + if (!first) sb.append(", "); + sb.append("infoMessages:"); + if (this.infoMessages == null) { + sb.append("null"); + } else { + sb.append(this.infoMessages); + } + first = false; + } + if (isSetSqlState()) { + if (!first) sb.append(", "); + sb.append("sqlState:"); + if (this.sqlState == null) { + sb.append("null"); + } else { + sb.append(this.sqlState); + } + first = false; + } + if (isSetErrorCode()) { + if (!first) sb.append(", "); + sb.append("errorCode:"); + sb.append(this.errorCode); + first = false; + } + if (isSetErrorMessage()) { + if (!first) sb.append(", "); + sb.append("errorMessage:"); + if (this.errorMessage == null) { + sb.append("null"); + } else { + sb.append(this.errorMessage); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetStatusCode()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TStatusStandardSchemeFactory implements SchemeFactory { + public TStatusStandardScheme getScheme() { + return new TStatusStandardScheme(); + } + } + + private static class TStatusStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus 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_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.statusCode = TStatusCode.findByValue(iprot.readI32()); + struct.setStatusCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // INFO_MESSAGES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); + struct.infoMessages = new ArrayList(_list134.size); + String _elem135; + for (int _i136 = 0; _i136 < _list134.size; ++_i136) + { + _elem135 = iprot.readString(); + struct.infoMessages.add(_elem135); + } + iprot.readListEnd(); + } + struct.setInfoMessagesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SQL_STATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ERROR_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ERROR_MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(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, TStatus struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.statusCode != null) { + oprot.writeFieldBegin(STATUS_CODE_FIELD_DESC); + oprot.writeI32(struct.statusCode.getValue()); + oprot.writeFieldEnd(); + } + if (struct.infoMessages != null) { + if (struct.isSetInfoMessages()) { + oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); + for (String _iter137 : struct.infoMessages) + { + oprot.writeString(_iter137); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.sqlState != null) { + if (struct.isSetSqlState()) { + oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); + oprot.writeString(struct.sqlState); + oprot.writeFieldEnd(); + } + } + if (struct.isSetErrorCode()) { + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(struct.errorCode); + oprot.writeFieldEnd(); + } + if (struct.errorMessage != null) { + if (struct.isSetErrorMessage()) { + oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); + oprot.writeString(struct.errorMessage); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStatusTupleSchemeFactory implements SchemeFactory { + public TStatusTupleScheme getScheme() { + return new TStatusTupleScheme(); + } + } + + private static class TStatusTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeI32(struct.statusCode.getValue()); + BitSet optionals = new BitSet(); + if (struct.isSetInfoMessages()) { + optionals.set(0); + } + if (struct.isSetSqlState()) { + optionals.set(1); + } + if (struct.isSetErrorCode()) { + optionals.set(2); + } + if (struct.isSetErrorMessage()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetInfoMessages()) { + { + oprot.writeI32(struct.infoMessages.size()); + for (String _iter138 : struct.infoMessages) + { + oprot.writeString(_iter138); + } + } + } + if (struct.isSetSqlState()) { + oprot.writeString(struct.sqlState); + } + if (struct.isSetErrorCode()) { + oprot.writeI32(struct.errorCode); + } + if (struct.isSetErrorMessage()) { + oprot.writeString(struct.errorMessage); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.statusCode = TStatusCode.findByValue(iprot.readI32()); + struct.setStatusCodeIsSet(true); + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.infoMessages = new ArrayList(_list139.size); + String _elem140; + for (int _i141 = 0; _i141 < _list139.size; ++_i141) + { + _elem140 = iprot.readString(); + struct.infoMessages.add(_elem140); + } + } + struct.setInfoMessagesIsSet(true); + } + if (incoming.get(1)) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } + if (incoming.get(2)) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } + if (incoming.get(3)) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatusCode.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatusCode.java new file mode 100644 index 000000000000..02f1fa19a55b --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatusCode.java @@ -0,0 +1,50 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TStatusCode implements org.apache.thrift.TEnum { + SUCCESS_STATUS(0), + SUCCESS_WITH_INFO_STATUS(1), + STILL_EXECUTING_STATUS(2), + ERROR_STATUS(3), + INVALID_HANDLE_STATUS(4); + + private final int value; + + private TStatusCode(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TStatusCode findByValue(int value) { + switch (value) { + case 0: + return SUCCESS_STATUS; + case 1: + return SUCCESS_WITH_INFO_STATUS; + case 2: + return STILL_EXECUTING_STATUS; + case 3: + return ERROR_STATUS; + case 4: + return INVALID_HANDLE_STATUS; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringColumn.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringColumn.java new file mode 100644 index 000000000000..162a94cc7698 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringColumn.java @@ -0,0 +1,539 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStringColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStringColumnTupleSchemeFactory()); + } + + private List values; // required + private ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + 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: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap); + } + + public TStringColumn() { + } + + public TStringColumn( + List values, + ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TStringColumn(TStringColumn other) { + if (other.isSetValues()) { + List __this__values = new ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TStringColumn deepCopy() { + return new TStringColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(String elem) { + if (this.values == null) { + this.values = new ArrayList(); + } + this.values.add(elem); + } + + public List getValues() { + return this.values; + } + + public void setValues(List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + } + + public void setNulls(ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + setNulls((ByteBuffer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + 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 VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TStringColumn) + return this.equals((TStringColumn)that); + return false; + } + + public boolean equals(TStringColumn that) { + if (that == null) + return false; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); + + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); + + return list.hashCode(); + } + + @Override + public int compareTo(TStringColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + 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("TStringColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TStringColumnStandardSchemeFactory implements SchemeFactory { + public TStringColumnStandardScheme getScheme() { + return new TStringColumnStandardScheme(); + } + } + + private static class TStringColumnStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); + struct.values = new ArrayList(_list102.size); + String _elem103; + for (int _i104 = 0; _i104 < _list102.size; ++_i104) + { + _elem103 = iprot.readString(); + struct.values.add(_elem103); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TStringColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (String _iter105 : struct.values) + { + oprot.writeString(_iter105); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStringColumnTupleSchemeFactory implements SchemeFactory { + public TStringColumnTupleScheme getScheme() { + return new TStringColumnTupleScheme(); + } + } + + private static class TStringColumnTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (String _iter106 : struct.values) + { + oprot.writeString(_iter106); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new ArrayList(_list107.size); + String _elem108; + for (int _i109 = 0; _i109 < _list107.size; ++_i109) + { + _elem108 = iprot.readString(); + struct.values.add(_elem108); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringValue.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringValue.java new file mode 100644 index 000000000000..69ac17f9884b --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringValue.java @@ -0,0 +1,383 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStringValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStringValueTupleSchemeFactory()); + } + + private String value; // 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 { + VALUE((short)1, "value"); + + 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: // VALUE + return VALUE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.VALUE}; + 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.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); + } + + public TStringValue() { + } + + /** + * Performs a deep copy on other. + */ + public TStringValue(TStringValue other) { + if (other.isSetValue()) { + this.value = other.value; + } + } + + public TStringValue deepCopy() { + return new TStringValue(this); + } + + @Override + public void clear() { + this.value = null; + } + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + 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 VALUE: + return isSetValue(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TStringValue) + return this.equals((TStringValue)that); + return false; + } + + public boolean equals(TStringValue that) { + if (that == null) + return false; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); + + return list.hashCode(); + } + + @Override + public int compareTo(TStringValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + 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("TStringValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + sb.append(this.value); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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 TStringValueStandardSchemeFactory implements SchemeFactory { + public TStringValueStandardScheme getScheme() { + return new TStringValueStandardScheme(); + } + } + + private static class TStringValueStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readString(); + struct.setValueIsSet(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, TStringValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.value != null) { + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeString(struct.value); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStringValueTupleSchemeFactory implements SchemeFactory { + public TStringValueTupleScheme getScheme() { + return new TStringValueTupleScheme(); + } + } + + private static class TStringValueTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeString(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readString(); + struct.setValueIsSet(true); + } + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java new file mode 100644 index 000000000000..64fc9a1cf508 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java @@ -0,0 +1,441 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStructTypeEntry"); + + private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStructTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStructTypeEntryTupleSchemeFactory()); + } + + private Map nameToTypePtr; // 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 { + NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); + + 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: // NAME_TO_TYPE_PTR + return NAME_TO_TYPE_PTR; + 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.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStructTypeEntry.class, metaDataMap); + } + + public TStructTypeEntry() { + } + + public TStructTypeEntry( + Map nameToTypePtr) + { + this(); + this.nameToTypePtr = nameToTypePtr; + } + + /** + * Performs a deep copy on other. + */ + public TStructTypeEntry(TStructTypeEntry other) { + if (other.isSetNameToTypePtr()) { + Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); + for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { + + String other_element_key = other_element.getKey(); + Integer other_element_value = other_element.getValue(); + + String __this__nameToTypePtr_copy_key = other_element_key; + + Integer __this__nameToTypePtr_copy_value = other_element_value; + + __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); + } + this.nameToTypePtr = __this__nameToTypePtr; + } + } + + public TStructTypeEntry deepCopy() { + return new TStructTypeEntry(this); + } + + @Override + public void clear() { + this.nameToTypePtr = null; + } + + public int getNameToTypePtrSize() { + return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); + } + + public void putToNameToTypePtr(String key, int val) { + if (this.nameToTypePtr == null) { + this.nameToTypePtr = new HashMap(); + } + this.nameToTypePtr.put(key, val); + } + + public Map getNameToTypePtr() { + return this.nameToTypePtr; + } + + public void setNameToTypePtr(Map nameToTypePtr) { + this.nameToTypePtr = nameToTypePtr; + } + + public void unsetNameToTypePtr() { + this.nameToTypePtr = null; + } + + /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetNameToTypePtr() { + return this.nameToTypePtr != null; + } + + public void setNameToTypePtrIsSet(boolean value) { + if (!value) { + this.nameToTypePtr = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME_TO_TYPE_PTR: + if (value == null) { + unsetNameToTypePtr(); + } else { + setNameToTypePtr((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME_TO_TYPE_PTR: + return getNameToTypePtr(); + + } + 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 NAME_TO_TYPE_PTR: + return isSetNameToTypePtr(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TStructTypeEntry) + return this.equals((TStructTypeEntry)that); + return false; + } + + public boolean equals(TStructTypeEntry that) { + if (that == null) + return false; + + boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); + boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); + if (this_present_nameToTypePtr || that_present_nameToTypePtr) { + if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) + return false; + if (!this.nameToTypePtr.equals(that.nameToTypePtr)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); + list.add(present_nameToTypePtr); + if (present_nameToTypePtr) + list.add(nameToTypePtr); + + return list.hashCode(); + } + + @Override + public int compareTo(TStructTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNameToTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); + 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("TStructTypeEntry("); + boolean first = true; + + sb.append("nameToTypePtr:"); + if (this.nameToTypePtr == null) { + sb.append("null"); + } else { + sb.append(this.nameToTypePtr); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetNameToTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TStructTypeEntryStandardSchemeFactory implements SchemeFactory { + public TStructTypeEntryStandardScheme getScheme() { + return new TStructTypeEntryStandardScheme(); + } + } + + private static class TStructTypeEntryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry 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: // NAME_TO_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin(); + struct.nameToTypePtr = new HashMap(2*_map10.size); + String _key11; + int _val12; + for (int _i13 = 0; _i13 < _map10.size; ++_i13) + { + _key11 = iprot.readString(); + _val12 = iprot.readI32(); + struct.nameToTypePtr.put(_key11, _val12); + } + iprot.readMapEnd(); + } + struct.setNameToTypePtrIsSet(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, TStructTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.nameToTypePtr != null) { + oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); + for (Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter14.getKey()); + oprot.writeI32(_iter14.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStructTypeEntryTupleSchemeFactory implements SchemeFactory { + public TStructTypeEntryTupleScheme getScheme() { + return new TStructTypeEntryTupleScheme(); + } + } + + private static class TStructTypeEntryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.nameToTypePtr.size()); + for (Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter15.getKey()); + oprot.writeI32(_iter15.getValue()); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.nameToTypePtr = new HashMap(2*_map16.size); + String _key17; + int _val18; + for (int _i19 = 0; _i19 < _map16.size; ++_i19) + { + _key17 = iprot.readString(); + _val18 = iprot.readI32(); + struct.nameToTypePtr.put(_key17, _val18); + } + } + struct.setNameToTypePtrIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTableSchema.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTableSchema.java new file mode 100644 index 000000000000..ed6c508141e7 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTableSchema.java @@ -0,0 +1,432 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableSchema"); + + private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TTableSchemaStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TTableSchemaTupleSchemeFactory()); + } + + private List columns; // 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 { + COLUMNS((short)1, "columns"); + + 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: // COLUMNS + return COLUMNS; + 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.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnDesc.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableSchema.class, metaDataMap); + } + + public TTableSchema() { + } + + public TTableSchema( + List columns) + { + this(); + this.columns = columns; + } + + /** + * Performs a deep copy on other. + */ + public TTableSchema(TTableSchema other) { + if (other.isSetColumns()) { + List __this__columns = new ArrayList(other.columns.size()); + for (TColumnDesc other_element : other.columns) { + __this__columns.add(new TColumnDesc(other_element)); + } + this.columns = __this__columns; + } + } + + public TTableSchema deepCopy() { + return new TTableSchema(this); + } + + @Override + public void clear() { + this.columns = null; + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumnDesc elem) { + if (this.columns == null) { + this.columns = new ArrayList(); + } + this.columns.add(elem); + } + + public List getColumns() { + return this.columns; + } + + public void setColumns(List columns) { + this.columns = columns; + } + + public void unsetColumns() { + this.columns = null; + } + + /** Returns true if field columns is set (has been assigned a value) and false otherwise */ + public boolean isSetColumns() { + return this.columns != null; + } + + public void setColumnsIsSet(boolean value) { + if (!value) { + this.columns = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case COLUMNS: + return getColumns(); + + } + 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 COLUMNS: + return isSetColumns(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TTableSchema) + return this.equals((TTableSchema)that); + return false; + } + + public boolean equals(TTableSchema that) { + if (that == null) + return false; + + boolean this_present_columns = true && this.isSetColumns(); + boolean that_present_columns = true && that.isSetColumns(); + if (this_present_columns || that_present_columns) { + if (!(this_present_columns && that_present_columns)) + return false; + if (!this.columns.equals(that.columns)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); + + return list.hashCode(); + } + + @Override + public int compareTo(TTableSchema other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); + 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("TTableSchema("); + boolean first = true; + + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + sb.append(this.columns); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetColumns()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TTableSchemaStandardSchemeFactory implements SchemeFactory { + public TTableSchemaStandardScheme getScheme() { + return new TTableSchemaStandardScheme(); + } + } + + private static class TTableSchemaStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema 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: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); + struct.columns = new ArrayList(_list38.size); + TColumnDesc _elem39; + for (int _i40 = 0; _i40 < _list38.size; ++_i40) + { + _elem39 = new TColumnDesc(); + _elem39.read(iprot); + struct.columns.add(_elem39); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(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, TTableSchema struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (TColumnDesc _iter41 : struct.columns) + { + _iter41.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TTableSchemaTupleSchemeFactory implements SchemeFactory { + public TTableSchemaTupleScheme getScheme() { + return new TTableSchemaTupleScheme(); + } + } + + private static class TTableSchemaTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.columns.size()); + for (TColumnDesc _iter42 : struct.columns) + { + _iter42.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new ArrayList(_list43.size); + TColumnDesc _elem44; + for (int _i45 = 0; _i45 < _list43.size; ++_i45) + { + _elem44 = new TColumnDesc(); + _elem44.read(iprot); + struct.columns.add(_elem44); + } + } + struct.setColumnsIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeDesc.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeDesc.java new file mode 100644 index 000000000000..376bca420e78 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeDesc.java @@ -0,0 +1,432 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeDesc"); + + private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TTypeDescStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TTypeDescTupleSchemeFactory()); + } + + private List types; // 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 { + TYPES((short)1, "types"); + + 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: // TYPES + return TYPES; + 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.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeEntry.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeDesc.class, metaDataMap); + } + + public TTypeDesc() { + } + + public TTypeDesc( + List types) + { + this(); + this.types = types; + } + + /** + * Performs a deep copy on other. + */ + public TTypeDesc(TTypeDesc other) { + if (other.isSetTypes()) { + List __this__types = new ArrayList(other.types.size()); + for (TTypeEntry other_element : other.types) { + __this__types.add(new TTypeEntry(other_element)); + } + this.types = __this__types; + } + } + + public TTypeDesc deepCopy() { + return new TTypeDesc(this); + } + + @Override + public void clear() { + this.types = null; + } + + public int getTypesSize() { + return (this.types == null) ? 0 : this.types.size(); + } + + public java.util.Iterator getTypesIterator() { + return (this.types == null) ? null : this.types.iterator(); + } + + public void addToTypes(TTypeEntry elem) { + if (this.types == null) { + this.types = new ArrayList(); + } + this.types.add(elem); + } + + public List getTypes() { + return this.types; + } + + public void setTypes(List types) { + this.types = types; + } + + public void unsetTypes() { + this.types = null; + } + + /** Returns true if field types is set (has been assigned a value) and false otherwise */ + public boolean isSetTypes() { + return this.types != null; + } + + public void setTypesIsSet(boolean value) { + if (!value) { + this.types = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TYPES: + if (value == null) { + unsetTypes(); + } else { + setTypes((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TYPES: + return getTypes(); + + } + 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 TYPES: + return isSetTypes(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TTypeDesc) + return this.equals((TTypeDesc)that); + return false; + } + + public boolean equals(TTypeDesc that) { + if (that == null) + return false; + + boolean this_present_types = true && this.isSetTypes(); + boolean that_present_types = true && that.isSetTypes(); + if (this_present_types || that_present_types) { + if (!(this_present_types && that_present_types)) + return false; + if (!this.types.equals(that.types)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_types = true && (isSetTypes()); + list.add(present_types); + if (present_types) + list.add(types); + + return list.hashCode(); + } + + @Override + public int compareTo(TTypeDesc other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypes()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.types, other.types); + 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("TTypeDesc("); + boolean first = true; + + sb.append("types:"); + if (this.types == null) { + sb.append("null"); + } else { + sb.append(this.types); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetTypes()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'types' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TTypeDescStandardSchemeFactory implements SchemeFactory { + public TTypeDescStandardScheme getScheme() { + return new TTypeDescStandardScheme(); + } + } + + private static class TTypeDescStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc 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: // TYPES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); + struct.types = new ArrayList(_list30.size); + TTypeEntry _elem31; + for (int _i32 = 0; _i32 < _list30.size; ++_i32) + { + _elem31 = new TTypeEntry(); + _elem31.read(iprot); + struct.types.add(_elem31); + } + iprot.readListEnd(); + } + struct.setTypesIsSet(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, TTypeDesc struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.types != null) { + oprot.writeFieldBegin(TYPES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.types.size())); + for (TTypeEntry _iter33 : struct.types) + { + _iter33.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TTypeDescTupleSchemeFactory implements SchemeFactory { + public TTypeDescTupleScheme getScheme() { + return new TTypeDescTupleScheme(); + } + } + + private static class TTypeDescTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.types.size()); + for (TTypeEntry _iter34 : struct.types) + { + _iter34.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.types = new ArrayList(_list35.size); + TTypeEntry _elem36; + for (int _i37 = 0; _i37 < _list35.size; ++_i37) + { + _elem36 = new TTypeEntry(); + _elem36.read(iprot); + struct.types.add(_elem36); + } + } + struct.setTypesIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeEntry.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeEntry.java new file mode 100644 index 000000000000..d856f68c6a50 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeEntry.java @@ -0,0 +1,597 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +import org.apache.thrift.protocol.TProtocolException; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeEntry extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry"); + private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField ARRAY_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("arrayEntry", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField MAP_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("mapEntry", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField STRUCT_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("structEntry", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField UNION_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("unionEntry", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField USER_DEFINED_TYPE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("userDefinedTypeEntry", org.apache.thrift.protocol.TType.STRUCT, (short)6); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + PRIMITIVE_ENTRY((short)1, "primitiveEntry"), + ARRAY_ENTRY((short)2, "arrayEntry"), + MAP_ENTRY((short)3, "mapEntry"), + STRUCT_ENTRY((short)4, "structEntry"), + UNION_ENTRY((short)5, "unionEntry"), + USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry"); + + 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: // PRIMITIVE_ENTRY + return PRIMITIVE_ENTRY; + case 2: // ARRAY_ENTRY + return ARRAY_ENTRY; + case 3: // MAP_ENTRY + return MAP_ENTRY; + case 4: // STRUCT_ENTRY + return STRUCT_ENTRY; + case 5: // UNION_ENTRY + return UNION_ENTRY; + case 6: // USER_DEFINED_TYPE_ENTRY + return USER_DEFINED_TYPE_ENTRY; + 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; + } + } + + 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.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class))); + tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class))); + tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class))); + tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class))); + tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class))); + tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap); + } + + public TTypeEntry() { + super(); + } + + public TTypeEntry(_Fields setField, Object value) { + super(setField, value); + } + + public TTypeEntry(TTypeEntry other) { + super(other); + } + public TTypeEntry deepCopy() { + return new TTypeEntry(this); + } + + public static TTypeEntry primitiveEntry(TPrimitiveTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setPrimitiveEntry(value); + return x; + } + + public static TTypeEntry arrayEntry(TArrayTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setArrayEntry(value); + return x; + } + + public static TTypeEntry mapEntry(TMapTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setMapEntry(value); + return x; + } + + public static TTypeEntry structEntry(TStructTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setStructEntry(value); + return x; + } + + public static TTypeEntry unionEntry(TUnionTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setUnionEntry(value); + return x; + } + + public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setUserDefinedTypeEntry(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case PRIMITIVE_ENTRY: + if (value instanceof TPrimitiveTypeEntry) { + break; + } + throw new ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); + case ARRAY_ENTRY: + if (value instanceof TArrayTypeEntry) { + break; + } + throw new ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); + case MAP_ENTRY: + if (value instanceof TMapTypeEntry) { + break; + } + throw new ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); + case STRUCT_ENTRY: + if (value instanceof TStructTypeEntry) { + break; + } + throw new ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); + case UNION_ENTRY: + if (value instanceof TUnionTypeEntry) { + break; + } + throw new ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); + case USER_DEFINED_TYPE_ENTRY: + if (value instanceof TUserDefinedTypeEntry) { + break; + } + throw new ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case PRIMITIVE_ENTRY: + if (field.type == PRIMITIVE_ENTRY_FIELD_DESC.type) { + TPrimitiveTypeEntry primitiveEntry; + primitiveEntry = new TPrimitiveTypeEntry(); + primitiveEntry.read(iprot); + return primitiveEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case ARRAY_ENTRY: + if (field.type == ARRAY_ENTRY_FIELD_DESC.type) { + TArrayTypeEntry arrayEntry; + arrayEntry = new TArrayTypeEntry(); + arrayEntry.read(iprot); + return arrayEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case MAP_ENTRY: + if (field.type == MAP_ENTRY_FIELD_DESC.type) { + TMapTypeEntry mapEntry; + mapEntry = new TMapTypeEntry(); + mapEntry.read(iprot); + return mapEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRUCT_ENTRY: + if (field.type == STRUCT_ENTRY_FIELD_DESC.type) { + TStructTypeEntry structEntry; + structEntry = new TStructTypeEntry(); + structEntry.read(iprot); + return structEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case UNION_ENTRY: + if (field.type == UNION_ENTRY_FIELD_DESC.type) { + TUnionTypeEntry unionEntry; + unionEntry = new TUnionTypeEntry(); + unionEntry.read(iprot); + return unionEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case USER_DEFINED_TYPE_ENTRY: + if (field.type == USER_DEFINED_TYPE_ENTRY_FIELD_DESC.type) { + TUserDefinedTypeEntry userDefinedTypeEntry; + userDefinedTypeEntry = new TUserDefinedTypeEntry(); + userDefinedTypeEntry.read(iprot); + return userDefinedTypeEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case PRIMITIVE_ENTRY: + TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; + primitiveEntry.write(oprot); + return; + case ARRAY_ENTRY: + TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; + arrayEntry.write(oprot); + return; + case MAP_ENTRY: + TMapTypeEntry mapEntry = (TMapTypeEntry)value_; + mapEntry.write(oprot); + return; + case STRUCT_ENTRY: + TStructTypeEntry structEntry = (TStructTypeEntry)value_; + structEntry.write(oprot); + return; + case UNION_ENTRY: + TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; + unionEntry.write(oprot); + return; + case USER_DEFINED_TYPE_ENTRY: + TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; + userDefinedTypeEntry.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case PRIMITIVE_ENTRY: + TPrimitiveTypeEntry primitiveEntry; + primitiveEntry = new TPrimitiveTypeEntry(); + primitiveEntry.read(iprot); + return primitiveEntry; + case ARRAY_ENTRY: + TArrayTypeEntry arrayEntry; + arrayEntry = new TArrayTypeEntry(); + arrayEntry.read(iprot); + return arrayEntry; + case MAP_ENTRY: + TMapTypeEntry mapEntry; + mapEntry = new TMapTypeEntry(); + mapEntry.read(iprot); + return mapEntry; + case STRUCT_ENTRY: + TStructTypeEntry structEntry; + structEntry = new TStructTypeEntry(); + structEntry.read(iprot); + return structEntry; + case UNION_ENTRY: + TUnionTypeEntry unionEntry; + unionEntry = new TUnionTypeEntry(); + unionEntry.read(iprot); + return unionEntry; + case USER_DEFINED_TYPE_ENTRY: + TUserDefinedTypeEntry userDefinedTypeEntry; + userDefinedTypeEntry = new TUserDefinedTypeEntry(); + userDefinedTypeEntry.read(iprot); + return userDefinedTypeEntry; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case PRIMITIVE_ENTRY: + TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; + primitiveEntry.write(oprot); + return; + case ARRAY_ENTRY: + TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; + arrayEntry.write(oprot); + return; + case MAP_ENTRY: + TMapTypeEntry mapEntry = (TMapTypeEntry)value_; + mapEntry.write(oprot); + return; + case STRUCT_ENTRY: + TStructTypeEntry structEntry = (TStructTypeEntry)value_; + structEntry.write(oprot); + return; + case UNION_ENTRY: + TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; + unionEntry.write(oprot); + return; + case USER_DEFINED_TYPE_ENTRY: + TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; + userDefinedTypeEntry.write(oprot); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case PRIMITIVE_ENTRY: + return PRIMITIVE_ENTRY_FIELD_DESC; + case ARRAY_ENTRY: + return ARRAY_ENTRY_FIELD_DESC; + case MAP_ENTRY: + return MAP_ENTRY_FIELD_DESC; + case STRUCT_ENTRY: + return STRUCT_ENTRY_FIELD_DESC; + case UNION_ENTRY: + return UNION_ENTRY_FIELD_DESC; + case USER_DEFINED_TYPE_ENTRY: + return USER_DEFINED_TYPE_ENTRY_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public TPrimitiveTypeEntry getPrimitiveEntry() { + if (getSetField() == _Fields.PRIMITIVE_ENTRY) { + return (TPrimitiveTypeEntry)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setPrimitiveEntry(TPrimitiveTypeEntry value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.PRIMITIVE_ENTRY; + value_ = value; + } + + public TArrayTypeEntry getArrayEntry() { + if (getSetField() == _Fields.ARRAY_ENTRY) { + return (TArrayTypeEntry)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setArrayEntry(TArrayTypeEntry value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.ARRAY_ENTRY; + value_ = value; + } + + public TMapTypeEntry getMapEntry() { + if (getSetField() == _Fields.MAP_ENTRY) { + return (TMapTypeEntry)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setMapEntry(TMapTypeEntry value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.MAP_ENTRY; + value_ = value; + } + + public TStructTypeEntry getStructEntry() { + if (getSetField() == _Fields.STRUCT_ENTRY) { + return (TStructTypeEntry)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStructEntry(TStructTypeEntry value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.STRUCT_ENTRY; + value_ = value; + } + + public TUnionTypeEntry getUnionEntry() { + if (getSetField() == _Fields.UNION_ENTRY) { + return (TUnionTypeEntry)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setUnionEntry(TUnionTypeEntry value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.UNION_ENTRY; + value_ = value; + } + + public TUserDefinedTypeEntry getUserDefinedTypeEntry() { + if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) { + return (TUserDefinedTypeEntry)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.USER_DEFINED_TYPE_ENTRY; + value_ = value; + } + + public boolean isSetPrimitiveEntry() { + return setField_ == _Fields.PRIMITIVE_ENTRY; + } + + + public boolean isSetArrayEntry() { + return setField_ == _Fields.ARRAY_ENTRY; + } + + + public boolean isSetMapEntry() { + return setField_ == _Fields.MAP_ENTRY; + } + + + public boolean isSetStructEntry() { + return setField_ == _Fields.STRUCT_ENTRY; + } + + + public boolean isSetUnionEntry() { + return setField_ == _Fields.UNION_ENTRY; + } + + + public boolean isSetUserDefinedTypeEntry() { + return setField_ == _Fields.USER_DEFINED_TYPE_ENTRY; + } + + + public boolean equals(Object other) { + if (other instanceof TTypeEntry) { + return equals((TTypeEntry)other); + } else { + return false; + } + } + + public boolean equals(TTypeEntry other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TTypeEntry other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + List list = new ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeId.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeId.java new file mode 100644 index 000000000000..e06761b93c25 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeId.java @@ -0,0 +1,104 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + + +public enum TTypeId implements org.apache.thrift.TEnum { + BOOLEAN_TYPE(0), + TINYINT_TYPE(1), + SMALLINT_TYPE(2), + INT_TYPE(3), + BIGINT_TYPE(4), + FLOAT_TYPE(5), + DOUBLE_TYPE(6), + STRING_TYPE(7), + TIMESTAMP_TYPE(8), + BINARY_TYPE(9), + ARRAY_TYPE(10), + MAP_TYPE(11), + STRUCT_TYPE(12), + UNION_TYPE(13), + USER_DEFINED_TYPE(14), + DECIMAL_TYPE(15), + NULL_TYPE(16), + DATE_TYPE(17), + VARCHAR_TYPE(18), + CHAR_TYPE(19), + INTERVAL_YEAR_MONTH_TYPE(20), + INTERVAL_DAY_TIME_TYPE(21), + TIMESTAMPLOCALTZ_TYPE(22); + + private final int value; + + private TTypeId(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static TTypeId findByValue(int value) { + switch (value) { + case 0: + return BOOLEAN_TYPE; + case 1: + return TINYINT_TYPE; + case 2: + return SMALLINT_TYPE; + case 3: + return INT_TYPE; + case 4: + return BIGINT_TYPE; + case 5: + return FLOAT_TYPE; + case 6: + return DOUBLE_TYPE; + case 7: + return STRING_TYPE; + case 8: + return TIMESTAMP_TYPE; + case 9: + return BINARY_TYPE; + case 10: + return ARRAY_TYPE; + case 11: + return MAP_TYPE; + case 12: + return STRUCT_TYPE; + case 13: + return UNION_TYPE; + case 14: + return USER_DEFINED_TYPE; + case 15: + return DECIMAL_TYPE; + case 16: + return NULL_TYPE; + case 17: + return DATE_TYPE; + case 18: + return VARCHAR_TYPE; + case 19: + return CHAR_TYPE; + case 20: + return INTERVAL_YEAR_MONTH_TYPE; + case 21: + return INTERVAL_DAY_TIME_TYPE; + case 22: + return TIMESTAMPLOCALTZ_TYPE; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java new file mode 100644 index 000000000000..182163cec675 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java @@ -0,0 +1,348 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +import org.apache.thrift.protocol.TProtocolException; + +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeQualifierValue extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifierValue"); + private static final org.apache.thrift.protocol.TField I32_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Value", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)2); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + I32_VALUE((short)1, "i32Value"), + STRING_VALUE((short)2, "stringValue"); + + 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: // I32_VALUE + return I32_VALUE; + case 2: // STRING_VALUE + return STRING_VALUE; + 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; + } + } + + 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.I32_VALUE, new org.apache.thrift.meta_data.FieldMetaData("i32Value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifierValue.class, metaDataMap); + } + + public TTypeQualifierValue() { + super(); + } + + public TTypeQualifierValue(_Fields setField, Object value) { + super(setField, value); + } + + public TTypeQualifierValue(TTypeQualifierValue other) { + super(other); + } + public TTypeQualifierValue deepCopy() { + return new TTypeQualifierValue(this); + } + + public static TTypeQualifierValue i32Value(int value) { + TTypeQualifierValue x = new TTypeQualifierValue(); + x.setI32Value(value); + return x; + } + + public static TTypeQualifierValue stringValue(String value) { + TTypeQualifierValue x = new TTypeQualifierValue(); + x.setStringValue(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, Object value) throws ClassCastException { + switch (setField) { + case I32_VALUE: + if (value instanceof Integer) { + break; + } + throw new ClassCastException("Was expecting value of type Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); + case STRING_VALUE: + if (value instanceof String) { + break; + } + throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case I32_VALUE: + if (field.type == I32_VALUE_FIELD_DESC.type) { + Integer i32Value; + i32Value = iprot.readI32(); + return i32Value; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRING_VALUE: + if (field.type == STRING_VALUE_FIELD_DESC.type) { + String stringValue; + stringValue = iprot.readString(); + return stringValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case I32_VALUE: + Integer i32Value = (Integer)value_; + oprot.writeI32(i32Value); + return; + case STRING_VALUE: + String stringValue = (String)value_; + oprot.writeString(stringValue); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case I32_VALUE: + Integer i32Value; + i32Value = iprot.readI32(); + return i32Value; + case STRING_VALUE: + String stringValue; + stringValue = iprot.readString(); + return stringValue; + default: + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case I32_VALUE: + Integer i32Value = (Integer)value_; + oprot.writeI32(i32Value); + return; + case STRING_VALUE: + String stringValue = (String)value_; + oprot.writeString(stringValue); + return; + default: + throw new IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case I32_VALUE: + return I32_VALUE_FIELD_DESC; + case STRING_VALUE: + return STRING_VALUE_FIELD_DESC; + default: + throw new IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public int getI32Value() { + if (getSetField() == _Fields.I32_VALUE) { + return (Integer)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI32Value(int value) { + setField_ = _Fields.I32_VALUE; + value_ = value; + } + + public String getStringValue() { + if (getSetField() == _Fields.STRING_VALUE) { + return (String)getFieldValue(); + } else { + throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringValue(String value) { + if (value == null) throw new NullPointerException(); + setField_ = _Fields.STRING_VALUE; + value_ = value; + } + + public boolean isSetI32Value() { + return setField_ == _Fields.I32_VALUE; + } + + + public boolean isSetStringValue() { + return setField_ == _Fields.STRING_VALUE; + } + + + public boolean equals(Object other) { + if (other instanceof TTypeQualifierValue) { + return equals((TTypeQualifierValue)other); + } else { + return false; + } + } + + public boolean equals(TTypeQualifierValue other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TTypeQualifierValue other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + List list = new ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java new file mode 100644 index 000000000000..3f46e5577c20 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java @@ -0,0 +1,443 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifiers"); + + private static final org.apache.thrift.protocol.TField QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifiers", org.apache.thrift.protocol.TType.MAP, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TTypeQualifiersStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TTypeQualifiersTupleSchemeFactory()); + } + + private Map qualifiers; // 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 { + QUALIFIERS((short)1, "qualifiers"); + + 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: // QUALIFIERS + return QUALIFIERS; + 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.QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("qualifiers", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifierValue.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifiers.class, metaDataMap); + } + + public TTypeQualifiers() { + } + + public TTypeQualifiers( + Map qualifiers) + { + this(); + this.qualifiers = qualifiers; + } + + /** + * Performs a deep copy on other. + */ + public TTypeQualifiers(TTypeQualifiers other) { + if (other.isSetQualifiers()) { + Map __this__qualifiers = new HashMap(other.qualifiers.size()); + for (Map.Entry other_element : other.qualifiers.entrySet()) { + + String other_element_key = other_element.getKey(); + TTypeQualifierValue other_element_value = other_element.getValue(); + + String __this__qualifiers_copy_key = other_element_key; + + TTypeQualifierValue __this__qualifiers_copy_value = new TTypeQualifierValue(other_element_value); + + __this__qualifiers.put(__this__qualifiers_copy_key, __this__qualifiers_copy_value); + } + this.qualifiers = __this__qualifiers; + } + } + + public TTypeQualifiers deepCopy() { + return new TTypeQualifiers(this); + } + + @Override + public void clear() { + this.qualifiers = null; + } + + public int getQualifiersSize() { + return (this.qualifiers == null) ? 0 : this.qualifiers.size(); + } + + public void putToQualifiers(String key, TTypeQualifierValue val) { + if (this.qualifiers == null) { + this.qualifiers = new HashMap(); + } + this.qualifiers.put(key, val); + } + + public Map getQualifiers() { + return this.qualifiers; + } + + public void setQualifiers(Map qualifiers) { + this.qualifiers = qualifiers; + } + + public void unsetQualifiers() { + this.qualifiers = null; + } + + /** Returns true if field qualifiers is set (has been assigned a value) and false otherwise */ + public boolean isSetQualifiers() { + return this.qualifiers != null; + } + + public void setQualifiersIsSet(boolean value) { + if (!value) { + this.qualifiers = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case QUALIFIERS: + if (value == null) { + unsetQualifiers(); + } else { + setQualifiers((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case QUALIFIERS: + return getQualifiers(); + + } + 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 QUALIFIERS: + return isSetQualifiers(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TTypeQualifiers) + return this.equals((TTypeQualifiers)that); + return false; + } + + public boolean equals(TTypeQualifiers that) { + if (that == null) + return false; + + boolean this_present_qualifiers = true && this.isSetQualifiers(); + boolean that_present_qualifiers = true && that.isSetQualifiers(); + if (this_present_qualifiers || that_present_qualifiers) { + if (!(this_present_qualifiers && that_present_qualifiers)) + return false; + if (!this.qualifiers.equals(that.qualifiers)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_qualifiers = true && (isSetQualifiers()); + list.add(present_qualifiers); + if (present_qualifiers) + list.add(qualifiers); + + return list.hashCode(); + } + + @Override + public int compareTo(TTypeQualifiers other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQualifiers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifiers, other.qualifiers); + 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("TTypeQualifiers("); + boolean first = true; + + sb.append("qualifiers:"); + if (this.qualifiers == null) { + sb.append("null"); + } else { + sb.append(this.qualifiers); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetQualifiers()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifiers' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TTypeQualifiersStandardSchemeFactory implements SchemeFactory { + public TTypeQualifiersStandardScheme getScheme() { + return new TTypeQualifiersStandardScheme(); + } + } + + private static class TTypeQualifiersStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers 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: // QUALIFIERS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); + struct.qualifiers = new HashMap(2*_map0.size); + String _key1; + TTypeQualifierValue _val2; + for (int _i3 = 0; _i3 < _map0.size; ++_i3) + { + _key1 = iprot.readString(); + _val2 = new TTypeQualifierValue(); + _val2.read(iprot); + struct.qualifiers.put(_key1, _val2); + } + iprot.readMapEnd(); + } + struct.setQualifiersIsSet(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, TTypeQualifiers struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.qualifiers != null) { + oprot.writeFieldBegin(QUALIFIERS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.qualifiers.size())); + for (Map.Entry _iter4 : struct.qualifiers.entrySet()) + { + oprot.writeString(_iter4.getKey()); + _iter4.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TTypeQualifiersTupleSchemeFactory implements SchemeFactory { + public TTypeQualifiersTupleScheme getScheme() { + return new TTypeQualifiersTupleScheme(); + } + } + + private static class TTypeQualifiersTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.qualifiers.size()); + for (Map.Entry _iter5 : struct.qualifiers.entrySet()) + { + oprot.writeString(_iter5.getKey()); + _iter5.getValue().write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.qualifiers = new HashMap(2*_map6.size); + String _key7; + TTypeQualifierValue _val8; + for (int _i9 = 0; _i9 < _map6.size; ++_i9) + { + _key7 = iprot.readString(); + _val8 = new TTypeQualifierValue(); + _val8.read(iprot); + struct.qualifiers.put(_key7, _val8); + } + } + struct.setQualifiersIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java new file mode 100644 index 000000000000..3eee9c15e594 --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java @@ -0,0 +1,441 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTypeEntry"); + + private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TUnionTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TUnionTypeEntryTupleSchemeFactory()); + } + + private Map nameToTypePtr; // 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 { + NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); + + 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: // NAME_TO_TYPE_PTR + return NAME_TO_TYPE_PTR; + 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.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTypeEntry.class, metaDataMap); + } + + public TUnionTypeEntry() { + } + + public TUnionTypeEntry( + Map nameToTypePtr) + { + this(); + this.nameToTypePtr = nameToTypePtr; + } + + /** + * Performs a deep copy on other. + */ + public TUnionTypeEntry(TUnionTypeEntry other) { + if (other.isSetNameToTypePtr()) { + Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); + for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { + + String other_element_key = other_element.getKey(); + Integer other_element_value = other_element.getValue(); + + String __this__nameToTypePtr_copy_key = other_element_key; + + Integer __this__nameToTypePtr_copy_value = other_element_value; + + __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); + } + this.nameToTypePtr = __this__nameToTypePtr; + } + } + + public TUnionTypeEntry deepCopy() { + return new TUnionTypeEntry(this); + } + + @Override + public void clear() { + this.nameToTypePtr = null; + } + + public int getNameToTypePtrSize() { + return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); + } + + public void putToNameToTypePtr(String key, int val) { + if (this.nameToTypePtr == null) { + this.nameToTypePtr = new HashMap(); + } + this.nameToTypePtr.put(key, val); + } + + public Map getNameToTypePtr() { + return this.nameToTypePtr; + } + + public void setNameToTypePtr(Map nameToTypePtr) { + this.nameToTypePtr = nameToTypePtr; + } + + public void unsetNameToTypePtr() { + this.nameToTypePtr = null; + } + + /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetNameToTypePtr() { + return this.nameToTypePtr != null; + } + + public void setNameToTypePtrIsSet(boolean value) { + if (!value) { + this.nameToTypePtr = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NAME_TO_TYPE_PTR: + if (value == null) { + unsetNameToTypePtr(); + } else { + setNameToTypePtr((Map)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME_TO_TYPE_PTR: + return getNameToTypePtr(); + + } + 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 NAME_TO_TYPE_PTR: + return isSetNameToTypePtr(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TUnionTypeEntry) + return this.equals((TUnionTypeEntry)that); + return false; + } + + public boolean equals(TUnionTypeEntry that) { + if (that == null) + return false; + + boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); + boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); + if (this_present_nameToTypePtr || that_present_nameToTypePtr) { + if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) + return false; + if (!this.nameToTypePtr.equals(that.nameToTypePtr)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); + list.add(present_nameToTypePtr); + if (present_nameToTypePtr) + list.add(nameToTypePtr); + + return list.hashCode(); + } + + @Override + public int compareTo(TUnionTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNameToTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); + 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("TUnionTypeEntry("); + boolean first = true; + + sb.append("nameToTypePtr:"); + if (this.nameToTypePtr == null) { + sb.append("null"); + } else { + sb.append(this.nameToTypePtr); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetNameToTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TUnionTypeEntryStandardSchemeFactory implements SchemeFactory { + public TUnionTypeEntryStandardScheme getScheme() { + return new TUnionTypeEntryStandardScheme(); + } + } + + private static class TUnionTypeEntryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry 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: // NAME_TO_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin(); + struct.nameToTypePtr = new HashMap(2*_map20.size); + String _key21; + int _val22; + for (int _i23 = 0; _i23 < _map20.size; ++_i23) + { + _key21 = iprot.readString(); + _val22 = iprot.readI32(); + struct.nameToTypePtr.put(_key21, _val22); + } + iprot.readMapEnd(); + } + struct.setNameToTypePtrIsSet(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, TUnionTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.nameToTypePtr != null) { + oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); + for (Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter24.getKey()); + oprot.writeI32(_iter24.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TUnionTypeEntryTupleSchemeFactory implements SchemeFactory { + public TUnionTypeEntryTupleScheme getScheme() { + return new TUnionTypeEntryTupleScheme(); + } + } + + private static class TUnionTypeEntryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + { + oprot.writeI32(struct.nameToTypePtr.size()); + for (Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter25.getKey()); + oprot.writeI32(_iter25.getValue()); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.nameToTypePtr = new HashMap(2*_map26.size); + String _key27; + int _val28; + for (int _i29 = 0; _i29 < _map26.size; ++_i29) + { + _key27 = iprot.readString(); + _val28 = iprot.readI32(); + struct.nameToTypePtr.put(_key27, _val28); + } + } + struct.setNameToTypePtrIsSet(true); + } + } + +} + diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java new file mode 100644 index 000000000000..21b35185f5fa --- /dev/null +++ b/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java @@ -0,0 +1,378 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.service.rpc.thrift; + +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 java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.Collections; +import javax.annotation.Generated; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") +@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry"); + + private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TUserDefinedTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TUserDefinedTypeEntryTupleSchemeFactory()); + } + + private String typeClassName; // 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 { + TYPE_CLASS_NAME((short)1, "typeClassName"); + + 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: // TYPE_CLASS_NAME + return TYPE_CLASS_NAME; + 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.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap); + } + + public TUserDefinedTypeEntry() { + } + + public TUserDefinedTypeEntry( + String typeClassName) + { + this(); + this.typeClassName = typeClassName; + } + + /** + * Performs a deep copy on other. + */ + public TUserDefinedTypeEntry(TUserDefinedTypeEntry other) { + if (other.isSetTypeClassName()) { + this.typeClassName = other.typeClassName; + } + } + + public TUserDefinedTypeEntry deepCopy() { + return new TUserDefinedTypeEntry(this); + } + + @Override + public void clear() { + this.typeClassName = null; + } + + public String getTypeClassName() { + return this.typeClassName; + } + + public void setTypeClassName(String typeClassName) { + this.typeClassName = typeClassName; + } + + public void unsetTypeClassName() { + this.typeClassName = null; + } + + /** Returns true if field typeClassName is set (has been assigned a value) and false otherwise */ + public boolean isSetTypeClassName() { + return this.typeClassName != null; + } + + public void setTypeClassNameIsSet(boolean value) { + if (!value) { + this.typeClassName = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TYPE_CLASS_NAME: + if (value == null) { + unsetTypeClassName(); + } else { + setTypeClassName((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TYPE_CLASS_NAME: + return getTypeClassName(); + + } + 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 TYPE_CLASS_NAME: + return isSetTypeClassName(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TUserDefinedTypeEntry) + return this.equals((TUserDefinedTypeEntry)that); + return false; + } + + public boolean equals(TUserDefinedTypeEntry that) { + if (that == null) + return false; + + boolean this_present_typeClassName = true && this.isSetTypeClassName(); + boolean that_present_typeClassName = true && that.isSetTypeClassName(); + if (this_present_typeClassName || that_present_typeClassName) { + if (!(this_present_typeClassName && that_present_typeClassName)) + return false; + if (!this.typeClassName.equals(that.typeClassName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List list = new ArrayList(); + + boolean present_typeClassName = true && (isSetTypeClassName()); + list.add(present_typeClassName); + if (present_typeClassName) + list.add(typeClassName); + + return list.hashCode(); + } + + @Override + public int compareTo(TUserDefinedTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypeClassName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeClassName, other.typeClassName); + 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("TUserDefinedTypeEntry("); + boolean first = true; + + sb.append("typeClassName:"); + if (this.typeClassName == null) { + sb.append("null"); + } else { + sb.append(this.typeClassName); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetTypeClassName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeClassName' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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 TUserDefinedTypeEntryStandardSchemeFactory implements SchemeFactory { + public TUserDefinedTypeEntryStandardScheme getScheme() { + return new TUserDefinedTypeEntryStandardScheme(); + } + } + + private static class TUserDefinedTypeEntryStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry 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: // TYPE_CLASS_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.typeClassName = iprot.readString(); + struct.setTypeClassNameIsSet(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, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.typeClassName != null) { + oprot.writeFieldBegin(TYPE_CLASS_NAME_FIELD_DESC); + oprot.writeString(struct.typeClassName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TUserDefinedTypeEntryTupleSchemeFactory implements SchemeFactory { + public TUserDefinedTypeEntryTupleScheme getScheme() { + return new TUserDefinedTypeEntryTupleScheme(); + } + } + + private static class TUserDefinedTypeEntryTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.typeClassName); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.typeClassName = iprot.readString(); + struct.setTypeClassNameIsSet(true); + } + } + +} + From e30f686c467677de358748553301549c9d0a2082 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 23 Oct 2019 12:05:11 +0800 Subject: [PATCH 02/55] add pom lincense --- sql/thriftserver/pom.xml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index e0220513472b..e3770a01ddf9 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -1,3 +1,21 @@ + + + 4.0.0 From 4a50bc97be0040d617cda74b80bbdb730e65c453 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 23 Oct 2019 18:50:42 +0800 Subject: [PATCH 03/55] update code folder name --- sql/thriftserver/README.md | 6 ++++++ sql/thriftserver/pom.xml | 2 +- .../apache/spark/service/rpc/thrift/TArrayTypeEntry.java | 0 .../org/apache/spark/service/rpc/thrift/TBinaryColumn.java | 0 .../org/apache/spark/service/rpc/thrift/TBoolColumn.java | 0 .../org/apache/spark/service/rpc/thrift/TBoolValue.java | 0 .../org/apache/spark/service/rpc/thrift/TByteColumn.java | 0 .../org/apache/spark/service/rpc/thrift/TByteValue.java | 0 .../org/apache/spark/service/rpc/thrift/TCLIService.java | 0 .../spark/service/rpc/thrift/TCLIServiceConstants.java | 0 .../spark/service/rpc/thrift/TCancelDelegationTokenReq.java | 0 .../service/rpc/thrift/TCancelDelegationTokenResp.java | 0 .../spark/service/rpc/thrift/TCancelOperationReq.java | 0 .../spark/service/rpc/thrift/TCancelOperationResp.java | 0 .../apache/spark/service/rpc/thrift/TCloseOperationReq.java | 0 .../spark/service/rpc/thrift/TCloseOperationResp.java | 0 .../apache/spark/service/rpc/thrift/TCloseSessionReq.java | 0 .../apache/spark/service/rpc/thrift/TCloseSessionResp.java | 0 .../org/apache/spark/service/rpc/thrift/TColumn.java | 0 .../org/apache/spark/service/rpc/thrift/TColumnDesc.java | 0 .../org/apache/spark/service/rpc/thrift/TColumnValue.java | 0 .../org/apache/spark/service/rpc/thrift/TDoubleColumn.java | 0 .../org/apache/spark/service/rpc/thrift/TDoubleValue.java | 0 .../spark/service/rpc/thrift/TExecuteStatementReq.java | 0 .../spark/service/rpc/thrift/TExecuteStatementResp.java | 0 .../apache/spark/service/rpc/thrift/TFetchOrientation.java | 0 .../apache/spark/service/rpc/thrift/TFetchResultsReq.java | 0 .../apache/spark/service/rpc/thrift/TFetchResultsResp.java | 0 .../apache/spark/service/rpc/thrift/TGetCatalogsReq.java | 0 .../apache/spark/service/rpc/thrift/TGetCatalogsResp.java | 0 .../org/apache/spark/service/rpc/thrift/TGetColumnsReq.java | 0 .../apache/spark/service/rpc/thrift/TGetColumnsResp.java | 0 .../spark/service/rpc/thrift/TGetCrossReferenceReq.java | 0 .../spark/service/rpc/thrift/TGetCrossReferenceResp.java | 0 .../spark/service/rpc/thrift/TGetDelegationTokenReq.java | 0 .../spark/service/rpc/thrift/TGetDelegationTokenResp.java | 0 .../apache/spark/service/rpc/thrift/TGetFunctionsReq.java | 0 .../apache/spark/service/rpc/thrift/TGetFunctionsResp.java | 0 .../org/apache/spark/service/rpc/thrift/TGetInfoReq.java | 0 .../org/apache/spark/service/rpc/thrift/TGetInfoResp.java | 0 .../org/apache/spark/service/rpc/thrift/TGetInfoType.java | 0 .../org/apache/spark/service/rpc/thrift/TGetInfoValue.java | 0 .../spark/service/rpc/thrift/TGetOperationStatusReq.java | 0 .../spark/service/rpc/thrift/TGetOperationStatusResp.java | 0 .../apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java | 0 .../spark/service/rpc/thrift/TGetPrimaryKeysResp.java | 0 .../org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java | 0 .../apache/spark/service/rpc/thrift/TGetQueryIdResp.java | 0 .../spark/service/rpc/thrift/TGetResultSetMetadataReq.java | 0 .../spark/service/rpc/thrift/TGetResultSetMetadataResp.java | 0 .../org/apache/spark/service/rpc/thrift/TGetSchemasReq.java | 0 .../apache/spark/service/rpc/thrift/TGetSchemasResp.java | 0 .../apache/spark/service/rpc/thrift/TGetTableTypesReq.java | 0 .../apache/spark/service/rpc/thrift/TGetTableTypesResp.java | 0 .../org/apache/spark/service/rpc/thrift/TGetTablesReq.java | 0 .../org/apache/spark/service/rpc/thrift/TGetTablesResp.java | 0 .../apache/spark/service/rpc/thrift/TGetTypeInfoReq.java | 0 .../apache/spark/service/rpc/thrift/TGetTypeInfoResp.java | 0 .../apache/spark/service/rpc/thrift/THandleIdentifier.java | 0 .../org/apache/spark/service/rpc/thrift/TI16Column.java | 0 .../org/apache/spark/service/rpc/thrift/TI16Value.java | 0 .../org/apache/spark/service/rpc/thrift/TI32Column.java | 0 .../org/apache/spark/service/rpc/thrift/TI32Value.java | 0 .../org/apache/spark/service/rpc/thrift/TI64Column.java | 0 .../org/apache/spark/service/rpc/thrift/TI64Value.java | 0 .../spark/service/rpc/thrift/TJobExecutionStatus.java | 0 .../org/apache/spark/service/rpc/thrift/TMapTypeEntry.java | 0 .../apache/spark/service/rpc/thrift/TOpenSessionReq.java | 0 .../apache/spark/service/rpc/thrift/TOpenSessionResp.java | 0 .../apache/spark/service/rpc/thrift/TOperationHandle.java | 0 .../apache/spark/service/rpc/thrift/TOperationState.java | 0 .../org/apache/spark/service/rpc/thrift/TOperationType.java | 0 .../spark/service/rpc/thrift/TPrimitiveTypeEntry.java | 0 .../spark/service/rpc/thrift/TProgressUpdateResp.java | 0 .../apache/spark/service/rpc/thrift/TProtocolVersion.java | 0 .../spark/service/rpc/thrift/TRenewDelegationTokenReq.java | 0 .../spark/service/rpc/thrift/TRenewDelegationTokenResp.java | 0 .../org/apache/spark/service/rpc/thrift/TRow.java | 0 .../org/apache/spark/service/rpc/thrift/TRowSet.java | 0 .../org/apache/spark/service/rpc/thrift/TSessionHandle.java | 0 .../apache/spark/service/rpc/thrift/TSetClientInfoReq.java | 0 .../apache/spark/service/rpc/thrift/TSetClientInfoResp.java | 0 .../org/apache/spark/service/rpc/thrift/TStatus.java | 0 .../org/apache/spark/service/rpc/thrift/TStatusCode.java | 0 .../org/apache/spark/service/rpc/thrift/TStringColumn.java | 0 .../org/apache/spark/service/rpc/thrift/TStringValue.java | 0 .../apache/spark/service/rpc/thrift/TStructTypeEntry.java | 0 .../org/apache/spark/service/rpc/thrift/TTableSchema.java | 0 .../org/apache/spark/service/rpc/thrift/TTypeDesc.java | 0 .../org/apache/spark/service/rpc/thrift/TTypeEntry.java | 0 .../org/apache/spark/service/rpc/thrift/TTypeId.java | 0 .../spark/service/rpc/thrift/TTypeQualifierValue.java | 0 .../apache/spark/service/rpc/thrift/TTypeQualifiers.java | 0 .../apache/spark/service/rpc/thrift/TUnionTypeEntry.java | 0 .../spark/service/rpc/thrift/TUserDefinedTypeEntry.java | 0 95 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 sql/thriftserver/README.md rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TBinaryColumn.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TBoolColumn.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TBoolValue.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TByteColumn.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TByteValue.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCLIService.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TColumn.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TColumnDesc.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TColumnValue.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TDoubleColumn.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TDoubleValue.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TFetchOrientation.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetInfoReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetInfoResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetInfoType.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetInfoValue.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetTablesReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetTablesResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/THandleIdentifier.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TI16Column.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TI16Value.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TI32Column.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TI32Value.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TI64Column.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TI64Value.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TOperationHandle.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TOperationState.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TOperationType.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TProtocolVersion.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TRow.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TRowSet.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TSessionHandle.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TStatus.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TStatusCode.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TStringColumn.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TStringValue.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TTableSchema.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TTypeDesc.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TTypeEntry.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TTypeId.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java (100%) rename sql/thriftserver/src/gen/{java => thrift/gen-javabean}/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java (100%) diff --git a/sql/thriftserver/README.md b/sql/thriftserver/README.md new file mode 100644 index 000000000000..93b12f86f53e --- /dev/null +++ b/sql/thriftserver/README.md @@ -0,0 +1,6 @@ +Thrift commands to generate files from TCLIService.thrift: +-------------------- +thrift --gen java:beans,hashcode -o src/gen/thrift if/TCLIService.thrift +thrift --gen cpp -o src/gen/thrift if/TCLIService.thrift +thrift --gen py -o src/gen/thrift if/TCLIService.thrift +thrift --gen rb -o src/gen/thrift if/TCLIService.thrift diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index e3770a01ddf9..d26c7b9651ae 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -142,7 +142,7 @@ - src/gen/java + src/gen/thrift/gen-javabean diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBinaryColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBinaryColumn.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolColumn.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TBoolValue.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteColumn.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TByteValue.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIService.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIService.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumn.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnDesc.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TColumnValue.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleColumn.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TDoubleValue.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchOrientation.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchOrientation.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoType.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetInfoValue.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTablesResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/THandleIdentifier.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/THandleIdentifier.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Column.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI16Value.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Column.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI32Value.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Column.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TI64Value.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationHandle.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationState.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationState.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TOperationType.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProtocolVersion.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TProtocolVersion.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRow.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRow.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRowSet.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TRowSet.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSessionHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSessionHandle.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatus.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatusCode.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStatusCode.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringColumn.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStringValue.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTableSchema.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTableSchema.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeDesc.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeEntry.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeId.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeId.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java diff --git a/sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java similarity index 100% rename from sql/thriftserver/src/gen/java/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java rename to sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java From 7ffdc3b811f05ac0f248306f5faddbd672afd7a3 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 23 Oct 2019 19:22:37 +0800 Subject: [PATCH 04/55] all like hive --- pom.xml | 62 + sql/thriftserver/pom.xml | 4 + .../src/gen/thrift/gen-cpp/TCLIService.cpp | 8847 ++++++++++++ .../src/gen/thrift/gen-cpp/TCLIService.h | 3068 +++++ .../thrift/gen-cpp/TCLIService_constants.cpp | 74 + .../thrift/gen-cpp/TCLIService_constants.h | 31 + .../gen-cpp/TCLIService_server.skeleton.cpp | 152 + .../gen/thrift/gen-cpp/TCLIService_types.cpp | 11342 ++++++++++++++++ .../gen/thrift/gen-cpp/TCLIService_types.h | 4497 ++++++ .../service/rpc/thrift/TArrayTypeEntry.java | 114 +- .../service/rpc/thrift/TBinaryColumn.java | 166 +- .../spark/service/rpc/thrift/TBoolColumn.java | 156 +- .../spark/service/rpc/thrift/TBoolValue.java | 121 +- .../spark/service/rpc/thrift/TByteColumn.java | 156 +- .../spark/service/rpc/thrift/TByteValue.java | 121 +- .../spark/service/rpc/thrift/TCLIService.java | 5790 ++++---- .../rpc/thrift/TCLIServiceConstants.java | 119 +- .../rpc/thrift/TCancelDelegationTokenReq.java | 132 +- .../thrift/TCancelDelegationTokenResp.java | 112 +- .../rpc/thrift/TCancelOperationReq.java | 112 +- .../rpc/thrift/TCancelOperationResp.java | 112 +- .../rpc/thrift/TCloseOperationReq.java | 112 +- .../rpc/thrift/TCloseOperationResp.java | 112 +- .../service/rpc/thrift/TCloseSessionReq.java | 112 +- .../service/rpc/thrift/TCloseSessionResp.java | 112 +- .../spark/service/rpc/thrift/TColumn.java | 134 +- .../spark/service/rpc/thrift/TColumnDesc.java | 171 +- .../service/rpc/thrift/TColumnValue.java | 126 +- .../service/rpc/thrift/TDoubleColumn.java | 156 +- .../service/rpc/thrift/TDoubleValue.java | 121 +- .../rpc/thrift/TExecuteStatementReq.java | 212 +- .../rpc/thrift/TExecuteStatementResp.java | 131 +- .../service/rpc/thrift/TFetchOrientation.java | 4 +- .../service/rpc/thrift/TFetchResultsReq.java | 172 +- .../service/rpc/thrift/TFetchResultsResp.java | 149 +- .../service/rpc/thrift/TGetCatalogsReq.java | 112 +- .../service/rpc/thrift/TGetCatalogsResp.java | 131 +- .../service/rpc/thrift/TGetColumnsReq.java | 189 +- .../service/rpc/thrift/TGetColumnsResp.java | 131 +- .../rpc/thrift/TGetCrossReferenceReq.java | 241 +- .../rpc/thrift/TGetCrossReferenceResp.java | 131 +- .../rpc/thrift/TGetDelegationTokenReq.java | 152 +- .../rpc/thrift/TGetDelegationTokenResp.java | 135 +- .../service/rpc/thrift/TGetFunctionsReq.java | 173 +- .../service/rpc/thrift/TGetFunctionsResp.java | 131 +- .../spark/service/rpc/thrift/TGetInfoReq.java | 130 +- .../service/rpc/thrift/TGetInfoResp.java | 126 +- .../service/rpc/thrift/TGetInfoType.java | 4 +- .../service/rpc/thrift/TGetInfoValue.java | 186 +- .../rpc/thrift/TGetOperationStatusReq.java | 135 +- .../rpc/thrift/TGetOperationStatusResp.java | 274 +- .../rpc/thrift/TGetPrimaryKeysReq.java | 171 +- .../rpc/thrift/TGetPrimaryKeysResp.java | 131 +- .../service/rpc/thrift/TGetQueryIdReq.java | 112 +- .../service/rpc/thrift/TGetQueryIdResp.java | 118 +- .../rpc/thrift/TGetResultSetMetadataReq.java | 112 +- .../rpc/thrift/TGetResultSetMetadataResp.java | 131 +- .../service/rpc/thrift/TGetSchemasReq.java | 153 +- .../service/rpc/thrift/TGetSchemasResp.java | 131 +- .../service/rpc/thrift/TGetTableTypesReq.java | 112 +- .../rpc/thrift/TGetTableTypesResp.java | 131 +- .../service/rpc/thrift/TGetTablesReq.java | 210 +- .../service/rpc/thrift/TGetTablesResp.java | 131 +- .../service/rpc/thrift/TGetTypeInfoReq.java | 112 +- .../service/rpc/thrift/TGetTypeInfoResp.java | 131 +- .../service/rpc/thrift/THandleIdentifier.java | 150 +- .../spark/service/rpc/thrift/TI16Column.java | 156 +- .../spark/service/rpc/thrift/TI16Value.java | 121 +- .../spark/service/rpc/thrift/TI32Column.java | 156 +- .../spark/service/rpc/thrift/TI32Value.java | 121 +- .../spark/service/rpc/thrift/TI64Column.java | 156 +- .../spark/service/rpc/thrift/TI64Value.java | 121 +- .../rpc/thrift/TJobExecutionStatus.java | 4 +- .../service/rpc/thrift/TMapTypeEntry.java | 129 +- .../service/rpc/thrift/TOpenSessionReq.java | 201 +- .../service/rpc/thrift/TOpenSessionResp.java | 193 +- .../service/rpc/thrift/TOperationHandle.java | 168 +- .../service/rpc/thrift/TOperationState.java | 4 +- .../service/rpc/thrift/TOperationType.java | 4 +- .../rpc/thrift/TPrimitiveTypeEntry.java | 135 +- .../rpc/thrift/TProgressUpdateResp.java | 265 +- .../service/rpc/thrift/TProtocolVersion.java | 4 +- .../rpc/thrift/TRenewDelegationTokenReq.java | 132 +- .../rpc/thrift/TRenewDelegationTokenResp.java | 112 +- .../apache/spark/service/rpc/thrift/TRow.java | 131 +- .../spark/service/rpc/thrift/TRowSet.java | 225 +- .../service/rpc/thrift/TSessionHandle.java | 112 +- .../service/rpc/thrift/TSetClientInfoReq.java | 157 +- .../rpc/thrift/TSetClientInfoResp.java | 112 +- .../spark/service/rpc/thrift/TStatus.java | 214 +- .../spark/service/rpc/thrift/TStatusCode.java | 4 +- .../service/rpc/thrift/TStringColumn.java | 166 +- .../service/rpc/thrift/TStringValue.java | 121 +- .../service/rpc/thrift/TStructTypeEntry.java | 146 +- .../service/rpc/thrift/TTableSchema.java | 131 +- .../spark/service/rpc/thrift/TTypeDesc.java | 131 +- .../spark/service/rpc/thrift/TTypeEntry.java | 118 +- .../spark/service/rpc/thrift/TTypeId.java | 4 +- .../rpc/thrift/TTypeQualifierValue.java | 110 +- .../service/rpc/thrift/TTypeQualifiers.java | 146 +- .../service/rpc/thrift/TUnionTypeEntry.java | 146 +- .../rpc/thrift/TUserDefinedTypeEntry.java | 118 +- .../gen-py/TCLIService/TCLIService-remote | 271 + .../thrift/gen-py/TCLIService/TCLIService.py | 4401 ++++++ .../gen/thrift/gen-py/TCLIService/__init__.py | 1 + .../thrift/gen-py/TCLIService/constants.py | 72 + .../gen/thrift/gen-py/TCLIService/ttypes.py | 7526 ++++++++++ .../src/gen/thrift/gen-py/__init__.py | 0 .../src/gen/thrift/gen-rb/t_c_l_i_service.rb | 1266 ++ .../gen-rb/t_c_l_i_service_constants.rb | 74 + .../thrift/gen-rb/t_c_l_i_service_types.rb | 2156 +++ 111 files changed, 52672 insertions(+), 9098 deletions(-) create mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp create mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h create mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp create mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h create mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp create mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp create mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h create mode 100755 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote create mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py create mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py create mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py create mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py create mode 100644 sql/thriftserver/src/gen/thrift/gen-py/__init__.py create mode 100644 sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb create mode 100644 sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb create mode 100644 sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb diff --git a/pom.xml b/pom.xml index b31748446437..abce71678a31 100644 --- a/pom.xml +++ b/pom.xml @@ -3084,5 +3084,67 @@ sparkr + + + thriftif + + + + org.apache.maven.plugins + maven-antrun-plugin + + + generate-thrift-sources + generate-sources + + + + + + + + + + + + + + + + + + + + + + run + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + enforce-property + + enforce + + + + + thrift.home + + + true + + + + + + + diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index d26c7b9651ae..e6bd641fe582 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -32,6 +32,10 @@ http://spark.apache.org/ thriftserver + + you-must-set-this-to-run-thrift + ${basedir}/src/gen/thrift + -I ${thrift.home} --gen java:beans,hashcode,generated_annotations=undated --gen cpp --gen php --gen py --gen rb diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp new file mode 100644 index 000000000000..1c0d0dcdf1e8 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp @@ -0,0 +1,8847 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "TCLIService.h" + +namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { + + +TCLIService_OpenSession_args::~TCLIService_OpenSession_args() throw() { +} + + +uint32_t TCLIService_OpenSession_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_OpenSession_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_OpenSession_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; +} + + +TCLIService_OpenSession_pargs::~TCLIService_OpenSession_pargs() throw() { +} + + +uint32_t TCLIService_OpenSession_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_OpenSession_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; +} + + +TCLIService_OpenSession_result::~TCLIService_OpenSession_result() throw() { +} + + +uint32_t TCLIService_OpenSession_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_OpenSession_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_OpenSession_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; +} + + +TCLIService_OpenSession_presult::~TCLIService_OpenSession_presult() throw() { +} + + +uint32_t TCLIService_OpenSession_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_CloseSession_args::~TCLIService_CloseSession_args() throw() { +} + + +uint32_t TCLIService_CloseSession_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseSession_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_CloseSession_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; +} + + +TCLIService_CloseSession_pargs::~TCLIService_CloseSession_pargs() throw() { +} + + +uint32_t TCLIService_CloseSession_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_CloseSession_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; +} + + +TCLIService_CloseSession_result::~TCLIService_CloseSession_result() throw() { +} + + +uint32_t TCLIService_CloseSession_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseSession_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_CloseSession_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; +} + + +TCLIService_CloseSession_presult::~TCLIService_CloseSession_presult() throw() { +} + + +uint32_t TCLIService_CloseSession_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetInfo_args::~TCLIService_GetInfo_args() throw() { +} + + +uint32_t TCLIService_GetInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetInfo_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; +} + + +TCLIService_GetInfo_pargs::~TCLIService_GetInfo_pargs() throw() { +} + + +uint32_t TCLIService_GetInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetInfo_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; +} + + +TCLIService_GetInfo_result::~TCLIService_GetInfo_result() throw() { +} + + +uint32_t TCLIService_GetInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetInfo_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; +} + + +TCLIService_GetInfo_presult::~TCLIService_GetInfo_presult() throw() { +} + + +uint32_t TCLIService_GetInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_ExecuteStatement_args::~TCLIService_ExecuteStatement_args() throw() { +} + + +uint32_t TCLIService_ExecuteStatement_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_ExecuteStatement_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_ExecuteStatement_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; +} + + +TCLIService_ExecuteStatement_pargs::~TCLIService_ExecuteStatement_pargs() throw() { +} + + +uint32_t TCLIService_ExecuteStatement_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_ExecuteStatement_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; +} + + +TCLIService_ExecuteStatement_result::~TCLIService_ExecuteStatement_result() throw() { +} + + +uint32_t TCLIService_ExecuteStatement_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_ExecuteStatement_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_ExecuteStatement_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; +} + + +TCLIService_ExecuteStatement_presult::~TCLIService_ExecuteStatement_presult() throw() { +} + + +uint32_t TCLIService_ExecuteStatement_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetTypeInfo_args::~TCLIService_GetTypeInfo_args() throw() { +} + + +uint32_t TCLIService_GetTypeInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTypeInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_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; +} + + +TCLIService_GetTypeInfo_pargs::~TCLIService_GetTypeInfo_pargs() throw() { +} + + +uint32_t TCLIService_GetTypeInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_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; +} + + +TCLIService_GetTypeInfo_result::~TCLIService_GetTypeInfo_result() throw() { +} + + +uint32_t TCLIService_GetTypeInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTypeInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_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; +} + + +TCLIService_GetTypeInfo_presult::~TCLIService_GetTypeInfo_presult() throw() { +} + + +uint32_t TCLIService_GetTypeInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetCatalogs_args::~TCLIService_GetCatalogs_args() throw() { +} + + +uint32_t TCLIService_GetCatalogs_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCatalogs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_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; +} + + +TCLIService_GetCatalogs_pargs::~TCLIService_GetCatalogs_pargs() throw() { +} + + +uint32_t TCLIService_GetCatalogs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_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; +} + + +TCLIService_GetCatalogs_result::~TCLIService_GetCatalogs_result() throw() { +} + + +uint32_t TCLIService_GetCatalogs_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCatalogs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_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; +} + + +TCLIService_GetCatalogs_presult::~TCLIService_GetCatalogs_presult() throw() { +} + + +uint32_t TCLIService_GetCatalogs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetSchemas_args::~TCLIService_GetSchemas_args() throw() { +} + + +uint32_t TCLIService_GetSchemas_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetSchemas_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetSchemas_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; +} + + +TCLIService_GetSchemas_pargs::~TCLIService_GetSchemas_pargs() throw() { +} + + +uint32_t TCLIService_GetSchemas_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetSchemas_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; +} + + +TCLIService_GetSchemas_result::~TCLIService_GetSchemas_result() throw() { +} + + +uint32_t TCLIService_GetSchemas_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetSchemas_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetSchemas_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; +} + + +TCLIService_GetSchemas_presult::~TCLIService_GetSchemas_presult() throw() { +} + + +uint32_t TCLIService_GetSchemas_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetTables_args::~TCLIService_GetTables_args() throw() { +} + + +uint32_t TCLIService_GetTables_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTables_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetTables_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; +} + + +TCLIService_GetTables_pargs::~TCLIService_GetTables_pargs() throw() { +} + + +uint32_t TCLIService_GetTables_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetTables_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; +} + + +TCLIService_GetTables_result::~TCLIService_GetTables_result() throw() { +} + + +uint32_t TCLIService_GetTables_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTables_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetTables_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; +} + + +TCLIService_GetTables_presult::~TCLIService_GetTables_presult() throw() { +} + + +uint32_t TCLIService_GetTables_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetTableTypes_args::~TCLIService_GetTableTypes_args() throw() { +} + + +uint32_t TCLIService_GetTableTypes_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTableTypes_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_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; +} + + +TCLIService_GetTableTypes_pargs::~TCLIService_GetTableTypes_pargs() throw() { +} + + +uint32_t TCLIService_GetTableTypes_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_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; +} + + +TCLIService_GetTableTypes_result::~TCLIService_GetTableTypes_result() throw() { +} + + +uint32_t TCLIService_GetTableTypes_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTableTypes_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_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; +} + + +TCLIService_GetTableTypes_presult::~TCLIService_GetTableTypes_presult() throw() { +} + + +uint32_t TCLIService_GetTableTypes_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetColumns_args::~TCLIService_GetColumns_args() throw() { +} + + +uint32_t TCLIService_GetColumns_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetColumns_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetColumns_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; +} + + +TCLIService_GetColumns_pargs::~TCLIService_GetColumns_pargs() throw() { +} + + +uint32_t TCLIService_GetColumns_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetColumns_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; +} + + +TCLIService_GetColumns_result::~TCLIService_GetColumns_result() throw() { +} + + +uint32_t TCLIService_GetColumns_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetColumns_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetColumns_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; +} + + +TCLIService_GetColumns_presult::~TCLIService_GetColumns_presult() throw() { +} + + +uint32_t TCLIService_GetColumns_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetFunctions_args::~TCLIService_GetFunctions_args() throw() { +} + + +uint32_t TCLIService_GetFunctions_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetFunctions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetFunctions_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; +} + + +TCLIService_GetFunctions_pargs::~TCLIService_GetFunctions_pargs() throw() { +} + + +uint32_t TCLIService_GetFunctions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetFunctions_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; +} + + +TCLIService_GetFunctions_result::~TCLIService_GetFunctions_result() throw() { +} + + +uint32_t TCLIService_GetFunctions_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetFunctions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetFunctions_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; +} + + +TCLIService_GetFunctions_presult::~TCLIService_GetFunctions_presult() throw() { +} + + +uint32_t TCLIService_GetFunctions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetPrimaryKeys_args::~TCLIService_GetPrimaryKeys_args() throw() { +} + + +uint32_t TCLIService_GetPrimaryKeys_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetPrimaryKeys_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetPrimaryKeys_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; +} + + +TCLIService_GetPrimaryKeys_pargs::~TCLIService_GetPrimaryKeys_pargs() throw() { +} + + +uint32_t TCLIService_GetPrimaryKeys_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetPrimaryKeys_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; +} + + +TCLIService_GetPrimaryKeys_result::~TCLIService_GetPrimaryKeys_result() throw() { +} + + +uint32_t TCLIService_GetPrimaryKeys_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetPrimaryKeys_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetPrimaryKeys_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; +} + + +TCLIService_GetPrimaryKeys_presult::~TCLIService_GetPrimaryKeys_presult() throw() { +} + + +uint32_t TCLIService_GetPrimaryKeys_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetCrossReference_args::~TCLIService_GetCrossReference_args() throw() { +} + + +uint32_t TCLIService_GetCrossReference_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCrossReference_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetCrossReference_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; +} + + +TCLIService_GetCrossReference_pargs::~TCLIService_GetCrossReference_pargs() throw() { +} + + +uint32_t TCLIService_GetCrossReference_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetCrossReference_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; +} + + +TCLIService_GetCrossReference_result::~TCLIService_GetCrossReference_result() throw() { +} + + +uint32_t TCLIService_GetCrossReference_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCrossReference_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetCrossReference_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; +} + + +TCLIService_GetCrossReference_presult::~TCLIService_GetCrossReference_presult() throw() { +} + + +uint32_t TCLIService_GetCrossReference_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetOperationStatus_args::~TCLIService_GetOperationStatus_args() throw() { +} + + +uint32_t TCLIService_GetOperationStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetOperationStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_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; +} + + +TCLIService_GetOperationStatus_pargs::~TCLIService_GetOperationStatus_pargs() throw() { +} + + +uint32_t TCLIService_GetOperationStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_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; +} + + +TCLIService_GetOperationStatus_result::~TCLIService_GetOperationStatus_result() throw() { +} + + +uint32_t TCLIService_GetOperationStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetOperationStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_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; +} + + +TCLIService_GetOperationStatus_presult::~TCLIService_GetOperationStatus_presult() throw() { +} + + +uint32_t TCLIService_GetOperationStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_CancelOperation_args::~TCLIService_CancelOperation_args() throw() { +} + + +uint32_t TCLIService_CancelOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CancelOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_CancelOperation_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; +} + + +TCLIService_CancelOperation_pargs::~TCLIService_CancelOperation_pargs() throw() { +} + + +uint32_t TCLIService_CancelOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_CancelOperation_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; +} + + +TCLIService_CancelOperation_result::~TCLIService_CancelOperation_result() throw() { +} + + +uint32_t TCLIService_CancelOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CancelOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_CancelOperation_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; +} + + +TCLIService_CancelOperation_presult::~TCLIService_CancelOperation_presult() throw() { +} + + +uint32_t TCLIService_CancelOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_CloseOperation_args::~TCLIService_CloseOperation_args() throw() { +} + + +uint32_t TCLIService_CloseOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_CloseOperation_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; +} + + +TCLIService_CloseOperation_pargs::~TCLIService_CloseOperation_pargs() throw() { +} + + +uint32_t TCLIService_CloseOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_CloseOperation_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; +} + + +TCLIService_CloseOperation_result::~TCLIService_CloseOperation_result() throw() { +} + + +uint32_t TCLIService_CloseOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_CloseOperation_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; +} + + +TCLIService_CloseOperation_presult::~TCLIService_CloseOperation_presult() throw() { +} + + +uint32_t TCLIService_CloseOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetResultSetMetadata_args::~TCLIService_GetResultSetMetadata_args() throw() { +} + + +uint32_t TCLIService_GetResultSetMetadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetResultSetMetadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_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; +} + + +TCLIService_GetResultSetMetadata_pargs::~TCLIService_GetResultSetMetadata_pargs() throw() { +} + + +uint32_t TCLIService_GetResultSetMetadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_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; +} + + +TCLIService_GetResultSetMetadata_result::~TCLIService_GetResultSetMetadata_result() throw() { +} + + +uint32_t TCLIService_GetResultSetMetadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetResultSetMetadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_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; +} + + +TCLIService_GetResultSetMetadata_presult::~TCLIService_GetResultSetMetadata_presult() throw() { +} + + +uint32_t TCLIService_GetResultSetMetadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_FetchResults_args::~TCLIService_FetchResults_args() throw() { +} + + +uint32_t TCLIService_FetchResults_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_FetchResults_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_FetchResults_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; +} + + +TCLIService_FetchResults_pargs::~TCLIService_FetchResults_pargs() throw() { +} + + +uint32_t TCLIService_FetchResults_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_FetchResults_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; +} + + +TCLIService_FetchResults_result::~TCLIService_FetchResults_result() throw() { +} + + +uint32_t TCLIService_FetchResults_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_FetchResults_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_FetchResults_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; +} + + +TCLIService_FetchResults_presult::~TCLIService_FetchResults_presult() throw() { +} + + +uint32_t TCLIService_FetchResults_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetDelegationToken_args::~TCLIService_GetDelegationToken_args() throw() { +} + + +uint32_t TCLIService_GetDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + 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; +} + + +TCLIService_GetDelegationToken_pargs::~TCLIService_GetDelegationToken_pargs() throw() { +} + + +uint32_t TCLIService_GetDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + 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; +} + + +TCLIService_GetDelegationToken_result::~TCLIService_GetDelegationToken_result() throw() { +} + + +uint32_t TCLIService_GetDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetDelegationToken_presult::~TCLIService_GetDelegationToken_presult() throw() { +} + + +uint32_t TCLIService_GetDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_CancelDelegationToken_args::~TCLIService_CancelDelegationToken_args() throw() { +} + + +uint32_t TCLIService_CancelDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + 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; +} + + +TCLIService_CancelDelegationToken_pargs::~TCLIService_CancelDelegationToken_pargs() throw() { +} + + +uint32_t TCLIService_CancelDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + 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; +} + + +TCLIService_CancelDelegationToken_result::~TCLIService_CancelDelegationToken_result() throw() { +} + + +uint32_t TCLIService_CancelDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_CancelDelegationToken_presult::~TCLIService_CancelDelegationToken_presult() throw() { +} + + +uint32_t TCLIService_CancelDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_RenewDelegationToken_args::~TCLIService_RenewDelegationToken_args() throw() { +} + + +uint32_t TCLIService_RenewDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + 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; +} + + +TCLIService_RenewDelegationToken_pargs::~TCLIService_RenewDelegationToken_pargs() throw() { +} + + +uint32_t TCLIService_RenewDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + 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; +} + + +TCLIService_RenewDelegationToken_result::~TCLIService_RenewDelegationToken_result() throw() { +} + + +uint32_t TCLIService_RenewDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_RenewDelegationToken_presult::~TCLIService_RenewDelegationToken_presult() throw() { +} + + +uint32_t TCLIService_RenewDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_GetQueryId_args::~TCLIService_GetQueryId_args() throw() { +} + + +uint32_t TCLIService_GetQueryId_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetQueryId_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetQueryId_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; +} + + +TCLIService_GetQueryId_pargs::~TCLIService_GetQueryId_pargs() throw() { +} + + +uint32_t TCLIService_GetQueryId_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_GetQueryId_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; +} + + +TCLIService_GetQueryId_result::~TCLIService_GetQueryId_result() throw() { +} + + +uint32_t TCLIService_GetQueryId_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetQueryId_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_GetQueryId_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; +} + + +TCLIService_GetQueryId_presult::~TCLIService_GetQueryId_presult() throw() { +} + + +uint32_t TCLIService_GetQueryId_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; +} + + +TCLIService_SetClientInfo_args::~TCLIService_SetClientInfo_args() throw() { +} + + +uint32_t TCLIService_SetClientInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_SetClientInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_SetClientInfo_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; +} + + +TCLIService_SetClientInfo_pargs::~TCLIService_SetClientInfo_pargs() throw() { +} + + +uint32_t TCLIService_SetClientInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCLIService_SetClientInfo_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; +} + + +TCLIService_SetClientInfo_result::~TCLIService_SetClientInfo_result() throw() { +} + + +uint32_t TCLIService_SetClientInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_SetClientInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { + + uint32_t xfer = 0; + + xfer += oprot->writeStructBegin("TCLIService_SetClientInfo_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; +} + + +TCLIService_SetClientInfo_presult::~TCLIService_SetClientInfo_presult() throw() { +} + + +uint32_t TCLIService_SetClientInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetInfo(TGetInfoResp& _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("GetInfo") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetInfo_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, "GetInfo failed: unknown result"); +} + +void TCLIServiceClient::ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) +{ + send_ExecuteStatement(req); + recv_ExecuteStatement(_return); +} + +void TCLIServiceClient::send_ExecuteStatement(const TExecuteStatementReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("ExecuteStatement", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_ExecuteStatement_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_ExecuteStatement(TExecuteStatementResp& _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("ExecuteStatement") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_ExecuteStatement_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, "ExecuteStatement failed: unknown result"); +} + +void TCLIServiceClient::GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) +{ + send_GetTypeInfo(req); + recv_GetTypeInfo(_return); +} + +void TCLIServiceClient::send_GetTypeInfo(const TGetTypeInfoReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetTypeInfo", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetTypeInfo_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetTypeInfo(TGetTypeInfoResp& _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("GetTypeInfo") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetTypeInfo_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, "GetTypeInfo failed: unknown result"); +} + +void TCLIServiceClient::GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) +{ + send_GetCatalogs(req); + recv_GetCatalogs(_return); +} + +void TCLIServiceClient::send_GetCatalogs(const TGetCatalogsReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetCatalogs", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetCatalogs_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetCatalogs(TGetCatalogsResp& _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("GetCatalogs") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetCatalogs_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, "GetCatalogs failed: unknown result"); +} + +void TCLIServiceClient::GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) +{ + send_GetSchemas(req); + recv_GetSchemas(_return); +} + +void TCLIServiceClient::send_GetSchemas(const TGetSchemasReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetSchemas", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetSchemas_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetSchemas(TGetSchemasResp& _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("GetSchemas") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetSchemas_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, "GetSchemas failed: unknown result"); +} + +void TCLIServiceClient::GetTables(TGetTablesResp& _return, const TGetTablesReq& req) +{ + send_GetTables(req); + recv_GetTables(_return); +} + +void TCLIServiceClient::send_GetTables(const TGetTablesReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetTables", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetTables_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetTables(TGetTablesResp& _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("GetTables") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetTables_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, "GetTables failed: unknown result"); +} + +void TCLIServiceClient::GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) +{ + send_GetTableTypes(req); + recv_GetTableTypes(_return); +} + +void TCLIServiceClient::send_GetTableTypes(const TGetTableTypesReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetTableTypes", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetTableTypes_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetTableTypes(TGetTableTypesResp& _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("GetTableTypes") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetTableTypes_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, "GetTableTypes failed: unknown result"); +} + +void TCLIServiceClient::GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) +{ + send_GetColumns(req); + recv_GetColumns(_return); +} + +void TCLIServiceClient::send_GetColumns(const TGetColumnsReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetColumns", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetColumns_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetColumns(TGetColumnsResp& _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("GetColumns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetColumns_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, "GetColumns failed: unknown result"); +} + +void TCLIServiceClient::GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) +{ + send_GetFunctions(req); + recv_GetFunctions(_return); +} + +void TCLIServiceClient::send_GetFunctions(const TGetFunctionsReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetFunctions", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetFunctions_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetFunctions(TGetFunctionsResp& _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("GetFunctions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetFunctions_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, "GetFunctions failed: unknown result"); +} + +void TCLIServiceClient::GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) +{ + send_GetPrimaryKeys(req); + recv_GetPrimaryKeys(_return); +} + +void TCLIServiceClient::send_GetPrimaryKeys(const TGetPrimaryKeysReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetPrimaryKeys", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetPrimaryKeys_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetPrimaryKeys(TGetPrimaryKeysResp& _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("GetPrimaryKeys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetPrimaryKeys_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, "GetPrimaryKeys failed: unknown result"); +} + +void TCLIServiceClient::GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) +{ + send_GetCrossReference(req); + recv_GetCrossReference(_return); +} + +void TCLIServiceClient::send_GetCrossReference(const TGetCrossReferenceReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetCrossReference", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetCrossReference_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetCrossReference(TGetCrossReferenceResp& _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("GetCrossReference") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetCrossReference_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, "GetCrossReference failed: unknown result"); +} + +void TCLIServiceClient::GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) +{ + send_GetOperationStatus(req); + recv_GetOperationStatus(_return); +} + +void TCLIServiceClient::send_GetOperationStatus(const TGetOperationStatusReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetOperationStatus", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetOperationStatus_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetOperationStatus(TGetOperationStatusResp& _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("GetOperationStatus") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetOperationStatus_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, "GetOperationStatus failed: unknown result"); +} + +void TCLIServiceClient::CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) +{ + send_CancelOperation(req); + recv_CancelOperation(_return); +} + +void TCLIServiceClient::send_CancelOperation(const TCancelOperationReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("CancelOperation", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_CancelOperation_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_CancelOperation(TCancelOperationResp& _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("CancelOperation") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_CancelOperation_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, "CancelOperation failed: unknown result"); +} + +void TCLIServiceClient::CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) +{ + send_CloseOperation(req); + recv_CloseOperation(_return); +} + +void TCLIServiceClient::send_CloseOperation(const TCloseOperationReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("CloseOperation", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_CloseOperation_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_CloseOperation(TCloseOperationResp& _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("CloseOperation") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_CloseOperation_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, "CloseOperation failed: unknown result"); +} + +void TCLIServiceClient::GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) +{ + send_GetResultSetMetadata(req); + recv_GetResultSetMetadata(_return); +} + +void TCLIServiceClient::send_GetResultSetMetadata(const TGetResultSetMetadataReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetResultSetMetadata", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetResultSetMetadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetResultSetMetadata(TGetResultSetMetadataResp& _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("GetResultSetMetadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetResultSetMetadata_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, "GetResultSetMetadata failed: unknown result"); +} + +void TCLIServiceClient::FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) +{ + send_FetchResults(req); + recv_FetchResults(_return); +} + +void TCLIServiceClient::send_FetchResults(const TFetchResultsReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("FetchResults", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_FetchResults_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_FetchResults(TFetchResultsResp& _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("FetchResults") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_FetchResults_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, "FetchResults failed: unknown result"); +} + +void TCLIServiceClient::GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) +{ + send_GetDelegationToken(req); + recv_GetDelegationToken(_return); +} + +void TCLIServiceClient::send_GetDelegationToken(const TGetDelegationTokenReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetDelegationToken_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetDelegationToken(TGetDelegationTokenResp& _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("GetDelegationToken") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetDelegationToken_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, "GetDelegationToken failed: unknown result"); +} + +void TCLIServiceClient::CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) +{ + send_CancelDelegationToken(req); + recv_CancelDelegationToken(_return); +} + +void TCLIServiceClient::send_CancelDelegationToken(const TCancelDelegationTokenReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("CancelDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_CancelDelegationToken_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_CancelDelegationToken(TCancelDelegationTokenResp& _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("CancelDelegationToken") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_CancelDelegationToken_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, "CancelDelegationToken failed: unknown result"); +} + +void TCLIServiceClient::RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) +{ + send_RenewDelegationToken(req); + recv_RenewDelegationToken(_return); +} + +void TCLIServiceClient::send_RenewDelegationToken(const TRenewDelegationTokenReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("RenewDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_RenewDelegationToken_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_RenewDelegationToken(TRenewDelegationTokenResp& _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("RenewDelegationToken") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_RenewDelegationToken_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, "RenewDelegationToken failed: unknown result"); +} + +void TCLIServiceClient::GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) +{ + send_GetQueryId(req); + recv_GetQueryId(_return); +} + +void TCLIServiceClient::send_GetQueryId(const TGetQueryIdReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("GetQueryId", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetQueryId_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_GetQueryId(TGetQueryIdResp& _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("GetQueryId") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_GetQueryId_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, "GetQueryId failed: unknown result"); +} + +void TCLIServiceClient::SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) +{ + send_SetClientInfo(req); + recv_SetClientInfo(_return); +} + +void TCLIServiceClient::send_SetClientInfo(const TSetClientInfoReq& req) +{ + int32_t cseqid = 0; + oprot_->writeMessageBegin("SetClientInfo", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_SetClientInfo_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); +} + +void TCLIServiceClient::recv_SetClientInfo(TSetClientInfoResp& _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("SetClientInfo") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + TCLIService_SetClientInfo_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, "SetClientInfo failed: unknown result"); +} + +bool TCLIServiceProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { + ProcessMap::iterator pfn; + pfn = processMap_.find(fname); + if (pfn == processMap_.end()) { + iprot->skip(::apache::thrift::protocol::T_STRUCT); + iprot->readMessageEnd(); + iprot->getTransport()->readEnd(); + ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'"); + oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); + x.write(oprot); + oprot->writeMessageEnd(); + oprot->getTransport()->writeEnd(); + oprot->getTransport()->flush(); + return true; + } + (this->*(pfn->second))(seqid, iprot, oprot, callContext); + return true; +} + +void TCLIServiceProcessor::process_OpenSession(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.OpenSession", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.OpenSession"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.OpenSession"); + } + + TCLIService_OpenSession_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.OpenSession", bytes); + } + + TCLIService_OpenSession_result result; + try { + iface_->OpenSession(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.OpenSession"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("OpenSession", ::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.OpenSession"); + } + + oprot->writeMessageBegin("OpenSession", ::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.OpenSession", bytes); + } +} + +void TCLIServiceProcessor::process_CloseSession(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.CloseSession", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CloseSession"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.CloseSession"); + } + + TCLIService_CloseSession_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.CloseSession", bytes); + } + + TCLIService_CloseSession_result result; + try { + iface_->CloseSession(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.CloseSession"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("CloseSession", ::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.CloseSession"); + } + + oprot->writeMessageBegin("CloseSession", ::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.CloseSession", bytes); + } +} + +void TCLIServiceProcessor::process_GetInfo(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.GetInfo", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetInfo"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetInfo"); + } + + TCLIService_GetInfo_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetInfo", bytes); + } + + TCLIService_GetInfo_result result; + try { + iface_->GetInfo(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetInfo"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetInfo", ::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.GetInfo"); + } + + oprot->writeMessageBegin("GetInfo", ::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.GetInfo", bytes); + } +} + +void TCLIServiceProcessor::process_ExecuteStatement(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.ExecuteStatement", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.ExecuteStatement"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.ExecuteStatement"); + } + + TCLIService_ExecuteStatement_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.ExecuteStatement", bytes); + } + + TCLIService_ExecuteStatement_result result; + try { + iface_->ExecuteStatement(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.ExecuteStatement"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("ExecuteStatement", ::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.ExecuteStatement"); + } + + oprot->writeMessageBegin("ExecuteStatement", ::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.ExecuteStatement", bytes); + } +} + +void TCLIServiceProcessor::process_GetTypeInfo(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.GetTypeInfo", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetTypeInfo"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetTypeInfo"); + } + + TCLIService_GetTypeInfo_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetTypeInfo", bytes); + } + + TCLIService_GetTypeInfo_result result; + try { + iface_->GetTypeInfo(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetTypeInfo"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetTypeInfo", ::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.GetTypeInfo"); + } + + oprot->writeMessageBegin("GetTypeInfo", ::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.GetTypeInfo", bytes); + } +} + +void TCLIServiceProcessor::process_GetCatalogs(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.GetCatalogs", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetCatalogs"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetCatalogs"); + } + + TCLIService_GetCatalogs_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetCatalogs", bytes); + } + + TCLIService_GetCatalogs_result result; + try { + iface_->GetCatalogs(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetCatalogs"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetCatalogs", ::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.GetCatalogs"); + } + + oprot->writeMessageBegin("GetCatalogs", ::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.GetCatalogs", bytes); + } +} + +void TCLIServiceProcessor::process_GetSchemas(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.GetSchemas", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetSchemas"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetSchemas"); + } + + TCLIService_GetSchemas_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetSchemas", bytes); + } + + TCLIService_GetSchemas_result result; + try { + iface_->GetSchemas(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetSchemas"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetSchemas", ::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.GetSchemas"); + } + + oprot->writeMessageBegin("GetSchemas", ::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.GetSchemas", bytes); + } +} + +void TCLIServiceProcessor::process_GetTables(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.GetTables", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetTables"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetTables"); + } + + TCLIService_GetTables_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetTables", bytes); + } + + TCLIService_GetTables_result result; + try { + iface_->GetTables(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetTables"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetTables", ::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.GetTables"); + } + + oprot->writeMessageBegin("GetTables", ::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.GetTables", bytes); + } +} + +void TCLIServiceProcessor::process_GetTableTypes(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.GetTableTypes", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetTableTypes"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetTableTypes"); + } + + TCLIService_GetTableTypes_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetTableTypes", bytes); + } + + TCLIService_GetTableTypes_result result; + try { + iface_->GetTableTypes(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetTableTypes"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetTableTypes", ::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.GetTableTypes"); + } + + oprot->writeMessageBegin("GetTableTypes", ::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.GetTableTypes", bytes); + } +} + +void TCLIServiceProcessor::process_GetColumns(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.GetColumns", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetColumns"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetColumns"); + } + + TCLIService_GetColumns_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetColumns", bytes); + } + + TCLIService_GetColumns_result result; + try { + iface_->GetColumns(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetColumns"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetColumns", ::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.GetColumns"); + } + + oprot->writeMessageBegin("GetColumns", ::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.GetColumns", bytes); + } +} + +void TCLIServiceProcessor::process_GetFunctions(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.GetFunctions", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetFunctions"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetFunctions"); + } + + TCLIService_GetFunctions_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetFunctions", bytes); + } + + TCLIService_GetFunctions_result result; + try { + iface_->GetFunctions(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetFunctions"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetFunctions", ::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.GetFunctions"); + } + + oprot->writeMessageBegin("GetFunctions", ::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.GetFunctions", bytes); + } +} + +void TCLIServiceProcessor::process_GetPrimaryKeys(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.GetPrimaryKeys", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetPrimaryKeys"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetPrimaryKeys"); + } + + TCLIService_GetPrimaryKeys_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetPrimaryKeys", bytes); + } + + TCLIService_GetPrimaryKeys_result result; + try { + iface_->GetPrimaryKeys(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetPrimaryKeys"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetPrimaryKeys", ::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.GetPrimaryKeys"); + } + + oprot->writeMessageBegin("GetPrimaryKeys", ::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.GetPrimaryKeys", bytes); + } +} + +void TCLIServiceProcessor::process_GetCrossReference(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.GetCrossReference", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetCrossReference"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetCrossReference"); + } + + TCLIService_GetCrossReference_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetCrossReference", bytes); + } + + TCLIService_GetCrossReference_result result; + try { + iface_->GetCrossReference(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetCrossReference"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetCrossReference", ::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.GetCrossReference"); + } + + oprot->writeMessageBegin("GetCrossReference", ::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.GetCrossReference", bytes); + } +} + +void TCLIServiceProcessor::process_GetOperationStatus(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.GetOperationStatus", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetOperationStatus"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetOperationStatus"); + } + + TCLIService_GetOperationStatus_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetOperationStatus", bytes); + } + + TCLIService_GetOperationStatus_result result; + try { + iface_->GetOperationStatus(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetOperationStatus"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetOperationStatus", ::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.GetOperationStatus"); + } + + oprot->writeMessageBegin("GetOperationStatus", ::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.GetOperationStatus", bytes); + } +} + +void TCLIServiceProcessor::process_CancelOperation(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.CancelOperation", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CancelOperation"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.CancelOperation"); + } + + TCLIService_CancelOperation_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.CancelOperation", bytes); + } + + TCLIService_CancelOperation_result result; + try { + iface_->CancelOperation(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.CancelOperation"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("CancelOperation", ::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.CancelOperation"); + } + + oprot->writeMessageBegin("CancelOperation", ::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.CancelOperation", bytes); + } +} + +void TCLIServiceProcessor::process_CloseOperation(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.CloseOperation", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CloseOperation"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.CloseOperation"); + } + + TCLIService_CloseOperation_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.CloseOperation", bytes); + } + + TCLIService_CloseOperation_result result; + try { + iface_->CloseOperation(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.CloseOperation"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("CloseOperation", ::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.CloseOperation"); + } + + oprot->writeMessageBegin("CloseOperation", ::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.CloseOperation", bytes); + } +} + +void TCLIServiceProcessor::process_GetResultSetMetadata(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.GetResultSetMetadata", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetResultSetMetadata"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetResultSetMetadata"); + } + + TCLIService_GetResultSetMetadata_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetResultSetMetadata", bytes); + } + + TCLIService_GetResultSetMetadata_result result; + try { + iface_->GetResultSetMetadata(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetResultSetMetadata"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetResultSetMetadata", ::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.GetResultSetMetadata"); + } + + oprot->writeMessageBegin("GetResultSetMetadata", ::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.GetResultSetMetadata", bytes); + } +} + +void TCLIServiceProcessor::process_FetchResults(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.FetchResults", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.FetchResults"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.FetchResults"); + } + + TCLIService_FetchResults_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.FetchResults", bytes); + } + + TCLIService_FetchResults_result result; + try { + iface_->FetchResults(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.FetchResults"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("FetchResults", ::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.FetchResults"); + } + + oprot->writeMessageBegin("FetchResults", ::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.FetchResults", bytes); + } +} + +void TCLIServiceProcessor::process_GetDelegationToken(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.GetDelegationToken", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetDelegationToken"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetDelegationToken"); + } + + TCLIService_GetDelegationToken_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetDelegationToken", bytes); + } + + TCLIService_GetDelegationToken_result result; + try { + iface_->GetDelegationToken(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetDelegationToken"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetDelegationToken", ::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.GetDelegationToken"); + } + + oprot->writeMessageBegin("GetDelegationToken", ::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.GetDelegationToken", bytes); + } +} + +void TCLIServiceProcessor::process_CancelDelegationToken(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.CancelDelegationToken", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CancelDelegationToken"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.CancelDelegationToken"); + } + + TCLIService_CancelDelegationToken_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.CancelDelegationToken", bytes); + } + + TCLIService_CancelDelegationToken_result result; + try { + iface_->CancelDelegationToken(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.CancelDelegationToken"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("CancelDelegationToken", ::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.CancelDelegationToken"); + } + + oprot->writeMessageBegin("CancelDelegationToken", ::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.CancelDelegationToken", bytes); + } +} + +void TCLIServiceProcessor::process_RenewDelegationToken(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.RenewDelegationToken", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.RenewDelegationToken"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.RenewDelegationToken"); + } + + TCLIService_RenewDelegationToken_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.RenewDelegationToken", bytes); + } + + TCLIService_RenewDelegationToken_result result; + try { + iface_->RenewDelegationToken(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.RenewDelegationToken"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("RenewDelegationToken", ::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.RenewDelegationToken"); + } + + oprot->writeMessageBegin("RenewDelegationToken", ::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.RenewDelegationToken", bytes); + } +} + +void TCLIServiceProcessor::process_GetQueryId(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.GetQueryId", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetQueryId"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.GetQueryId"); + } + + TCLIService_GetQueryId_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.GetQueryId", bytes); + } + + TCLIService_GetQueryId_result result; + try { + iface_->GetQueryId(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.GetQueryId"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("GetQueryId", ::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.GetQueryId"); + } + + oprot->writeMessageBegin("GetQueryId", ::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.GetQueryId", bytes); + } +} + +void TCLIServiceProcessor::process_SetClientInfo(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.SetClientInfo", callContext); + } + ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.SetClientInfo"); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->preRead(ctx, "TCLIService.SetClientInfo"); + } + + TCLIService_SetClientInfo_args args; + args.read(iprot); + iprot->readMessageEnd(); + uint32_t bytes = iprot->getTransport()->readEnd(); + + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->postRead(ctx, "TCLIService.SetClientInfo", bytes); + } + + TCLIService_SetClientInfo_result result; + try { + iface_->SetClientInfo(result.success, args.req); + result.__isset.success = true; + } catch (const std::exception& e) { + if (this->eventHandler_.get() != NULL) { + this->eventHandler_->handlerError(ctx, "TCLIService.SetClientInfo"); + } + + ::apache::thrift::TApplicationException x(e.what()); + oprot->writeMessageBegin("SetClientInfo", ::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.SetClientInfo"); + } + + oprot->writeMessageBegin("SetClientInfo", ::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.SetClientInfo", bytes); + } +} + +::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > TCLIServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { + ::apache::thrift::ReleaseHandler< TCLIServiceIfFactory > cleanup(handlerFactory_); + ::apache::thrift::stdcxx::shared_ptr< TCLIServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup); + ::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > processor(new TCLIServiceProcessor(handler)); + return processor; +} + +void TCLIServiceConcurrentClient::OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) +{ + int32_t seqid = send_OpenSession(req); + recv_OpenSession(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_OpenSession(const TOpenSessionReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + 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(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_OpenSession(TOpenSessionResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + 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(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + 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 + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "OpenSession failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) +{ + int32_t seqid = send_CloseSession(req); + recv_CloseSession(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_CloseSession(const TCloseSessionReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + 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(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_CloseSession(TCloseSessionResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + 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(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + 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 + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CloseSession failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) +{ + int32_t seqid = send_GetInfo(req); + recv_GetInfo(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetInfo(const TGetInfoReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetInfo", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetInfo_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetInfo(TGetInfoResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetInfo") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetInfo_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetInfo failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) +{ + int32_t seqid = send_ExecuteStatement(req); + recv_ExecuteStatement(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_ExecuteStatement(const TExecuteStatementReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("ExecuteStatement", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_ExecuteStatement_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_ExecuteStatement(TExecuteStatementResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("ExecuteStatement") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_ExecuteStatement_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "ExecuteStatement failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) +{ + int32_t seqid = send_GetTypeInfo(req); + recv_GetTypeInfo(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetTypeInfo(const TGetTypeInfoReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetTypeInfo", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetTypeInfo_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetTypeInfo(TGetTypeInfoResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetTypeInfo") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetTypeInfo_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetTypeInfo failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) +{ + int32_t seqid = send_GetCatalogs(req); + recv_GetCatalogs(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetCatalogs(const TGetCatalogsReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetCatalogs", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetCatalogs_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetCatalogs(TGetCatalogsResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetCatalogs") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetCatalogs_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetCatalogs failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) +{ + int32_t seqid = send_GetSchemas(req); + recv_GetSchemas(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetSchemas(const TGetSchemasReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetSchemas", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetSchemas_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetSchemas(TGetSchemasResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetSchemas") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetSchemas_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetSchemas failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetTables(TGetTablesResp& _return, const TGetTablesReq& req) +{ + int32_t seqid = send_GetTables(req); + recv_GetTables(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetTables(const TGetTablesReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetTables", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetTables_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetTables(TGetTablesResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetTables") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetTables_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetTables failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) +{ + int32_t seqid = send_GetTableTypes(req); + recv_GetTableTypes(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetTableTypes(const TGetTableTypesReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetTableTypes", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetTableTypes_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetTableTypes(TGetTableTypesResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetTableTypes") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetTableTypes_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetTableTypes failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) +{ + int32_t seqid = send_GetColumns(req); + recv_GetColumns(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetColumns(const TGetColumnsReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetColumns", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetColumns_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetColumns(TGetColumnsResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetColumns") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetColumns_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetColumns failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) +{ + int32_t seqid = send_GetFunctions(req); + recv_GetFunctions(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetFunctions(const TGetFunctionsReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetFunctions", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetFunctions_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetFunctions(TGetFunctionsResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetFunctions") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetFunctions_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetFunctions failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) +{ + int32_t seqid = send_GetPrimaryKeys(req); + recv_GetPrimaryKeys(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetPrimaryKeys(const TGetPrimaryKeysReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetPrimaryKeys", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetPrimaryKeys_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetPrimaryKeys(TGetPrimaryKeysResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetPrimaryKeys") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetPrimaryKeys_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetPrimaryKeys failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) +{ + int32_t seqid = send_GetCrossReference(req); + recv_GetCrossReference(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetCrossReference(const TGetCrossReferenceReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetCrossReference", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetCrossReference_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetCrossReference(TGetCrossReferenceResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetCrossReference") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetCrossReference_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetCrossReference failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) +{ + int32_t seqid = send_GetOperationStatus(req); + recv_GetOperationStatus(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetOperationStatus(const TGetOperationStatusReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetOperationStatus", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetOperationStatus_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetOperationStatus(TGetOperationStatusResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetOperationStatus") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetOperationStatus_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetOperationStatus failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) +{ + int32_t seqid = send_CancelOperation(req); + recv_CancelOperation(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_CancelOperation(const TCancelOperationReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("CancelOperation", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_CancelOperation_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_CancelOperation(TCancelOperationResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("CancelOperation") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_CancelOperation_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CancelOperation failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) +{ + int32_t seqid = send_CloseOperation(req); + recv_CloseOperation(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_CloseOperation(const TCloseOperationReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("CloseOperation", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_CloseOperation_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_CloseOperation(TCloseOperationResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("CloseOperation") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_CloseOperation_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CloseOperation failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) +{ + int32_t seqid = send_GetResultSetMetadata(req); + recv_GetResultSetMetadata(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetResultSetMetadata(const TGetResultSetMetadataReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetResultSetMetadata", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetResultSetMetadata_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetResultSetMetadata(TGetResultSetMetadataResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetResultSetMetadata") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetResultSetMetadata_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetResultSetMetadata failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) +{ + int32_t seqid = send_FetchResults(req); + recv_FetchResults(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_FetchResults(const TFetchResultsReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("FetchResults", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_FetchResults_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_FetchResults(TFetchResultsResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("FetchResults") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_FetchResults_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "FetchResults failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) +{ + int32_t seqid = send_GetDelegationToken(req); + recv_GetDelegationToken(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetDelegationToken(const TGetDelegationTokenReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetDelegationToken_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetDelegationToken(TGetDelegationTokenResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetDelegationToken") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetDelegationToken_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetDelegationToken failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) +{ + int32_t seqid = send_CancelDelegationToken(req); + recv_CancelDelegationToken(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_CancelDelegationToken(const TCancelDelegationTokenReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("CancelDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_CancelDelegationToken_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_CancelDelegationToken(TCancelDelegationTokenResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("CancelDelegationToken") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_CancelDelegationToken_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CancelDelegationToken failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) +{ + int32_t seqid = send_RenewDelegationToken(req); + recv_RenewDelegationToken(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_RenewDelegationToken(const TRenewDelegationTokenReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("RenewDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_RenewDelegationToken_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_RenewDelegationToken(TRenewDelegationTokenResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("RenewDelegationToken") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_RenewDelegationToken_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "RenewDelegationToken failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) +{ + int32_t seqid = send_GetQueryId(req); + recv_GetQueryId(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_GetQueryId(const TGetQueryIdReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("GetQueryId", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_GetQueryId_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_GetQueryId(TGetQueryIdResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("GetQueryId") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_GetQueryId_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetQueryId failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +void TCLIServiceConcurrentClient::SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) +{ + int32_t seqid = send_SetClientInfo(req); + recv_SetClientInfo(_return, seqid); +} + +int32_t TCLIServiceConcurrentClient::send_SetClientInfo(const TSetClientInfoReq& req) +{ + int32_t cseqid = this->sync_.generateSeqId(); + ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); + oprot_->writeMessageBegin("SetClientInfo", ::apache::thrift::protocol::T_CALL, cseqid); + + TCLIService_SetClientInfo_pargs args; + args.req = &req; + args.write(oprot_); + + oprot_->writeMessageEnd(); + oprot_->getTransport()->writeEnd(); + oprot_->getTransport()->flush(); + + sentry.commit(); + return cseqid; +} + +void TCLIServiceConcurrentClient::recv_SetClientInfo(TSetClientInfoResp& _return, const int32_t seqid) +{ + + int32_t rseqid = 0; + std::string fname; + ::apache::thrift::protocol::TMessageType mtype; + + // the read mutex gets dropped and reacquired as part of waitForWork() + // The destructor of this sentry wakes up other clients + ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); + + while(true) { + if(!this->sync_.getPending(fname, mtype, rseqid)) { + iprot_->readMessageBegin(fname, mtype, rseqid); + } + if(seqid == rseqid) { + if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { + ::apache::thrift::TApplicationException x; + x.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + sentry.commit(); + throw x; + } + if (mtype != ::apache::thrift::protocol::T_REPLY) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + } + if (fname.compare("SetClientInfo") != 0) { + iprot_->skip(::apache::thrift::protocol::T_STRUCT); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + // in a bad state, don't commit + using ::apache::thrift::protocol::TProtocolException; + throw TProtocolException(TProtocolException::INVALID_DATA); + } + TCLIService_SetClientInfo_presult result; + result.success = &_return; + result.read(iprot_); + iprot_->readMessageEnd(); + iprot_->getTransport()->readEnd(); + + if (result.__isset.success) { + // _return pointer has now been filled + sentry.commit(); + return; + } + // in a bad state, don't commit + throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "SetClientInfo failed: unknown result"); + } + // seqid != rseqid + this->sync_.updatePending(fname, mtype, rseqid); + + // this will temporarily unlock the readMutex, and let other clients get work done + this->sync_.waitForWork(seqid); + } // end while(true) +} + +}}}}} // namespace + diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h new file mode 100644 index 000000000000..23614ee3dcf6 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h @@ -0,0 +1,3068 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef TCLIService_H +#define TCLIService_H + +#include +#include +#include "TCLIService_types.h" + +namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { + +#ifdef _MSC_VER + #pragma warning( push ) + #pragma warning (disable : 4250 ) //inheriting methods via dominance +#endif + +class TCLIServiceIf { + public: + virtual ~TCLIServiceIf() {} + virtual void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) = 0; + 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 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; + virtual void GetTables(TGetTablesResp& _return, const TGetTablesReq& req) = 0; + virtual void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) = 0; + virtual void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) = 0; + virtual void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) = 0; + virtual void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) = 0; + virtual void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) = 0; + virtual void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) = 0; + virtual void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) = 0; + virtual void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) = 0; + virtual void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) = 0; + virtual void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) = 0; + virtual void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) = 0; + virtual void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) = 0; + virtual void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) = 0; + virtual void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) = 0; + virtual void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) = 0; +}; + +class TCLIServiceIfFactory { + public: + typedef TCLIServiceIf Handler; + + virtual ~TCLIServiceIfFactory() {} + + virtual TCLIServiceIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; + virtual void releaseHandler(TCLIServiceIf* /* handler */) = 0; +}; + +class TCLIServiceIfSingletonFactory : virtual public TCLIServiceIfFactory { + public: + TCLIServiceIfSingletonFactory(const ::apache::thrift::stdcxx::shared_ptr& iface) : iface_(iface) {} + virtual ~TCLIServiceIfSingletonFactory() {} + + virtual TCLIServiceIf* getHandler(const ::apache::thrift::TConnectionInfo&) { + return iface_.get(); + } + virtual void releaseHandler(TCLIServiceIf* /* handler */) {} + + protected: + ::apache::thrift::stdcxx::shared_ptr iface_; +}; + +class TCLIServiceNull : virtual public TCLIServiceIf { + public: + virtual ~TCLIServiceNull() {} + void OpenSession(TOpenSessionResp& /* _return */, const TOpenSessionReq& /* req */) { + return; + } + void CloseSession(TCloseSessionResp& /* _return */, const TCloseSessionReq& /* req */) { + return; + } + void GetInfo(TGetInfoResp& /* _return */, const TGetInfoReq& /* req */) { + return; + } + void ExecuteStatement(TExecuteStatementResp& /* _return */, const TExecuteStatementReq& /* req */) { + return; + } + void GetTypeInfo(TGetTypeInfoResp& /* _return */, const TGetTypeInfoReq& /* req */) { + return; + } + void GetCatalogs(TGetCatalogsResp& /* _return */, const TGetCatalogsReq& /* req */) { + return; + } + void GetSchemas(TGetSchemasResp& /* _return */, const TGetSchemasReq& /* req */) { + return; + } + void GetTables(TGetTablesResp& /* _return */, const TGetTablesReq& /* req */) { + return; + } + void GetTableTypes(TGetTableTypesResp& /* _return */, const TGetTableTypesReq& /* req */) { + return; + } + void GetColumns(TGetColumnsResp& /* _return */, const TGetColumnsReq& /* req */) { + return; + } + void GetFunctions(TGetFunctionsResp& /* _return */, const TGetFunctionsReq& /* req */) { + return; + } + void GetPrimaryKeys(TGetPrimaryKeysResp& /* _return */, const TGetPrimaryKeysReq& /* req */) { + return; + } + void GetCrossReference(TGetCrossReferenceResp& /* _return */, const TGetCrossReferenceReq& /* req */) { + return; + } + void GetOperationStatus(TGetOperationStatusResp& /* _return */, const TGetOperationStatusReq& /* req */) { + return; + } + void CancelOperation(TCancelOperationResp& /* _return */, const TCancelOperationReq& /* req */) { + return; + } + void CloseOperation(TCloseOperationResp& /* _return */, const TCloseOperationReq& /* req */) { + return; + } + void GetResultSetMetadata(TGetResultSetMetadataResp& /* _return */, const TGetResultSetMetadataReq& /* req */) { + return; + } + void FetchResults(TFetchResultsResp& /* _return */, const TFetchResultsReq& /* req */) { + return; + } + void GetDelegationToken(TGetDelegationTokenResp& /* _return */, const TGetDelegationTokenReq& /* req */) { + return; + } + void CancelDelegationToken(TCancelDelegationTokenResp& /* _return */, const TCancelDelegationTokenReq& /* req */) { + return; + } + void RenewDelegationToken(TRenewDelegationTokenResp& /* _return */, const TRenewDelegationTokenReq& /* req */) { + return; + } + void GetQueryId(TGetQueryIdResp& /* _return */, const TGetQueryIdReq& /* req */) { + return; + } + void SetClientInfo(TSetClientInfoResp& /* _return */, const TSetClientInfoReq& /* req */) { + return; + } +}; + +typedef struct _TCLIService_OpenSession_args__isset { + _TCLIService_OpenSession_args__isset() : req(false) {} + bool req :1; +} _TCLIService_OpenSession_args__isset; + +class TCLIService_OpenSession_args { + public: + + TCLIService_OpenSession_args(const TCLIService_OpenSession_args&); + TCLIService_OpenSession_args& operator=(const TCLIService_OpenSession_args&); + TCLIService_OpenSession_args() { + } + + virtual ~TCLIService_OpenSession_args() throw(); + TOpenSessionReq req; + + _TCLIService_OpenSession_args__isset __isset; + + void __set_req(const TOpenSessionReq& val); + + bool operator == (const TCLIService_OpenSession_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_OpenSession_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_OpenSession_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_OpenSession_pargs { + public: + + + virtual ~TCLIService_OpenSession_pargs() throw(); + const TOpenSessionReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_OpenSession_result__isset { + _TCLIService_OpenSession_result__isset() : success(false) {} + bool success :1; +} _TCLIService_OpenSession_result__isset; + +class TCLIService_OpenSession_result { + public: + + TCLIService_OpenSession_result(const TCLIService_OpenSession_result&); + TCLIService_OpenSession_result& operator=(const TCLIService_OpenSession_result&); + TCLIService_OpenSession_result() { + } + + virtual ~TCLIService_OpenSession_result() throw(); + TOpenSessionResp success; + + _TCLIService_OpenSession_result__isset __isset; + + void __set_success(const TOpenSessionResp& val); + + bool operator == (const TCLIService_OpenSession_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_OpenSession_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_OpenSession_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_OpenSession_presult__isset { + _TCLIService_OpenSession_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_OpenSession_presult__isset; + +class TCLIService_OpenSession_presult { + public: + + + virtual ~TCLIService_OpenSession_presult() throw(); + TOpenSessionResp* success; + + _TCLIService_OpenSession_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_CloseSession_args__isset { + _TCLIService_CloseSession_args__isset() : req(false) {} + bool req :1; +} _TCLIService_CloseSession_args__isset; + +class TCLIService_CloseSession_args { + public: + + TCLIService_CloseSession_args(const TCLIService_CloseSession_args&); + TCLIService_CloseSession_args& operator=(const TCLIService_CloseSession_args&); + TCLIService_CloseSession_args() { + } + + virtual ~TCLIService_CloseSession_args() throw(); + TCloseSessionReq req; + + _TCLIService_CloseSession_args__isset __isset; + + void __set_req(const TCloseSessionReq& val); + + bool operator == (const TCLIService_CloseSession_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_CloseSession_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CloseSession_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_CloseSession_pargs { + public: + + + virtual ~TCLIService_CloseSession_pargs() throw(); + const TCloseSessionReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CloseSession_result__isset { + _TCLIService_CloseSession_result__isset() : success(false) {} + bool success :1; +} _TCLIService_CloseSession_result__isset; + +class TCLIService_CloseSession_result { + public: + + TCLIService_CloseSession_result(const TCLIService_CloseSession_result&); + TCLIService_CloseSession_result& operator=(const TCLIService_CloseSession_result&); + TCLIService_CloseSession_result() { + } + + virtual ~TCLIService_CloseSession_result() throw(); + TCloseSessionResp success; + + _TCLIService_CloseSession_result__isset __isset; + + void __set_success(const TCloseSessionResp& val); + + bool operator == (const TCLIService_CloseSession_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_CloseSession_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CloseSession_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CloseSession_presult__isset { + _TCLIService_CloseSession_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_CloseSession_presult__isset; + +class TCLIService_CloseSession_presult { + public: + + + virtual ~TCLIService_CloseSession_presult() throw(); + TCloseSessionResp* success; + + _TCLIService_CloseSession_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetInfo_args__isset { + _TCLIService_GetInfo_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetInfo_args__isset; + +class TCLIService_GetInfo_args { + public: + + TCLIService_GetInfo_args(const TCLIService_GetInfo_args&); + TCLIService_GetInfo_args& operator=(const TCLIService_GetInfo_args&); + TCLIService_GetInfo_args() { + } + + virtual ~TCLIService_GetInfo_args() throw(); + TGetInfoReq req; + + _TCLIService_GetInfo_args__isset __isset; + + void __set_req(const TGetInfoReq& val); + + bool operator == (const TCLIService_GetInfo_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetInfo_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetInfo_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetInfo_pargs { + public: + + + virtual ~TCLIService_GetInfo_pargs() throw(); + const TGetInfoReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetInfo_result__isset { + _TCLIService_GetInfo_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetInfo_result__isset; + +class TCLIService_GetInfo_result { + public: + + TCLIService_GetInfo_result(const TCLIService_GetInfo_result&); + TCLIService_GetInfo_result& operator=(const TCLIService_GetInfo_result&); + TCLIService_GetInfo_result() { + } + + virtual ~TCLIService_GetInfo_result() throw(); + TGetInfoResp success; + + _TCLIService_GetInfo_result__isset __isset; + + void __set_success(const TGetInfoResp& val); + + bool operator == (const TCLIService_GetInfo_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetInfo_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetInfo_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetInfo_presult__isset { + _TCLIService_GetInfo_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetInfo_presult__isset; + +class TCLIService_GetInfo_presult { + public: + + + virtual ~TCLIService_GetInfo_presult() throw(); + TGetInfoResp* success; + + _TCLIService_GetInfo_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_ExecuteStatement_args__isset { + _TCLIService_ExecuteStatement_args__isset() : req(false) {} + bool req :1; +} _TCLIService_ExecuteStatement_args__isset; + +class TCLIService_ExecuteStatement_args { + public: + + TCLIService_ExecuteStatement_args(const TCLIService_ExecuteStatement_args&); + TCLIService_ExecuteStatement_args& operator=(const TCLIService_ExecuteStatement_args&); + TCLIService_ExecuteStatement_args() { + } + + virtual ~TCLIService_ExecuteStatement_args() throw(); + TExecuteStatementReq req; + + _TCLIService_ExecuteStatement_args__isset __isset; + + void __set_req(const TExecuteStatementReq& val); + + bool operator == (const TCLIService_ExecuteStatement_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_ExecuteStatement_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_ExecuteStatement_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_ExecuteStatement_pargs { + public: + + + virtual ~TCLIService_ExecuteStatement_pargs() throw(); + const TExecuteStatementReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_ExecuteStatement_result__isset { + _TCLIService_ExecuteStatement_result__isset() : success(false) {} + bool success :1; +} _TCLIService_ExecuteStatement_result__isset; + +class TCLIService_ExecuteStatement_result { + public: + + TCLIService_ExecuteStatement_result(const TCLIService_ExecuteStatement_result&); + TCLIService_ExecuteStatement_result& operator=(const TCLIService_ExecuteStatement_result&); + TCLIService_ExecuteStatement_result() { + } + + virtual ~TCLIService_ExecuteStatement_result() throw(); + TExecuteStatementResp success; + + _TCLIService_ExecuteStatement_result__isset __isset; + + void __set_success(const TExecuteStatementResp& val); + + bool operator == (const TCLIService_ExecuteStatement_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_ExecuteStatement_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_ExecuteStatement_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_ExecuteStatement_presult__isset { + _TCLIService_ExecuteStatement_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_ExecuteStatement_presult__isset; + +class TCLIService_ExecuteStatement_presult { + public: + + + virtual ~TCLIService_ExecuteStatement_presult() throw(); + TExecuteStatementResp* success; + + _TCLIService_ExecuteStatement_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 :1; +} _TCLIService_GetTypeInfo_args__isset; + +class TCLIService_GetTypeInfo_args { + public: + + TCLIService_GetTypeInfo_args(const TCLIService_GetTypeInfo_args&); + TCLIService_GetTypeInfo_args& operator=(const TCLIService_GetTypeInfo_args&); + TCLIService_GetTypeInfo_args() { + } + + virtual ~TCLIService_GetTypeInfo_args() throw(); + TGetTypeInfoReq req; + + _TCLIService_GetTypeInfo_args__isset __isset; + + void __set_req(const TGetTypeInfoReq& val); + + bool operator == (const TCLIService_GetTypeInfo_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetTypeInfo_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetTypeInfo_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetTypeInfo_pargs { + public: + + + virtual ~TCLIService_GetTypeInfo_pargs() throw(); + const TGetTypeInfoReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetTypeInfo_result__isset { + _TCLIService_GetTypeInfo_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetTypeInfo_result__isset; + +class TCLIService_GetTypeInfo_result { + public: + + TCLIService_GetTypeInfo_result(const TCLIService_GetTypeInfo_result&); + TCLIService_GetTypeInfo_result& operator=(const TCLIService_GetTypeInfo_result&); + TCLIService_GetTypeInfo_result() { + } + + virtual ~TCLIService_GetTypeInfo_result() throw(); + TGetTypeInfoResp success; + + _TCLIService_GetTypeInfo_result__isset __isset; + + void __set_success(const TGetTypeInfoResp& val); + + bool operator == (const TCLIService_GetTypeInfo_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetTypeInfo_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetTypeInfo_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetTypeInfo_presult__isset { + _TCLIService_GetTypeInfo_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetTypeInfo_presult__isset; + +class TCLIService_GetTypeInfo_presult { + public: + + + virtual ~TCLIService_GetTypeInfo_presult() throw(); + TGetTypeInfoResp* success; + + _TCLIService_GetTypeInfo_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetCatalogs_args__isset { + _TCLIService_GetCatalogs_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetCatalogs_args__isset; + +class TCLIService_GetCatalogs_args { + public: + + TCLIService_GetCatalogs_args(const TCLIService_GetCatalogs_args&); + TCLIService_GetCatalogs_args& operator=(const TCLIService_GetCatalogs_args&); + TCLIService_GetCatalogs_args() { + } + + virtual ~TCLIService_GetCatalogs_args() throw(); + TGetCatalogsReq req; + + _TCLIService_GetCatalogs_args__isset __isset; + + void __set_req(const TGetCatalogsReq& val); + + bool operator == (const TCLIService_GetCatalogs_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetCatalogs_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetCatalogs_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetCatalogs_pargs { + public: + + + virtual ~TCLIService_GetCatalogs_pargs() throw(); + const TGetCatalogsReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetCatalogs_result__isset { + _TCLIService_GetCatalogs_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetCatalogs_result__isset; + +class TCLIService_GetCatalogs_result { + public: + + TCLIService_GetCatalogs_result(const TCLIService_GetCatalogs_result&); + TCLIService_GetCatalogs_result& operator=(const TCLIService_GetCatalogs_result&); + TCLIService_GetCatalogs_result() { + } + + virtual ~TCLIService_GetCatalogs_result() throw(); + TGetCatalogsResp success; + + _TCLIService_GetCatalogs_result__isset __isset; + + void __set_success(const TGetCatalogsResp& val); + + bool operator == (const TCLIService_GetCatalogs_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetCatalogs_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetCatalogs_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetCatalogs_presult__isset { + _TCLIService_GetCatalogs_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetCatalogs_presult__isset; + +class TCLIService_GetCatalogs_presult { + public: + + + virtual ~TCLIService_GetCatalogs_presult() throw(); + TGetCatalogsResp* success; + + _TCLIService_GetCatalogs_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetSchemas_args__isset { + _TCLIService_GetSchemas_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetSchemas_args__isset; + +class TCLIService_GetSchemas_args { + public: + + TCLIService_GetSchemas_args(const TCLIService_GetSchemas_args&); + TCLIService_GetSchemas_args& operator=(const TCLIService_GetSchemas_args&); + TCLIService_GetSchemas_args() { + } + + virtual ~TCLIService_GetSchemas_args() throw(); + TGetSchemasReq req; + + _TCLIService_GetSchemas_args__isset __isset; + + void __set_req(const TGetSchemasReq& val); + + bool operator == (const TCLIService_GetSchemas_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetSchemas_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetSchemas_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetSchemas_pargs { + public: + + + virtual ~TCLIService_GetSchemas_pargs() throw(); + const TGetSchemasReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetSchemas_result__isset { + _TCLIService_GetSchemas_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetSchemas_result__isset; + +class TCLIService_GetSchemas_result { + public: + + TCLIService_GetSchemas_result(const TCLIService_GetSchemas_result&); + TCLIService_GetSchemas_result& operator=(const TCLIService_GetSchemas_result&); + TCLIService_GetSchemas_result() { + } + + virtual ~TCLIService_GetSchemas_result() throw(); + TGetSchemasResp success; + + _TCLIService_GetSchemas_result__isset __isset; + + void __set_success(const TGetSchemasResp& val); + + bool operator == (const TCLIService_GetSchemas_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetSchemas_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetSchemas_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetSchemas_presult__isset { + _TCLIService_GetSchemas_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetSchemas_presult__isset; + +class TCLIService_GetSchemas_presult { + public: + + + virtual ~TCLIService_GetSchemas_presult() throw(); + TGetSchemasResp* success; + + _TCLIService_GetSchemas_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetTables_args__isset { + _TCLIService_GetTables_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetTables_args__isset; + +class TCLIService_GetTables_args { + public: + + TCLIService_GetTables_args(const TCLIService_GetTables_args&); + TCLIService_GetTables_args& operator=(const TCLIService_GetTables_args&); + TCLIService_GetTables_args() { + } + + virtual ~TCLIService_GetTables_args() throw(); + TGetTablesReq req; + + _TCLIService_GetTables_args__isset __isset; + + void __set_req(const TGetTablesReq& val); + + bool operator == (const TCLIService_GetTables_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetTables_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetTables_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetTables_pargs { + public: + + + virtual ~TCLIService_GetTables_pargs() throw(); + const TGetTablesReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetTables_result__isset { + _TCLIService_GetTables_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetTables_result__isset; + +class TCLIService_GetTables_result { + public: + + TCLIService_GetTables_result(const TCLIService_GetTables_result&); + TCLIService_GetTables_result& operator=(const TCLIService_GetTables_result&); + TCLIService_GetTables_result() { + } + + virtual ~TCLIService_GetTables_result() throw(); + TGetTablesResp success; + + _TCLIService_GetTables_result__isset __isset; + + void __set_success(const TGetTablesResp& val); + + bool operator == (const TCLIService_GetTables_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetTables_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetTables_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetTables_presult__isset { + _TCLIService_GetTables_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetTables_presult__isset; + +class TCLIService_GetTables_presult { + public: + + + virtual ~TCLIService_GetTables_presult() throw(); + TGetTablesResp* success; + + _TCLIService_GetTables_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetTableTypes_args__isset { + _TCLIService_GetTableTypes_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetTableTypes_args__isset; + +class TCLIService_GetTableTypes_args { + public: + + TCLIService_GetTableTypes_args(const TCLIService_GetTableTypes_args&); + TCLIService_GetTableTypes_args& operator=(const TCLIService_GetTableTypes_args&); + TCLIService_GetTableTypes_args() { + } + + virtual ~TCLIService_GetTableTypes_args() throw(); + TGetTableTypesReq req; + + _TCLIService_GetTableTypes_args__isset __isset; + + void __set_req(const TGetTableTypesReq& val); + + bool operator == (const TCLIService_GetTableTypes_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetTableTypes_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetTableTypes_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetTableTypes_pargs { + public: + + + virtual ~TCLIService_GetTableTypes_pargs() throw(); + const TGetTableTypesReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetTableTypes_result__isset { + _TCLIService_GetTableTypes_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetTableTypes_result__isset; + +class TCLIService_GetTableTypes_result { + public: + + TCLIService_GetTableTypes_result(const TCLIService_GetTableTypes_result&); + TCLIService_GetTableTypes_result& operator=(const TCLIService_GetTableTypes_result&); + TCLIService_GetTableTypes_result() { + } + + virtual ~TCLIService_GetTableTypes_result() throw(); + TGetTableTypesResp success; + + _TCLIService_GetTableTypes_result__isset __isset; + + void __set_success(const TGetTableTypesResp& val); + + bool operator == (const TCLIService_GetTableTypes_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetTableTypes_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetTableTypes_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetTableTypes_presult__isset { + _TCLIService_GetTableTypes_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetTableTypes_presult__isset; + +class TCLIService_GetTableTypes_presult { + public: + + + virtual ~TCLIService_GetTableTypes_presult() throw(); + TGetTableTypesResp* success; + + _TCLIService_GetTableTypes_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetColumns_args__isset { + _TCLIService_GetColumns_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetColumns_args__isset; + +class TCLIService_GetColumns_args { + public: + + TCLIService_GetColumns_args(const TCLIService_GetColumns_args&); + TCLIService_GetColumns_args& operator=(const TCLIService_GetColumns_args&); + TCLIService_GetColumns_args() { + } + + virtual ~TCLIService_GetColumns_args() throw(); + TGetColumnsReq req; + + _TCLIService_GetColumns_args__isset __isset; + + void __set_req(const TGetColumnsReq& val); + + bool operator == (const TCLIService_GetColumns_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetColumns_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetColumns_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetColumns_pargs { + public: + + + virtual ~TCLIService_GetColumns_pargs() throw(); + const TGetColumnsReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetColumns_result__isset { + _TCLIService_GetColumns_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetColumns_result__isset; + +class TCLIService_GetColumns_result { + public: + + TCLIService_GetColumns_result(const TCLIService_GetColumns_result&); + TCLIService_GetColumns_result& operator=(const TCLIService_GetColumns_result&); + TCLIService_GetColumns_result() { + } + + virtual ~TCLIService_GetColumns_result() throw(); + TGetColumnsResp success; + + _TCLIService_GetColumns_result__isset __isset; + + void __set_success(const TGetColumnsResp& val); + + bool operator == (const TCLIService_GetColumns_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetColumns_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetColumns_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetColumns_presult__isset { + _TCLIService_GetColumns_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetColumns_presult__isset; + +class TCLIService_GetColumns_presult { + public: + + + virtual ~TCLIService_GetColumns_presult() throw(); + TGetColumnsResp* success; + + _TCLIService_GetColumns_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetFunctions_args__isset { + _TCLIService_GetFunctions_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetFunctions_args__isset; + +class TCLIService_GetFunctions_args { + public: + + TCLIService_GetFunctions_args(const TCLIService_GetFunctions_args&); + TCLIService_GetFunctions_args& operator=(const TCLIService_GetFunctions_args&); + TCLIService_GetFunctions_args() { + } + + virtual ~TCLIService_GetFunctions_args() throw(); + TGetFunctionsReq req; + + _TCLIService_GetFunctions_args__isset __isset; + + void __set_req(const TGetFunctionsReq& val); + + bool operator == (const TCLIService_GetFunctions_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetFunctions_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetFunctions_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetFunctions_pargs { + public: + + + virtual ~TCLIService_GetFunctions_pargs() throw(); + const TGetFunctionsReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetFunctions_result__isset { + _TCLIService_GetFunctions_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetFunctions_result__isset; + +class TCLIService_GetFunctions_result { + public: + + TCLIService_GetFunctions_result(const TCLIService_GetFunctions_result&); + TCLIService_GetFunctions_result& operator=(const TCLIService_GetFunctions_result&); + TCLIService_GetFunctions_result() { + } + + virtual ~TCLIService_GetFunctions_result() throw(); + TGetFunctionsResp success; + + _TCLIService_GetFunctions_result__isset __isset; + + void __set_success(const TGetFunctionsResp& val); + + bool operator == (const TCLIService_GetFunctions_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetFunctions_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetFunctions_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetFunctions_presult__isset { + _TCLIService_GetFunctions_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetFunctions_presult__isset; + +class TCLIService_GetFunctions_presult { + public: + + + virtual ~TCLIService_GetFunctions_presult() throw(); + TGetFunctionsResp* success; + + _TCLIService_GetFunctions_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetPrimaryKeys_args__isset { + _TCLIService_GetPrimaryKeys_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetPrimaryKeys_args__isset; + +class TCLIService_GetPrimaryKeys_args { + public: + + TCLIService_GetPrimaryKeys_args(const TCLIService_GetPrimaryKeys_args&); + TCLIService_GetPrimaryKeys_args& operator=(const TCLIService_GetPrimaryKeys_args&); + TCLIService_GetPrimaryKeys_args() { + } + + virtual ~TCLIService_GetPrimaryKeys_args() throw(); + TGetPrimaryKeysReq req; + + _TCLIService_GetPrimaryKeys_args__isset __isset; + + void __set_req(const TGetPrimaryKeysReq& val); + + bool operator == (const TCLIService_GetPrimaryKeys_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetPrimaryKeys_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetPrimaryKeys_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetPrimaryKeys_pargs { + public: + + + virtual ~TCLIService_GetPrimaryKeys_pargs() throw(); + const TGetPrimaryKeysReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetPrimaryKeys_result__isset { + _TCLIService_GetPrimaryKeys_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetPrimaryKeys_result__isset; + +class TCLIService_GetPrimaryKeys_result { + public: + + TCLIService_GetPrimaryKeys_result(const TCLIService_GetPrimaryKeys_result&); + TCLIService_GetPrimaryKeys_result& operator=(const TCLIService_GetPrimaryKeys_result&); + TCLIService_GetPrimaryKeys_result() { + } + + virtual ~TCLIService_GetPrimaryKeys_result() throw(); + TGetPrimaryKeysResp success; + + _TCLIService_GetPrimaryKeys_result__isset __isset; + + void __set_success(const TGetPrimaryKeysResp& val); + + bool operator == (const TCLIService_GetPrimaryKeys_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetPrimaryKeys_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetPrimaryKeys_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetPrimaryKeys_presult__isset { + _TCLIService_GetPrimaryKeys_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetPrimaryKeys_presult__isset; + +class TCLIService_GetPrimaryKeys_presult { + public: + + + virtual ~TCLIService_GetPrimaryKeys_presult() throw(); + TGetPrimaryKeysResp* success; + + _TCLIService_GetPrimaryKeys_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetCrossReference_args__isset { + _TCLIService_GetCrossReference_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetCrossReference_args__isset; + +class TCLIService_GetCrossReference_args { + public: + + TCLIService_GetCrossReference_args(const TCLIService_GetCrossReference_args&); + TCLIService_GetCrossReference_args& operator=(const TCLIService_GetCrossReference_args&); + TCLIService_GetCrossReference_args() { + } + + virtual ~TCLIService_GetCrossReference_args() throw(); + TGetCrossReferenceReq req; + + _TCLIService_GetCrossReference_args__isset __isset; + + void __set_req(const TGetCrossReferenceReq& val); + + bool operator == (const TCLIService_GetCrossReference_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetCrossReference_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetCrossReference_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetCrossReference_pargs { + public: + + + virtual ~TCLIService_GetCrossReference_pargs() throw(); + const TGetCrossReferenceReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetCrossReference_result__isset { + _TCLIService_GetCrossReference_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetCrossReference_result__isset; + +class TCLIService_GetCrossReference_result { + public: + + TCLIService_GetCrossReference_result(const TCLIService_GetCrossReference_result&); + TCLIService_GetCrossReference_result& operator=(const TCLIService_GetCrossReference_result&); + TCLIService_GetCrossReference_result() { + } + + virtual ~TCLIService_GetCrossReference_result() throw(); + TGetCrossReferenceResp success; + + _TCLIService_GetCrossReference_result__isset __isset; + + void __set_success(const TGetCrossReferenceResp& val); + + bool operator == (const TCLIService_GetCrossReference_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetCrossReference_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetCrossReference_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetCrossReference_presult__isset { + _TCLIService_GetCrossReference_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetCrossReference_presult__isset; + +class TCLIService_GetCrossReference_presult { + public: + + + virtual ~TCLIService_GetCrossReference_presult() throw(); + TGetCrossReferenceResp* success; + + _TCLIService_GetCrossReference_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetOperationStatus_args__isset { + _TCLIService_GetOperationStatus_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetOperationStatus_args__isset; + +class TCLIService_GetOperationStatus_args { + public: + + TCLIService_GetOperationStatus_args(const TCLIService_GetOperationStatus_args&); + TCLIService_GetOperationStatus_args& operator=(const TCLIService_GetOperationStatus_args&); + TCLIService_GetOperationStatus_args() { + } + + virtual ~TCLIService_GetOperationStatus_args() throw(); + TGetOperationStatusReq req; + + _TCLIService_GetOperationStatus_args__isset __isset; + + void __set_req(const TGetOperationStatusReq& val); + + bool operator == (const TCLIService_GetOperationStatus_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetOperationStatus_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetOperationStatus_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetOperationStatus_pargs { + public: + + + virtual ~TCLIService_GetOperationStatus_pargs() throw(); + const TGetOperationStatusReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetOperationStatus_result__isset { + _TCLIService_GetOperationStatus_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetOperationStatus_result__isset; + +class TCLIService_GetOperationStatus_result { + public: + + TCLIService_GetOperationStatus_result(const TCLIService_GetOperationStatus_result&); + TCLIService_GetOperationStatus_result& operator=(const TCLIService_GetOperationStatus_result&); + TCLIService_GetOperationStatus_result() { + } + + virtual ~TCLIService_GetOperationStatus_result() throw(); + TGetOperationStatusResp success; + + _TCLIService_GetOperationStatus_result__isset __isset; + + void __set_success(const TGetOperationStatusResp& val); + + bool operator == (const TCLIService_GetOperationStatus_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetOperationStatus_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetOperationStatus_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetOperationStatus_presult__isset { + _TCLIService_GetOperationStatus_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetOperationStatus_presult__isset; + +class TCLIService_GetOperationStatus_presult { + public: + + + virtual ~TCLIService_GetOperationStatus_presult() throw(); + TGetOperationStatusResp* success; + + _TCLIService_GetOperationStatus_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_CancelOperation_args__isset { + _TCLIService_CancelOperation_args__isset() : req(false) {} + bool req :1; +} _TCLIService_CancelOperation_args__isset; + +class TCLIService_CancelOperation_args { + public: + + TCLIService_CancelOperation_args(const TCLIService_CancelOperation_args&); + TCLIService_CancelOperation_args& operator=(const TCLIService_CancelOperation_args&); + TCLIService_CancelOperation_args() { + } + + virtual ~TCLIService_CancelOperation_args() throw(); + TCancelOperationReq req; + + _TCLIService_CancelOperation_args__isset __isset; + + void __set_req(const TCancelOperationReq& val); + + bool operator == (const TCLIService_CancelOperation_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_CancelOperation_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CancelOperation_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_CancelOperation_pargs { + public: + + + virtual ~TCLIService_CancelOperation_pargs() throw(); + const TCancelOperationReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CancelOperation_result__isset { + _TCLIService_CancelOperation_result__isset() : success(false) {} + bool success :1; +} _TCLIService_CancelOperation_result__isset; + +class TCLIService_CancelOperation_result { + public: + + TCLIService_CancelOperation_result(const TCLIService_CancelOperation_result&); + TCLIService_CancelOperation_result& operator=(const TCLIService_CancelOperation_result&); + TCLIService_CancelOperation_result() { + } + + virtual ~TCLIService_CancelOperation_result() throw(); + TCancelOperationResp success; + + _TCLIService_CancelOperation_result__isset __isset; + + void __set_success(const TCancelOperationResp& val); + + bool operator == (const TCLIService_CancelOperation_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_CancelOperation_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CancelOperation_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CancelOperation_presult__isset { + _TCLIService_CancelOperation_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_CancelOperation_presult__isset; + +class TCLIService_CancelOperation_presult { + public: + + + virtual ~TCLIService_CancelOperation_presult() throw(); + TCancelOperationResp* success; + + _TCLIService_CancelOperation_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_CloseOperation_args__isset { + _TCLIService_CloseOperation_args__isset() : req(false) {} + bool req :1; +} _TCLIService_CloseOperation_args__isset; + +class TCLIService_CloseOperation_args { + public: + + TCLIService_CloseOperation_args(const TCLIService_CloseOperation_args&); + TCLIService_CloseOperation_args& operator=(const TCLIService_CloseOperation_args&); + TCLIService_CloseOperation_args() { + } + + virtual ~TCLIService_CloseOperation_args() throw(); + TCloseOperationReq req; + + _TCLIService_CloseOperation_args__isset __isset; + + void __set_req(const TCloseOperationReq& val); + + bool operator == (const TCLIService_CloseOperation_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_CloseOperation_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CloseOperation_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_CloseOperation_pargs { + public: + + + virtual ~TCLIService_CloseOperation_pargs() throw(); + const TCloseOperationReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CloseOperation_result__isset { + _TCLIService_CloseOperation_result__isset() : success(false) {} + bool success :1; +} _TCLIService_CloseOperation_result__isset; + +class TCLIService_CloseOperation_result { + public: + + TCLIService_CloseOperation_result(const TCLIService_CloseOperation_result&); + TCLIService_CloseOperation_result& operator=(const TCLIService_CloseOperation_result&); + TCLIService_CloseOperation_result() { + } + + virtual ~TCLIService_CloseOperation_result() throw(); + TCloseOperationResp success; + + _TCLIService_CloseOperation_result__isset __isset; + + void __set_success(const TCloseOperationResp& val); + + bool operator == (const TCLIService_CloseOperation_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_CloseOperation_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CloseOperation_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CloseOperation_presult__isset { + _TCLIService_CloseOperation_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_CloseOperation_presult__isset; + +class TCLIService_CloseOperation_presult { + public: + + + virtual ~TCLIService_CloseOperation_presult() throw(); + TCloseOperationResp* success; + + _TCLIService_CloseOperation_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetResultSetMetadata_args__isset { + _TCLIService_GetResultSetMetadata_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetResultSetMetadata_args__isset; + +class TCLIService_GetResultSetMetadata_args { + public: + + TCLIService_GetResultSetMetadata_args(const TCLIService_GetResultSetMetadata_args&); + TCLIService_GetResultSetMetadata_args& operator=(const TCLIService_GetResultSetMetadata_args&); + TCLIService_GetResultSetMetadata_args() { + } + + virtual ~TCLIService_GetResultSetMetadata_args() throw(); + TGetResultSetMetadataReq req; + + _TCLIService_GetResultSetMetadata_args__isset __isset; + + void __set_req(const TGetResultSetMetadataReq& val); + + bool operator == (const TCLIService_GetResultSetMetadata_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetResultSetMetadata_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetResultSetMetadata_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetResultSetMetadata_pargs { + public: + + + virtual ~TCLIService_GetResultSetMetadata_pargs() throw(); + const TGetResultSetMetadataReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetResultSetMetadata_result__isset { + _TCLIService_GetResultSetMetadata_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetResultSetMetadata_result__isset; + +class TCLIService_GetResultSetMetadata_result { + public: + + TCLIService_GetResultSetMetadata_result(const TCLIService_GetResultSetMetadata_result&); + TCLIService_GetResultSetMetadata_result& operator=(const TCLIService_GetResultSetMetadata_result&); + TCLIService_GetResultSetMetadata_result() { + } + + virtual ~TCLIService_GetResultSetMetadata_result() throw(); + TGetResultSetMetadataResp success; + + _TCLIService_GetResultSetMetadata_result__isset __isset; + + void __set_success(const TGetResultSetMetadataResp& val); + + bool operator == (const TCLIService_GetResultSetMetadata_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetResultSetMetadata_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetResultSetMetadata_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetResultSetMetadata_presult__isset { + _TCLIService_GetResultSetMetadata_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetResultSetMetadata_presult__isset; + +class TCLIService_GetResultSetMetadata_presult { + public: + + + virtual ~TCLIService_GetResultSetMetadata_presult() throw(); + TGetResultSetMetadataResp* success; + + _TCLIService_GetResultSetMetadata_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_FetchResults_args__isset { + _TCLIService_FetchResults_args__isset() : req(false) {} + bool req :1; +} _TCLIService_FetchResults_args__isset; + +class TCLIService_FetchResults_args { + public: + + TCLIService_FetchResults_args(const TCLIService_FetchResults_args&); + TCLIService_FetchResults_args& operator=(const TCLIService_FetchResults_args&); + TCLIService_FetchResults_args() { + } + + virtual ~TCLIService_FetchResults_args() throw(); + TFetchResultsReq req; + + _TCLIService_FetchResults_args__isset __isset; + + void __set_req(const TFetchResultsReq& val); + + bool operator == (const TCLIService_FetchResults_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_FetchResults_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_FetchResults_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_FetchResults_pargs { + public: + + + virtual ~TCLIService_FetchResults_pargs() throw(); + const TFetchResultsReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_FetchResults_result__isset { + _TCLIService_FetchResults_result__isset() : success(false) {} + bool success :1; +} _TCLIService_FetchResults_result__isset; + +class TCLIService_FetchResults_result { + public: + + TCLIService_FetchResults_result(const TCLIService_FetchResults_result&); + TCLIService_FetchResults_result& operator=(const TCLIService_FetchResults_result&); + TCLIService_FetchResults_result() { + } + + virtual ~TCLIService_FetchResults_result() throw(); + TFetchResultsResp success; + + _TCLIService_FetchResults_result__isset __isset; + + void __set_success(const TFetchResultsResp& val); + + bool operator == (const TCLIService_FetchResults_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_FetchResults_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_FetchResults_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_FetchResults_presult__isset { + _TCLIService_FetchResults_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_FetchResults_presult__isset; + +class TCLIService_FetchResults_presult { + public: + + + virtual ~TCLIService_FetchResults_presult() throw(); + TFetchResultsResp* success; + + _TCLIService_FetchResults_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetDelegationToken_args__isset { + _TCLIService_GetDelegationToken_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetDelegationToken_args__isset; + +class TCLIService_GetDelegationToken_args { + public: + + TCLIService_GetDelegationToken_args(const TCLIService_GetDelegationToken_args&); + TCLIService_GetDelegationToken_args& operator=(const TCLIService_GetDelegationToken_args&); + TCLIService_GetDelegationToken_args() { + } + + virtual ~TCLIService_GetDelegationToken_args() throw(); + TGetDelegationTokenReq req; + + _TCLIService_GetDelegationToken_args__isset __isset; + + void __set_req(const TGetDelegationTokenReq& val); + + bool operator == (const TCLIService_GetDelegationToken_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetDelegationToken_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetDelegationToken_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetDelegationToken_pargs { + public: + + + virtual ~TCLIService_GetDelegationToken_pargs() throw(); + const TGetDelegationTokenReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetDelegationToken_result__isset { + _TCLIService_GetDelegationToken_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetDelegationToken_result__isset; + +class TCLIService_GetDelegationToken_result { + public: + + TCLIService_GetDelegationToken_result(const TCLIService_GetDelegationToken_result&); + TCLIService_GetDelegationToken_result& operator=(const TCLIService_GetDelegationToken_result&); + TCLIService_GetDelegationToken_result() { + } + + virtual ~TCLIService_GetDelegationToken_result() throw(); + TGetDelegationTokenResp success; + + _TCLIService_GetDelegationToken_result__isset __isset; + + void __set_success(const TGetDelegationTokenResp& val); + + bool operator == (const TCLIService_GetDelegationToken_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetDelegationToken_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetDelegationToken_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetDelegationToken_presult__isset { + _TCLIService_GetDelegationToken_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetDelegationToken_presult__isset; + +class TCLIService_GetDelegationToken_presult { + public: + + + virtual ~TCLIService_GetDelegationToken_presult() throw(); + TGetDelegationTokenResp* success; + + _TCLIService_GetDelegationToken_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_CancelDelegationToken_args__isset { + _TCLIService_CancelDelegationToken_args__isset() : req(false) {} + bool req :1; +} _TCLIService_CancelDelegationToken_args__isset; + +class TCLIService_CancelDelegationToken_args { + public: + + TCLIService_CancelDelegationToken_args(const TCLIService_CancelDelegationToken_args&); + TCLIService_CancelDelegationToken_args& operator=(const TCLIService_CancelDelegationToken_args&); + TCLIService_CancelDelegationToken_args() { + } + + virtual ~TCLIService_CancelDelegationToken_args() throw(); + TCancelDelegationTokenReq req; + + _TCLIService_CancelDelegationToken_args__isset __isset; + + void __set_req(const TCancelDelegationTokenReq& val); + + bool operator == (const TCLIService_CancelDelegationToken_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_CancelDelegationToken_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CancelDelegationToken_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_CancelDelegationToken_pargs { + public: + + + virtual ~TCLIService_CancelDelegationToken_pargs() throw(); + const TCancelDelegationTokenReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CancelDelegationToken_result__isset { + _TCLIService_CancelDelegationToken_result__isset() : success(false) {} + bool success :1; +} _TCLIService_CancelDelegationToken_result__isset; + +class TCLIService_CancelDelegationToken_result { + public: + + TCLIService_CancelDelegationToken_result(const TCLIService_CancelDelegationToken_result&); + TCLIService_CancelDelegationToken_result& operator=(const TCLIService_CancelDelegationToken_result&); + TCLIService_CancelDelegationToken_result() { + } + + virtual ~TCLIService_CancelDelegationToken_result() throw(); + TCancelDelegationTokenResp success; + + _TCLIService_CancelDelegationToken_result__isset __isset; + + void __set_success(const TCancelDelegationTokenResp& val); + + bool operator == (const TCLIService_CancelDelegationToken_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_CancelDelegationToken_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_CancelDelegationToken_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_CancelDelegationToken_presult__isset { + _TCLIService_CancelDelegationToken_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_CancelDelegationToken_presult__isset; + +class TCLIService_CancelDelegationToken_presult { + public: + + + virtual ~TCLIService_CancelDelegationToken_presult() throw(); + TCancelDelegationTokenResp* success; + + _TCLIService_CancelDelegationToken_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_RenewDelegationToken_args__isset { + _TCLIService_RenewDelegationToken_args__isset() : req(false) {} + bool req :1; +} _TCLIService_RenewDelegationToken_args__isset; + +class TCLIService_RenewDelegationToken_args { + public: + + TCLIService_RenewDelegationToken_args(const TCLIService_RenewDelegationToken_args&); + TCLIService_RenewDelegationToken_args& operator=(const TCLIService_RenewDelegationToken_args&); + TCLIService_RenewDelegationToken_args() { + } + + virtual ~TCLIService_RenewDelegationToken_args() throw(); + TRenewDelegationTokenReq req; + + _TCLIService_RenewDelegationToken_args__isset __isset; + + void __set_req(const TRenewDelegationTokenReq& val); + + bool operator == (const TCLIService_RenewDelegationToken_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_RenewDelegationToken_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_RenewDelegationToken_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_RenewDelegationToken_pargs { + public: + + + virtual ~TCLIService_RenewDelegationToken_pargs() throw(); + const TRenewDelegationTokenReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_RenewDelegationToken_result__isset { + _TCLIService_RenewDelegationToken_result__isset() : success(false) {} + bool success :1; +} _TCLIService_RenewDelegationToken_result__isset; + +class TCLIService_RenewDelegationToken_result { + public: + + TCLIService_RenewDelegationToken_result(const TCLIService_RenewDelegationToken_result&); + TCLIService_RenewDelegationToken_result& operator=(const TCLIService_RenewDelegationToken_result&); + TCLIService_RenewDelegationToken_result() { + } + + virtual ~TCLIService_RenewDelegationToken_result() throw(); + TRenewDelegationTokenResp success; + + _TCLIService_RenewDelegationToken_result__isset __isset; + + void __set_success(const TRenewDelegationTokenResp& val); + + bool operator == (const TCLIService_RenewDelegationToken_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_RenewDelegationToken_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_RenewDelegationToken_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_RenewDelegationToken_presult__isset { + _TCLIService_RenewDelegationToken_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_RenewDelegationToken_presult__isset; + +class TCLIService_RenewDelegationToken_presult { + public: + + + virtual ~TCLIService_RenewDelegationToken_presult() throw(); + TRenewDelegationTokenResp* success; + + _TCLIService_RenewDelegationToken_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_GetQueryId_args__isset { + _TCLIService_GetQueryId_args__isset() : req(false) {} + bool req :1; +} _TCLIService_GetQueryId_args__isset; + +class TCLIService_GetQueryId_args { + public: + + TCLIService_GetQueryId_args(const TCLIService_GetQueryId_args&); + TCLIService_GetQueryId_args& operator=(const TCLIService_GetQueryId_args&); + TCLIService_GetQueryId_args() { + } + + virtual ~TCLIService_GetQueryId_args() throw(); + TGetQueryIdReq req; + + _TCLIService_GetQueryId_args__isset __isset; + + void __set_req(const TGetQueryIdReq& val); + + bool operator == (const TCLIService_GetQueryId_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_GetQueryId_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetQueryId_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_GetQueryId_pargs { + public: + + + virtual ~TCLIService_GetQueryId_pargs() throw(); + const TGetQueryIdReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetQueryId_result__isset { + _TCLIService_GetQueryId_result__isset() : success(false) {} + bool success :1; +} _TCLIService_GetQueryId_result__isset; + +class TCLIService_GetQueryId_result { + public: + + TCLIService_GetQueryId_result(const TCLIService_GetQueryId_result&); + TCLIService_GetQueryId_result& operator=(const TCLIService_GetQueryId_result&); + TCLIService_GetQueryId_result() { + } + + virtual ~TCLIService_GetQueryId_result() throw(); + TGetQueryIdResp success; + + _TCLIService_GetQueryId_result__isset __isset; + + void __set_success(const TGetQueryIdResp& val); + + bool operator == (const TCLIService_GetQueryId_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_GetQueryId_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_GetQueryId_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_GetQueryId_presult__isset { + _TCLIService_GetQueryId_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_GetQueryId_presult__isset; + +class TCLIService_GetQueryId_presult { + public: + + + virtual ~TCLIService_GetQueryId_presult() throw(); + TGetQueryIdResp* success; + + _TCLIService_GetQueryId_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +typedef struct _TCLIService_SetClientInfo_args__isset { + _TCLIService_SetClientInfo_args__isset() : req(false) {} + bool req :1; +} _TCLIService_SetClientInfo_args__isset; + +class TCLIService_SetClientInfo_args { + public: + + TCLIService_SetClientInfo_args(const TCLIService_SetClientInfo_args&); + TCLIService_SetClientInfo_args& operator=(const TCLIService_SetClientInfo_args&); + TCLIService_SetClientInfo_args() { + } + + virtual ~TCLIService_SetClientInfo_args() throw(); + TSetClientInfoReq req; + + _TCLIService_SetClientInfo_args__isset __isset; + + void __set_req(const TSetClientInfoReq& val); + + bool operator == (const TCLIService_SetClientInfo_args & rhs) const + { + if (!(req == rhs.req)) + return false; + return true; + } + bool operator != (const TCLIService_SetClientInfo_args &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_SetClientInfo_args & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + + +class TCLIService_SetClientInfo_pargs { + public: + + + virtual ~TCLIService_SetClientInfo_pargs() throw(); + const TSetClientInfoReq* req; + + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_SetClientInfo_result__isset { + _TCLIService_SetClientInfo_result__isset() : success(false) {} + bool success :1; +} _TCLIService_SetClientInfo_result__isset; + +class TCLIService_SetClientInfo_result { + public: + + TCLIService_SetClientInfo_result(const TCLIService_SetClientInfo_result&); + TCLIService_SetClientInfo_result& operator=(const TCLIService_SetClientInfo_result&); + TCLIService_SetClientInfo_result() { + } + + virtual ~TCLIService_SetClientInfo_result() throw(); + TSetClientInfoResp success; + + _TCLIService_SetClientInfo_result__isset __isset; + + void __set_success(const TSetClientInfoResp& val); + + bool operator == (const TCLIService_SetClientInfo_result & rhs) const + { + if (!(success == rhs.success)) + return false; + return true; + } + bool operator != (const TCLIService_SetClientInfo_result &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCLIService_SetClientInfo_result & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + +}; + +typedef struct _TCLIService_SetClientInfo_presult__isset { + _TCLIService_SetClientInfo_presult__isset() : success(false) {} + bool success :1; +} _TCLIService_SetClientInfo_presult__isset; + +class TCLIService_SetClientInfo_presult { + public: + + + virtual ~TCLIService_SetClientInfo_presult() throw(); + TSetClientInfoResp* success; + + _TCLIService_SetClientInfo_presult__isset __isset; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + +}; + +class TCLIServiceClient : virtual public TCLIServiceIf { + public: + TCLIServiceClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot); + } + TCLIServiceClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + setProtocol(iprot,oprot); + } + private: + void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req); + void send_OpenSession(const TOpenSessionReq& req); + void recv_OpenSession(TOpenSessionResp& _return); + void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req); + void send_CloseSession(const TCloseSessionReq& req); + void recv_CloseSession(TCloseSessionResp& _return); + void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req); + void send_GetInfo(const TGetInfoReq& req); + void recv_GetInfo(TGetInfoResp& _return); + void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req); + void send_ExecuteStatement(const TExecuteStatementReq& req); + void recv_ExecuteStatement(TExecuteStatementResp& _return); + void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req); + void send_GetTypeInfo(const TGetTypeInfoReq& req); + void recv_GetTypeInfo(TGetTypeInfoResp& _return); + void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req); + void send_GetCatalogs(const TGetCatalogsReq& req); + void recv_GetCatalogs(TGetCatalogsResp& _return); + void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req); + void send_GetSchemas(const TGetSchemasReq& req); + void recv_GetSchemas(TGetSchemasResp& _return); + void GetTables(TGetTablesResp& _return, const TGetTablesReq& req); + void send_GetTables(const TGetTablesReq& req); + void recv_GetTables(TGetTablesResp& _return); + void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req); + void send_GetTableTypes(const TGetTableTypesReq& req); + void recv_GetTableTypes(TGetTableTypesResp& _return); + void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req); + void send_GetColumns(const TGetColumnsReq& req); + void recv_GetColumns(TGetColumnsResp& _return); + void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req); + void send_GetFunctions(const TGetFunctionsReq& req); + void recv_GetFunctions(TGetFunctionsResp& _return); + void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req); + void send_GetPrimaryKeys(const TGetPrimaryKeysReq& req); + void recv_GetPrimaryKeys(TGetPrimaryKeysResp& _return); + void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req); + void send_GetCrossReference(const TGetCrossReferenceReq& req); + void recv_GetCrossReference(TGetCrossReferenceResp& _return); + void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req); + void send_GetOperationStatus(const TGetOperationStatusReq& req); + void recv_GetOperationStatus(TGetOperationStatusResp& _return); + void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req); + void send_CancelOperation(const TCancelOperationReq& req); + void recv_CancelOperation(TCancelOperationResp& _return); + void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req); + void send_CloseOperation(const TCloseOperationReq& req); + void recv_CloseOperation(TCloseOperationResp& _return); + void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req); + void send_GetResultSetMetadata(const TGetResultSetMetadataReq& req); + void recv_GetResultSetMetadata(TGetResultSetMetadataResp& _return); + void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req); + void send_FetchResults(const TFetchResultsReq& req); + void recv_FetchResults(TFetchResultsResp& _return); + void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req); + void send_GetDelegationToken(const TGetDelegationTokenReq& req); + void recv_GetDelegationToken(TGetDelegationTokenResp& _return); + void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req); + void send_CancelDelegationToken(const TCancelDelegationTokenReq& req); + void recv_CancelDelegationToken(TCancelDelegationTokenResp& _return); + void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req); + void send_RenewDelegationToken(const TRenewDelegationTokenReq& req); + void recv_RenewDelegationToken(TRenewDelegationTokenResp& _return); + void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req); + void send_GetQueryId(const TGetQueryIdReq& req); + void recv_GetQueryId(TGetQueryIdResp& _return); + void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req); + void send_SetClientInfo(const TSetClientInfoReq& req); + void recv_SetClientInfo(TSetClientInfoResp& _return); + protected: + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; +}; + +class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor { + protected: + ::apache::thrift::stdcxx::shared_ptr iface_; + virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); + private: + typedef void (TCLIServiceProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); + typedef std::map ProcessMap; + ProcessMap processMap_; + void process_OpenSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + 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_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); + void process_GetTables(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetTableTypes(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetColumns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetFunctions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetPrimaryKeys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetCrossReference(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetOperationStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_CancelOperation(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_CloseOperation(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetResultSetMetadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_FetchResults(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_CancelDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_RenewDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_GetQueryId(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + void process_SetClientInfo(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); + public: + TCLIServiceProcessor(::apache::thrift::stdcxx::shared_ptr iface) : + iface_(iface) { + processMap_["OpenSession"] = &TCLIServiceProcessor::process_OpenSession; + processMap_["CloseSession"] = &TCLIServiceProcessor::process_CloseSession; + processMap_["GetInfo"] = &TCLIServiceProcessor::process_GetInfo; + processMap_["ExecuteStatement"] = &TCLIServiceProcessor::process_ExecuteStatement; + processMap_["GetTypeInfo"] = &TCLIServiceProcessor::process_GetTypeInfo; + processMap_["GetCatalogs"] = &TCLIServiceProcessor::process_GetCatalogs; + processMap_["GetSchemas"] = &TCLIServiceProcessor::process_GetSchemas; + processMap_["GetTables"] = &TCLIServiceProcessor::process_GetTables; + processMap_["GetTableTypes"] = &TCLIServiceProcessor::process_GetTableTypes; + processMap_["GetColumns"] = &TCLIServiceProcessor::process_GetColumns; + processMap_["GetFunctions"] = &TCLIServiceProcessor::process_GetFunctions; + processMap_["GetPrimaryKeys"] = &TCLIServiceProcessor::process_GetPrimaryKeys; + processMap_["GetCrossReference"] = &TCLIServiceProcessor::process_GetCrossReference; + processMap_["GetOperationStatus"] = &TCLIServiceProcessor::process_GetOperationStatus; + processMap_["CancelOperation"] = &TCLIServiceProcessor::process_CancelOperation; + processMap_["CloseOperation"] = &TCLIServiceProcessor::process_CloseOperation; + processMap_["GetResultSetMetadata"] = &TCLIServiceProcessor::process_GetResultSetMetadata; + processMap_["FetchResults"] = &TCLIServiceProcessor::process_FetchResults; + processMap_["GetDelegationToken"] = &TCLIServiceProcessor::process_GetDelegationToken; + processMap_["CancelDelegationToken"] = &TCLIServiceProcessor::process_CancelDelegationToken; + processMap_["RenewDelegationToken"] = &TCLIServiceProcessor::process_RenewDelegationToken; + processMap_["GetQueryId"] = &TCLIServiceProcessor::process_GetQueryId; + processMap_["SetClientInfo"] = &TCLIServiceProcessor::process_SetClientInfo; + } + + virtual ~TCLIServiceProcessor() {} +}; + +class TCLIServiceProcessorFactory : public ::apache::thrift::TProcessorFactory { + public: + TCLIServiceProcessorFactory(const ::apache::thrift::stdcxx::shared_ptr< TCLIServiceIfFactory >& handlerFactory) : + handlerFactory_(handlerFactory) {} + + ::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); + + protected: + ::apache::thrift::stdcxx::shared_ptr< TCLIServiceIfFactory > handlerFactory_; +}; + +class TCLIServiceMultiface : virtual public TCLIServiceIf { + public: + TCLIServiceMultiface(std::vector >& ifaces) : ifaces_(ifaces) { + } + virtual ~TCLIServiceMultiface() {} + protected: + std::vector > ifaces_; + TCLIServiceMultiface() {} + void add(::apache::thrift::stdcxx::shared_ptr iface) { + ifaces_.push_back(iface); + } + public: + void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->OpenSession(_return, req); + } + ifaces_[i]->OpenSession(_return, req); + return; + } + + void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->CloseSession(_return, req); + } + ifaces_[i]->CloseSession(_return, req); + return; + } + + void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetInfo(_return, req); + } + ifaces_[i]->GetInfo(_return, req); + return; + } + + void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->ExecuteStatement(_return, req); + } + ifaces_[i]->ExecuteStatement(_return, req); + return; + } + + void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetTypeInfo(_return, req); + } + ifaces_[i]->GetTypeInfo(_return, req); + return; + } + + void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetCatalogs(_return, req); + } + ifaces_[i]->GetCatalogs(_return, req); + return; + } + + void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetSchemas(_return, req); + } + ifaces_[i]->GetSchemas(_return, req); + return; + } + + void GetTables(TGetTablesResp& _return, const TGetTablesReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetTables(_return, req); + } + ifaces_[i]->GetTables(_return, req); + return; + } + + void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetTableTypes(_return, req); + } + ifaces_[i]->GetTableTypes(_return, req); + return; + } + + void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetColumns(_return, req); + } + ifaces_[i]->GetColumns(_return, req); + return; + } + + void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetFunctions(_return, req); + } + ifaces_[i]->GetFunctions(_return, req); + return; + } + + void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetPrimaryKeys(_return, req); + } + ifaces_[i]->GetPrimaryKeys(_return, req); + return; + } + + void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetCrossReference(_return, req); + } + ifaces_[i]->GetCrossReference(_return, req); + return; + } + + void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetOperationStatus(_return, req); + } + ifaces_[i]->GetOperationStatus(_return, req); + return; + } + + void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->CancelOperation(_return, req); + } + ifaces_[i]->CancelOperation(_return, req); + return; + } + + void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->CloseOperation(_return, req); + } + ifaces_[i]->CloseOperation(_return, req); + return; + } + + void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetResultSetMetadata(_return, req); + } + ifaces_[i]->GetResultSetMetadata(_return, req); + return; + } + + void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->FetchResults(_return, req); + } + ifaces_[i]->FetchResults(_return, req); + return; + } + + void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetDelegationToken(_return, req); + } + ifaces_[i]->GetDelegationToken(_return, req); + return; + } + + void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->CancelDelegationToken(_return, req); + } + ifaces_[i]->CancelDelegationToken(_return, req); + return; + } + + void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->RenewDelegationToken(_return, req); + } + ifaces_[i]->RenewDelegationToken(_return, req); + return; + } + + void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->GetQueryId(_return, req); + } + ifaces_[i]->GetQueryId(_return, req); + return; + } + + void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) { + size_t sz = ifaces_.size(); + size_t i = 0; + for (; i < (sz - 1); ++i) { + ifaces_[i]->SetClientInfo(_return, req); + } + ifaces_[i]->SetClientInfo(_return, req); + return; + } + +}; + +// The 'concurrent' client is a thread safe client that correctly handles +// out of order responses. It is slower than the regular client, so should +// only be used when you need to share a connection among multiple threads +class TCLIServiceConcurrentClient : virtual public TCLIServiceIf { + public: + TCLIServiceConcurrentClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot); + } + TCLIServiceConcurrentClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + setProtocol(iprot,oprot); + } + private: + void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { + setProtocol(prot,prot); + } + void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { + piprot_=iprot; + poprot_=oprot; + iprot_ = iprot.get(); + oprot_ = oprot.get(); + } + public: + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { + return piprot_; + } + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { + return poprot_; + } + void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req); + int32_t send_OpenSession(const TOpenSessionReq& req); + void recv_OpenSession(TOpenSessionResp& _return, const int32_t seqid); + void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req); + int32_t send_CloseSession(const TCloseSessionReq& req); + void recv_CloseSession(TCloseSessionResp& _return, const int32_t seqid); + void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req); + int32_t send_GetInfo(const TGetInfoReq& req); + void recv_GetInfo(TGetInfoResp& _return, const int32_t seqid); + void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req); + int32_t send_ExecuteStatement(const TExecuteStatementReq& req); + void recv_ExecuteStatement(TExecuteStatementResp& _return, const int32_t seqid); + void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req); + int32_t send_GetTypeInfo(const TGetTypeInfoReq& req); + void recv_GetTypeInfo(TGetTypeInfoResp& _return, const int32_t seqid); + void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req); + int32_t send_GetCatalogs(const TGetCatalogsReq& req); + void recv_GetCatalogs(TGetCatalogsResp& _return, const int32_t seqid); + void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req); + int32_t send_GetSchemas(const TGetSchemasReq& req); + void recv_GetSchemas(TGetSchemasResp& _return, const int32_t seqid); + void GetTables(TGetTablesResp& _return, const TGetTablesReq& req); + int32_t send_GetTables(const TGetTablesReq& req); + void recv_GetTables(TGetTablesResp& _return, const int32_t seqid); + void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req); + int32_t send_GetTableTypes(const TGetTableTypesReq& req); + void recv_GetTableTypes(TGetTableTypesResp& _return, const int32_t seqid); + void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req); + int32_t send_GetColumns(const TGetColumnsReq& req); + void recv_GetColumns(TGetColumnsResp& _return, const int32_t seqid); + void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req); + int32_t send_GetFunctions(const TGetFunctionsReq& req); + void recv_GetFunctions(TGetFunctionsResp& _return, const int32_t seqid); + void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req); + int32_t send_GetPrimaryKeys(const TGetPrimaryKeysReq& req); + void recv_GetPrimaryKeys(TGetPrimaryKeysResp& _return, const int32_t seqid); + void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req); + int32_t send_GetCrossReference(const TGetCrossReferenceReq& req); + void recv_GetCrossReference(TGetCrossReferenceResp& _return, const int32_t seqid); + void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req); + int32_t send_GetOperationStatus(const TGetOperationStatusReq& req); + void recv_GetOperationStatus(TGetOperationStatusResp& _return, const int32_t seqid); + void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req); + int32_t send_CancelOperation(const TCancelOperationReq& req); + void recv_CancelOperation(TCancelOperationResp& _return, const int32_t seqid); + void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req); + int32_t send_CloseOperation(const TCloseOperationReq& req); + void recv_CloseOperation(TCloseOperationResp& _return, const int32_t seqid); + void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req); + int32_t send_GetResultSetMetadata(const TGetResultSetMetadataReq& req); + void recv_GetResultSetMetadata(TGetResultSetMetadataResp& _return, const int32_t seqid); + void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req); + int32_t send_FetchResults(const TFetchResultsReq& req); + void recv_FetchResults(TFetchResultsResp& _return, const int32_t seqid); + void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req); + int32_t send_GetDelegationToken(const TGetDelegationTokenReq& req); + void recv_GetDelegationToken(TGetDelegationTokenResp& _return, const int32_t seqid); + void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req); + int32_t send_CancelDelegationToken(const TCancelDelegationTokenReq& req); + void recv_CancelDelegationToken(TCancelDelegationTokenResp& _return, const int32_t seqid); + void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req); + int32_t send_RenewDelegationToken(const TRenewDelegationTokenReq& req); + void recv_RenewDelegationToken(TRenewDelegationTokenResp& _return, const int32_t seqid); + void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req); + int32_t send_GetQueryId(const TGetQueryIdReq& req); + void recv_GetQueryId(TGetQueryIdResp& _return, const int32_t seqid); + void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req); + int32_t send_SetClientInfo(const TSetClientInfoReq& req); + void recv_SetClientInfo(TSetClientInfoResp& _return, const int32_t seqid); + protected: + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; + apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; + ::apache::thrift::protocol::TProtocol* iprot_; + ::apache::thrift::protocol::TProtocol* oprot_; + ::apache::thrift::async::TConcurrentClientSyncInfo sync_; +}; + +#ifdef _MSC_VER + #pragma warning( pop ) +#endif + +}}}}} // namespace + +#endif diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp new file mode 100644 index 000000000000..60dc6442ee68 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp @@ -0,0 +1,74 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "TCLIService_constants.h" + +namespace apache { namespace spark { 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); + PRIMITIVE_TYPES.insert((TTypeId::type)22); + + 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)10, "ARRAY")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)4, "BIGINT")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)9, "BINARY")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)0, "BOOLEAN")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)19, "CHAR")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)17, "DATE")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)15, "DECIMAL")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)6, "DOUBLE")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)5, "FLOAT")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)21, "INTERVAL_DAY_TIME")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)20, "INTERVAL_YEAR_MONTH")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)3, "INT")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)11, "MAP")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)16, "NULL")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)2, "SMALLINT")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)7, "STRING")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)12, "STRUCT")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)22, "TIMESTAMP WITH LOCAL TIME ZONE")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)8, "TIMESTAMP")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)1, "TINYINT")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)13, "UNIONTYPE")); + TYPE_NAMES.insert(std::make_pair((TTypeId::type)18, "VARCHAR")); + + CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; + + PRECISION = "precision"; + + SCALE = "scale"; + +} + +}}}}} // namespace + diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h new file mode 100644 index 000000000000..82dc51bca478 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h @@ -0,0 +1,31 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * 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 spark { namespace service { namespace rpc { namespace thrift { + +class TCLIServiceConstants { + public: + TCLIServiceConstants(); + + std::set PRIMITIVE_TYPES; + std::set COMPLEX_TYPES; + std::set COLLECTION_TYPES; + std::map TYPE_NAMES; + std::string CHARACTER_MAXIMUM_LENGTH; + std::string PRECISION; + std::string SCALE; +}; + +extern const TCLIServiceConstants g_TCLIService_constants; + +}}}}} // namespace + +#endif diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp new file mode 100644 index 000000000000..d1fe9cabf7f5 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp @@ -0,0 +1,152 @@ +// 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 +#include +#include +#include + +using namespace ::apache::thrift; +using namespace ::apache::thrift::protocol; +using namespace ::apache::thrift::transport; +using namespace ::apache::thrift::server; + +using namespace ::apache::spark::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 GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) { + // Your implementation goes here + printf("GetPrimaryKeys\n"); + } + + void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) { + // Your implementation goes here + printf("GetCrossReference\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"); + } + + void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) { + // Your implementation goes here + printf("GetQueryId\n"); + } + + void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) { + // Your implementation goes here + printf("SetClientInfo\n"); + } + +}; + +int main(int argc, char **argv) { + int port = 9090; + ::apache::thrift::stdcxx::shared_ptr handler(new TCLIServiceHandler()); + ::apache::thrift::stdcxx::shared_ptr processor(new TCLIServiceProcessor(handler)); + ::apache::thrift::stdcxx::shared_ptr serverTransport(new TServerSocket(port)); + ::apache::thrift::stdcxx::shared_ptr transportFactory(new TBufferedTransportFactory()); + ::apache::thrift::stdcxx::shared_ptr protocolFactory(new TBinaryProtocolFactory()); + + TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); + server.serve(); + return 0; +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp new file mode 100644 index 000000000000..2a99c29f34ec --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp @@ -0,0 +1,11342 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#include "TCLIService_types.h" + +#include +#include + +#include + +namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { + +int _kTProtocolVersionValues[] = { + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V1, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V2, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V3, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V4, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V5, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V6, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V7, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V8, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V9, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V10, + TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V11 +}; +const char* _kTProtocolVersionNames[] = { + "HIVE_CLI_SERVICE_PROTOCOL_V1", + "HIVE_CLI_SERVICE_PROTOCOL_V2", + "HIVE_CLI_SERVICE_PROTOCOL_V3", + "HIVE_CLI_SERVICE_PROTOCOL_V4", + "HIVE_CLI_SERVICE_PROTOCOL_V5", + "HIVE_CLI_SERVICE_PROTOCOL_V6", + "HIVE_CLI_SERVICE_PROTOCOL_V7", + "HIVE_CLI_SERVICE_PROTOCOL_V8", + "HIVE_CLI_SERVICE_PROTOCOL_V9", + "HIVE_CLI_SERVICE_PROTOCOL_V10", + "HIVE_CLI_SERVICE_PROTOCOL_V11" +}; +const std::map _TProtocolVersion_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(11, _kTProtocolVersionValues, _kTProtocolVersionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TProtocolVersion::type& val) { + std::map::const_iterator it = _TProtocolVersion_VALUES_TO_NAMES.find(val); + if (it != _TProtocolVersion_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +int _kTTypeIdValues[] = { + TTypeId::BOOLEAN_TYPE, + TTypeId::TINYINT_TYPE, + TTypeId::SMALLINT_TYPE, + TTypeId::INT_TYPE, + TTypeId::BIGINT_TYPE, + TTypeId::FLOAT_TYPE, + TTypeId::DOUBLE_TYPE, + TTypeId::STRING_TYPE, + TTypeId::TIMESTAMP_TYPE, + TTypeId::BINARY_TYPE, + TTypeId::ARRAY_TYPE, + TTypeId::MAP_TYPE, + TTypeId::STRUCT_TYPE, + TTypeId::UNION_TYPE, + TTypeId::USER_DEFINED_TYPE, + TTypeId::DECIMAL_TYPE, + TTypeId::NULL_TYPE, + TTypeId::DATE_TYPE, + TTypeId::VARCHAR_TYPE, + TTypeId::CHAR_TYPE, + TTypeId::INTERVAL_YEAR_MONTH_TYPE, + TTypeId::INTERVAL_DAY_TIME_TYPE, + TTypeId::TIMESTAMPLOCALTZ_TYPE +}; +const char* _kTTypeIdNames[] = { + "BOOLEAN_TYPE", + "TINYINT_TYPE", + "SMALLINT_TYPE", + "INT_TYPE", + "BIGINT_TYPE", + "FLOAT_TYPE", + "DOUBLE_TYPE", + "STRING_TYPE", + "TIMESTAMP_TYPE", + "BINARY_TYPE", + "ARRAY_TYPE", + "MAP_TYPE", + "STRUCT_TYPE", + "UNION_TYPE", + "USER_DEFINED_TYPE", + "DECIMAL_TYPE", + "NULL_TYPE", + "DATE_TYPE", + "VARCHAR_TYPE", + "CHAR_TYPE", + "INTERVAL_YEAR_MONTH_TYPE", + "INTERVAL_DAY_TIME_TYPE", + "TIMESTAMPLOCALTZ_TYPE" +}; +const std::map _TTypeId_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(23, _kTTypeIdValues, _kTTypeIdNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TTypeId::type& val) { + std::map::const_iterator it = _TTypeId_VALUES_TO_NAMES.find(val); + if (it != _TTypeId_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +int _kTStatusCodeValues[] = { + TStatusCode::SUCCESS_STATUS, + TStatusCode::SUCCESS_WITH_INFO_STATUS, + TStatusCode::STILL_EXECUTING_STATUS, + TStatusCode::ERROR_STATUS, + TStatusCode::INVALID_HANDLE_STATUS +}; +const char* _kTStatusCodeNames[] = { + "SUCCESS_STATUS", + "SUCCESS_WITH_INFO_STATUS", + "STILL_EXECUTING_STATUS", + "ERROR_STATUS", + "INVALID_HANDLE_STATUS" +}; +const std::map _TStatusCode_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kTStatusCodeValues, _kTStatusCodeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TStatusCode::type& val) { + std::map::const_iterator it = _TStatusCode_VALUES_TO_NAMES.find(val); + if (it != _TStatusCode_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +int _kTOperationStateValues[] = { + TOperationState::INITIALIZED_STATE, + TOperationState::RUNNING_STATE, + TOperationState::FINISHED_STATE, + TOperationState::CANCELED_STATE, + TOperationState::CLOSED_STATE, + TOperationState::ERROR_STATE, + TOperationState::UKNOWN_STATE, + TOperationState::PENDING_STATE, + TOperationState::TIMEDOUT_STATE +}; +const char* _kTOperationStateNames[] = { + "INITIALIZED_STATE", + "RUNNING_STATE", + "FINISHED_STATE", + "CANCELED_STATE", + "CLOSED_STATE", + "ERROR_STATE", + "UKNOWN_STATE", + "PENDING_STATE", + "TIMEDOUT_STATE" +}; +const std::map _TOperationState_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(9, _kTOperationStateValues, _kTOperationStateNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TOperationState::type& val) { + std::map::const_iterator it = _TOperationState_VALUES_TO_NAMES.find(val); + if (it != _TOperationState_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +int _kTOperationTypeValues[] = { + TOperationType::EXECUTE_STATEMENT, + TOperationType::GET_TYPE_INFO, + TOperationType::GET_CATALOGS, + TOperationType::GET_SCHEMAS, + TOperationType::GET_TABLES, + TOperationType::GET_TABLE_TYPES, + TOperationType::GET_COLUMNS, + TOperationType::GET_FUNCTIONS, + TOperationType::UNKNOWN +}; +const char* _kTOperationTypeNames[] = { + "EXECUTE_STATEMENT", + "GET_TYPE_INFO", + "GET_CATALOGS", + "GET_SCHEMAS", + "GET_TABLES", + "GET_TABLE_TYPES", + "GET_COLUMNS", + "GET_FUNCTIONS", + "UNKNOWN" +}; +const std::map _TOperationType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(9, _kTOperationTypeValues, _kTOperationTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TOperationType::type& val) { + std::map::const_iterator it = _TOperationType_VALUES_TO_NAMES.find(val); + if (it != _TOperationType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +int _kTGetInfoTypeValues[] = { + TGetInfoType::CLI_MAX_DRIVER_CONNECTIONS, + TGetInfoType::CLI_MAX_CONCURRENT_ACTIVITIES, + TGetInfoType::CLI_DATA_SOURCE_NAME, + TGetInfoType::CLI_FETCH_DIRECTION, + TGetInfoType::CLI_SERVER_NAME, + TGetInfoType::CLI_SEARCH_PATTERN_ESCAPE, + TGetInfoType::CLI_DBMS_NAME, + TGetInfoType::CLI_DBMS_VER, + TGetInfoType::CLI_ACCESSIBLE_TABLES, + TGetInfoType::CLI_ACCESSIBLE_PROCEDURES, + TGetInfoType::CLI_CURSOR_COMMIT_BEHAVIOR, + TGetInfoType::CLI_DATA_SOURCE_READ_ONLY, + TGetInfoType::CLI_DEFAULT_TXN_ISOLATION, + TGetInfoType::CLI_IDENTIFIER_CASE, + TGetInfoType::CLI_IDENTIFIER_QUOTE_CHAR, + TGetInfoType::CLI_MAX_COLUMN_NAME_LEN, + TGetInfoType::CLI_MAX_CURSOR_NAME_LEN, + TGetInfoType::CLI_MAX_SCHEMA_NAME_LEN, + TGetInfoType::CLI_MAX_CATALOG_NAME_LEN, + TGetInfoType::CLI_MAX_TABLE_NAME_LEN, + TGetInfoType::CLI_SCROLL_CONCURRENCY, + TGetInfoType::CLI_TXN_CAPABLE, + TGetInfoType::CLI_USER_NAME, + TGetInfoType::CLI_TXN_ISOLATION_OPTION, + TGetInfoType::CLI_INTEGRITY, + TGetInfoType::CLI_GETDATA_EXTENSIONS, + TGetInfoType::CLI_NULL_COLLATION, + TGetInfoType::CLI_ALTER_TABLE, + TGetInfoType::CLI_ORDER_BY_COLUMNS_IN_SELECT, + TGetInfoType::CLI_SPECIAL_CHARACTERS, + TGetInfoType::CLI_MAX_COLUMNS_IN_GROUP_BY, + TGetInfoType::CLI_MAX_COLUMNS_IN_INDEX, + TGetInfoType::CLI_MAX_COLUMNS_IN_ORDER_BY, + TGetInfoType::CLI_MAX_COLUMNS_IN_SELECT, + TGetInfoType::CLI_MAX_COLUMNS_IN_TABLE, + TGetInfoType::CLI_MAX_INDEX_SIZE, + TGetInfoType::CLI_MAX_ROW_SIZE, + TGetInfoType::CLI_MAX_STATEMENT_LEN, + TGetInfoType::CLI_MAX_TABLES_IN_SELECT, + TGetInfoType::CLI_MAX_USER_NAME_LEN, + TGetInfoType::CLI_OJ_CAPABILITIES, + TGetInfoType::CLI_XOPEN_CLI_YEAR, + TGetInfoType::CLI_CURSOR_SENSITIVITY, + TGetInfoType::CLI_DESCRIBE_PARAMETER, + TGetInfoType::CLI_CATALOG_NAME, + TGetInfoType::CLI_COLLATION_SEQ, + TGetInfoType::CLI_MAX_IDENTIFIER_LEN, + TGetInfoType::CLI_ODBC_KEYWORDS +}; +const char* _kTGetInfoTypeNames[] = { + "CLI_MAX_DRIVER_CONNECTIONS", + "CLI_MAX_CONCURRENT_ACTIVITIES", + "CLI_DATA_SOURCE_NAME", + "CLI_FETCH_DIRECTION", + "CLI_SERVER_NAME", + "CLI_SEARCH_PATTERN_ESCAPE", + "CLI_DBMS_NAME", + "CLI_DBMS_VER", + "CLI_ACCESSIBLE_TABLES", + "CLI_ACCESSIBLE_PROCEDURES", + "CLI_CURSOR_COMMIT_BEHAVIOR", + "CLI_DATA_SOURCE_READ_ONLY", + "CLI_DEFAULT_TXN_ISOLATION", + "CLI_IDENTIFIER_CASE", + "CLI_IDENTIFIER_QUOTE_CHAR", + "CLI_MAX_COLUMN_NAME_LEN", + "CLI_MAX_CURSOR_NAME_LEN", + "CLI_MAX_SCHEMA_NAME_LEN", + "CLI_MAX_CATALOG_NAME_LEN", + "CLI_MAX_TABLE_NAME_LEN", + "CLI_SCROLL_CONCURRENCY", + "CLI_TXN_CAPABLE", + "CLI_USER_NAME", + "CLI_TXN_ISOLATION_OPTION", + "CLI_INTEGRITY", + "CLI_GETDATA_EXTENSIONS", + "CLI_NULL_COLLATION", + "CLI_ALTER_TABLE", + "CLI_ORDER_BY_COLUMNS_IN_SELECT", + "CLI_SPECIAL_CHARACTERS", + "CLI_MAX_COLUMNS_IN_GROUP_BY", + "CLI_MAX_COLUMNS_IN_INDEX", + "CLI_MAX_COLUMNS_IN_ORDER_BY", + "CLI_MAX_COLUMNS_IN_SELECT", + "CLI_MAX_COLUMNS_IN_TABLE", + "CLI_MAX_INDEX_SIZE", + "CLI_MAX_ROW_SIZE", + "CLI_MAX_STATEMENT_LEN", + "CLI_MAX_TABLES_IN_SELECT", + "CLI_MAX_USER_NAME_LEN", + "CLI_OJ_CAPABILITIES", + "CLI_XOPEN_CLI_YEAR", + "CLI_CURSOR_SENSITIVITY", + "CLI_DESCRIBE_PARAMETER", + "CLI_CATALOG_NAME", + "CLI_COLLATION_SEQ", + "CLI_MAX_IDENTIFIER_LEN", + "CLI_ODBC_KEYWORDS" +}; +const std::map _TGetInfoType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(48, _kTGetInfoTypeValues, _kTGetInfoTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TGetInfoType::type& val) { + std::map::const_iterator it = _TGetInfoType_VALUES_TO_NAMES.find(val); + if (it != _TGetInfoType_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +int _kTFetchOrientationValues[] = { + TFetchOrientation::FETCH_NEXT, + TFetchOrientation::FETCH_PRIOR, + TFetchOrientation::FETCH_RELATIVE, + TFetchOrientation::FETCH_ABSOLUTE, + TFetchOrientation::FETCH_FIRST, + TFetchOrientation::FETCH_LAST +}; +const char* _kTFetchOrientationNames[] = { + "FETCH_NEXT", + "FETCH_PRIOR", + "FETCH_RELATIVE", + "FETCH_ABSOLUTE", + "FETCH_FIRST", + "FETCH_LAST" +}; +const std::map _TFetchOrientation_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kTFetchOrientationValues, _kTFetchOrientationNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TFetchOrientation::type& val) { + std::map::const_iterator it = _TFetchOrientation_VALUES_TO_NAMES.find(val); + if (it != _TFetchOrientation_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + +int _kTJobExecutionStatusValues[] = { + TJobExecutionStatus::IN_PROGRESS, + TJobExecutionStatus::COMPLETE, + TJobExecutionStatus::NOT_AVAILABLE +}; +const char* _kTJobExecutionStatusNames[] = { + "IN_PROGRESS", + "COMPLETE", + "NOT_AVAILABLE" +}; +const std::map _TJobExecutionStatus_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kTJobExecutionStatusValues, _kTJobExecutionStatusNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); + +std::ostream& operator<<(std::ostream& out, const TJobExecutionStatus::type& val) { + std::map::const_iterator it = _TJobExecutionStatus_VALUES_TO_NAMES.find(val); + if (it != _TJobExecutionStatus_VALUES_TO_NAMES.end()) { + out << it->second; + } else { + out << static_cast(val); + } + return out; +} + + +TTypeQualifierValue::~TTypeQualifierValue() throw() { +} + + +void TTypeQualifierValue::__set_i32Value(const int32_t val) { + this->i32Value = val; +__isset.i32Value = true; +} + +void TTypeQualifierValue::__set_stringValue(const std::string& val) { + this->stringValue = val; +__isset.stringValue = true; +} +std::ostream& operator<<(std::ostream& out, const TTypeQualifierValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TTypeQualifierValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I32) { + xfer += iprot->readI32(this->i32Value); + this->__isset.i32Value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->stringValue); + this->__isset.stringValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TTypeQualifierValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TTypeQualifierValue"); + + if (this->__isset.i32Value) { + xfer += oprot->writeFieldBegin("i32Value", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->i32Value); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.stringValue) { + xfer += oprot->writeFieldBegin("stringValue", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->stringValue); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TTypeQualifierValue &a, TTypeQualifierValue &b) { + using ::std::swap; + swap(a.i32Value, b.i32Value); + swap(a.stringValue, b.stringValue); + swap(a.__isset, b.__isset); +} + +TTypeQualifierValue::TTypeQualifierValue(const TTypeQualifierValue& other0) { + i32Value = other0.i32Value; + stringValue = other0.stringValue; + __isset = other0.__isset; +} +TTypeQualifierValue& TTypeQualifierValue::operator=(const TTypeQualifierValue& other1) { + i32Value = other1.i32Value; + stringValue = other1.stringValue; + __isset = other1.__isset; + return *this; +} +void TTypeQualifierValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TTypeQualifierValue("; + out << "i32Value="; (__isset.i32Value ? (out << to_string(i32Value)) : (out << "")); + out << ", " << "stringValue="; (__isset.stringValue ? (out << to_string(stringValue)) : (out << "")); + out << ")"; +} + + +TTypeQualifiers::~TTypeQualifiers() throw() { +} + + +void TTypeQualifiers::__set_qualifiers(const std::map & val) { + this->qualifiers = val; +} +std::ostream& operator<<(std::ostream& out, const TTypeQualifiers& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TTypeQualifiers::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_qualifiers = 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_MAP) { + { + this->qualifiers.clear(); + uint32_t _size2; + ::apache::thrift::protocol::TType _ktype3; + ::apache::thrift::protocol::TType _vtype4; + xfer += iprot->readMapBegin(_ktype3, _vtype4, _size2); + uint32_t _i6; + for (_i6 = 0; _i6 < _size2; ++_i6) + { + std::string _key7; + xfer += iprot->readString(_key7); + TTypeQualifierValue& _val8 = this->qualifiers[_key7]; + xfer += _val8.read(iprot); + } + xfer += iprot->readMapEnd(); + } + isset_qualifiers = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_qualifiers) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TTypeQualifiers::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TTypeQualifiers"); + + xfer += oprot->writeFieldBegin("qualifiers", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRUCT, static_cast(this->qualifiers.size())); + std::map ::const_iterator _iter9; + for (_iter9 = this->qualifiers.begin(); _iter9 != this->qualifiers.end(); ++_iter9) + { + xfer += oprot->writeString(_iter9->first); + xfer += _iter9->second.write(oprot); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TTypeQualifiers &a, TTypeQualifiers &b) { + using ::std::swap; + swap(a.qualifiers, b.qualifiers); +} + +TTypeQualifiers::TTypeQualifiers(const TTypeQualifiers& other10) { + qualifiers = other10.qualifiers; +} +TTypeQualifiers& TTypeQualifiers::operator=(const TTypeQualifiers& other11) { + qualifiers = other11.qualifiers; + return *this; +} +void TTypeQualifiers::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TTypeQualifiers("; + out << "qualifiers=" << to_string(qualifiers); + out << ")"; +} + + +TPrimitiveTypeEntry::~TPrimitiveTypeEntry() throw() { +} + + +void TPrimitiveTypeEntry::__set_type(const TTypeId::type val) { + this->type = val; +} + +void TPrimitiveTypeEntry::__set_typeQualifiers(const TTypeQualifiers& val) { + this->typeQualifiers = val; +__isset.typeQualifiers = true; +} +std::ostream& operator<<(std::ostream& out, const TPrimitiveTypeEntry& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TPrimitiveTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_type = 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_I32) { + int32_t ecast12; + xfer += iprot->readI32(ecast12); + this->type = (TTypeId::type)ecast12; + isset_type = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->typeQualifiers.read(iprot); + this->__isset.typeQualifiers = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_type) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TPrimitiveTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TPrimitiveTypeEntry"); + + xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((int32_t)this->type); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.typeQualifiers) { + xfer += oprot->writeFieldBegin("typeQualifiers", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->typeQualifiers.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TPrimitiveTypeEntry &a, TPrimitiveTypeEntry &b) { + using ::std::swap; + swap(a.type, b.type); + swap(a.typeQualifiers, b.typeQualifiers); + swap(a.__isset, b.__isset); +} + +TPrimitiveTypeEntry::TPrimitiveTypeEntry(const TPrimitiveTypeEntry& other13) { + type = other13.type; + typeQualifiers = other13.typeQualifiers; + __isset = other13.__isset; +} +TPrimitiveTypeEntry& TPrimitiveTypeEntry::operator=(const TPrimitiveTypeEntry& other14) { + type = other14.type; + typeQualifiers = other14.typeQualifiers; + __isset = other14.__isset; + return *this; +} +void TPrimitiveTypeEntry::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TPrimitiveTypeEntry("; + out << "type=" << to_string(type); + out << ", " << "typeQualifiers="; (__isset.typeQualifiers ? (out << to_string(typeQualifiers)) : (out << "")); + out << ")"; +} + + +TArrayTypeEntry::~TArrayTypeEntry() throw() { +} + + +void TArrayTypeEntry::__set_objectTypePtr(const TTypeEntryPtr val) { + this->objectTypePtr = val; +} +std::ostream& operator<<(std::ostream& out, const TArrayTypeEntry& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TArrayTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_objectTypePtr = 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_I32) { + xfer += iprot->readI32(this->objectTypePtr); + isset_objectTypePtr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_objectTypePtr) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TArrayTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TArrayTypeEntry"); + + xfer += oprot->writeFieldBegin("objectTypePtr", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->objectTypePtr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TArrayTypeEntry &a, TArrayTypeEntry &b) { + using ::std::swap; + swap(a.objectTypePtr, b.objectTypePtr); +} + +TArrayTypeEntry::TArrayTypeEntry(const TArrayTypeEntry& other15) { + objectTypePtr = other15.objectTypePtr; +} +TArrayTypeEntry& TArrayTypeEntry::operator=(const TArrayTypeEntry& other16) { + objectTypePtr = other16.objectTypePtr; + return *this; +} +void TArrayTypeEntry::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TArrayTypeEntry("; + out << "objectTypePtr=" << to_string(objectTypePtr); + out << ")"; +} + + +TMapTypeEntry::~TMapTypeEntry() throw() { +} + + +void TMapTypeEntry::__set_keyTypePtr(const TTypeEntryPtr val) { + this->keyTypePtr = val; +} + +void TMapTypeEntry::__set_valueTypePtr(const TTypeEntryPtr val) { + this->valueTypePtr = val; +} +std::ostream& operator<<(std::ostream& out, const TMapTypeEntry& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TMapTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_keyTypePtr = false; + bool isset_valueTypePtr = 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_I32) { + xfer += iprot->readI32(this->keyTypePtr); + isset_keyTypePtr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->valueTypePtr); + isset_valueTypePtr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_keyTypePtr) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_valueTypePtr) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TMapTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TMapTypeEntry"); + + xfer += oprot->writeFieldBegin("keyTypePtr", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->keyTypePtr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("valueTypePtr", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32(this->valueTypePtr); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TMapTypeEntry &a, TMapTypeEntry &b) { + using ::std::swap; + swap(a.keyTypePtr, b.keyTypePtr); + swap(a.valueTypePtr, b.valueTypePtr); +} + +TMapTypeEntry::TMapTypeEntry(const TMapTypeEntry& other17) { + keyTypePtr = other17.keyTypePtr; + valueTypePtr = other17.valueTypePtr; +} +TMapTypeEntry& TMapTypeEntry::operator=(const TMapTypeEntry& other18) { + keyTypePtr = other18.keyTypePtr; + valueTypePtr = other18.valueTypePtr; + return *this; +} +void TMapTypeEntry::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TMapTypeEntry("; + out << "keyTypePtr=" << to_string(keyTypePtr); + out << ", " << "valueTypePtr=" << to_string(valueTypePtr); + out << ")"; +} + + +TStructTypeEntry::~TStructTypeEntry() throw() { +} + + +void TStructTypeEntry::__set_nameToTypePtr(const std::map & val) { + this->nameToTypePtr = val; +} +std::ostream& operator<<(std::ostream& out, const TStructTypeEntry& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TStructTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_nameToTypePtr = 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_MAP) { + { + this->nameToTypePtr.clear(); + uint32_t _size19; + ::apache::thrift::protocol::TType _ktype20; + ::apache::thrift::protocol::TType _vtype21; + xfer += iprot->readMapBegin(_ktype20, _vtype21, _size19); + uint32_t _i23; + for (_i23 = 0; _i23 < _size19; ++_i23) + { + std::string _key24; + xfer += iprot->readString(_key24); + TTypeEntryPtr& _val25 = this->nameToTypePtr[_key24]; + xfer += iprot->readI32(_val25); + } + xfer += iprot->readMapEnd(); + } + isset_nameToTypePtr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_nameToTypePtr) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TStructTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TStructTypeEntry"); + + xfer += oprot->writeFieldBegin("nameToTypePtr", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, static_cast(this->nameToTypePtr.size())); + std::map ::const_iterator _iter26; + for (_iter26 = this->nameToTypePtr.begin(); _iter26 != this->nameToTypePtr.end(); ++_iter26) + { + xfer += oprot->writeString(_iter26->first); + xfer += oprot->writeI32(_iter26->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TStructTypeEntry &a, TStructTypeEntry &b) { + using ::std::swap; + swap(a.nameToTypePtr, b.nameToTypePtr); +} + +TStructTypeEntry::TStructTypeEntry(const TStructTypeEntry& other27) { + nameToTypePtr = other27.nameToTypePtr; +} +TStructTypeEntry& TStructTypeEntry::operator=(const TStructTypeEntry& other28) { + nameToTypePtr = other28.nameToTypePtr; + return *this; +} +void TStructTypeEntry::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TStructTypeEntry("; + out << "nameToTypePtr=" << to_string(nameToTypePtr); + out << ")"; +} + + +TUnionTypeEntry::~TUnionTypeEntry() throw() { +} + + +void TUnionTypeEntry::__set_nameToTypePtr(const std::map & val) { + this->nameToTypePtr = val; +} +std::ostream& operator<<(std::ostream& out, const TUnionTypeEntry& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TUnionTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_nameToTypePtr = 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_MAP) { + { + this->nameToTypePtr.clear(); + uint32_t _size29; + ::apache::thrift::protocol::TType _ktype30; + ::apache::thrift::protocol::TType _vtype31; + xfer += iprot->readMapBegin(_ktype30, _vtype31, _size29); + uint32_t _i33; + for (_i33 = 0; _i33 < _size29; ++_i33) + { + std::string _key34; + xfer += iprot->readString(_key34); + TTypeEntryPtr& _val35 = this->nameToTypePtr[_key34]; + xfer += iprot->readI32(_val35); + } + xfer += iprot->readMapEnd(); + } + isset_nameToTypePtr = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_nameToTypePtr) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TUnionTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TUnionTypeEntry"); + + xfer += oprot->writeFieldBegin("nameToTypePtr", ::apache::thrift::protocol::T_MAP, 1); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, static_cast(this->nameToTypePtr.size())); + std::map ::const_iterator _iter36; + for (_iter36 = this->nameToTypePtr.begin(); _iter36 != this->nameToTypePtr.end(); ++_iter36) + { + xfer += oprot->writeString(_iter36->first); + xfer += oprot->writeI32(_iter36->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TUnionTypeEntry &a, TUnionTypeEntry &b) { + using ::std::swap; + swap(a.nameToTypePtr, b.nameToTypePtr); +} + +TUnionTypeEntry::TUnionTypeEntry(const TUnionTypeEntry& other37) { + nameToTypePtr = other37.nameToTypePtr; +} +TUnionTypeEntry& TUnionTypeEntry::operator=(const TUnionTypeEntry& other38) { + nameToTypePtr = other38.nameToTypePtr; + return *this; +} +void TUnionTypeEntry::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TUnionTypeEntry("; + out << "nameToTypePtr=" << to_string(nameToTypePtr); + out << ")"; +} + + +TUserDefinedTypeEntry::~TUserDefinedTypeEntry() throw() { +} + + +void TUserDefinedTypeEntry::__set_typeClassName(const std::string& val) { + this->typeClassName = val; +} +std::ostream& operator<<(std::ostream& out, const TUserDefinedTypeEntry& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TUserDefinedTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_typeClassName = 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_STRING) { + xfer += iprot->readString(this->typeClassName); + isset_typeClassName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_typeClassName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TUserDefinedTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TUserDefinedTypeEntry"); + + xfer += oprot->writeFieldBegin("typeClassName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->typeClassName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TUserDefinedTypeEntry &a, TUserDefinedTypeEntry &b) { + using ::std::swap; + swap(a.typeClassName, b.typeClassName); +} + +TUserDefinedTypeEntry::TUserDefinedTypeEntry(const TUserDefinedTypeEntry& other39) { + typeClassName = other39.typeClassName; +} +TUserDefinedTypeEntry& TUserDefinedTypeEntry::operator=(const TUserDefinedTypeEntry& other40) { + typeClassName = other40.typeClassName; + return *this; +} +void TUserDefinedTypeEntry::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TUserDefinedTypeEntry("; + out << "typeClassName=" << to_string(typeClassName); + out << ")"; +} + + +TTypeEntry::~TTypeEntry() throw() { +} + + +void TTypeEntry::__set_primitiveEntry(const TPrimitiveTypeEntry& val) { + this->primitiveEntry = val; +__isset.primitiveEntry = true; +} + +void TTypeEntry::__set_arrayEntry(const TArrayTypeEntry& val) { + this->arrayEntry = val; +__isset.arrayEntry = true; +} + +void TTypeEntry::__set_mapEntry(const TMapTypeEntry& val) { + this->mapEntry = val; +__isset.mapEntry = true; +} + +void TTypeEntry::__set_structEntry(const TStructTypeEntry& val) { + this->structEntry = val; +__isset.structEntry = true; +} + +void TTypeEntry::__set_unionEntry(const TUnionTypeEntry& val) { + this->unionEntry = val; +__isset.unionEntry = true; +} + +void TTypeEntry::__set_userDefinedTypeEntry(const TUserDefinedTypeEntry& val) { + this->userDefinedTypeEntry = val; +__isset.userDefinedTypeEntry = true; +} +std::ostream& operator<<(std::ostream& out, const TTypeEntry& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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->primitiveEntry.read(iprot); + this->__isset.primitiveEntry = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->arrayEntry.read(iprot); + this->__isset.arrayEntry = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->mapEntry.read(iprot); + this->__isset.mapEntry = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->structEntry.read(iprot); + this->__isset.structEntry = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->unionEntry.read(iprot); + this->__isset.unionEntry = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->userDefinedTypeEntry.read(iprot); + this->__isset.userDefinedTypeEntry = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TTypeEntry"); + + if (this->__isset.primitiveEntry) { + xfer += oprot->writeFieldBegin("primitiveEntry", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->primitiveEntry.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.arrayEntry) { + xfer += oprot->writeFieldBegin("arrayEntry", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->arrayEntry.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.mapEntry) { + xfer += oprot->writeFieldBegin("mapEntry", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->mapEntry.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.structEntry) { + xfer += oprot->writeFieldBegin("structEntry", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->structEntry.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.unionEntry) { + xfer += oprot->writeFieldBegin("unionEntry", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->unionEntry.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.userDefinedTypeEntry) { + xfer += oprot->writeFieldBegin("userDefinedTypeEntry", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->userDefinedTypeEntry.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TTypeEntry &a, TTypeEntry &b) { + using ::std::swap; + swap(a.primitiveEntry, b.primitiveEntry); + swap(a.arrayEntry, b.arrayEntry); + swap(a.mapEntry, b.mapEntry); + swap(a.structEntry, b.structEntry); + swap(a.unionEntry, b.unionEntry); + swap(a.userDefinedTypeEntry, b.userDefinedTypeEntry); + swap(a.__isset, b.__isset); +} + +TTypeEntry::TTypeEntry(const TTypeEntry& other41) { + primitiveEntry = other41.primitiveEntry; + arrayEntry = other41.arrayEntry; + mapEntry = other41.mapEntry; + structEntry = other41.structEntry; + unionEntry = other41.unionEntry; + userDefinedTypeEntry = other41.userDefinedTypeEntry; + __isset = other41.__isset; +} +TTypeEntry& TTypeEntry::operator=(const TTypeEntry& other42) { + primitiveEntry = other42.primitiveEntry; + arrayEntry = other42.arrayEntry; + mapEntry = other42.mapEntry; + structEntry = other42.structEntry; + unionEntry = other42.unionEntry; + userDefinedTypeEntry = other42.userDefinedTypeEntry; + __isset = other42.__isset; + return *this; +} +void TTypeEntry::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TTypeEntry("; + out << "primitiveEntry="; (__isset.primitiveEntry ? (out << to_string(primitiveEntry)) : (out << "")); + out << ", " << "arrayEntry="; (__isset.arrayEntry ? (out << to_string(arrayEntry)) : (out << "")); + out << ", " << "mapEntry="; (__isset.mapEntry ? (out << to_string(mapEntry)) : (out << "")); + out << ", " << "structEntry="; (__isset.structEntry ? (out << to_string(structEntry)) : (out << "")); + out << ", " << "unionEntry="; (__isset.unionEntry ? (out << to_string(unionEntry)) : (out << "")); + out << ", " << "userDefinedTypeEntry="; (__isset.userDefinedTypeEntry ? (out << to_string(userDefinedTypeEntry)) : (out << "")); + out << ")"; +} + + +TTypeDesc::~TTypeDesc() throw() { +} + + +void TTypeDesc::__set_types(const std::vector & val) { + this->types = val; +} +std::ostream& operator<<(std::ostream& out, const TTypeDesc& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TTypeDesc::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_types = 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_LIST) { + { + this->types.clear(); + uint32_t _size43; + ::apache::thrift::protocol::TType _etype46; + xfer += iprot->readListBegin(_etype46, _size43); + this->types.resize(_size43); + uint32_t _i47; + for (_i47 = 0; _i47 < _size43; ++_i47) + { + xfer += this->types[_i47].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_types = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_types) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TTypeDesc::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TTypeDesc"); + + xfer += oprot->writeFieldBegin("types", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->types.size())); + std::vector ::const_iterator _iter48; + for (_iter48 = this->types.begin(); _iter48 != this->types.end(); ++_iter48) + { + xfer += (*_iter48).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TTypeDesc &a, TTypeDesc &b) { + using ::std::swap; + swap(a.types, b.types); +} + +TTypeDesc::TTypeDesc(const TTypeDesc& other49) { + types = other49.types; +} +TTypeDesc& TTypeDesc::operator=(const TTypeDesc& other50) { + types = other50.types; + return *this; +} +void TTypeDesc::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TTypeDesc("; + out << "types=" << to_string(types); + out << ")"; +} + + +TColumnDesc::~TColumnDesc() throw() { +} + + +void TColumnDesc::__set_columnName(const std::string& val) { + this->columnName = val; +} + +void TColumnDesc::__set_typeDesc(const TTypeDesc& val) { + this->typeDesc = val; +} + +void TColumnDesc::__set_position(const int32_t val) { + this->position = val; +} + +void TColumnDesc::__set_comment(const std::string& val) { + this->comment = val; +__isset.comment = true; +} +std::ostream& operator<<(std::ostream& out, const TColumnDesc& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TColumnDesc::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_columnName = false; + bool isset_typeDesc = false; + bool isset_position = 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_STRING) { + xfer += iprot->readString(this->columnName); + isset_columnName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->typeDesc.read(iprot); + isset_typeDesc = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->position); + isset_position = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->comment); + this->__isset.comment = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_columnName) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_typeDesc) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_position) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TColumnDesc::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TColumnDesc"); + + xfer += oprot->writeFieldBegin("columnName", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->columnName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("typeDesc", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->typeDesc.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("position", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->position); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.comment) { + xfer += oprot->writeFieldBegin("comment", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->comment); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TColumnDesc &a, TColumnDesc &b) { + using ::std::swap; + swap(a.columnName, b.columnName); + swap(a.typeDesc, b.typeDesc); + swap(a.position, b.position); + swap(a.comment, b.comment); + swap(a.__isset, b.__isset); +} + +TColumnDesc::TColumnDesc(const TColumnDesc& other51) { + columnName = other51.columnName; + typeDesc = other51.typeDesc; + position = other51.position; + comment = other51.comment; + __isset = other51.__isset; +} +TColumnDesc& TColumnDesc::operator=(const TColumnDesc& other52) { + columnName = other52.columnName; + typeDesc = other52.typeDesc; + position = other52.position; + comment = other52.comment; + __isset = other52.__isset; + return *this; +} +void TColumnDesc::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TColumnDesc("; + out << "columnName=" << to_string(columnName); + out << ", " << "typeDesc=" << to_string(typeDesc); + out << ", " << "position=" << to_string(position); + out << ", " << "comment="; (__isset.comment ? (out << to_string(comment)) : (out << "")); + out << ")"; +} + + +TTableSchema::~TTableSchema() throw() { +} + + +void TTableSchema::__set_columns(const std::vector & val) { + this->columns = val; +} +std::ostream& operator<<(std::ostream& out, const TTableSchema& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TTableSchema::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_columns = 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_LIST) { + { + this->columns.clear(); + uint32_t _size53; + ::apache::thrift::protocol::TType _etype56; + xfer += iprot->readListBegin(_etype56, _size53); + this->columns.resize(_size53); + uint32_t _i57; + for (_i57 = 0; _i57 < _size53; ++_i57) + { + xfer += this->columns[_i57].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_columns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_columns) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TTableSchema::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TTableSchema"); + + xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->columns.size())); + std::vector ::const_iterator _iter58; + for (_iter58 = this->columns.begin(); _iter58 != this->columns.end(); ++_iter58) + { + xfer += (*_iter58).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TTableSchema &a, TTableSchema &b) { + using ::std::swap; + swap(a.columns, b.columns); +} + +TTableSchema::TTableSchema(const TTableSchema& other59) { + columns = other59.columns; +} +TTableSchema& TTableSchema::operator=(const TTableSchema& other60) { + columns = other60.columns; + return *this; +} +void TTableSchema::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TTableSchema("; + out << "columns=" << to_string(columns); + out << ")"; +} + + +TBoolValue::~TBoolValue() throw() { +} + + +void TBoolValue::__set_value(const bool val) { + this->value = val; +__isset.value = true; +} +std::ostream& operator<<(std::ostream& out, const TBoolValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TBoolValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_BOOL) { + xfer += iprot->readBool(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TBoolValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TBoolValue"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeBool(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TBoolValue &a, TBoolValue &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +TBoolValue::TBoolValue(const TBoolValue& other61) { + value = other61.value; + __isset = other61.__isset; +} +TBoolValue& TBoolValue::operator=(const TBoolValue& other62) { + value = other62.value; + __isset = other62.__isset; + return *this; +} +void TBoolValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TBoolValue("; + out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); + out << ")"; +} + + +TByteValue::~TByteValue() throw() { +} + + +void TByteValue::__set_value(const int8_t val) { + this->value = val; +__isset.value = true; +} +std::ostream& operator<<(std::ostream& out, const TByteValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TByteValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_BYTE) { + xfer += iprot->readByte(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TByteValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TByteValue"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_BYTE, 1); + xfer += oprot->writeByte(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TByteValue &a, TByteValue &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +TByteValue::TByteValue(const TByteValue& other63) { + value = other63.value; + __isset = other63.__isset; +} +TByteValue& TByteValue::operator=(const TByteValue& other64) { + value = other64.value; + __isset = other64.__isset; + return *this; +} +void TByteValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TByteValue("; + out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); + out << ")"; +} + + +TI16Value::~TI16Value() throw() { +} + + +void TI16Value::__set_value(const int16_t val) { + this->value = val; +__isset.value = true; +} +std::ostream& operator<<(std::ostream& out, const TI16Value& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TI16Value::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I16) { + xfer += iprot->readI16(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TI16Value::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TI16Value"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I16, 1); + xfer += oprot->writeI16(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TI16Value &a, TI16Value &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +TI16Value::TI16Value(const TI16Value& other65) { + value = other65.value; + __isset = other65.__isset; +} +TI16Value& TI16Value::operator=(const TI16Value& other66) { + value = other66.value; + __isset = other66.__isset; + return *this; +} +void TI16Value::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TI16Value("; + out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); + out << ")"; +} + + +TI32Value::~TI32Value() throw() { +} + + +void TI32Value::__set_value(const int32_t val) { + this->value = val; +__isset.value = true; +} +std::ostream& operator<<(std::ostream& out, const TI32Value& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TI32Value::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I32) { + xfer += iprot->readI32(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TI32Value::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TI32Value"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TI32Value &a, TI32Value &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +TI32Value::TI32Value(const TI32Value& other67) { + value = other67.value; + __isset = other67.__isset; +} +TI32Value& TI32Value::operator=(const TI32Value& other68) { + value = other68.value; + __isset = other68.__isset; + return *this; +} +void TI32Value::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TI32Value("; + out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); + out << ")"; +} + + +TI64Value::~TI64Value() throw() { +} + + +void TI64Value::__set_value(const int64_t val) { + this->value = val; +__isset.value = true; +} +std::ostream& operator<<(std::ostream& out, const TI64Value& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TI64Value::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I64) { + xfer += iprot->readI64(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TI64Value::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TI64Value"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TI64Value &a, TI64Value &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +TI64Value::TI64Value(const TI64Value& other69) { + value = other69.value; + __isset = other69.__isset; +} +TI64Value& TI64Value::operator=(const TI64Value& other70) { + value = other70.value; + __isset = other70.__isset; + return *this; +} +void TI64Value::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TI64Value("; + out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); + out << ")"; +} + + +TDoubleValue::~TDoubleValue() throw() { +} + + +void TDoubleValue::__set_value(const double val) { + this->value = val; +__isset.value = true; +} +std::ostream& operator<<(std::ostream& out, const TDoubleValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TDoubleValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_DOUBLE) { + xfer += iprot->readDouble(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TDoubleValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TDoubleValue"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_DOUBLE, 1); + xfer += oprot->writeDouble(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TDoubleValue &a, TDoubleValue &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +TDoubleValue::TDoubleValue(const TDoubleValue& other71) { + value = other71.value; + __isset = other71.__isset; +} +TDoubleValue& TDoubleValue::operator=(const TDoubleValue& other72) { + value = other72.value; + __isset = other72.__isset; + return *this; +} +void TDoubleValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TDoubleValue("; + out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); + out << ")"; +} + + +TStringValue::~TStringValue() throw() { +} + + +void TStringValue::__set_value(const std::string& val) { + this->value = val; +__isset.value = true; +} +std::ostream& operator<<(std::ostream& out, const TStringValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TStringValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->value); + this->__isset.value = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TStringValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TStringValue"); + + if (this->__isset.value) { + xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->value); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TStringValue &a, TStringValue &b) { + using ::std::swap; + swap(a.value, b.value); + swap(a.__isset, b.__isset); +} + +TStringValue::TStringValue(const TStringValue& other73) { + value = other73.value; + __isset = other73.__isset; +} +TStringValue& TStringValue::operator=(const TStringValue& other74) { + value = other74.value; + __isset = other74.__isset; + return *this; +} +void TStringValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TStringValue("; + out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); + out << ")"; +} + + +TColumnValue::~TColumnValue() throw() { +} + + +void TColumnValue::__set_boolVal(const TBoolValue& val) { + this->boolVal = val; +__isset.boolVal = true; +} + +void TColumnValue::__set_byteVal(const TByteValue& val) { + this->byteVal = val; +__isset.byteVal = true; +} + +void TColumnValue::__set_i16Val(const TI16Value& val) { + this->i16Val = val; +__isset.i16Val = true; +} + +void TColumnValue::__set_i32Val(const TI32Value& val) { + this->i32Val = val; +__isset.i32Val = true; +} + +void TColumnValue::__set_i64Val(const TI64Value& val) { + this->i64Val = val; +__isset.i64Val = true; +} + +void TColumnValue::__set_doubleVal(const TDoubleValue& val) { + this->doubleVal = val; +__isset.doubleVal = true; +} + +void TColumnValue::__set_stringVal(const TStringValue& val) { + this->stringVal = val; +__isset.stringVal = true; +} +std::ostream& operator<<(std::ostream& out, const TColumnValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TColumnValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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->boolVal.read(iprot); + this->__isset.boolVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->byteVal.read(iprot); + this->__isset.byteVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->i16Val.read(iprot); + this->__isset.i16Val = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->i32Val.read(iprot); + this->__isset.i32Val = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->i64Val.read(iprot); + this->__isset.i64Val = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->doubleVal.read(iprot); + this->__isset.doubleVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->stringVal.read(iprot); + this->__isset.stringVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TColumnValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TColumnValue"); + + if (this->__isset.boolVal) { + xfer += oprot->writeFieldBegin("boolVal", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->boolVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.byteVal) { + xfer += oprot->writeFieldBegin("byteVal", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->byteVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.i16Val) { + xfer += oprot->writeFieldBegin("i16Val", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->i16Val.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.i32Val) { + xfer += oprot->writeFieldBegin("i32Val", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->i32Val.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.i64Val) { + xfer += oprot->writeFieldBegin("i64Val", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->i64Val.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.doubleVal) { + xfer += oprot->writeFieldBegin("doubleVal", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->doubleVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.stringVal) { + xfer += oprot->writeFieldBegin("stringVal", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->stringVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TColumnValue &a, TColumnValue &b) { + using ::std::swap; + swap(a.boolVal, b.boolVal); + swap(a.byteVal, b.byteVal); + swap(a.i16Val, b.i16Val); + swap(a.i32Val, b.i32Val); + swap(a.i64Val, b.i64Val); + swap(a.doubleVal, b.doubleVal); + swap(a.stringVal, b.stringVal); + swap(a.__isset, b.__isset); +} + +TColumnValue::TColumnValue(const TColumnValue& other75) { + boolVal = other75.boolVal; + byteVal = other75.byteVal; + i16Val = other75.i16Val; + i32Val = other75.i32Val; + i64Val = other75.i64Val; + doubleVal = other75.doubleVal; + stringVal = other75.stringVal; + __isset = other75.__isset; +} +TColumnValue& TColumnValue::operator=(const TColumnValue& other76) { + boolVal = other76.boolVal; + byteVal = other76.byteVal; + i16Val = other76.i16Val; + i32Val = other76.i32Val; + i64Val = other76.i64Val; + doubleVal = other76.doubleVal; + stringVal = other76.stringVal; + __isset = other76.__isset; + return *this; +} +void TColumnValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TColumnValue("; + out << "boolVal="; (__isset.boolVal ? (out << to_string(boolVal)) : (out << "")); + out << ", " << "byteVal="; (__isset.byteVal ? (out << to_string(byteVal)) : (out << "")); + out << ", " << "i16Val="; (__isset.i16Val ? (out << to_string(i16Val)) : (out << "")); + out << ", " << "i32Val="; (__isset.i32Val ? (out << to_string(i32Val)) : (out << "")); + out << ", " << "i64Val="; (__isset.i64Val ? (out << to_string(i64Val)) : (out << "")); + out << ", " << "doubleVal="; (__isset.doubleVal ? (out << to_string(doubleVal)) : (out << "")); + out << ", " << "stringVal="; (__isset.stringVal ? (out << to_string(stringVal)) : (out << "")); + out << ")"; +} + + +TRow::~TRow() throw() { +} + + +void TRow::__set_colVals(const std::vector & val) { + this->colVals = val; +} +std::ostream& operator<<(std::ostream& out, const TRow& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TRow::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_colVals = 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_LIST) { + { + this->colVals.clear(); + uint32_t _size77; + ::apache::thrift::protocol::TType _etype80; + xfer += iprot->readListBegin(_etype80, _size77); + this->colVals.resize(_size77); + uint32_t _i81; + for (_i81 = 0; _i81 < _size77; ++_i81) + { + xfer += this->colVals[_i81].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_colVals = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_colVals) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TRow::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TRow"); + + xfer += oprot->writeFieldBegin("colVals", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->colVals.size())); + std::vector ::const_iterator _iter82; + for (_iter82 = this->colVals.begin(); _iter82 != this->colVals.end(); ++_iter82) + { + xfer += (*_iter82).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TRow &a, TRow &b) { + using ::std::swap; + swap(a.colVals, b.colVals); +} + +TRow::TRow(const TRow& other83) { + colVals = other83.colVals; +} +TRow& TRow::operator=(const TRow& other84) { + colVals = other84.colVals; + return *this; +} +void TRow::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TRow("; + out << "colVals=" << to_string(colVals); + out << ")"; +} + + +TBoolColumn::~TBoolColumn() throw() { +} + + +void TBoolColumn::__set_values(const std::vector & val) { + this->values = val; +} + +void TBoolColumn::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TBoolColumn& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TBoolColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size85; + ::apache::thrift::protocol::TType _etype88; + xfer += iprot->readListBegin(_etype88, _size85); + this->values.resize(_size85); + uint32_t _i89; + for (_i89 = 0; _i89 < _size85; ++_i89) + { + xfer += iprot->readBool(this->values[_i89]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TBoolColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TBoolColumn"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_BOOL, static_cast(this->values.size())); + std::vector ::const_iterator _iter90; + for (_iter90 = this->values.begin(); _iter90 != this->values.end(); ++_iter90) + { + xfer += oprot->writeBool((*_iter90)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TBoolColumn &a, TBoolColumn &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TBoolColumn::TBoolColumn(const TBoolColumn& other91) { + values = other91.values; + nulls = other91.nulls; +} +TBoolColumn& TBoolColumn::operator=(const TBoolColumn& other92) { + values = other92.values; + nulls = other92.nulls; + return *this; +} +void TBoolColumn::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TBoolColumn("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TByteColumn::~TByteColumn() throw() { +} + + +void TByteColumn::__set_values(const std::vector & val) { + this->values = val; +} + +void TByteColumn::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TByteColumn& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TByteColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size93; + ::apache::thrift::protocol::TType _etype96; + xfer += iprot->readListBegin(_etype96, _size93); + this->values.resize(_size93); + uint32_t _i97; + for (_i97 = 0; _i97 < _size93; ++_i97) + { + xfer += iprot->readByte(this->values[_i97]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TByteColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TByteColumn"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_BYTE, static_cast(this->values.size())); + std::vector ::const_iterator _iter98; + for (_iter98 = this->values.begin(); _iter98 != this->values.end(); ++_iter98) + { + xfer += oprot->writeByte((*_iter98)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TByteColumn &a, TByteColumn &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TByteColumn::TByteColumn(const TByteColumn& other99) { + values = other99.values; + nulls = other99.nulls; +} +TByteColumn& TByteColumn::operator=(const TByteColumn& other100) { + values = other100.values; + nulls = other100.nulls; + return *this; +} +void TByteColumn::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TByteColumn("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TI16Column::~TI16Column() throw() { +} + + +void TI16Column::__set_values(const std::vector & val) { + this->values = val; +} + +void TI16Column::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TI16Column& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TI16Column::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size101; + ::apache::thrift::protocol::TType _etype104; + xfer += iprot->readListBegin(_etype104, _size101); + this->values.resize(_size101); + uint32_t _i105; + for (_i105 = 0; _i105 < _size101; ++_i105) + { + xfer += iprot->readI16(this->values[_i105]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TI16Column::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TI16Column"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I16, static_cast(this->values.size())); + std::vector ::const_iterator _iter106; + for (_iter106 = this->values.begin(); _iter106 != this->values.end(); ++_iter106) + { + xfer += oprot->writeI16((*_iter106)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TI16Column &a, TI16Column &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TI16Column::TI16Column(const TI16Column& other107) { + values = other107.values; + nulls = other107.nulls; +} +TI16Column& TI16Column::operator=(const TI16Column& other108) { + values = other108.values; + nulls = other108.nulls; + return *this; +} +void TI16Column::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TI16Column("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TI32Column::~TI32Column() throw() { +} + + +void TI32Column::__set_values(const std::vector & val) { + this->values = val; +} + +void TI32Column::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TI32Column& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TI32Column::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size109; + ::apache::thrift::protocol::TType _etype112; + xfer += iprot->readListBegin(_etype112, _size109); + this->values.resize(_size109); + uint32_t _i113; + for (_i113 = 0; _i113 < _size109; ++_i113) + { + xfer += iprot->readI32(this->values[_i113]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TI32Column::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TI32Column"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->values.size())); + std::vector ::const_iterator _iter114; + for (_iter114 = this->values.begin(); _iter114 != this->values.end(); ++_iter114) + { + xfer += oprot->writeI32((*_iter114)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TI32Column &a, TI32Column &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TI32Column::TI32Column(const TI32Column& other115) { + values = other115.values; + nulls = other115.nulls; +} +TI32Column& TI32Column::operator=(const TI32Column& other116) { + values = other116.values; + nulls = other116.nulls; + return *this; +} +void TI32Column::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TI32Column("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TI64Column::~TI64Column() throw() { +} + + +void TI64Column::__set_values(const std::vector & val) { + this->values = val; +} + +void TI64Column::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TI64Column& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TI64Column::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size117; + ::apache::thrift::protocol::TType _etype120; + xfer += iprot->readListBegin(_etype120, _size117); + this->values.resize(_size117); + uint32_t _i121; + for (_i121 = 0; _i121 < _size117; ++_i121) + { + xfer += iprot->readI64(this->values[_i121]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TI64Column::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TI64Column"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->values.size())); + std::vector ::const_iterator _iter122; + for (_iter122 = this->values.begin(); _iter122 != this->values.end(); ++_iter122) + { + xfer += oprot->writeI64((*_iter122)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TI64Column &a, TI64Column &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TI64Column::TI64Column(const TI64Column& other123) { + values = other123.values; + nulls = other123.nulls; +} +TI64Column& TI64Column::operator=(const TI64Column& other124) { + values = other124.values; + nulls = other124.nulls; + return *this; +} +void TI64Column::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TI64Column("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TDoubleColumn::~TDoubleColumn() throw() { +} + + +void TDoubleColumn::__set_values(const std::vector & val) { + this->values = val; +} + +void TDoubleColumn::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TDoubleColumn& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TDoubleColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size125; + ::apache::thrift::protocol::TType _etype128; + xfer += iprot->readListBegin(_etype128, _size125); + this->values.resize(_size125); + uint32_t _i129; + for (_i129 = 0; _i129 < _size125; ++_i129) + { + xfer += iprot->readDouble(this->values[_i129]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TDoubleColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TDoubleColumn"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_DOUBLE, static_cast(this->values.size())); + std::vector ::const_iterator _iter130; + for (_iter130 = this->values.begin(); _iter130 != this->values.end(); ++_iter130) + { + xfer += oprot->writeDouble((*_iter130)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TDoubleColumn &a, TDoubleColumn &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TDoubleColumn::TDoubleColumn(const TDoubleColumn& other131) { + values = other131.values; + nulls = other131.nulls; +} +TDoubleColumn& TDoubleColumn::operator=(const TDoubleColumn& other132) { + values = other132.values; + nulls = other132.nulls; + return *this; +} +void TDoubleColumn::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TDoubleColumn("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TStringColumn::~TStringColumn() throw() { +} + + +void TStringColumn::__set_values(const std::vector & val) { + this->values = val; +} + +void TStringColumn::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TStringColumn& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TStringColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size133; + ::apache::thrift::protocol::TType _etype136; + xfer += iprot->readListBegin(_etype136, _size133); + this->values.resize(_size133); + uint32_t _i137; + for (_i137 = 0; _i137 < _size133; ++_i137) + { + xfer += iprot->readString(this->values[_i137]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TStringColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TStringColumn"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); + std::vector ::const_iterator _iter138; + for (_iter138 = this->values.begin(); _iter138 != this->values.end(); ++_iter138) + { + xfer += oprot->writeString((*_iter138)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TStringColumn &a, TStringColumn &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TStringColumn::TStringColumn(const TStringColumn& other139) { + values = other139.values; + nulls = other139.nulls; +} +TStringColumn& TStringColumn::operator=(const TStringColumn& other140) { + values = other140.values; + nulls = other140.nulls; + return *this; +} +void TStringColumn::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TStringColumn("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TBinaryColumn::~TBinaryColumn() throw() { +} + + +void TBinaryColumn::__set_values(const std::vector & val) { + this->values = val; +} + +void TBinaryColumn::__set_nulls(const std::string& val) { + this->nulls = val; +} +std::ostream& operator<<(std::ostream& out, const TBinaryColumn& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TBinaryColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; + bool isset_nulls = 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_LIST) { + { + this->values.clear(); + uint32_t _size141; + ::apache::thrift::protocol::TType _etype144; + xfer += iprot->readListBegin(_etype144, _size141); + this->values.resize(_size141); + uint32_t _i145; + for (_i145 = 0; _i145 < _size141; ++_i145) + { + xfer += iprot->readBinary(this->values[_i145]); + } + xfer += iprot->readListEnd(); + } + isset_values = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->nulls); + isset_nulls = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_values) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_nulls) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TBinaryColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TBinaryColumn"); + + xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); + std::vector ::const_iterator _iter146; + for (_iter146 = this->values.begin(); _iter146 != this->values.end(); ++_iter146) + { + xfer += oprot->writeBinary((*_iter146)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->nulls); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TBinaryColumn &a, TBinaryColumn &b) { + using ::std::swap; + swap(a.values, b.values); + swap(a.nulls, b.nulls); +} + +TBinaryColumn::TBinaryColumn(const TBinaryColumn& other147) { + values = other147.values; + nulls = other147.nulls; +} +TBinaryColumn& TBinaryColumn::operator=(const TBinaryColumn& other148) { + values = other148.values; + nulls = other148.nulls; + return *this; +} +void TBinaryColumn::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TBinaryColumn("; + out << "values=" << to_string(values); + out << ", " << "nulls=" << to_string(nulls); + out << ")"; +} + + +TColumn::~TColumn() throw() { +} + + +void TColumn::__set_boolVal(const TBoolColumn& val) { + this->boolVal = val; +__isset.boolVal = true; +} + +void TColumn::__set_byteVal(const TByteColumn& val) { + this->byteVal = val; +__isset.byteVal = true; +} + +void TColumn::__set_i16Val(const TI16Column& val) { + this->i16Val = val; +__isset.i16Val = true; +} + +void TColumn::__set_i32Val(const TI32Column& val) { + this->i32Val = val; +__isset.i32Val = true; +} + +void TColumn::__set_i64Val(const TI64Column& val) { + this->i64Val = val; +__isset.i64Val = true; +} + +void TColumn::__set_doubleVal(const TDoubleColumn& val) { + this->doubleVal = val; +__isset.doubleVal = true; +} + +void TColumn::__set_stringVal(const TStringColumn& val) { + this->stringVal = val; +__isset.stringVal = true; +} + +void TColumn::__set_binaryVal(const TBinaryColumn& val) { + this->binaryVal = val; +__isset.binaryVal = true; +} +std::ostream& operator<<(std::ostream& out, const TColumn& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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->boolVal.read(iprot); + this->__isset.boolVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->byteVal.read(iprot); + this->__isset.byteVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->i16Val.read(iprot); + this->__isset.i16Val = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->i32Val.read(iprot); + this->__isset.i32Val = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->i64Val.read(iprot); + this->__isset.i64Val = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->doubleVal.read(iprot); + this->__isset.doubleVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->stringVal.read(iprot); + this->__isset.stringVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->binaryVal.read(iprot); + this->__isset.binaryVal = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TColumn"); + + if (this->__isset.boolVal) { + xfer += oprot->writeFieldBegin("boolVal", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->boolVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.byteVal) { + xfer += oprot->writeFieldBegin("byteVal", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->byteVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.i16Val) { + xfer += oprot->writeFieldBegin("i16Val", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->i16Val.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.i32Val) { + xfer += oprot->writeFieldBegin("i32Val", ::apache::thrift::protocol::T_STRUCT, 4); + xfer += this->i32Val.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.i64Val) { + xfer += oprot->writeFieldBegin("i64Val", ::apache::thrift::protocol::T_STRUCT, 5); + xfer += this->i64Val.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.doubleVal) { + xfer += oprot->writeFieldBegin("doubleVal", ::apache::thrift::protocol::T_STRUCT, 6); + xfer += this->doubleVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.stringVal) { + xfer += oprot->writeFieldBegin("stringVal", ::apache::thrift::protocol::T_STRUCT, 7); + xfer += this->stringVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.binaryVal) { + xfer += oprot->writeFieldBegin("binaryVal", ::apache::thrift::protocol::T_STRUCT, 8); + xfer += this->binaryVal.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TColumn &a, TColumn &b) { + using ::std::swap; + swap(a.boolVal, b.boolVal); + swap(a.byteVal, b.byteVal); + swap(a.i16Val, b.i16Val); + swap(a.i32Val, b.i32Val); + swap(a.i64Val, b.i64Val); + swap(a.doubleVal, b.doubleVal); + swap(a.stringVal, b.stringVal); + swap(a.binaryVal, b.binaryVal); + swap(a.__isset, b.__isset); +} + +TColumn::TColumn(const TColumn& other149) { + boolVal = other149.boolVal; + byteVal = other149.byteVal; + i16Val = other149.i16Val; + i32Val = other149.i32Val; + i64Val = other149.i64Val; + doubleVal = other149.doubleVal; + stringVal = other149.stringVal; + binaryVal = other149.binaryVal; + __isset = other149.__isset; +} +TColumn& TColumn::operator=(const TColumn& other150) { + boolVal = other150.boolVal; + byteVal = other150.byteVal; + i16Val = other150.i16Val; + i32Val = other150.i32Val; + i64Val = other150.i64Val; + doubleVal = other150.doubleVal; + stringVal = other150.stringVal; + binaryVal = other150.binaryVal; + __isset = other150.__isset; + return *this; +} +void TColumn::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TColumn("; + out << "boolVal="; (__isset.boolVal ? (out << to_string(boolVal)) : (out << "")); + out << ", " << "byteVal="; (__isset.byteVal ? (out << to_string(byteVal)) : (out << "")); + out << ", " << "i16Val="; (__isset.i16Val ? (out << to_string(i16Val)) : (out << "")); + out << ", " << "i32Val="; (__isset.i32Val ? (out << to_string(i32Val)) : (out << "")); + out << ", " << "i64Val="; (__isset.i64Val ? (out << to_string(i64Val)) : (out << "")); + out << ", " << "doubleVal="; (__isset.doubleVal ? (out << to_string(doubleVal)) : (out << "")); + out << ", " << "stringVal="; (__isset.stringVal ? (out << to_string(stringVal)) : (out << "")); + out << ", " << "binaryVal="; (__isset.binaryVal ? (out << to_string(binaryVal)) : (out << "")); + out << ")"; +} + + +TRowSet::~TRowSet() throw() { +} + + +void TRowSet::__set_startRowOffset(const int64_t val) { + this->startRowOffset = val; +} + +void TRowSet::__set_rows(const std::vector & val) { + this->rows = val; +} + +void TRowSet::__set_columns(const std::vector & val) { + this->columns = val; +__isset.columns = true; +} + +void TRowSet::__set_binaryColumns(const std::string& val) { + this->binaryColumns = val; +__isset.binaryColumns = true; +} + +void TRowSet::__set_columnCount(const int32_t val) { + this->columnCount = val; +__isset.columnCount = true; +} +std::ostream& operator<<(std::ostream& out, const TRowSet& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_startRowOffset = false; + bool isset_rows = 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_I64) { + xfer += iprot->readI64(this->startRowOffset); + isset_startRowOffset = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->rows.clear(); + uint32_t _size151; + ::apache::thrift::protocol::TType _etype154; + xfer += iprot->readListBegin(_etype154, _size151); + this->rows.resize(_size151); + uint32_t _i155; + for (_i155 = 0; _i155 < _size151; ++_i155) + { + xfer += this->rows[_i155].read(iprot); + } + xfer += iprot->readListEnd(); + } + isset_rows = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->columns.clear(); + uint32_t _size156; + ::apache::thrift::protocol::TType _etype159; + xfer += iprot->readListBegin(_etype159, _size156); + this->columns.resize(_size156); + uint32_t _i160; + for (_i160 = 0; _i160 < _size156; ++_i160) + { + xfer += this->columns[_i160].read(iprot); + } + xfer += iprot->readListEnd(); + } + this->__isset.columns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->binaryColumns); + this->__isset.binaryColumns = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->columnCount); + this->__isset.columnCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_startRowOffset) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_rows) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TRowSet::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TRowSet"); + + xfer += oprot->writeFieldBegin("startRowOffset", ::apache::thrift::protocol::T_I64, 1); + xfer += oprot->writeI64(this->startRowOffset); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->rows.size())); + std::vector ::const_iterator _iter161; + for (_iter161 = this->rows.begin(); _iter161 != this->rows.end(); ++_iter161) + { + xfer += (*_iter161).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + if (this->__isset.columns) { + xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 3); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->columns.size())); + std::vector ::const_iterator _iter162; + for (_iter162 = this->columns.begin(); _iter162 != this->columns.end(); ++_iter162) + { + xfer += (*_iter162).write(oprot); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.binaryColumns) { + xfer += oprot->writeFieldBegin("binaryColumns", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeBinary(this->binaryColumns); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.columnCount) { + xfer += oprot->writeFieldBegin("columnCount", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->columnCount); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TRowSet &a, TRowSet &b) { + using ::std::swap; + swap(a.startRowOffset, b.startRowOffset); + swap(a.rows, b.rows); + swap(a.columns, b.columns); + swap(a.binaryColumns, b.binaryColumns); + swap(a.columnCount, b.columnCount); + swap(a.__isset, b.__isset); +} + +TRowSet::TRowSet(const TRowSet& other163) { + startRowOffset = other163.startRowOffset; + rows = other163.rows; + columns = other163.columns; + binaryColumns = other163.binaryColumns; + columnCount = other163.columnCount; + __isset = other163.__isset; +} +TRowSet& TRowSet::operator=(const TRowSet& other164) { + startRowOffset = other164.startRowOffset; + rows = other164.rows; + columns = other164.columns; + binaryColumns = other164.binaryColumns; + columnCount = other164.columnCount; + __isset = other164.__isset; + return *this; +} +void TRowSet::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TRowSet("; + out << "startRowOffset=" << to_string(startRowOffset); + out << ", " << "rows=" << to_string(rows); + out << ", " << "columns="; (__isset.columns ? (out << to_string(columns)) : (out << "")); + out << ", " << "binaryColumns="; (__isset.binaryColumns ? (out << to_string(binaryColumns)) : (out << "")); + out << ", " << "columnCount="; (__isset.columnCount ? (out << to_string(columnCount)) : (out << "")); + out << ")"; +} + + +TStatus::~TStatus() throw() { +} + + +void TStatus::__set_statusCode(const TStatusCode::type val) { + this->statusCode = val; +} + +void TStatus::__set_infoMessages(const std::vector & val) { + this->infoMessages = val; +__isset.infoMessages = true; +} + +void TStatus::__set_sqlState(const std::string& val) { + this->sqlState = val; +__isset.sqlState = true; +} + +void TStatus::__set_errorCode(const int32_t val) { + this->errorCode = val; +__isset.errorCode = true; +} + +void TStatus::__set_errorMessage(const std::string& val) { + this->errorMessage = val; +__isset.errorMessage = true; +} +std::ostream& operator<<(std::ostream& out, const TStatus& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TStatus::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_statusCode = 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_I32) { + int32_t ecast165; + xfer += iprot->readI32(ecast165); + this->statusCode = (TStatusCode::type)ecast165; + isset_statusCode = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->infoMessages.clear(); + uint32_t _size166; + ::apache::thrift::protocol::TType _etype169; + xfer += iprot->readListBegin(_etype169, _size166); + this->infoMessages.resize(_size166); + uint32_t _i170; + for (_i170 = 0; _i170 < _size166; ++_i170) + { + xfer += iprot->readString(this->infoMessages[_i170]); + } + xfer += iprot->readListEnd(); + } + this->__isset.infoMessages = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->sqlState); + this->__isset.sqlState = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->errorCode); + this->__isset.errorCode = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->errorMessage); + this->__isset.errorMessage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_statusCode) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TStatus::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TStatus"); + + xfer += oprot->writeFieldBegin("statusCode", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((int32_t)this->statusCode); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.infoMessages) { + xfer += oprot->writeFieldBegin("infoMessages", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->infoMessages.size())); + std::vector ::const_iterator _iter171; + for (_iter171 = this->infoMessages.begin(); _iter171 != this->infoMessages.end(); ++_iter171) + { + xfer += oprot->writeString((*_iter171)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.sqlState) { + xfer += oprot->writeFieldBegin("sqlState", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->sqlState); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.errorCode) { + xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->errorCode); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.errorMessage) { + xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->errorMessage); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TStatus &a, TStatus &b) { + using ::std::swap; + swap(a.statusCode, b.statusCode); + swap(a.infoMessages, b.infoMessages); + swap(a.sqlState, b.sqlState); + swap(a.errorCode, b.errorCode); + swap(a.errorMessage, b.errorMessage); + swap(a.__isset, b.__isset); +} + +TStatus::TStatus(const TStatus& other172) { + statusCode = other172.statusCode; + infoMessages = other172.infoMessages; + sqlState = other172.sqlState; + errorCode = other172.errorCode; + errorMessage = other172.errorMessage; + __isset = other172.__isset; +} +TStatus& TStatus::operator=(const TStatus& other173) { + statusCode = other173.statusCode; + infoMessages = other173.infoMessages; + sqlState = other173.sqlState; + errorCode = other173.errorCode; + errorMessage = other173.errorMessage; + __isset = other173.__isset; + return *this; +} +void TStatus::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TStatus("; + out << "statusCode=" << to_string(statusCode); + out << ", " << "infoMessages="; (__isset.infoMessages ? (out << to_string(infoMessages)) : (out << "")); + out << ", " << "sqlState="; (__isset.sqlState ? (out << to_string(sqlState)) : (out << "")); + out << ", " << "errorCode="; (__isset.errorCode ? (out << to_string(errorCode)) : (out << "")); + out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); + out << ")"; +} + + +THandleIdentifier::~THandleIdentifier() throw() { +} + + +void THandleIdentifier::__set_guid(const std::string& val) { + this->guid = val; +} + +void THandleIdentifier::__set_secret(const std::string& val) { + this->secret = val; +} +std::ostream& operator<<(std::ostream& out, const THandleIdentifier& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t THandleIdentifier::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_guid = false; + bool isset_secret = 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_STRING) { + xfer += iprot->readBinary(this->guid); + isset_guid = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readBinary(this->secret); + isset_secret = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_guid) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_secret) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t THandleIdentifier::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("THandleIdentifier"); + + xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeBinary(this->guid); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("secret", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeBinary(this->secret); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(THandleIdentifier &a, THandleIdentifier &b) { + using ::std::swap; + swap(a.guid, b.guid); + swap(a.secret, b.secret); +} + +THandleIdentifier::THandleIdentifier(const THandleIdentifier& other174) { + guid = other174.guid; + secret = other174.secret; +} +THandleIdentifier& THandleIdentifier::operator=(const THandleIdentifier& other175) { + guid = other175.guid; + secret = other175.secret; + return *this; +} +void THandleIdentifier::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "THandleIdentifier("; + out << "guid=" << to_string(guid); + out << ", " << "secret=" << to_string(secret); + out << ")"; +} + + +TSessionHandle::~TSessionHandle() throw() { +} + + +void TSessionHandle::__set_sessionId(const THandleIdentifier& val) { + this->sessionId = val; +} +std::ostream& operator<<(std::ostream& out, const TSessionHandle& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TSessionHandle::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_sessionId = 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->sessionId.read(iprot); + isset_sessionId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_sessionId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TSessionHandle::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TSessionHandle"); + + xfer += oprot->writeFieldBegin("sessionId", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionId.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TSessionHandle &a, TSessionHandle &b) { + using ::std::swap; + swap(a.sessionId, b.sessionId); +} + +TSessionHandle::TSessionHandle(const TSessionHandle& other176) { + sessionId = other176.sessionId; +} +TSessionHandle& TSessionHandle::operator=(const TSessionHandle& other177) { + sessionId = other177.sessionId; + return *this; +} +void TSessionHandle::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TSessionHandle("; + out << "sessionId=" << to_string(sessionId); + out << ")"; +} + + +TOperationHandle::~TOperationHandle() throw() { +} + + +void TOperationHandle::__set_operationId(const THandleIdentifier& val) { + this->operationId = val; +} + +void TOperationHandle::__set_operationType(const TOperationType::type val) { + this->operationType = val; +} + +void TOperationHandle::__set_hasResultSet(const bool val) { + this->hasResultSet = val; +} + +void TOperationHandle::__set_modifiedRowCount(const double val) { + this->modifiedRowCount = val; +__isset.modifiedRowCount = true; +} +std::ostream& operator<<(std::ostream& out, const TOperationHandle& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TOperationHandle::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_operationId = false; + bool isset_operationType = false; + bool isset_hasResultSet = 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->operationId.read(iprot); + isset_operationId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast178; + xfer += iprot->readI32(ecast178); + this->operationType = (TOperationType::type)ecast178; + isset_operationType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->hasResultSet); + isset_hasResultSet = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->modifiedRowCount); + this->__isset.modifiedRowCount = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_operationId) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_operationType) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_hasResultSet) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TOperationHandle::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TOperationHandle"); + + xfer += oprot->writeFieldBegin("operationId", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->operationId.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("operationType", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->operationType); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("hasResultSet", ::apache::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeBool(this->hasResultSet); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.modifiedRowCount) { + xfer += oprot->writeFieldBegin("modifiedRowCount", ::apache::thrift::protocol::T_DOUBLE, 4); + xfer += oprot->writeDouble(this->modifiedRowCount); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TOperationHandle &a, TOperationHandle &b) { + using ::std::swap; + swap(a.operationId, b.operationId); + swap(a.operationType, b.operationType); + swap(a.hasResultSet, b.hasResultSet); + swap(a.modifiedRowCount, b.modifiedRowCount); + swap(a.__isset, b.__isset); +} + +TOperationHandle::TOperationHandle(const TOperationHandle& other179) { + operationId = other179.operationId; + operationType = other179.operationType; + hasResultSet = other179.hasResultSet; + modifiedRowCount = other179.modifiedRowCount; + __isset = other179.__isset; +} +TOperationHandle& TOperationHandle::operator=(const TOperationHandle& other180) { + operationId = other180.operationId; + operationType = other180.operationType; + hasResultSet = other180.hasResultSet; + modifiedRowCount = other180.modifiedRowCount; + __isset = other180.__isset; + return *this; +} +void TOperationHandle::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TOperationHandle("; + out << "operationId=" << to_string(operationId); + out << ", " << "operationType=" << to_string(operationType); + out << ", " << "hasResultSet=" << to_string(hasResultSet); + out << ", " << "modifiedRowCount="; (__isset.modifiedRowCount ? (out << to_string(modifiedRowCount)) : (out << "")); + out << ")"; +} + + +TOpenSessionReq::~TOpenSessionReq() throw() { +} + + +void TOpenSessionReq::__set_client_protocol(const TProtocolVersion::type val) { + this->client_protocol = val; +} + +void TOpenSessionReq::__set_username(const std::string& val) { + this->username = val; +__isset.username = true; +} + +void TOpenSessionReq::__set_password(const std::string& val) { + this->password = val; +__isset.password = true; +} + +void TOpenSessionReq::__set_configuration(const std::map & val) { + this->configuration = val; +__isset.configuration = true; +} +std::ostream& operator<<(std::ostream& out, const TOpenSessionReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TOpenSessionReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_client_protocol = 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_I32) { + int32_t ecast181; + xfer += iprot->readI32(ecast181); + this->client_protocol = (TProtocolVersion::type)ecast181; + isset_client_protocol = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->username); + this->__isset.username = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->password); + this->__isset.password = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->configuration.clear(); + uint32_t _size182; + ::apache::thrift::protocol::TType _ktype183; + ::apache::thrift::protocol::TType _vtype184; + xfer += iprot->readMapBegin(_ktype183, _vtype184, _size182); + uint32_t _i186; + for (_i186 = 0; _i186 < _size182; ++_i186) + { + std::string _key187; + xfer += iprot->readString(_key187); + std::string& _val188 = this->configuration[_key187]; + xfer += iprot->readString(_val188); + } + xfer += iprot->readMapEnd(); + } + this->__isset.configuration = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_client_protocol) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TOpenSessionReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TOpenSessionReq"); + + xfer += oprot->writeFieldBegin("client_protocol", ::apache::thrift::protocol::T_I32, 1); + xfer += oprot->writeI32((int32_t)this->client_protocol); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.username) { + xfer += oprot->writeFieldBegin("username", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->username); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.password) { + xfer += oprot->writeFieldBegin("password", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->password); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.configuration) { + xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 4); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); + std::map ::const_iterator _iter189; + for (_iter189 = this->configuration.begin(); _iter189 != this->configuration.end(); ++_iter189) + { + xfer += oprot->writeString(_iter189->first); + xfer += oprot->writeString(_iter189->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TOpenSessionReq &a, TOpenSessionReq &b) { + using ::std::swap; + swap(a.client_protocol, b.client_protocol); + swap(a.username, b.username); + swap(a.password, b.password); + swap(a.configuration, b.configuration); + swap(a.__isset, b.__isset); +} + +TOpenSessionReq::TOpenSessionReq(const TOpenSessionReq& other190) { + client_protocol = other190.client_protocol; + username = other190.username; + password = other190.password; + configuration = other190.configuration; + __isset = other190.__isset; +} +TOpenSessionReq& TOpenSessionReq::operator=(const TOpenSessionReq& other191) { + client_protocol = other191.client_protocol; + username = other191.username; + password = other191.password; + configuration = other191.configuration; + __isset = other191.__isset; + return *this; +} +void TOpenSessionReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TOpenSessionReq("; + out << "client_protocol=" << to_string(client_protocol); + out << ", " << "username="; (__isset.username ? (out << to_string(username)) : (out << "")); + out << ", " << "password="; (__isset.password ? (out << to_string(password)) : (out << "")); + out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); + out << ")"; +} + + +TOpenSessionResp::~TOpenSessionResp() throw() { +} + + +void TOpenSessionResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TOpenSessionResp::__set_serverProtocolVersion(const TProtocolVersion::type val) { + this->serverProtocolVersion = val; +} + +void TOpenSessionResp::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +__isset.sessionHandle = true; +} + +void TOpenSessionResp::__set_configuration(const std::map & val) { + this->configuration = val; +__isset.configuration = true; +} +std::ostream& operator<<(std::ostream& out, const TOpenSessionResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TOpenSessionResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_serverProtocolVersion = 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_I32) { + int32_t ecast192; + xfer += iprot->readI32(ecast192); + this->serverProtocolVersion = (TProtocolVersion::type)ecast192; + isset_serverProtocolVersion = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->sessionHandle.read(iprot); + this->__isset.sessionHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->configuration.clear(); + uint32_t _size193; + ::apache::thrift::protocol::TType _ktype194; + ::apache::thrift::protocol::TType _vtype195; + xfer += iprot->readMapBegin(_ktype194, _vtype195, _size193); + uint32_t _i197; + for (_i197 = 0; _i197 < _size193; ++_i197) + { + std::string _key198; + xfer += iprot->readString(_key198); + std::string& _val199 = this->configuration[_key198]; + xfer += iprot->readString(_val199); + } + xfer += iprot->readMapEnd(); + } + this->__isset.configuration = 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_serverProtocolVersion) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TOpenSessionResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TOpenSessionResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("serverProtocolVersion", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->serverProtocolVersion); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.sessionHandle) { + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.configuration) { + xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 4); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); + std::map ::const_iterator _iter200; + for (_iter200 = this->configuration.begin(); _iter200 != this->configuration.end(); ++_iter200) + { + xfer += oprot->writeString(_iter200->first); + xfer += oprot->writeString(_iter200->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TOpenSessionResp &a, TOpenSessionResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.serverProtocolVersion, b.serverProtocolVersion); + swap(a.sessionHandle, b.sessionHandle); + swap(a.configuration, b.configuration); + swap(a.__isset, b.__isset); +} + +TOpenSessionResp::TOpenSessionResp(const TOpenSessionResp& other201) { + status = other201.status; + serverProtocolVersion = other201.serverProtocolVersion; + sessionHandle = other201.sessionHandle; + configuration = other201.configuration; + __isset = other201.__isset; +} +TOpenSessionResp& TOpenSessionResp::operator=(const TOpenSessionResp& other202) { + status = other202.status; + serverProtocolVersion = other202.serverProtocolVersion; + sessionHandle = other202.sessionHandle; + configuration = other202.configuration; + __isset = other202.__isset; + return *this; +} +void TOpenSessionResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TOpenSessionResp("; + out << "status=" << to_string(status); + out << ", " << "serverProtocolVersion=" << to_string(serverProtocolVersion); + out << ", " << "sessionHandle="; (__isset.sessionHandle ? (out << to_string(sessionHandle)) : (out << "")); + out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); + out << ")"; +} + + +TSetClientInfoReq::~TSetClientInfoReq() throw() { +} + + +void TSetClientInfoReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TSetClientInfoReq::__set_configuration(const std::map & val) { + this->configuration = val; +__isset.configuration = true; +} +std::ostream& operator<<(std::ostream& out, const TSetClientInfoReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TSetClientInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_MAP) { + { + this->configuration.clear(); + uint32_t _size203; + ::apache::thrift::protocol::TType _ktype204; + ::apache::thrift::protocol::TType _vtype205; + xfer += iprot->readMapBegin(_ktype204, _vtype205, _size203); + uint32_t _i207; + for (_i207 = 0; _i207 < _size203; ++_i207) + { + std::string _key208; + xfer += iprot->readString(_key208); + std::string& _val209 = this->configuration[_key208]; + xfer += iprot->readString(_val209); + } + xfer += iprot->readMapEnd(); + } + this->__isset.configuration = 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); + return xfer; +} + +uint32_t TSetClientInfoReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TSetClientInfoReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.configuration) { + xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 2); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); + std::map ::const_iterator _iter210; + for (_iter210 = this->configuration.begin(); _iter210 != this->configuration.end(); ++_iter210) + { + xfer += oprot->writeString(_iter210->first); + xfer += oprot->writeString(_iter210->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TSetClientInfoReq &a, TSetClientInfoReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.configuration, b.configuration); + swap(a.__isset, b.__isset); +} + +TSetClientInfoReq::TSetClientInfoReq(const TSetClientInfoReq& other211) { + sessionHandle = other211.sessionHandle; + configuration = other211.configuration; + __isset = other211.__isset; +} +TSetClientInfoReq& TSetClientInfoReq::operator=(const TSetClientInfoReq& other212) { + sessionHandle = other212.sessionHandle; + configuration = other212.configuration; + __isset = other212.__isset; + return *this; +} +void TSetClientInfoReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TSetClientInfoReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); + out << ")"; +} + + +TSetClientInfoResp::~TSetClientInfoResp() throw() { +} + + +void TSetClientInfoResp::__set_status(const TStatus& val) { + this->status = val; +} +std::ostream& operator<<(std::ostream& out, const TSetClientInfoResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TSetClientInfoResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TSetClientInfoResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TSetClientInfoResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TSetClientInfoResp &a, TSetClientInfoResp &b) { + using ::std::swap; + swap(a.status, b.status); +} + +TSetClientInfoResp::TSetClientInfoResp(const TSetClientInfoResp& other213) { + status = other213.status; +} +TSetClientInfoResp& TSetClientInfoResp::operator=(const TSetClientInfoResp& other214) { + status = other214.status; + return *this; +} +void TSetClientInfoResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TSetClientInfoResp("; + out << "status=" << to_string(status); + out << ")"; +} + + +TCloseSessionReq::~TCloseSessionReq() throw() { +} + + +void TCloseSessionReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TCloseSessionReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCloseSessionReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_sessionHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCloseSessionReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCloseSessionReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCloseSessionReq &a, TCloseSessionReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); +} + +TCloseSessionReq::TCloseSessionReq(const TCloseSessionReq& other215) { + sessionHandle = other215.sessionHandle; +} +TCloseSessionReq& TCloseSessionReq::operator=(const TCloseSessionReq& other216) { + sessionHandle = other216.sessionHandle; + return *this; +} +void TCloseSessionReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCloseSessionReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ")"; +} + + +TCloseSessionResp::~TCloseSessionResp() throw() { +} + + +void TCloseSessionResp::__set_status(const TStatus& val) { + this->status = val; +} +std::ostream& operator<<(std::ostream& out, const TCloseSessionResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCloseSessionResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCloseSessionResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCloseSessionResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCloseSessionResp &a, TCloseSessionResp &b) { + using ::std::swap; + swap(a.status, b.status); +} + +TCloseSessionResp::TCloseSessionResp(const TCloseSessionResp& other217) { + status = other217.status; +} +TCloseSessionResp& TCloseSessionResp::operator=(const TCloseSessionResp& other218) { + status = other218.status; + return *this; +} +void TCloseSessionResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCloseSessionResp("; + out << "status=" << to_string(status); + out << ")"; +} + + +TGetInfoValue::~TGetInfoValue() throw() { +} + + +void TGetInfoValue::__set_stringValue(const std::string& val) { + this->stringValue = val; +__isset.stringValue = true; +} + +void TGetInfoValue::__set_smallIntValue(const int16_t val) { + this->smallIntValue = val; +__isset.smallIntValue = true; +} + +void TGetInfoValue::__set_integerBitmask(const int32_t val) { + this->integerBitmask = val; +__isset.integerBitmask = true; +} + +void TGetInfoValue::__set_integerFlag(const int32_t val) { + this->integerFlag = val; +__isset.integerFlag = true; +} + +void TGetInfoValue::__set_binaryValue(const int32_t val) { + this->binaryValue = val; +__isset.binaryValue = true; +} + +void TGetInfoValue::__set_lenValue(const int64_t val) { + this->lenValue = val; +__isset.lenValue = true; +} +std::ostream& operator<<(std::ostream& out, const TGetInfoValue& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetInfoValue::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); + uint32_t xfer = 0; + std::string fname; + ::apache::thrift::protocol::TType ftype; + int16_t fid; + + xfer += iprot->readStructBegin(fname); + + using ::apache::thrift::protocol::TProtocolException; + + + while (true) + { + xfer += iprot->readFieldBegin(fname, ftype, fid); + if (ftype == ::apache::thrift::protocol::T_STOP) { + break; + } + switch (fid) + { + case 1: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->stringValue); + this->__isset.stringValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->smallIntValue); + this->__isset.smallIntValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->integerBitmask); + this->__isset.integerBitmask = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->integerFlag); + this->__isset.integerFlag = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->binaryValue); + this->__isset.binaryValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->lenValue); + this->__isset.lenValue = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + return xfer; +} + +uint32_t TGetInfoValue::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetInfoValue"); + + if (this->__isset.stringValue) { + xfer += oprot->writeFieldBegin("stringValue", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->stringValue); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.smallIntValue) { + xfer += oprot->writeFieldBegin("smallIntValue", ::apache::thrift::protocol::T_I16, 2); + xfer += oprot->writeI16(this->smallIntValue); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.integerBitmask) { + xfer += oprot->writeFieldBegin("integerBitmask", ::apache::thrift::protocol::T_I32, 3); + xfer += oprot->writeI32(this->integerBitmask); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.integerFlag) { + xfer += oprot->writeFieldBegin("integerFlag", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->integerFlag); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.binaryValue) { + xfer += oprot->writeFieldBegin("binaryValue", ::apache::thrift::protocol::T_I32, 5); + xfer += oprot->writeI32(this->binaryValue); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.lenValue) { + xfer += oprot->writeFieldBegin("lenValue", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->lenValue); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetInfoValue &a, TGetInfoValue &b) { + using ::std::swap; + swap(a.stringValue, b.stringValue); + swap(a.smallIntValue, b.smallIntValue); + swap(a.integerBitmask, b.integerBitmask); + swap(a.integerFlag, b.integerFlag); + swap(a.binaryValue, b.binaryValue); + swap(a.lenValue, b.lenValue); + swap(a.__isset, b.__isset); +} + +TGetInfoValue::TGetInfoValue(const TGetInfoValue& other219) { + stringValue = other219.stringValue; + smallIntValue = other219.smallIntValue; + integerBitmask = other219.integerBitmask; + integerFlag = other219.integerFlag; + binaryValue = other219.binaryValue; + lenValue = other219.lenValue; + __isset = other219.__isset; +} +TGetInfoValue& TGetInfoValue::operator=(const TGetInfoValue& other220) { + stringValue = other220.stringValue; + smallIntValue = other220.smallIntValue; + integerBitmask = other220.integerBitmask; + integerFlag = other220.integerFlag; + binaryValue = other220.binaryValue; + lenValue = other220.lenValue; + __isset = other220.__isset; + return *this; +} +void TGetInfoValue::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetInfoValue("; + out << "stringValue="; (__isset.stringValue ? (out << to_string(stringValue)) : (out << "")); + out << ", " << "smallIntValue="; (__isset.smallIntValue ? (out << to_string(smallIntValue)) : (out << "")); + out << ", " << "integerBitmask="; (__isset.integerBitmask ? (out << to_string(integerBitmask)) : (out << "")); + out << ", " << "integerFlag="; (__isset.integerFlag ? (out << to_string(integerFlag)) : (out << "")); + out << ", " << "binaryValue="; (__isset.binaryValue ? (out << to_string(binaryValue)) : (out << "")); + out << ", " << "lenValue="; (__isset.lenValue ? (out << to_string(lenValue)) : (out << "")); + out << ")"; +} + + +TGetInfoReq::~TGetInfoReq() throw() { +} + + +void TGetInfoReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetInfoReq::__set_infoType(const TGetInfoType::type val) { + this->infoType = val; +} +std::ostream& operator<<(std::ostream& out, const TGetInfoReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_infoType = 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_I32) { + int32_t ecast221; + xfer += iprot->readI32(ecast221); + this->infoType = (TGetInfoType::type)ecast221; + isset_infoType = 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_infoType) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetInfoReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetInfoReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("infoType", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->infoType); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetInfoReq &a, TGetInfoReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.infoType, b.infoType); +} + +TGetInfoReq::TGetInfoReq(const TGetInfoReq& other222) { + sessionHandle = other222.sessionHandle; + infoType = other222.infoType; +} +TGetInfoReq& TGetInfoReq::operator=(const TGetInfoReq& other223) { + sessionHandle = other223.sessionHandle; + infoType = other223.infoType; + return *this; +} +void TGetInfoReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetInfoReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "infoType=" << to_string(infoType); + out << ")"; +} + + +TGetInfoResp::~TGetInfoResp() throw() { +} + + +void TGetInfoResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetInfoResp::__set_infoValue(const TGetInfoValue& val) { + this->infoValue = val; +} +std::ostream& operator<<(std::ostream& out, const TGetInfoResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetInfoResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_infoValue = 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->infoValue.read(iprot); + isset_infoValue = 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_infoValue) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetInfoResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetInfoResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("infoValue", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->infoValue.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetInfoResp &a, TGetInfoResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.infoValue, b.infoValue); +} + +TGetInfoResp::TGetInfoResp(const TGetInfoResp& other224) { + status = other224.status; + infoValue = other224.infoValue; +} +TGetInfoResp& TGetInfoResp::operator=(const TGetInfoResp& other225) { + status = other225.status; + infoValue = other225.infoValue; + return *this; +} +void TGetInfoResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetInfoResp("; + out << "status=" << to_string(status); + out << ", " << "infoValue=" << to_string(infoValue); + out << ")"; +} + + +TExecuteStatementReq::~TExecuteStatementReq() throw() { +} + + +void TExecuteStatementReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TExecuteStatementReq::__set_statement(const std::string& val) { + this->statement = val; +} + +void TExecuteStatementReq::__set_confOverlay(const std::map & val) { + this->confOverlay = val; +__isset.confOverlay = true; +} + +void TExecuteStatementReq::__set_runAsync(const bool val) { + this->runAsync = val; +__isset.runAsync = true; +} + +void TExecuteStatementReq::__set_queryTimeout(const int64_t val) { + this->queryTimeout = val; +__isset.queryTimeout = true; +} +std::ostream& operator<<(std::ostream& out, const TExecuteStatementReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TExecuteStatementReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_statement = 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_STRING) { + xfer += iprot->readString(this->statement); + isset_statement = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_MAP) { + { + this->confOverlay.clear(); + uint32_t _size226; + ::apache::thrift::protocol::TType _ktype227; + ::apache::thrift::protocol::TType _vtype228; + xfer += iprot->readMapBegin(_ktype227, _vtype228, _size226); + uint32_t _i230; + for (_i230 = 0; _i230 < _size226; ++_i230) + { + std::string _key231; + xfer += iprot->readString(_key231); + std::string& _val232 = this->confOverlay[_key231]; + xfer += iprot->readString(_val232); + } + xfer += iprot->readMapEnd(); + } + this->__isset.confOverlay = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->runAsync); + this->__isset.runAsync = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->queryTimeout); + this->__isset.queryTimeout = 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_statement) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TExecuteStatementReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TExecuteStatementReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("statement", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->statement); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.confOverlay) { + xfer += oprot->writeFieldBegin("confOverlay", ::apache::thrift::protocol::T_MAP, 3); + { + xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->confOverlay.size())); + std::map ::const_iterator _iter233; + for (_iter233 = this->confOverlay.begin(); _iter233 != this->confOverlay.end(); ++_iter233) + { + xfer += oprot->writeString(_iter233->first); + xfer += oprot->writeString(_iter233->second); + } + xfer += oprot->writeMapEnd(); + } + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.runAsync) { + xfer += oprot->writeFieldBegin("runAsync", ::apache::thrift::protocol::T_BOOL, 4); + xfer += oprot->writeBool(this->runAsync); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.queryTimeout) { + xfer += oprot->writeFieldBegin("queryTimeout", ::apache::thrift::protocol::T_I64, 5); + xfer += oprot->writeI64(this->queryTimeout); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TExecuteStatementReq &a, TExecuteStatementReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.statement, b.statement); + swap(a.confOverlay, b.confOverlay); + swap(a.runAsync, b.runAsync); + swap(a.queryTimeout, b.queryTimeout); + swap(a.__isset, b.__isset); +} + +TExecuteStatementReq::TExecuteStatementReq(const TExecuteStatementReq& other234) { + sessionHandle = other234.sessionHandle; + statement = other234.statement; + confOverlay = other234.confOverlay; + runAsync = other234.runAsync; + queryTimeout = other234.queryTimeout; + __isset = other234.__isset; +} +TExecuteStatementReq& TExecuteStatementReq::operator=(const TExecuteStatementReq& other235) { + sessionHandle = other235.sessionHandle; + statement = other235.statement; + confOverlay = other235.confOverlay; + runAsync = other235.runAsync; + queryTimeout = other235.queryTimeout; + __isset = other235.__isset; + return *this; +} +void TExecuteStatementReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TExecuteStatementReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "statement=" << to_string(statement); + out << ", " << "confOverlay="; (__isset.confOverlay ? (out << to_string(confOverlay)) : (out << "")); + out << ", " << "runAsync="; (__isset.runAsync ? (out << to_string(runAsync)) : (out << "")); + out << ", " << "queryTimeout="; (__isset.queryTimeout ? (out << to_string(queryTimeout)) : (out << "")); + out << ")"; +} + + +TExecuteStatementResp::~TExecuteStatementResp() throw() { +} + + +void TExecuteStatementResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TExecuteStatementResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TExecuteStatementResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TExecuteStatementResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TExecuteStatementResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TExecuteStatementResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TExecuteStatementResp &a, TExecuteStatementResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TExecuteStatementResp::TExecuteStatementResp(const TExecuteStatementResp& other236) { + status = other236.status; + operationHandle = other236.operationHandle; + __isset = other236.__isset; +} +TExecuteStatementResp& TExecuteStatementResp::operator=(const TExecuteStatementResp& other237) { + status = other237.status; + operationHandle = other237.operationHandle; + __isset = other237.__isset; + return *this; +} +void TExecuteStatementResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TExecuteStatementResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetTypeInfoReq::~TGetTypeInfoReq() throw() { +} + + +void TGetTypeInfoReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TGetTypeInfoReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetTypeInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_sessionHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetTypeInfoReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetTypeInfoReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetTypeInfoReq &a, TGetTypeInfoReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); +} + +TGetTypeInfoReq::TGetTypeInfoReq(const TGetTypeInfoReq& other238) { + sessionHandle = other238.sessionHandle; +} +TGetTypeInfoReq& TGetTypeInfoReq::operator=(const TGetTypeInfoReq& other239) { + sessionHandle = other239.sessionHandle; + return *this; +} +void TGetTypeInfoReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetTypeInfoReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ")"; +} + + +TGetTypeInfoResp::~TGetTypeInfoResp() throw() { +} + + +void TGetTypeInfoResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetTypeInfoResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetTypeInfoResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetTypeInfoResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetTypeInfoResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetTypeInfoResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetTypeInfoResp &a, TGetTypeInfoResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetTypeInfoResp::TGetTypeInfoResp(const TGetTypeInfoResp& other240) { + status = other240.status; + operationHandle = other240.operationHandle; + __isset = other240.__isset; +} +TGetTypeInfoResp& TGetTypeInfoResp::operator=(const TGetTypeInfoResp& other241) { + status = other241.status; + operationHandle = other241.operationHandle; + __isset = other241.__isset; + return *this; +} +void TGetTypeInfoResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetTypeInfoResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetCatalogsReq::~TGetCatalogsReq() throw() { +} + + +void TGetCatalogsReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TGetCatalogsReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetCatalogsReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_sessionHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetCatalogsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetCatalogsReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetCatalogsReq &a, TGetCatalogsReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); +} + +TGetCatalogsReq::TGetCatalogsReq(const TGetCatalogsReq& other242) { + sessionHandle = other242.sessionHandle; +} +TGetCatalogsReq& TGetCatalogsReq::operator=(const TGetCatalogsReq& other243) { + sessionHandle = other243.sessionHandle; + return *this; +} +void TGetCatalogsReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetCatalogsReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ")"; +} + + +TGetCatalogsResp::~TGetCatalogsResp() throw() { +} + + +void TGetCatalogsResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetCatalogsResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetCatalogsResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetCatalogsResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetCatalogsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetCatalogsResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetCatalogsResp &a, TGetCatalogsResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetCatalogsResp::TGetCatalogsResp(const TGetCatalogsResp& other244) { + status = other244.status; + operationHandle = other244.operationHandle; + __isset = other244.__isset; +} +TGetCatalogsResp& TGetCatalogsResp::operator=(const TGetCatalogsResp& other245) { + status = other245.status; + operationHandle = other245.operationHandle; + __isset = other245.__isset; + return *this; +} +void TGetCatalogsResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetCatalogsResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetSchemasReq::~TGetSchemasReq() throw() { +} + + +void TGetSchemasReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetSchemasReq::__set_catalogName(const TIdentifier& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void TGetSchemasReq::__set_schemaName(const TPatternOrIdentifier& val) { + this->schemaName = val; +__isset.schemaName = true; +} +std::ostream& operator<<(std::ostream& out, const TGetSchemasReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetSchemasReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaName); + this->__isset.schemaName = 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); + return xfer; +} + +uint32_t TGetSchemasReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetSchemasReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schemaName) { + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->schemaName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetSchemasReq &a, TGetSchemasReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.catalogName, b.catalogName); + swap(a.schemaName, b.schemaName); + swap(a.__isset, b.__isset); +} + +TGetSchemasReq::TGetSchemasReq(const TGetSchemasReq& other246) { + sessionHandle = other246.sessionHandle; + catalogName = other246.catalogName; + schemaName = other246.schemaName; + __isset = other246.__isset; +} +TGetSchemasReq& TGetSchemasReq::operator=(const TGetSchemasReq& other247) { + sessionHandle = other247.sessionHandle; + catalogName = other247.catalogName; + schemaName = other247.schemaName; + __isset = other247.__isset; + return *this; +} +void TGetSchemasReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetSchemasReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); + out << ")"; +} + + +TGetSchemasResp::~TGetSchemasResp() throw() { +} + + +void TGetSchemasResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetSchemasResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetSchemasResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetSchemasResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetSchemasResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetSchemasResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetSchemasResp &a, TGetSchemasResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetSchemasResp::TGetSchemasResp(const TGetSchemasResp& other248) { + status = other248.status; + operationHandle = other248.operationHandle; + __isset = other248.__isset; +} +TGetSchemasResp& TGetSchemasResp::operator=(const TGetSchemasResp& other249) { + status = other249.status; + operationHandle = other249.operationHandle; + __isset = other249.__isset; + return *this; +} +void TGetSchemasResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetSchemasResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetTablesReq::~TGetTablesReq() throw() { +} + + +void TGetTablesReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetTablesReq::__set_catalogName(const TPatternOrIdentifier& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void TGetTablesReq::__set_schemaName(const TPatternOrIdentifier& val) { + this->schemaName = val; +__isset.schemaName = true; +} + +void TGetTablesReq::__set_tableName(const TPatternOrIdentifier& val) { + this->tableName = val; +__isset.tableName = true; +} + +void TGetTablesReq::__set_tableTypes(const std::vector & val) { + this->tableTypes = val; +__isset.tableTypes = true; +} +std::ostream& operator<<(std::ostream& out, const TGetTablesReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetTablesReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaName); + this->__isset.schemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->tableTypes.clear(); + uint32_t _size250; + ::apache::thrift::protocol::TType _etype253; + xfer += iprot->readListBegin(_etype253, _size250); + this->tableTypes.resize(_size250); + uint32_t _i254; + for (_i254 = 0; _i254 < _size250; ++_i254) + { + xfer += iprot->readString(this->tableTypes[_i254]); + } + xfer += iprot->readListEnd(); + } + this->__isset.tableTypes = 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); + return xfer; +} + +uint32_t TGetTablesReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetTablesReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schemaName) { + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->schemaName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableName) { + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableTypes) { + xfer += oprot->writeFieldBegin("tableTypes", ::apache::thrift::protocol::T_LIST, 5); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tableTypes.size())); + std::vector ::const_iterator _iter255; + for (_iter255 = this->tableTypes.begin(); _iter255 != this->tableTypes.end(); ++_iter255) + { + xfer += oprot->writeString((*_iter255)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetTablesReq &a, TGetTablesReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.catalogName, b.catalogName); + swap(a.schemaName, b.schemaName); + swap(a.tableName, b.tableName); + swap(a.tableTypes, b.tableTypes); + swap(a.__isset, b.__isset); +} + +TGetTablesReq::TGetTablesReq(const TGetTablesReq& other256) { + sessionHandle = other256.sessionHandle; + catalogName = other256.catalogName; + schemaName = other256.schemaName; + tableName = other256.tableName; + tableTypes = other256.tableTypes; + __isset = other256.__isset; +} +TGetTablesReq& TGetTablesReq::operator=(const TGetTablesReq& other257) { + sessionHandle = other257.sessionHandle; + catalogName = other257.catalogName; + schemaName = other257.schemaName; + tableName = other257.tableName; + tableTypes = other257.tableTypes; + __isset = other257.__isset; + return *this; +} +void TGetTablesReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetTablesReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); + out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); + out << ", " << "tableTypes="; (__isset.tableTypes ? (out << to_string(tableTypes)) : (out << "")); + out << ")"; +} + + +TGetTablesResp::~TGetTablesResp() throw() { +} + + +void TGetTablesResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetTablesResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetTablesResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetTablesResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetTablesResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetTablesResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetTablesResp &a, TGetTablesResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetTablesResp::TGetTablesResp(const TGetTablesResp& other258) { + status = other258.status; + operationHandle = other258.operationHandle; + __isset = other258.__isset; +} +TGetTablesResp& TGetTablesResp::operator=(const TGetTablesResp& other259) { + status = other259.status; + operationHandle = other259.operationHandle; + __isset = other259.__isset; + return *this; +} +void TGetTablesResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetTablesResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetTableTypesReq::~TGetTableTypesReq() throw() { +} + + +void TGetTableTypesReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TGetTableTypesReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetTableTypesReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_sessionHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetTableTypesReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetTableTypesReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetTableTypesReq &a, TGetTableTypesReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); +} + +TGetTableTypesReq::TGetTableTypesReq(const TGetTableTypesReq& other260) { + sessionHandle = other260.sessionHandle; +} +TGetTableTypesReq& TGetTableTypesReq::operator=(const TGetTableTypesReq& other261) { + sessionHandle = other261.sessionHandle; + return *this; +} +void TGetTableTypesReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetTableTypesReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ")"; +} + + +TGetTableTypesResp::~TGetTableTypesResp() throw() { +} + + +void TGetTableTypesResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetTableTypesResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetTableTypesResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetTableTypesResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetTableTypesResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetTableTypesResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetTableTypesResp &a, TGetTableTypesResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetTableTypesResp::TGetTableTypesResp(const TGetTableTypesResp& other262) { + status = other262.status; + operationHandle = other262.operationHandle; + __isset = other262.__isset; +} +TGetTableTypesResp& TGetTableTypesResp::operator=(const TGetTableTypesResp& other263) { + status = other263.status; + operationHandle = other263.operationHandle; + __isset = other263.__isset; + return *this; +} +void TGetTableTypesResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetTableTypesResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetColumnsReq::~TGetColumnsReq() throw() { +} + + +void TGetColumnsReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetColumnsReq::__set_catalogName(const TIdentifier& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void TGetColumnsReq::__set_schemaName(const TPatternOrIdentifier& val) { + this->schemaName = val; +__isset.schemaName = true; +} + +void TGetColumnsReq::__set_tableName(const TPatternOrIdentifier& val) { + this->tableName = val; +__isset.tableName = true; +} + +void TGetColumnsReq::__set_columnName(const TPatternOrIdentifier& val) { + this->columnName = val; +__isset.columnName = true; +} +std::ostream& operator<<(std::ostream& out, const TGetColumnsReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetColumnsReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaName); + this->__isset.schemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->columnName); + this->__isset.columnName = 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); + return xfer; +} + +uint32_t TGetColumnsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetColumnsReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schemaName) { + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->schemaName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableName) { + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.columnName) { + xfer += oprot->writeFieldBegin("columnName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->columnName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetColumnsReq &a, TGetColumnsReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.catalogName, b.catalogName); + swap(a.schemaName, b.schemaName); + swap(a.tableName, b.tableName); + swap(a.columnName, b.columnName); + swap(a.__isset, b.__isset); +} + +TGetColumnsReq::TGetColumnsReq(const TGetColumnsReq& other264) { + sessionHandle = other264.sessionHandle; + catalogName = other264.catalogName; + schemaName = other264.schemaName; + tableName = other264.tableName; + columnName = other264.columnName; + __isset = other264.__isset; +} +TGetColumnsReq& TGetColumnsReq::operator=(const TGetColumnsReq& other265) { + sessionHandle = other265.sessionHandle; + catalogName = other265.catalogName; + schemaName = other265.schemaName; + tableName = other265.tableName; + columnName = other265.columnName; + __isset = other265.__isset; + return *this; +} +void TGetColumnsReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetColumnsReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); + out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); + out << ", " << "columnName="; (__isset.columnName ? (out << to_string(columnName)) : (out << "")); + out << ")"; +} + + +TGetColumnsResp::~TGetColumnsResp() throw() { +} + + +void TGetColumnsResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetColumnsResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetColumnsResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetColumnsResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetColumnsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetColumnsResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetColumnsResp &a, TGetColumnsResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetColumnsResp::TGetColumnsResp(const TGetColumnsResp& other266) { + status = other266.status; + operationHandle = other266.operationHandle; + __isset = other266.__isset; +} +TGetColumnsResp& TGetColumnsResp::operator=(const TGetColumnsResp& other267) { + status = other267.status; + operationHandle = other267.operationHandle; + __isset = other267.__isset; + return *this; +} +void TGetColumnsResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetColumnsResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetFunctionsReq::~TGetFunctionsReq() throw() { +} + + +void TGetFunctionsReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetFunctionsReq::__set_catalogName(const TIdentifier& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void TGetFunctionsReq::__set_schemaName(const TPatternOrIdentifier& val) { + this->schemaName = val; +__isset.schemaName = true; +} + +void TGetFunctionsReq::__set_functionName(const TPatternOrIdentifier& val) { + this->functionName = val; +} +std::ostream& operator<<(std::ostream& out, const TGetFunctionsReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetFunctionsReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_functionName = 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_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaName); + this->__isset.schemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->functionName); + isset_functionName = 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_functionName) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetFunctionsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetFunctionsReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schemaName) { + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->schemaName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldBegin("functionName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->functionName); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetFunctionsReq &a, TGetFunctionsReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.catalogName, b.catalogName); + swap(a.schemaName, b.schemaName); + swap(a.functionName, b.functionName); + swap(a.__isset, b.__isset); +} + +TGetFunctionsReq::TGetFunctionsReq(const TGetFunctionsReq& other268) { + sessionHandle = other268.sessionHandle; + catalogName = other268.catalogName; + schemaName = other268.schemaName; + functionName = other268.functionName; + __isset = other268.__isset; +} +TGetFunctionsReq& TGetFunctionsReq::operator=(const TGetFunctionsReq& other269) { + sessionHandle = other269.sessionHandle; + catalogName = other269.catalogName; + schemaName = other269.schemaName; + functionName = other269.functionName; + __isset = other269.__isset; + return *this; +} +void TGetFunctionsReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetFunctionsReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); + out << ", " << "functionName=" << to_string(functionName); + out << ")"; +} + + +TGetFunctionsResp::~TGetFunctionsResp() throw() { +} + + +void TGetFunctionsResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetFunctionsResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetFunctionsResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetFunctionsResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetFunctionsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetFunctionsResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetFunctionsResp &a, TGetFunctionsResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetFunctionsResp::TGetFunctionsResp(const TGetFunctionsResp& other270) { + status = other270.status; + operationHandle = other270.operationHandle; + __isset = other270.__isset; +} +TGetFunctionsResp& TGetFunctionsResp::operator=(const TGetFunctionsResp& other271) { + status = other271.status; + operationHandle = other271.operationHandle; + __isset = other271.__isset; + return *this; +} +void TGetFunctionsResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetFunctionsResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetPrimaryKeysReq::~TGetPrimaryKeysReq() throw() { +} + + +void TGetPrimaryKeysReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetPrimaryKeysReq::__set_catalogName(const TIdentifier& val) { + this->catalogName = val; +__isset.catalogName = true; +} + +void TGetPrimaryKeysReq::__set_schemaName(const TIdentifier& val) { + this->schemaName = val; +__isset.schemaName = true; +} + +void TGetPrimaryKeysReq::__set_tableName(const TIdentifier& val) { + this->tableName = val; +__isset.tableName = true; +} +std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetPrimaryKeysReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_STRING) { + xfer += iprot->readString(this->catalogName); + this->__isset.catalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->schemaName); + this->__isset.schemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->tableName); + this->__isset.tableName = 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); + return xfer; +} + +uint32_t TGetPrimaryKeysReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetPrimaryKeysReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.catalogName) { + xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->catalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.schemaName) { + xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->schemaName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.tableName) { + xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->tableName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetPrimaryKeysReq &a, TGetPrimaryKeysReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.catalogName, b.catalogName); + swap(a.schemaName, b.schemaName); + swap(a.tableName, b.tableName); + swap(a.__isset, b.__isset); +} + +TGetPrimaryKeysReq::TGetPrimaryKeysReq(const TGetPrimaryKeysReq& other272) { + sessionHandle = other272.sessionHandle; + catalogName = other272.catalogName; + schemaName = other272.schemaName; + tableName = other272.tableName; + __isset = other272.__isset; +} +TGetPrimaryKeysReq& TGetPrimaryKeysReq::operator=(const TGetPrimaryKeysReq& other273) { + sessionHandle = other273.sessionHandle; + catalogName = other273.catalogName; + schemaName = other273.schemaName; + tableName = other273.tableName; + __isset = other273.__isset; + return *this; +} +void TGetPrimaryKeysReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetPrimaryKeysReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); + out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); + out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); + out << ")"; +} + + +TGetPrimaryKeysResp::~TGetPrimaryKeysResp() throw() { +} + + +void TGetPrimaryKeysResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetPrimaryKeysResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetPrimaryKeysResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetPrimaryKeysResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetPrimaryKeysResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetPrimaryKeysResp &a, TGetPrimaryKeysResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetPrimaryKeysResp::TGetPrimaryKeysResp(const TGetPrimaryKeysResp& other274) { + status = other274.status; + operationHandle = other274.operationHandle; + __isset = other274.__isset; +} +TGetPrimaryKeysResp& TGetPrimaryKeysResp::operator=(const TGetPrimaryKeysResp& other275) { + status = other275.status; + operationHandle = other275.operationHandle; + __isset = other275.__isset; + return *this; +} +void TGetPrimaryKeysResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetPrimaryKeysResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetCrossReferenceReq::~TGetCrossReferenceReq() throw() { +} + + +void TGetCrossReferenceReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetCrossReferenceReq::__set_parentCatalogName(const TIdentifier& val) { + this->parentCatalogName = val; +__isset.parentCatalogName = true; +} + +void TGetCrossReferenceReq::__set_parentSchemaName(const TIdentifier& val) { + this->parentSchemaName = val; +__isset.parentSchemaName = true; +} + +void TGetCrossReferenceReq::__set_parentTableName(const TIdentifier& val) { + this->parentTableName = val; +__isset.parentTableName = true; +} + +void TGetCrossReferenceReq::__set_foreignCatalogName(const TIdentifier& val) { + this->foreignCatalogName = val; +__isset.foreignCatalogName = true; +} + +void TGetCrossReferenceReq::__set_foreignSchemaName(const TIdentifier& val) { + this->foreignSchemaName = val; +__isset.foreignSchemaName = true; +} + +void TGetCrossReferenceReq::__set_foreignTableName(const TIdentifier& val) { + this->foreignTableName = val; +__isset.foreignTableName = true; +} +std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetCrossReferenceReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_STRING) { + xfer += iprot->readString(this->parentCatalogName); + this->__isset.parentCatalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->parentSchemaName); + this->__isset.parentSchemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->parentTableName); + this->__isset.parentTableName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->foreignCatalogName); + this->__isset.foreignCatalogName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->foreignSchemaName); + this->__isset.foreignSchemaName = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->foreignTableName); + this->__isset.foreignTableName = 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); + return xfer; +} + +uint32_t TGetCrossReferenceReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetCrossReferenceReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.parentCatalogName) { + xfer += oprot->writeFieldBegin("parentCatalogName", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->parentCatalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.parentSchemaName) { + xfer += oprot->writeFieldBegin("parentSchemaName", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->parentSchemaName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.parentTableName) { + xfer += oprot->writeFieldBegin("parentTableName", ::apache::thrift::protocol::T_STRING, 4); + xfer += oprot->writeString(this->parentTableName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.foreignCatalogName) { + xfer += oprot->writeFieldBegin("foreignCatalogName", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->foreignCatalogName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.foreignSchemaName) { + xfer += oprot->writeFieldBegin("foreignSchemaName", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->foreignSchemaName); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.foreignTableName) { + xfer += oprot->writeFieldBegin("foreignTableName", ::apache::thrift::protocol::T_STRING, 7); + xfer += oprot->writeString(this->foreignTableName); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetCrossReferenceReq &a, TGetCrossReferenceReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.parentCatalogName, b.parentCatalogName); + swap(a.parentSchemaName, b.parentSchemaName); + swap(a.parentTableName, b.parentTableName); + swap(a.foreignCatalogName, b.foreignCatalogName); + swap(a.foreignSchemaName, b.foreignSchemaName); + swap(a.foreignTableName, b.foreignTableName); + swap(a.__isset, b.__isset); +} + +TGetCrossReferenceReq::TGetCrossReferenceReq(const TGetCrossReferenceReq& other276) { + sessionHandle = other276.sessionHandle; + parentCatalogName = other276.parentCatalogName; + parentSchemaName = other276.parentSchemaName; + parentTableName = other276.parentTableName; + foreignCatalogName = other276.foreignCatalogName; + foreignSchemaName = other276.foreignSchemaName; + foreignTableName = other276.foreignTableName; + __isset = other276.__isset; +} +TGetCrossReferenceReq& TGetCrossReferenceReq::operator=(const TGetCrossReferenceReq& other277) { + sessionHandle = other277.sessionHandle; + parentCatalogName = other277.parentCatalogName; + parentSchemaName = other277.parentSchemaName; + parentTableName = other277.parentTableName; + foreignCatalogName = other277.foreignCatalogName; + foreignSchemaName = other277.foreignSchemaName; + foreignTableName = other277.foreignTableName; + __isset = other277.__isset; + return *this; +} +void TGetCrossReferenceReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetCrossReferenceReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "parentCatalogName="; (__isset.parentCatalogName ? (out << to_string(parentCatalogName)) : (out << "")); + out << ", " << "parentSchemaName="; (__isset.parentSchemaName ? (out << to_string(parentSchemaName)) : (out << "")); + out << ", " << "parentTableName="; (__isset.parentTableName ? (out << to_string(parentTableName)) : (out << "")); + out << ", " << "foreignCatalogName="; (__isset.foreignCatalogName ? (out << to_string(foreignCatalogName)) : (out << "")); + out << ", " << "foreignSchemaName="; (__isset.foreignSchemaName ? (out << to_string(foreignSchemaName)) : (out << "")); + out << ", " << "foreignTableName="; (__isset.foreignTableName ? (out << to_string(foreignTableName)) : (out << "")); + out << ")"; +} + + +TGetCrossReferenceResp::~TGetCrossReferenceResp() throw() { +} + + +void TGetCrossReferenceResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetCrossReferenceResp::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +__isset.operationHandle = true; +} +std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetCrossReferenceResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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); + this->__isset.operationHandle = 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); + return xfer; +} + +uint32_t TGetCrossReferenceResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetCrossReferenceResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationHandle) { + 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(TGetCrossReferenceResp &a, TGetCrossReferenceResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationHandle, b.operationHandle); + swap(a.__isset, b.__isset); +} + +TGetCrossReferenceResp::TGetCrossReferenceResp(const TGetCrossReferenceResp& other278) { + status = other278.status; + operationHandle = other278.operationHandle; + __isset = other278.__isset; +} +TGetCrossReferenceResp& TGetCrossReferenceResp::operator=(const TGetCrossReferenceResp& other279) { + status = other279.status; + operationHandle = other279.operationHandle; + __isset = other279.__isset; + return *this; +} +void TGetCrossReferenceResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetCrossReferenceResp("; + out << "status=" << to_string(status); + out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); + out << ")"; +} + + +TGetOperationStatusReq::~TGetOperationStatusReq() throw() { +} + + +void TGetOperationStatusReq::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +} + +void TGetOperationStatusReq::__set_getProgressUpdate(const bool val) { + this->getProgressUpdate = val; +__isset.getProgressUpdate = true; +} +std::ostream& operator<<(std::ostream& out, const TGetOperationStatusReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetOperationStatusReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->operationHandle.read(iprot); + isset_operationHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->getProgressUpdate); + this->__isset.getProgressUpdate = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetOperationStatusReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetOperationStatusReq"); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.getProgressUpdate) { + xfer += oprot->writeFieldBegin("getProgressUpdate", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->getProgressUpdate); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetOperationStatusReq &a, TGetOperationStatusReq &b) { + using ::std::swap; + swap(a.operationHandle, b.operationHandle); + swap(a.getProgressUpdate, b.getProgressUpdate); + swap(a.__isset, b.__isset); +} + +TGetOperationStatusReq::TGetOperationStatusReq(const TGetOperationStatusReq& other280) { + operationHandle = other280.operationHandle; + getProgressUpdate = other280.getProgressUpdate; + __isset = other280.__isset; +} +TGetOperationStatusReq& TGetOperationStatusReq::operator=(const TGetOperationStatusReq& other281) { + operationHandle = other281.operationHandle; + getProgressUpdate = other281.getProgressUpdate; + __isset = other281.__isset; + return *this; +} +void TGetOperationStatusReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetOperationStatusReq("; + out << "operationHandle=" << to_string(operationHandle); + out << ", " << "getProgressUpdate="; (__isset.getProgressUpdate ? (out << to_string(getProgressUpdate)) : (out << "")); + out << ")"; +} + + +TGetOperationStatusResp::~TGetOperationStatusResp() throw() { +} + + +void TGetOperationStatusResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetOperationStatusResp::__set_operationState(const TOperationState::type val) { + this->operationState = val; +__isset.operationState = true; +} + +void TGetOperationStatusResp::__set_sqlState(const std::string& val) { + this->sqlState = val; +__isset.sqlState = true; +} + +void TGetOperationStatusResp::__set_errorCode(const int32_t val) { + this->errorCode = val; +__isset.errorCode = true; +} + +void TGetOperationStatusResp::__set_errorMessage(const std::string& val) { + this->errorMessage = val; +__isset.errorMessage = true; +} + +void TGetOperationStatusResp::__set_taskStatus(const std::string& val) { + this->taskStatus = val; +__isset.taskStatus = true; +} + +void TGetOperationStatusResp::__set_operationStarted(const int64_t val) { + this->operationStarted = val; +__isset.operationStarted = true; +} + +void TGetOperationStatusResp::__set_operationCompleted(const int64_t val) { + this->operationCompleted = val; +__isset.operationCompleted = true; +} + +void TGetOperationStatusResp::__set_hasResultSet(const bool val) { + this->hasResultSet = val; +__isset.hasResultSet = true; +} + +void TGetOperationStatusResp::__set_progressUpdateResponse(const TProgressUpdateResp& val) { + this->progressUpdateResponse = val; +__isset.progressUpdateResponse = true; +} +std::ostream& operator<<(std::ostream& out, const TGetOperationStatusResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetOperationStatusResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_I32) { + int32_t ecast282; + xfer += iprot->readI32(ecast282); + this->operationState = (TOperationState::type)ecast282; + this->__isset.operationState = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->sqlState); + this->__isset.sqlState = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + xfer += iprot->readI32(this->errorCode); + this->__isset.errorCode = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->errorMessage); + this->__isset.errorMessage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->taskStatus); + this->__isset.taskStatus = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 7: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->operationStarted); + this->__isset.operationStarted = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 8: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->operationCompleted); + this->__isset.operationCompleted = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 9: + if (ftype == ::apache::thrift::protocol::T_BOOL) { + xfer += iprot->readBool(this->hasResultSet); + this->__isset.hasResultSet = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 10: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->progressUpdateResponse.read(iprot); + this->__isset.progressUpdateResponse = 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); + return xfer; +} + +uint32_t TGetOperationStatusResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetOperationStatusResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.operationState) { + xfer += oprot->writeFieldBegin("operationState", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->operationState); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.sqlState) { + xfer += oprot->writeFieldBegin("sqlState", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->sqlState); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.errorCode) { + xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32(this->errorCode); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.errorMessage) { + xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->errorMessage); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.taskStatus) { + xfer += oprot->writeFieldBegin("taskStatus", ::apache::thrift::protocol::T_STRING, 6); + xfer += oprot->writeString(this->taskStatus); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.operationStarted) { + xfer += oprot->writeFieldBegin("operationStarted", ::apache::thrift::protocol::T_I64, 7); + xfer += oprot->writeI64(this->operationStarted); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.operationCompleted) { + xfer += oprot->writeFieldBegin("operationCompleted", ::apache::thrift::protocol::T_I64, 8); + xfer += oprot->writeI64(this->operationCompleted); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.hasResultSet) { + xfer += oprot->writeFieldBegin("hasResultSet", ::apache::thrift::protocol::T_BOOL, 9); + xfer += oprot->writeBool(this->hasResultSet); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.progressUpdateResponse) { + xfer += oprot->writeFieldBegin("progressUpdateResponse", ::apache::thrift::protocol::T_STRUCT, 10); + xfer += this->progressUpdateResponse.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetOperationStatusResp &a, TGetOperationStatusResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.operationState, b.operationState); + swap(a.sqlState, b.sqlState); + swap(a.errorCode, b.errorCode); + swap(a.errorMessage, b.errorMessage); + swap(a.taskStatus, b.taskStatus); + swap(a.operationStarted, b.operationStarted); + swap(a.operationCompleted, b.operationCompleted); + swap(a.hasResultSet, b.hasResultSet); + swap(a.progressUpdateResponse, b.progressUpdateResponse); + swap(a.__isset, b.__isset); +} + +TGetOperationStatusResp::TGetOperationStatusResp(const TGetOperationStatusResp& other283) { + status = other283.status; + operationState = other283.operationState; + sqlState = other283.sqlState; + errorCode = other283.errorCode; + errorMessage = other283.errorMessage; + taskStatus = other283.taskStatus; + operationStarted = other283.operationStarted; + operationCompleted = other283.operationCompleted; + hasResultSet = other283.hasResultSet; + progressUpdateResponse = other283.progressUpdateResponse; + __isset = other283.__isset; +} +TGetOperationStatusResp& TGetOperationStatusResp::operator=(const TGetOperationStatusResp& other284) { + status = other284.status; + operationState = other284.operationState; + sqlState = other284.sqlState; + errorCode = other284.errorCode; + errorMessage = other284.errorMessage; + taskStatus = other284.taskStatus; + operationStarted = other284.operationStarted; + operationCompleted = other284.operationCompleted; + hasResultSet = other284.hasResultSet; + progressUpdateResponse = other284.progressUpdateResponse; + __isset = other284.__isset; + return *this; +} +void TGetOperationStatusResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetOperationStatusResp("; + out << "status=" << to_string(status); + out << ", " << "operationState="; (__isset.operationState ? (out << to_string(operationState)) : (out << "")); + out << ", " << "sqlState="; (__isset.sqlState ? (out << to_string(sqlState)) : (out << "")); + out << ", " << "errorCode="; (__isset.errorCode ? (out << to_string(errorCode)) : (out << "")); + out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); + out << ", " << "taskStatus="; (__isset.taskStatus ? (out << to_string(taskStatus)) : (out << "")); + out << ", " << "operationStarted="; (__isset.operationStarted ? (out << to_string(operationStarted)) : (out << "")); + out << ", " << "operationCompleted="; (__isset.operationCompleted ? (out << to_string(operationCompleted)) : (out << "")); + out << ", " << "hasResultSet="; (__isset.hasResultSet ? (out << to_string(hasResultSet)) : (out << "")); + out << ", " << "progressUpdateResponse="; (__isset.progressUpdateResponse ? (out << to_string(progressUpdateResponse)) : (out << "")); + out << ")"; +} + + +TCancelOperationReq::~TCancelOperationReq() throw() { +} + + +void TCancelOperationReq::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TCancelOperationReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCancelOperationReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCancelOperationReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCancelOperationReq"); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCancelOperationReq &a, TCancelOperationReq &b) { + using ::std::swap; + swap(a.operationHandle, b.operationHandle); +} + +TCancelOperationReq::TCancelOperationReq(const TCancelOperationReq& other285) { + operationHandle = other285.operationHandle; +} +TCancelOperationReq& TCancelOperationReq::operator=(const TCancelOperationReq& other286) { + operationHandle = other286.operationHandle; + return *this; +} +void TCancelOperationReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCancelOperationReq("; + out << "operationHandle=" << to_string(operationHandle); + out << ")"; +} + + +TCancelOperationResp::~TCancelOperationResp() throw() { +} + + +void TCancelOperationResp::__set_status(const TStatus& val) { + this->status = val; +} +std::ostream& operator<<(std::ostream& out, const TCancelOperationResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCancelOperationResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCancelOperationResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCancelOperationResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCancelOperationResp &a, TCancelOperationResp &b) { + using ::std::swap; + swap(a.status, b.status); +} + +TCancelOperationResp::TCancelOperationResp(const TCancelOperationResp& other287) { + status = other287.status; +} +TCancelOperationResp& TCancelOperationResp::operator=(const TCancelOperationResp& other288) { + status = other288.status; + return *this; +} +void TCancelOperationResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCancelOperationResp("; + out << "status=" << to_string(status); + out << ")"; +} + + +TCloseOperationReq::~TCloseOperationReq() throw() { +} + + +void TCloseOperationReq::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TCloseOperationReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCloseOperationReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCloseOperationReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCloseOperationReq"); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCloseOperationReq &a, TCloseOperationReq &b) { + using ::std::swap; + swap(a.operationHandle, b.operationHandle); +} + +TCloseOperationReq::TCloseOperationReq(const TCloseOperationReq& other289) { + operationHandle = other289.operationHandle; +} +TCloseOperationReq& TCloseOperationReq::operator=(const TCloseOperationReq& other290) { + operationHandle = other290.operationHandle; + return *this; +} +void TCloseOperationReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCloseOperationReq("; + out << "operationHandle=" << to_string(operationHandle); + out << ")"; +} + + +TCloseOperationResp::~TCloseOperationResp() throw() { +} + + +void TCloseOperationResp::__set_status(const TStatus& val) { + this->status = val; +} +std::ostream& operator<<(std::ostream& out, const TCloseOperationResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCloseOperationResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCloseOperationResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCloseOperationResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCloseOperationResp &a, TCloseOperationResp &b) { + using ::std::swap; + swap(a.status, b.status); +} + +TCloseOperationResp::TCloseOperationResp(const TCloseOperationResp& other291) { + status = other291.status; +} +TCloseOperationResp& TCloseOperationResp::operator=(const TCloseOperationResp& other292) { + status = other292.status; + return *this; +} +void TCloseOperationResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCloseOperationResp("; + out << "status=" << to_string(status); + out << ")"; +} + + +TGetResultSetMetadataReq::~TGetResultSetMetadataReq() throw() { +} + + +void TGetResultSetMetadataReq::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetResultSetMetadataReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetResultSetMetadataReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetResultSetMetadataReq"); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetResultSetMetadataReq &a, TGetResultSetMetadataReq &b) { + using ::std::swap; + swap(a.operationHandle, b.operationHandle); +} + +TGetResultSetMetadataReq::TGetResultSetMetadataReq(const TGetResultSetMetadataReq& other293) { + operationHandle = other293.operationHandle; +} +TGetResultSetMetadataReq& TGetResultSetMetadataReq::operator=(const TGetResultSetMetadataReq& other294) { + operationHandle = other294.operationHandle; + return *this; +} +void TGetResultSetMetadataReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetResultSetMetadataReq("; + out << "operationHandle=" << to_string(operationHandle); + out << ")"; +} + + +TGetResultSetMetadataResp::~TGetResultSetMetadataResp() throw() { +} + + +void TGetResultSetMetadataResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetResultSetMetadataResp::__set_schema(const TTableSchema& val) { + this->schema = val; +__isset.schema = true; +} +std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetResultSetMetadataResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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->schema.read(iprot); + this->__isset.schema = 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); + return xfer; +} + +uint32_t TGetResultSetMetadataResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetResultSetMetadataResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.schema) { + xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 2); + xfer += this->schema.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetResultSetMetadataResp &a, TGetResultSetMetadataResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.schema, b.schema); + swap(a.__isset, b.__isset); +} + +TGetResultSetMetadataResp::TGetResultSetMetadataResp(const TGetResultSetMetadataResp& other295) { + status = other295.status; + schema = other295.schema; + __isset = other295.__isset; +} +TGetResultSetMetadataResp& TGetResultSetMetadataResp::operator=(const TGetResultSetMetadataResp& other296) { + status = other296.status; + schema = other296.schema; + __isset = other296.__isset; + return *this; +} +void TGetResultSetMetadataResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetResultSetMetadataResp("; + out << "status=" << to_string(status); + out << ", " << "schema="; (__isset.schema ? (out << to_string(schema)) : (out << "")); + out << ")"; +} + + +TFetchResultsReq::~TFetchResultsReq() throw() { +} + + +void TFetchResultsReq::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +} + +void TFetchResultsReq::__set_orientation(const TFetchOrientation::type val) { + this->orientation = val; +} + +void TFetchResultsReq::__set_maxRows(const int64_t val) { + this->maxRows = val; +} + +void TFetchResultsReq::__set_fetchType(const int16_t val) { + this->fetchType = val; +__isset.fetchType = true; +} +std::ostream& operator<<(std::ostream& out, const TFetchResultsReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TFetchResultsReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_operationHandle = false; + bool isset_orientation = false; + bool isset_maxRows = 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->operationHandle.read(iprot); + isset_operationHandle = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast297; + xfer += iprot->readI32(ecast297); + this->orientation = (TFetchOrientation::type)ecast297; + isset_orientation = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->maxRows); + isset_maxRows = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I16) { + xfer += iprot->readI16(this->fetchType); + this->__isset.fetchType = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_orientation) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_maxRows) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TFetchResultsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TFetchResultsReq"); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("orientation", ::apache::thrift::protocol::T_I32, 2); + xfer += oprot->writeI32((int32_t)this->orientation); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("maxRows", ::apache::thrift::protocol::T_I64, 3); + xfer += oprot->writeI64(this->maxRows); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.fetchType) { + xfer += oprot->writeFieldBegin("fetchType", ::apache::thrift::protocol::T_I16, 4); + xfer += oprot->writeI16(this->fetchType); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TFetchResultsReq &a, TFetchResultsReq &b) { + using ::std::swap; + swap(a.operationHandle, b.operationHandle); + swap(a.orientation, b.orientation); + swap(a.maxRows, b.maxRows); + swap(a.fetchType, b.fetchType); + swap(a.__isset, b.__isset); +} + +TFetchResultsReq::TFetchResultsReq(const TFetchResultsReq& other298) { + operationHandle = other298.operationHandle; + orientation = other298.orientation; + maxRows = other298.maxRows; + fetchType = other298.fetchType; + __isset = other298.__isset; +} +TFetchResultsReq& TFetchResultsReq::operator=(const TFetchResultsReq& other299) { + operationHandle = other299.operationHandle; + orientation = other299.orientation; + maxRows = other299.maxRows; + fetchType = other299.fetchType; + __isset = other299.__isset; + return *this; +} +void TFetchResultsReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TFetchResultsReq("; + out << "operationHandle=" << to_string(operationHandle); + out << ", " << "orientation=" << to_string(orientation); + out << ", " << "maxRows=" << to_string(maxRows); + out << ", " << "fetchType="; (__isset.fetchType ? (out << to_string(fetchType)) : (out << "")); + out << ")"; +} + + +TFetchResultsResp::~TFetchResultsResp() throw() { +} + + +void TFetchResultsResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TFetchResultsResp::__set_hasMoreRows(const bool val) { + this->hasMoreRows = val; +__isset.hasMoreRows = true; +} + +void TFetchResultsResp::__set_results(const TRowSet& val) { + this->results = val; +__isset.results = true; +} +std::ostream& operator<<(std::ostream& out, const TFetchResultsResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TFetchResultsResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_BOOL) { + xfer += iprot->readBool(this->hasMoreRows); + this->__isset.hasMoreRows = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRUCT) { + xfer += this->results.read(iprot); + this->__isset.results = 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); + return xfer; +} + +uint32_t TFetchResultsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TFetchResultsResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.hasMoreRows) { + xfer += oprot->writeFieldBegin("hasMoreRows", ::apache::thrift::protocol::T_BOOL, 2); + xfer += oprot->writeBool(this->hasMoreRows); + xfer += oprot->writeFieldEnd(); + } + if (this->__isset.results) { + xfer += oprot->writeFieldBegin("results", ::apache::thrift::protocol::T_STRUCT, 3); + xfer += this->results.write(oprot); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TFetchResultsResp &a, TFetchResultsResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.hasMoreRows, b.hasMoreRows); + swap(a.results, b.results); + swap(a.__isset, b.__isset); +} + +TFetchResultsResp::TFetchResultsResp(const TFetchResultsResp& other300) { + status = other300.status; + hasMoreRows = other300.hasMoreRows; + results = other300.results; + __isset = other300.__isset; +} +TFetchResultsResp& TFetchResultsResp::operator=(const TFetchResultsResp& other301) { + status = other301.status; + hasMoreRows = other301.hasMoreRows; + results = other301.results; + __isset = other301.__isset; + return *this; +} +void TFetchResultsResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TFetchResultsResp("; + out << "status=" << to_string(status); + out << ", " << "hasMoreRows="; (__isset.hasMoreRows ? (out << to_string(hasMoreRows)) : (out << "")); + out << ", " << "results="; (__isset.results ? (out << to_string(results)) : (out << "")); + out << ")"; +} + + +TGetDelegationTokenReq::~TGetDelegationTokenReq() throw() { +} + + +void TGetDelegationTokenReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TGetDelegationTokenReq::__set_owner(const std::string& val) { + this->owner = val; +} + +void TGetDelegationTokenReq::__set_renewer(const std::string& val) { + this->renewer = val; +} +std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetDelegationTokenReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_owner = false; + bool isset_renewer = 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_STRING) { + xfer += iprot->readString(this->owner); + isset_owner = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->renewer); + isset_renewer = 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_owner) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_renewer) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetDelegationTokenReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetDelegationTokenReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("owner", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->owner); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("renewer", ::apache::thrift::protocol::T_STRING, 3); + xfer += oprot->writeString(this->renewer); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetDelegationTokenReq &a, TGetDelegationTokenReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.owner, b.owner); + swap(a.renewer, b.renewer); +} + +TGetDelegationTokenReq::TGetDelegationTokenReq(const TGetDelegationTokenReq& other302) { + sessionHandle = other302.sessionHandle; + owner = other302.owner; + renewer = other302.renewer; +} +TGetDelegationTokenReq& TGetDelegationTokenReq::operator=(const TGetDelegationTokenReq& other303) { + sessionHandle = other303.sessionHandle; + owner = other303.owner; + renewer = other303.renewer; + return *this; +} +void TGetDelegationTokenReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetDelegationTokenReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "owner=" << to_string(owner); + out << ", " << "renewer=" << to_string(renewer); + out << ")"; +} + + +TGetDelegationTokenResp::~TGetDelegationTokenResp() throw() { +} + + +void TGetDelegationTokenResp::__set_status(const TStatus& val) { + this->status = val; +} + +void TGetDelegationTokenResp::__set_delegationToken(const std::string& val) { + this->delegationToken = val; +__isset.delegationToken = true; +} +std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetDelegationTokenResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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_STRING) { + xfer += iprot->readString(this->delegationToken); + this->__isset.delegationToken = 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); + return xfer; +} + +uint32_t TGetDelegationTokenResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetDelegationTokenResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + if (this->__isset.delegationToken) { + xfer += oprot->writeFieldBegin("delegationToken", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->delegationToken); + xfer += oprot->writeFieldEnd(); + } + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetDelegationTokenResp &a, TGetDelegationTokenResp &b) { + using ::std::swap; + swap(a.status, b.status); + swap(a.delegationToken, b.delegationToken); + swap(a.__isset, b.__isset); +} + +TGetDelegationTokenResp::TGetDelegationTokenResp(const TGetDelegationTokenResp& other304) { + status = other304.status; + delegationToken = other304.delegationToken; + __isset = other304.__isset; +} +TGetDelegationTokenResp& TGetDelegationTokenResp::operator=(const TGetDelegationTokenResp& other305) { + status = other305.status; + delegationToken = other305.delegationToken; + __isset = other305.__isset; + return *this; +} +void TGetDelegationTokenResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetDelegationTokenResp("; + out << "status=" << to_string(status); + out << ", " << "delegationToken="; (__isset.delegationToken ? (out << to_string(delegationToken)) : (out << "")); + out << ")"; +} + + +TCancelDelegationTokenReq::~TCancelDelegationTokenReq() throw() { +} + + +void TCancelDelegationTokenReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TCancelDelegationTokenReq::__set_delegationToken(const std::string& val) { + this->delegationToken = val; +} +std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCancelDelegationTokenReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_delegationToken = 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_STRING) { + xfer += iprot->readString(this->delegationToken); + isset_delegationToken = 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_delegationToken) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCancelDelegationTokenReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCancelDelegationTokenReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("delegationToken", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->delegationToken); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCancelDelegationTokenReq &a, TCancelDelegationTokenReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.delegationToken, b.delegationToken); +} + +TCancelDelegationTokenReq::TCancelDelegationTokenReq(const TCancelDelegationTokenReq& other306) { + sessionHandle = other306.sessionHandle; + delegationToken = other306.delegationToken; +} +TCancelDelegationTokenReq& TCancelDelegationTokenReq::operator=(const TCancelDelegationTokenReq& other307) { + sessionHandle = other307.sessionHandle; + delegationToken = other307.delegationToken; + return *this; +} +void TCancelDelegationTokenReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCancelDelegationTokenReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "delegationToken=" << to_string(delegationToken); + out << ")"; +} + + +TCancelDelegationTokenResp::~TCancelDelegationTokenResp() throw() { +} + + +void TCancelDelegationTokenResp::__set_status(const TStatus& val) { + this->status = val; +} +std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TCancelDelegationTokenResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TCancelDelegationTokenResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TCancelDelegationTokenResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TCancelDelegationTokenResp &a, TCancelDelegationTokenResp &b) { + using ::std::swap; + swap(a.status, b.status); +} + +TCancelDelegationTokenResp::TCancelDelegationTokenResp(const TCancelDelegationTokenResp& other308) { + status = other308.status; +} +TCancelDelegationTokenResp& TCancelDelegationTokenResp::operator=(const TCancelDelegationTokenResp& other309) { + status = other309.status; + return *this; +} +void TCancelDelegationTokenResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TCancelDelegationTokenResp("; + out << "status=" << to_string(status); + out << ")"; +} + + +TRenewDelegationTokenReq::~TRenewDelegationTokenReq() throw() { +} + + +void TRenewDelegationTokenReq::__set_sessionHandle(const TSessionHandle& val) { + this->sessionHandle = val; +} + +void TRenewDelegationTokenReq::__set_delegationToken(const std::string& val) { + this->delegationToken = val; +} +std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TRenewDelegationTokenReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_delegationToken = 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_STRING) { + xfer += iprot->readString(this->delegationToken); + isset_delegationToken = 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_delegationToken) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TRenewDelegationTokenReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TRenewDelegationTokenReq"); + + xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->sessionHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("delegationToken", ::apache::thrift::protocol::T_STRING, 2); + xfer += oprot->writeString(this->delegationToken); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TRenewDelegationTokenReq &a, TRenewDelegationTokenReq &b) { + using ::std::swap; + swap(a.sessionHandle, b.sessionHandle); + swap(a.delegationToken, b.delegationToken); +} + +TRenewDelegationTokenReq::TRenewDelegationTokenReq(const TRenewDelegationTokenReq& other310) { + sessionHandle = other310.sessionHandle; + delegationToken = other310.delegationToken; +} +TRenewDelegationTokenReq& TRenewDelegationTokenReq::operator=(const TRenewDelegationTokenReq& other311) { + sessionHandle = other311.sessionHandle; + delegationToken = other311.delegationToken; + return *this; +} +void TRenewDelegationTokenReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TRenewDelegationTokenReq("; + out << "sessionHandle=" << to_string(sessionHandle); + out << ", " << "delegationToken=" << to_string(delegationToken); + out << ")"; +} + + +TRenewDelegationTokenResp::~TRenewDelegationTokenResp() throw() { +} + + +void TRenewDelegationTokenResp::__set_status(const TStatus& val) { + this->status = val; +} +std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TRenewDelegationTokenResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; + + 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; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TRenewDelegationTokenResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TRenewDelegationTokenResp"); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->status.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b) { + using ::std::swap; + swap(a.status, b.status); +} + +TRenewDelegationTokenResp::TRenewDelegationTokenResp(const TRenewDelegationTokenResp& other312) { + status = other312.status; +} +TRenewDelegationTokenResp& TRenewDelegationTokenResp::operator=(const TRenewDelegationTokenResp& other313) { + status = other313.status; + return *this; +} +void TRenewDelegationTokenResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TRenewDelegationTokenResp("; + out << "status=" << to_string(status); + out << ")"; +} + + +TProgressUpdateResp::~TProgressUpdateResp() throw() { +} + + +void TProgressUpdateResp::__set_headerNames(const std::vector & val) { + this->headerNames = val; +} + +void TProgressUpdateResp::__set_rows(const std::vector > & val) { + this->rows = val; +} + +void TProgressUpdateResp::__set_progressedPercentage(const double val) { + this->progressedPercentage = val; +} + +void TProgressUpdateResp::__set_status(const TJobExecutionStatus::type val) { + this->status = val; +} + +void TProgressUpdateResp::__set_footerSummary(const std::string& val) { + this->footerSummary = val; +} + +void TProgressUpdateResp::__set_startTime(const int64_t val) { + this->startTime = val; +} +std::ostream& operator<<(std::ostream& out, const TProgressUpdateResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TProgressUpdateResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_headerNames = false; + bool isset_rows = false; + bool isset_progressedPercentage = false; + bool isset_status = false; + bool isset_footerSummary = false; + bool isset_startTime = 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_LIST) { + { + this->headerNames.clear(); + uint32_t _size314; + ::apache::thrift::protocol::TType _etype317; + xfer += iprot->readListBegin(_etype317, _size314); + this->headerNames.resize(_size314); + uint32_t _i318; + for (_i318 = 0; _i318 < _size314; ++_i318) + { + xfer += iprot->readString(this->headerNames[_i318]); + } + xfer += iprot->readListEnd(); + } + isset_headerNames = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 2: + if (ftype == ::apache::thrift::protocol::T_LIST) { + { + this->rows.clear(); + uint32_t _size319; + ::apache::thrift::protocol::TType _etype322; + xfer += iprot->readListBegin(_etype322, _size319); + this->rows.resize(_size319); + uint32_t _i323; + for (_i323 = 0; _i323 < _size319; ++_i323) + { + { + this->rows[_i323].clear(); + uint32_t _size324; + ::apache::thrift::protocol::TType _etype327; + xfer += iprot->readListBegin(_etype327, _size324); + this->rows[_i323].resize(_size324); + uint32_t _i328; + for (_i328 = 0; _i328 < _size324; ++_i328) + { + xfer += iprot->readString(this->rows[_i323][_i328]); + } + xfer += iprot->readListEnd(); + } + } + xfer += iprot->readListEnd(); + } + isset_rows = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 3: + if (ftype == ::apache::thrift::protocol::T_DOUBLE) { + xfer += iprot->readDouble(this->progressedPercentage); + isset_progressedPercentage = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 4: + if (ftype == ::apache::thrift::protocol::T_I32) { + int32_t ecast329; + xfer += iprot->readI32(ecast329); + this->status = (TJobExecutionStatus::type)ecast329; + isset_status = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 5: + if (ftype == ::apache::thrift::protocol::T_STRING) { + xfer += iprot->readString(this->footerSummary); + isset_footerSummary = true; + } else { + xfer += iprot->skip(ftype); + } + break; + case 6: + if (ftype == ::apache::thrift::protocol::T_I64) { + xfer += iprot->readI64(this->startTime); + isset_startTime = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_headerNames) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_rows) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_progressedPercentage) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_status) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_footerSummary) + throw TProtocolException(TProtocolException::INVALID_DATA); + if (!isset_startTime) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TProgressUpdateResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TProgressUpdateResp"); + + xfer += oprot->writeFieldBegin("headerNames", ::apache::thrift::protocol::T_LIST, 1); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->headerNames.size())); + std::vector ::const_iterator _iter330; + for (_iter330 = this->headerNames.begin(); _iter330 != this->headerNames.end(); ++_iter330) + { + xfer += oprot->writeString((*_iter330)); + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2); + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_LIST, static_cast(this->rows.size())); + std::vector > ::const_iterator _iter331; + for (_iter331 = this->rows.begin(); _iter331 != this->rows.end(); ++_iter331) + { + { + xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*_iter331).size())); + std::vector ::const_iterator _iter332; + for (_iter332 = (*_iter331).begin(); _iter332 != (*_iter331).end(); ++_iter332) + { + xfer += oprot->writeString((*_iter332)); + } + xfer += oprot->writeListEnd(); + } + } + xfer += oprot->writeListEnd(); + } + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("progressedPercentage", ::apache::thrift::protocol::T_DOUBLE, 3); + xfer += oprot->writeDouble(this->progressedPercentage); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_I32, 4); + xfer += oprot->writeI32((int32_t)this->status); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("footerSummary", ::apache::thrift::protocol::T_STRING, 5); + xfer += oprot->writeString(this->footerSummary); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldBegin("startTime", ::apache::thrift::protocol::T_I64, 6); + xfer += oprot->writeI64(this->startTime); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TProgressUpdateResp &a, TProgressUpdateResp &b) { + using ::std::swap; + swap(a.headerNames, b.headerNames); + swap(a.rows, b.rows); + swap(a.progressedPercentage, b.progressedPercentage); + swap(a.status, b.status); + swap(a.footerSummary, b.footerSummary); + swap(a.startTime, b.startTime); +} + +TProgressUpdateResp::TProgressUpdateResp(const TProgressUpdateResp& other333) { + headerNames = other333.headerNames; + rows = other333.rows; + progressedPercentage = other333.progressedPercentage; + status = other333.status; + footerSummary = other333.footerSummary; + startTime = other333.startTime; +} +TProgressUpdateResp& TProgressUpdateResp::operator=(const TProgressUpdateResp& other334) { + headerNames = other334.headerNames; + rows = other334.rows; + progressedPercentage = other334.progressedPercentage; + status = other334.status; + footerSummary = other334.footerSummary; + startTime = other334.startTime; + return *this; +} +void TProgressUpdateResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TProgressUpdateResp("; + out << "headerNames=" << to_string(headerNames); + out << ", " << "rows=" << to_string(rows); + out << ", " << "progressedPercentage=" << to_string(progressedPercentage); + out << ", " << "status=" << to_string(status); + out << ", " << "footerSummary=" << to_string(footerSummary); + out << ", " << "startTime=" << to_string(startTime); + out << ")"; +} + + +TGetQueryIdReq::~TGetQueryIdReq() throw() { +} + + +void TGetQueryIdReq::__set_operationHandle(const TOperationHandle& val) { + this->operationHandle = val; +} +std::ostream& operator<<(std::ostream& out, const TGetQueryIdReq& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetQueryIdReq::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetQueryIdReq::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetQueryIdReq"); + + xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); + xfer += this->operationHandle.write(oprot); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetQueryIdReq &a, TGetQueryIdReq &b) { + using ::std::swap; + swap(a.operationHandle, b.operationHandle); +} + +TGetQueryIdReq::TGetQueryIdReq(const TGetQueryIdReq& other335) { + operationHandle = other335.operationHandle; +} +TGetQueryIdReq& TGetQueryIdReq::operator=(const TGetQueryIdReq& other336) { + operationHandle = other336.operationHandle; + return *this; +} +void TGetQueryIdReq::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetQueryIdReq("; + out << "operationHandle=" << to_string(operationHandle); + out << ")"; +} + + +TGetQueryIdResp::~TGetQueryIdResp() throw() { +} + + +void TGetQueryIdResp::__set_queryId(const std::string& val) { + this->queryId = val; +} +std::ostream& operator<<(std::ostream& out, const TGetQueryIdResp& obj) +{ + obj.printTo(out); + return out; +} + + +uint32_t TGetQueryIdResp::read(::apache::thrift::protocol::TProtocol* iprot) { + + ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_queryId = 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_STRING) { + xfer += iprot->readString(this->queryId); + isset_queryId = true; + } else { + xfer += iprot->skip(ftype); + } + break; + default: + xfer += iprot->skip(ftype); + break; + } + xfer += iprot->readFieldEnd(); + } + + xfer += iprot->readStructEnd(); + + if (!isset_queryId) + throw TProtocolException(TProtocolException::INVALID_DATA); + return xfer; +} + +uint32_t TGetQueryIdResp::write(::apache::thrift::protocol::TProtocol* oprot) const { + uint32_t xfer = 0; + ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); + xfer += oprot->writeStructBegin("TGetQueryIdResp"); + + xfer += oprot->writeFieldBegin("queryId", ::apache::thrift::protocol::T_STRING, 1); + xfer += oprot->writeString(this->queryId); + xfer += oprot->writeFieldEnd(); + + xfer += oprot->writeFieldStop(); + xfer += oprot->writeStructEnd(); + return xfer; +} + +void swap(TGetQueryIdResp &a, TGetQueryIdResp &b) { + using ::std::swap; + swap(a.queryId, b.queryId); +} + +TGetQueryIdResp::TGetQueryIdResp(const TGetQueryIdResp& other337) { + queryId = other337.queryId; +} +TGetQueryIdResp& TGetQueryIdResp::operator=(const TGetQueryIdResp& other338) { + queryId = other338.queryId; + return *this; +} +void TGetQueryIdResp::printTo(std::ostream& out) const { + using ::apache::thrift::to_string; + out << "TGetQueryIdResp("; + out << "queryId=" << to_string(queryId); + out << ")"; +} + +}}}}} // namespace diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h new file mode 100644 index 000000000000..8723add2e82c --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h @@ -0,0 +1,4497 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +#ifndef TCLIService_TYPES_H +#define TCLIService_TYPES_H + +#include + +#include +#include +#include +#include +#include + +#include + + +namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { + +struct TProtocolVersion { + enum type { + HIVE_CLI_SERVICE_PROTOCOL_V1 = 0, + HIVE_CLI_SERVICE_PROTOCOL_V2 = 1, + HIVE_CLI_SERVICE_PROTOCOL_V3 = 2, + HIVE_CLI_SERVICE_PROTOCOL_V4 = 3, + HIVE_CLI_SERVICE_PROTOCOL_V5 = 4, + HIVE_CLI_SERVICE_PROTOCOL_V6 = 5, + HIVE_CLI_SERVICE_PROTOCOL_V7 = 6, + HIVE_CLI_SERVICE_PROTOCOL_V8 = 7, + HIVE_CLI_SERVICE_PROTOCOL_V9 = 8, + HIVE_CLI_SERVICE_PROTOCOL_V10 = 9, + HIVE_CLI_SERVICE_PROTOCOL_V11 = 10 + }; +}; + +extern const std::map _TProtocolVersion_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TProtocolVersion::type& val); + +struct TTypeId { + enum type { + BOOLEAN_TYPE = 0, + TINYINT_TYPE = 1, + SMALLINT_TYPE = 2, + INT_TYPE = 3, + BIGINT_TYPE = 4, + FLOAT_TYPE = 5, + DOUBLE_TYPE = 6, + STRING_TYPE = 7, + TIMESTAMP_TYPE = 8, + BINARY_TYPE = 9, + ARRAY_TYPE = 10, + MAP_TYPE = 11, + STRUCT_TYPE = 12, + UNION_TYPE = 13, + USER_DEFINED_TYPE = 14, + DECIMAL_TYPE = 15, + NULL_TYPE = 16, + DATE_TYPE = 17, + VARCHAR_TYPE = 18, + CHAR_TYPE = 19, + INTERVAL_YEAR_MONTH_TYPE = 20, + INTERVAL_DAY_TIME_TYPE = 21, + TIMESTAMPLOCALTZ_TYPE = 22 + }; +}; + +extern const std::map _TTypeId_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TTypeId::type& val); + +struct TStatusCode { + enum type { + SUCCESS_STATUS = 0, + SUCCESS_WITH_INFO_STATUS = 1, + STILL_EXECUTING_STATUS = 2, + ERROR_STATUS = 3, + INVALID_HANDLE_STATUS = 4 + }; +}; + +extern const std::map _TStatusCode_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TStatusCode::type& val); + +struct TOperationState { + enum type { + INITIALIZED_STATE = 0, + RUNNING_STATE = 1, + FINISHED_STATE = 2, + CANCELED_STATE = 3, + CLOSED_STATE = 4, + ERROR_STATE = 5, + UKNOWN_STATE = 6, + PENDING_STATE = 7, + TIMEDOUT_STATE = 8 + }; +}; + +extern const std::map _TOperationState_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TOperationState::type& val); + +struct TOperationType { + enum type { + EXECUTE_STATEMENT = 0, + GET_TYPE_INFO = 1, + GET_CATALOGS = 2, + GET_SCHEMAS = 3, + GET_TABLES = 4, + GET_TABLE_TYPES = 5, + GET_COLUMNS = 6, + GET_FUNCTIONS = 7, + UNKNOWN = 8 + }; +}; + +extern const std::map _TOperationType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TOperationType::type& val); + +struct TGetInfoType { + enum type { + CLI_MAX_DRIVER_CONNECTIONS = 0, + CLI_MAX_CONCURRENT_ACTIVITIES = 1, + CLI_DATA_SOURCE_NAME = 2, + CLI_FETCH_DIRECTION = 8, + CLI_SERVER_NAME = 13, + CLI_SEARCH_PATTERN_ESCAPE = 14, + CLI_DBMS_NAME = 17, + CLI_DBMS_VER = 18, + CLI_ACCESSIBLE_TABLES = 19, + CLI_ACCESSIBLE_PROCEDURES = 20, + CLI_CURSOR_COMMIT_BEHAVIOR = 23, + CLI_DATA_SOURCE_READ_ONLY = 25, + CLI_DEFAULT_TXN_ISOLATION = 26, + CLI_IDENTIFIER_CASE = 28, + CLI_IDENTIFIER_QUOTE_CHAR = 29, + CLI_MAX_COLUMN_NAME_LEN = 30, + CLI_MAX_CURSOR_NAME_LEN = 31, + CLI_MAX_SCHEMA_NAME_LEN = 32, + CLI_MAX_CATALOG_NAME_LEN = 34, + CLI_MAX_TABLE_NAME_LEN = 35, + CLI_SCROLL_CONCURRENCY = 43, + CLI_TXN_CAPABLE = 46, + CLI_USER_NAME = 47, + CLI_TXN_ISOLATION_OPTION = 72, + CLI_INTEGRITY = 73, + CLI_GETDATA_EXTENSIONS = 81, + CLI_NULL_COLLATION = 85, + CLI_ALTER_TABLE = 86, + CLI_ORDER_BY_COLUMNS_IN_SELECT = 90, + CLI_SPECIAL_CHARACTERS = 94, + CLI_MAX_COLUMNS_IN_GROUP_BY = 97, + CLI_MAX_COLUMNS_IN_INDEX = 98, + CLI_MAX_COLUMNS_IN_ORDER_BY = 99, + CLI_MAX_COLUMNS_IN_SELECT = 100, + CLI_MAX_COLUMNS_IN_TABLE = 101, + CLI_MAX_INDEX_SIZE = 102, + CLI_MAX_ROW_SIZE = 104, + CLI_MAX_STATEMENT_LEN = 105, + CLI_MAX_TABLES_IN_SELECT = 106, + CLI_MAX_USER_NAME_LEN = 107, + CLI_OJ_CAPABILITIES = 115, + CLI_XOPEN_CLI_YEAR = 10000, + CLI_CURSOR_SENSITIVITY = 10001, + CLI_DESCRIBE_PARAMETER = 10002, + CLI_CATALOG_NAME = 10003, + CLI_COLLATION_SEQ = 10004, + CLI_MAX_IDENTIFIER_LEN = 10005, + CLI_ODBC_KEYWORDS = 10006 + }; +}; + +extern const std::map _TGetInfoType_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TGetInfoType::type& val); + +struct TFetchOrientation { + enum type { + FETCH_NEXT = 0, + FETCH_PRIOR = 1, + FETCH_RELATIVE = 2, + FETCH_ABSOLUTE = 3, + FETCH_FIRST = 4, + FETCH_LAST = 5 + }; +}; + +extern const std::map _TFetchOrientation_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TFetchOrientation::type& val); + +struct TJobExecutionStatus { + enum type { + IN_PROGRESS = 0, + COMPLETE = 1, + NOT_AVAILABLE = 2 + }; +}; + +extern const std::map _TJobExecutionStatus_VALUES_TO_NAMES; + +std::ostream& operator<<(std::ostream& out, const TJobExecutionStatus::type& val); + +typedef int32_t TTypeEntryPtr; + +typedef std::string TIdentifier; + +typedef std::string TPattern; + +typedef std::string TPatternOrIdentifier; + +class TTypeQualifierValue; + +class TTypeQualifiers; + +class TPrimitiveTypeEntry; + +class TArrayTypeEntry; + +class TMapTypeEntry; + +class TStructTypeEntry; + +class TUnionTypeEntry; + +class TUserDefinedTypeEntry; + +class TTypeEntry; + +class TTypeDesc; + +class TColumnDesc; + +class TTableSchema; + +class TBoolValue; + +class TByteValue; + +class TI16Value; + +class TI32Value; + +class TI64Value; + +class TDoubleValue; + +class TStringValue; + +class TColumnValue; + +class TRow; + +class TBoolColumn; + +class TByteColumn; + +class TI16Column; + +class TI32Column; + +class TI64Column; + +class TDoubleColumn; + +class TStringColumn; + +class TBinaryColumn; + +class TColumn; + +class TRowSet; + +class TStatus; + +class THandleIdentifier; + +class TSessionHandle; + +class TOperationHandle; + +class TOpenSessionReq; + +class TOpenSessionResp; + +class TSetClientInfoReq; + +class TSetClientInfoResp; + +class TCloseSessionReq; + +class TCloseSessionResp; + +class TGetInfoValue; + +class TGetInfoReq; + +class TGetInfoResp; + +class TExecuteStatementReq; + +class TExecuteStatementResp; + +class TGetTypeInfoReq; + +class TGetTypeInfoResp; + +class TGetCatalogsReq; + +class TGetCatalogsResp; + +class TGetSchemasReq; + +class TGetSchemasResp; + +class TGetTablesReq; + +class TGetTablesResp; + +class TGetTableTypesReq; + +class TGetTableTypesResp; + +class TGetColumnsReq; + +class TGetColumnsResp; + +class TGetFunctionsReq; + +class TGetFunctionsResp; + +class TGetPrimaryKeysReq; + +class TGetPrimaryKeysResp; + +class TGetCrossReferenceReq; + +class TGetCrossReferenceResp; + +class TGetOperationStatusReq; + +class TGetOperationStatusResp; + +class TCancelOperationReq; + +class TCancelOperationResp; + +class TCloseOperationReq; + +class TCloseOperationResp; + +class TGetResultSetMetadataReq; + +class TGetResultSetMetadataResp; + +class TFetchResultsReq; + +class TFetchResultsResp; + +class TGetDelegationTokenReq; + +class TGetDelegationTokenResp; + +class TCancelDelegationTokenReq; + +class TCancelDelegationTokenResp; + +class TRenewDelegationTokenReq; + +class TRenewDelegationTokenResp; + +class TProgressUpdateResp; + +class TGetQueryIdReq; + +class TGetQueryIdResp; + +typedef struct _TTypeQualifierValue__isset { + _TTypeQualifierValue__isset() : i32Value(false), stringValue(false) {} + bool i32Value :1; + bool stringValue :1; +} _TTypeQualifierValue__isset; + +class TTypeQualifierValue : public virtual ::apache::thrift::TBase { + public: + + TTypeQualifierValue(const TTypeQualifierValue&); + TTypeQualifierValue& operator=(const TTypeQualifierValue&); + TTypeQualifierValue() : i32Value(0), stringValue() { + } + + virtual ~TTypeQualifierValue() throw(); + int32_t i32Value; + std::string stringValue; + + _TTypeQualifierValue__isset __isset; + + void __set_i32Value(const int32_t val); + + void __set_stringValue(const std::string& val); + + bool operator == (const TTypeQualifierValue & rhs) const + { + if (__isset.i32Value != rhs.__isset.i32Value) + return false; + else if (__isset.i32Value && !(i32Value == rhs.i32Value)) + return false; + if (__isset.stringValue != rhs.__isset.stringValue) + return false; + else if (__isset.stringValue && !(stringValue == rhs.stringValue)) + return false; + return true; + } + bool operator != (const TTypeQualifierValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TTypeQualifierValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TTypeQualifierValue &a, TTypeQualifierValue &b); + +std::ostream& operator<<(std::ostream& out, const TTypeQualifierValue& obj); + + +class TTypeQualifiers : public virtual ::apache::thrift::TBase { + public: + + TTypeQualifiers(const TTypeQualifiers&); + TTypeQualifiers& operator=(const TTypeQualifiers&); + TTypeQualifiers() { + } + + virtual ~TTypeQualifiers() throw(); + std::map qualifiers; + + void __set_qualifiers(const std::map & val); + + bool operator == (const TTypeQualifiers & rhs) const + { + if (!(qualifiers == rhs.qualifiers)) + return false; + return true; + } + bool operator != (const TTypeQualifiers &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TTypeQualifiers & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TTypeQualifiers &a, TTypeQualifiers &b); + +std::ostream& operator<<(std::ostream& out, const TTypeQualifiers& obj); + +typedef struct _TPrimitiveTypeEntry__isset { + _TPrimitiveTypeEntry__isset() : typeQualifiers(false) {} + bool typeQualifiers :1; +} _TPrimitiveTypeEntry__isset; + +class TPrimitiveTypeEntry : public virtual ::apache::thrift::TBase { + public: + + TPrimitiveTypeEntry(const TPrimitiveTypeEntry&); + TPrimitiveTypeEntry& operator=(const TPrimitiveTypeEntry&); + TPrimitiveTypeEntry() : type((TTypeId::type)0) { + } + + virtual ~TPrimitiveTypeEntry() throw(); + TTypeId::type type; + TTypeQualifiers typeQualifiers; + + _TPrimitiveTypeEntry__isset __isset; + + void __set_type(const TTypeId::type val); + + void __set_typeQualifiers(const TTypeQualifiers& val); + + bool operator == (const TPrimitiveTypeEntry & rhs) const + { + if (!(type == rhs.type)) + return false; + if (__isset.typeQualifiers != rhs.__isset.typeQualifiers) + return false; + else if (__isset.typeQualifiers && !(typeQualifiers == rhs.typeQualifiers)) + return false; + return true; + } + bool operator != (const TPrimitiveTypeEntry &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TPrimitiveTypeEntry & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TPrimitiveTypeEntry &a, TPrimitiveTypeEntry &b); + +std::ostream& operator<<(std::ostream& out, const TPrimitiveTypeEntry& obj); + + +class TArrayTypeEntry : public virtual ::apache::thrift::TBase { + public: + + TArrayTypeEntry(const TArrayTypeEntry&); + TArrayTypeEntry& operator=(const TArrayTypeEntry&); + TArrayTypeEntry() : objectTypePtr(0) { + } + + virtual ~TArrayTypeEntry() throw(); + TTypeEntryPtr objectTypePtr; + + void __set_objectTypePtr(const TTypeEntryPtr val); + + bool operator == (const TArrayTypeEntry & rhs) const + { + if (!(objectTypePtr == rhs.objectTypePtr)) + return false; + return true; + } + bool operator != (const TArrayTypeEntry &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TArrayTypeEntry & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TArrayTypeEntry &a, TArrayTypeEntry &b); + +std::ostream& operator<<(std::ostream& out, const TArrayTypeEntry& obj); + + +class TMapTypeEntry : public virtual ::apache::thrift::TBase { + public: + + TMapTypeEntry(const TMapTypeEntry&); + TMapTypeEntry& operator=(const TMapTypeEntry&); + TMapTypeEntry() : keyTypePtr(0), valueTypePtr(0) { + } + + virtual ~TMapTypeEntry() throw(); + TTypeEntryPtr keyTypePtr; + TTypeEntryPtr valueTypePtr; + + void __set_keyTypePtr(const TTypeEntryPtr val); + + void __set_valueTypePtr(const TTypeEntryPtr val); + + bool operator == (const TMapTypeEntry & rhs) const + { + if (!(keyTypePtr == rhs.keyTypePtr)) + return false; + if (!(valueTypePtr == rhs.valueTypePtr)) + return false; + return true; + } + bool operator != (const TMapTypeEntry &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TMapTypeEntry & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TMapTypeEntry &a, TMapTypeEntry &b); + +std::ostream& operator<<(std::ostream& out, const TMapTypeEntry& obj); + + +class TStructTypeEntry : public virtual ::apache::thrift::TBase { + public: + + TStructTypeEntry(const TStructTypeEntry&); + TStructTypeEntry& operator=(const TStructTypeEntry&); + TStructTypeEntry() { + } + + virtual ~TStructTypeEntry() throw(); + std::map nameToTypePtr; + + void __set_nameToTypePtr(const std::map & val); + + bool operator == (const TStructTypeEntry & rhs) const + { + if (!(nameToTypePtr == rhs.nameToTypePtr)) + return false; + return true; + } + bool operator != (const TStructTypeEntry &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TStructTypeEntry & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TStructTypeEntry &a, TStructTypeEntry &b); + +std::ostream& operator<<(std::ostream& out, const TStructTypeEntry& obj); + + +class TUnionTypeEntry : public virtual ::apache::thrift::TBase { + public: + + TUnionTypeEntry(const TUnionTypeEntry&); + TUnionTypeEntry& operator=(const TUnionTypeEntry&); + TUnionTypeEntry() { + } + + virtual ~TUnionTypeEntry() throw(); + std::map nameToTypePtr; + + void __set_nameToTypePtr(const std::map & val); + + bool operator == (const TUnionTypeEntry & rhs) const + { + if (!(nameToTypePtr == rhs.nameToTypePtr)) + return false; + return true; + } + bool operator != (const TUnionTypeEntry &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TUnionTypeEntry & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TUnionTypeEntry &a, TUnionTypeEntry &b); + +std::ostream& operator<<(std::ostream& out, const TUnionTypeEntry& obj); + + +class TUserDefinedTypeEntry : public virtual ::apache::thrift::TBase { + public: + + TUserDefinedTypeEntry(const TUserDefinedTypeEntry&); + TUserDefinedTypeEntry& operator=(const TUserDefinedTypeEntry&); + TUserDefinedTypeEntry() : typeClassName() { + } + + virtual ~TUserDefinedTypeEntry() throw(); + std::string typeClassName; + + void __set_typeClassName(const std::string& val); + + bool operator == (const TUserDefinedTypeEntry & rhs) const + { + if (!(typeClassName == rhs.typeClassName)) + return false; + return true; + } + bool operator != (const TUserDefinedTypeEntry &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TUserDefinedTypeEntry & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TUserDefinedTypeEntry &a, TUserDefinedTypeEntry &b); + +std::ostream& operator<<(std::ostream& out, const TUserDefinedTypeEntry& obj); + +typedef struct _TTypeEntry__isset { + _TTypeEntry__isset() : primitiveEntry(false), arrayEntry(false), mapEntry(false), structEntry(false), unionEntry(false), userDefinedTypeEntry(false) {} + bool primitiveEntry :1; + bool arrayEntry :1; + bool mapEntry :1; + bool structEntry :1; + bool unionEntry :1; + bool userDefinedTypeEntry :1; +} _TTypeEntry__isset; + +class TTypeEntry : public virtual ::apache::thrift::TBase { + public: + + TTypeEntry(const TTypeEntry&); + TTypeEntry& operator=(const TTypeEntry&); + TTypeEntry() { + } + + virtual ~TTypeEntry() throw(); + TPrimitiveTypeEntry primitiveEntry; + TArrayTypeEntry arrayEntry; + TMapTypeEntry mapEntry; + TStructTypeEntry structEntry; + TUnionTypeEntry unionEntry; + TUserDefinedTypeEntry userDefinedTypeEntry; + + _TTypeEntry__isset __isset; + + void __set_primitiveEntry(const TPrimitiveTypeEntry& val); + + void __set_arrayEntry(const TArrayTypeEntry& val); + + void __set_mapEntry(const TMapTypeEntry& val); + + void __set_structEntry(const TStructTypeEntry& val); + + void __set_unionEntry(const TUnionTypeEntry& val); + + void __set_userDefinedTypeEntry(const TUserDefinedTypeEntry& val); + + bool operator == (const TTypeEntry & rhs) const + { + if (__isset.primitiveEntry != rhs.__isset.primitiveEntry) + return false; + else if (__isset.primitiveEntry && !(primitiveEntry == rhs.primitiveEntry)) + return false; + if (__isset.arrayEntry != rhs.__isset.arrayEntry) + return false; + else if (__isset.arrayEntry && !(arrayEntry == rhs.arrayEntry)) + return false; + if (__isset.mapEntry != rhs.__isset.mapEntry) + return false; + else if (__isset.mapEntry && !(mapEntry == rhs.mapEntry)) + return false; + if (__isset.structEntry != rhs.__isset.structEntry) + return false; + else if (__isset.structEntry && !(structEntry == rhs.structEntry)) + return false; + if (__isset.unionEntry != rhs.__isset.unionEntry) + return false; + else if (__isset.unionEntry && !(unionEntry == rhs.unionEntry)) + return false; + if (__isset.userDefinedTypeEntry != rhs.__isset.userDefinedTypeEntry) + return false; + else if (__isset.userDefinedTypeEntry && !(userDefinedTypeEntry == rhs.userDefinedTypeEntry)) + return false; + return true; + } + bool operator != (const TTypeEntry &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TTypeEntry & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TTypeEntry &a, TTypeEntry &b); + +std::ostream& operator<<(std::ostream& out, const TTypeEntry& obj); + + +class TTypeDesc : public virtual ::apache::thrift::TBase { + public: + + TTypeDesc(const TTypeDesc&); + TTypeDesc& operator=(const TTypeDesc&); + TTypeDesc() { + } + + virtual ~TTypeDesc() throw(); + std::vector types; + + void __set_types(const std::vector & val); + + bool operator == (const TTypeDesc & rhs) const + { + if (!(types == rhs.types)) + return false; + return true; + } + bool operator != (const TTypeDesc &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TTypeDesc & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TTypeDesc &a, TTypeDesc &b); + +std::ostream& operator<<(std::ostream& out, const TTypeDesc& obj); + +typedef struct _TColumnDesc__isset { + _TColumnDesc__isset() : comment(false) {} + bool comment :1; +} _TColumnDesc__isset; + +class TColumnDesc : public virtual ::apache::thrift::TBase { + public: + + TColumnDesc(const TColumnDesc&); + TColumnDesc& operator=(const TColumnDesc&); + TColumnDesc() : columnName(), position(0), comment() { + } + + virtual ~TColumnDesc() throw(); + std::string columnName; + TTypeDesc typeDesc; + int32_t position; + std::string comment; + + _TColumnDesc__isset __isset; + + void __set_columnName(const std::string& val); + + void __set_typeDesc(const TTypeDesc& val); + + void __set_position(const int32_t val); + + void __set_comment(const std::string& val); + + bool operator == (const TColumnDesc & rhs) const + { + if (!(columnName == rhs.columnName)) + return false; + if (!(typeDesc == rhs.typeDesc)) + return false; + if (!(position == rhs.position)) + return false; + if (__isset.comment != rhs.__isset.comment) + return false; + else if (__isset.comment && !(comment == rhs.comment)) + return false; + return true; + } + bool operator != (const TColumnDesc &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TColumnDesc & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TColumnDesc &a, TColumnDesc &b); + +std::ostream& operator<<(std::ostream& out, const TColumnDesc& obj); + + +class TTableSchema : public virtual ::apache::thrift::TBase { + public: + + TTableSchema(const TTableSchema&); + TTableSchema& operator=(const TTableSchema&); + TTableSchema() { + } + + virtual ~TTableSchema() throw(); + std::vector columns; + + void __set_columns(const std::vector & val); + + bool operator == (const TTableSchema & rhs) const + { + if (!(columns == rhs.columns)) + return false; + return true; + } + bool operator != (const TTableSchema &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TTableSchema & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TTableSchema &a, TTableSchema &b); + +std::ostream& operator<<(std::ostream& out, const TTableSchema& obj); + +typedef struct _TBoolValue__isset { + _TBoolValue__isset() : value(false) {} + bool value :1; +} _TBoolValue__isset; + +class TBoolValue : public virtual ::apache::thrift::TBase { + public: + + TBoolValue(const TBoolValue&); + TBoolValue& operator=(const TBoolValue&); + TBoolValue() : value(0) { + } + + virtual ~TBoolValue() throw(); + bool value; + + _TBoolValue__isset __isset; + + void __set_value(const bool val); + + bool operator == (const TBoolValue & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TBoolValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TBoolValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TBoolValue &a, TBoolValue &b); + +std::ostream& operator<<(std::ostream& out, const TBoolValue& obj); + +typedef struct _TByteValue__isset { + _TByteValue__isset() : value(false) {} + bool value :1; +} _TByteValue__isset; + +class TByteValue : public virtual ::apache::thrift::TBase { + public: + + TByteValue(const TByteValue&); + TByteValue& operator=(const TByteValue&); + TByteValue() : value(0) { + } + + virtual ~TByteValue() throw(); + int8_t value; + + _TByteValue__isset __isset; + + void __set_value(const int8_t val); + + bool operator == (const TByteValue & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TByteValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TByteValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TByteValue &a, TByteValue &b); + +std::ostream& operator<<(std::ostream& out, const TByteValue& obj); + +typedef struct _TI16Value__isset { + _TI16Value__isset() : value(false) {} + bool value :1; +} _TI16Value__isset; + +class TI16Value : public virtual ::apache::thrift::TBase { + public: + + TI16Value(const TI16Value&); + TI16Value& operator=(const TI16Value&); + TI16Value() : value(0) { + } + + virtual ~TI16Value() throw(); + int16_t value; + + _TI16Value__isset __isset; + + void __set_value(const int16_t val); + + bool operator == (const TI16Value & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TI16Value &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TI16Value & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TI16Value &a, TI16Value &b); + +std::ostream& operator<<(std::ostream& out, const TI16Value& obj); + +typedef struct _TI32Value__isset { + _TI32Value__isset() : value(false) {} + bool value :1; +} _TI32Value__isset; + +class TI32Value : public virtual ::apache::thrift::TBase { + public: + + TI32Value(const TI32Value&); + TI32Value& operator=(const TI32Value&); + TI32Value() : value(0) { + } + + virtual ~TI32Value() throw(); + int32_t value; + + _TI32Value__isset __isset; + + void __set_value(const int32_t val); + + bool operator == (const TI32Value & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TI32Value &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TI32Value & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TI32Value &a, TI32Value &b); + +std::ostream& operator<<(std::ostream& out, const TI32Value& obj); + +typedef struct _TI64Value__isset { + _TI64Value__isset() : value(false) {} + bool value :1; +} _TI64Value__isset; + +class TI64Value : public virtual ::apache::thrift::TBase { + public: + + TI64Value(const TI64Value&); + TI64Value& operator=(const TI64Value&); + TI64Value() : value(0) { + } + + virtual ~TI64Value() throw(); + int64_t value; + + _TI64Value__isset __isset; + + void __set_value(const int64_t val); + + bool operator == (const TI64Value & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TI64Value &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TI64Value & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TI64Value &a, TI64Value &b); + +std::ostream& operator<<(std::ostream& out, const TI64Value& obj); + +typedef struct _TDoubleValue__isset { + _TDoubleValue__isset() : value(false) {} + bool value :1; +} _TDoubleValue__isset; + +class TDoubleValue : public virtual ::apache::thrift::TBase { + public: + + TDoubleValue(const TDoubleValue&); + TDoubleValue& operator=(const TDoubleValue&); + TDoubleValue() : value(0) { + } + + virtual ~TDoubleValue() throw(); + double value; + + _TDoubleValue__isset __isset; + + void __set_value(const double val); + + bool operator == (const TDoubleValue & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TDoubleValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TDoubleValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TDoubleValue &a, TDoubleValue &b); + +std::ostream& operator<<(std::ostream& out, const TDoubleValue& obj); + +typedef struct _TStringValue__isset { + _TStringValue__isset() : value(false) {} + bool value :1; +} _TStringValue__isset; + +class TStringValue : public virtual ::apache::thrift::TBase { + public: + + TStringValue(const TStringValue&); + TStringValue& operator=(const TStringValue&); + TStringValue() : value() { + } + + virtual ~TStringValue() throw(); + std::string value; + + _TStringValue__isset __isset; + + void __set_value(const std::string& val); + + bool operator == (const TStringValue & rhs) const + { + if (__isset.value != rhs.__isset.value) + return false; + else if (__isset.value && !(value == rhs.value)) + return false; + return true; + } + bool operator != (const TStringValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TStringValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TStringValue &a, TStringValue &b); + +std::ostream& operator<<(std::ostream& out, const TStringValue& obj); + +typedef struct _TColumnValue__isset { + _TColumnValue__isset() : boolVal(false), byteVal(false), i16Val(false), i32Val(false), i64Val(false), doubleVal(false), stringVal(false) {} + bool boolVal :1; + bool byteVal :1; + bool i16Val :1; + bool i32Val :1; + bool i64Val :1; + bool doubleVal :1; + bool stringVal :1; +} _TColumnValue__isset; + +class TColumnValue : public virtual ::apache::thrift::TBase { + public: + + TColumnValue(const TColumnValue&); + TColumnValue& operator=(const TColumnValue&); + TColumnValue() { + } + + virtual ~TColumnValue() throw(); + TBoolValue boolVal; + TByteValue byteVal; + TI16Value i16Val; + TI32Value i32Val; + TI64Value i64Val; + TDoubleValue doubleVal; + TStringValue stringVal; + + _TColumnValue__isset __isset; + + void __set_boolVal(const TBoolValue& val); + + void __set_byteVal(const TByteValue& val); + + void __set_i16Val(const TI16Value& val); + + void __set_i32Val(const TI32Value& val); + + void __set_i64Val(const TI64Value& val); + + void __set_doubleVal(const TDoubleValue& val); + + void __set_stringVal(const TStringValue& val); + + bool operator == (const TColumnValue & rhs) const + { + if (__isset.boolVal != rhs.__isset.boolVal) + return false; + else if (__isset.boolVal && !(boolVal == rhs.boolVal)) + return false; + if (__isset.byteVal != rhs.__isset.byteVal) + return false; + else if (__isset.byteVal && !(byteVal == rhs.byteVal)) + return false; + if (__isset.i16Val != rhs.__isset.i16Val) + return false; + else if (__isset.i16Val && !(i16Val == rhs.i16Val)) + return false; + if (__isset.i32Val != rhs.__isset.i32Val) + return false; + else if (__isset.i32Val && !(i32Val == rhs.i32Val)) + return false; + if (__isset.i64Val != rhs.__isset.i64Val) + return false; + else if (__isset.i64Val && !(i64Val == rhs.i64Val)) + return false; + if (__isset.doubleVal != rhs.__isset.doubleVal) + return false; + else if (__isset.doubleVal && !(doubleVal == rhs.doubleVal)) + return false; + if (__isset.stringVal != rhs.__isset.stringVal) + return false; + else if (__isset.stringVal && !(stringVal == rhs.stringVal)) + return false; + return true; + } + bool operator != (const TColumnValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TColumnValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TColumnValue &a, TColumnValue &b); + +std::ostream& operator<<(std::ostream& out, const TColumnValue& obj); + + +class TRow : public virtual ::apache::thrift::TBase { + public: + + TRow(const TRow&); + TRow& operator=(const TRow&); + TRow() { + } + + virtual ~TRow() throw(); + std::vector colVals; + + void __set_colVals(const std::vector & val); + + bool operator == (const TRow & rhs) const + { + if (!(colVals == rhs.colVals)) + return false; + return true; + } + bool operator != (const TRow &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TRow & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TRow &a, TRow &b); + +std::ostream& operator<<(std::ostream& out, const TRow& obj); + + +class TBoolColumn : public virtual ::apache::thrift::TBase { + public: + + TBoolColumn(const TBoolColumn&); + TBoolColumn& operator=(const TBoolColumn&); + TBoolColumn() : nulls() { + } + + virtual ~TBoolColumn() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TBoolColumn & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TBoolColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TBoolColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TBoolColumn &a, TBoolColumn &b); + +std::ostream& operator<<(std::ostream& out, const TBoolColumn& obj); + + +class TByteColumn : public virtual ::apache::thrift::TBase { + public: + + TByteColumn(const TByteColumn&); + TByteColumn& operator=(const TByteColumn&); + TByteColumn() : nulls() { + } + + virtual ~TByteColumn() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TByteColumn & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TByteColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TByteColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TByteColumn &a, TByteColumn &b); + +std::ostream& operator<<(std::ostream& out, const TByteColumn& obj); + + +class TI16Column : public virtual ::apache::thrift::TBase { + public: + + TI16Column(const TI16Column&); + TI16Column& operator=(const TI16Column&); + TI16Column() : nulls() { + } + + virtual ~TI16Column() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TI16Column & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TI16Column &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TI16Column & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TI16Column &a, TI16Column &b); + +std::ostream& operator<<(std::ostream& out, const TI16Column& obj); + + +class TI32Column : public virtual ::apache::thrift::TBase { + public: + + TI32Column(const TI32Column&); + TI32Column& operator=(const TI32Column&); + TI32Column() : nulls() { + } + + virtual ~TI32Column() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TI32Column & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TI32Column &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TI32Column & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TI32Column &a, TI32Column &b); + +std::ostream& operator<<(std::ostream& out, const TI32Column& obj); + + +class TI64Column : public virtual ::apache::thrift::TBase { + public: + + TI64Column(const TI64Column&); + TI64Column& operator=(const TI64Column&); + TI64Column() : nulls() { + } + + virtual ~TI64Column() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TI64Column & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TI64Column &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TI64Column & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TI64Column &a, TI64Column &b); + +std::ostream& operator<<(std::ostream& out, const TI64Column& obj); + + +class TDoubleColumn : public virtual ::apache::thrift::TBase { + public: + + TDoubleColumn(const TDoubleColumn&); + TDoubleColumn& operator=(const TDoubleColumn&); + TDoubleColumn() : nulls() { + } + + virtual ~TDoubleColumn() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TDoubleColumn & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TDoubleColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TDoubleColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TDoubleColumn &a, TDoubleColumn &b); + +std::ostream& operator<<(std::ostream& out, const TDoubleColumn& obj); + + +class TStringColumn : public virtual ::apache::thrift::TBase { + public: + + TStringColumn(const TStringColumn&); + TStringColumn& operator=(const TStringColumn&); + TStringColumn() : nulls() { + } + + virtual ~TStringColumn() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TStringColumn & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TStringColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TStringColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TStringColumn &a, TStringColumn &b); + +std::ostream& operator<<(std::ostream& out, const TStringColumn& obj); + + +class TBinaryColumn : public virtual ::apache::thrift::TBase { + public: + + TBinaryColumn(const TBinaryColumn&); + TBinaryColumn& operator=(const TBinaryColumn&); + TBinaryColumn() : nulls() { + } + + virtual ~TBinaryColumn() throw(); + std::vector values; + std::string nulls; + + void __set_values(const std::vector & val); + + void __set_nulls(const std::string& val); + + bool operator == (const TBinaryColumn & rhs) const + { + if (!(values == rhs.values)) + return false; + if (!(nulls == rhs.nulls)) + return false; + return true; + } + bool operator != (const TBinaryColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TBinaryColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TBinaryColumn &a, TBinaryColumn &b); + +std::ostream& operator<<(std::ostream& out, const TBinaryColumn& obj); + +typedef struct _TColumn__isset { + _TColumn__isset() : boolVal(false), byteVal(false), i16Val(false), i32Val(false), i64Val(false), doubleVal(false), stringVal(false), binaryVal(false) {} + bool boolVal :1; + bool byteVal :1; + bool i16Val :1; + bool i32Val :1; + bool i64Val :1; + bool doubleVal :1; + bool stringVal :1; + bool binaryVal :1; +} _TColumn__isset; + +class TColumn : public virtual ::apache::thrift::TBase { + public: + + TColumn(const TColumn&); + TColumn& operator=(const TColumn&); + TColumn() { + } + + virtual ~TColumn() throw(); + TBoolColumn boolVal; + TByteColumn byteVal; + TI16Column i16Val; + TI32Column i32Val; + TI64Column i64Val; + TDoubleColumn doubleVal; + TStringColumn stringVal; + TBinaryColumn binaryVal; + + _TColumn__isset __isset; + + void __set_boolVal(const TBoolColumn& val); + + void __set_byteVal(const TByteColumn& val); + + void __set_i16Val(const TI16Column& val); + + void __set_i32Val(const TI32Column& val); + + void __set_i64Val(const TI64Column& val); + + void __set_doubleVal(const TDoubleColumn& val); + + void __set_stringVal(const TStringColumn& val); + + void __set_binaryVal(const TBinaryColumn& val); + + bool operator == (const TColumn & rhs) const + { + if (__isset.boolVal != rhs.__isset.boolVal) + return false; + else if (__isset.boolVal && !(boolVal == rhs.boolVal)) + return false; + if (__isset.byteVal != rhs.__isset.byteVal) + return false; + else if (__isset.byteVal && !(byteVal == rhs.byteVal)) + return false; + if (__isset.i16Val != rhs.__isset.i16Val) + return false; + else if (__isset.i16Val && !(i16Val == rhs.i16Val)) + return false; + if (__isset.i32Val != rhs.__isset.i32Val) + return false; + else if (__isset.i32Val && !(i32Val == rhs.i32Val)) + return false; + if (__isset.i64Val != rhs.__isset.i64Val) + return false; + else if (__isset.i64Val && !(i64Val == rhs.i64Val)) + return false; + if (__isset.doubleVal != rhs.__isset.doubleVal) + return false; + else if (__isset.doubleVal && !(doubleVal == rhs.doubleVal)) + return false; + if (__isset.stringVal != rhs.__isset.stringVal) + return false; + else if (__isset.stringVal && !(stringVal == rhs.stringVal)) + return false; + if (__isset.binaryVal != rhs.__isset.binaryVal) + return false; + else if (__isset.binaryVal && !(binaryVal == rhs.binaryVal)) + return false; + return true; + } + bool operator != (const TColumn &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TColumn & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TColumn &a, TColumn &b); + +std::ostream& operator<<(std::ostream& out, const TColumn& obj); + +typedef struct _TRowSet__isset { + _TRowSet__isset() : columns(false), binaryColumns(false), columnCount(false) {} + bool columns :1; + bool binaryColumns :1; + bool columnCount :1; +} _TRowSet__isset; + +class TRowSet : public virtual ::apache::thrift::TBase { + public: + + TRowSet(const TRowSet&); + TRowSet& operator=(const TRowSet&); + TRowSet() : startRowOffset(0), binaryColumns(), columnCount(0) { + } + + virtual ~TRowSet() throw(); + int64_t startRowOffset; + std::vector rows; + std::vector columns; + std::string binaryColumns; + int32_t columnCount; + + _TRowSet__isset __isset; + + void __set_startRowOffset(const int64_t val); + + void __set_rows(const std::vector & val); + + void __set_columns(const std::vector & val); + + void __set_binaryColumns(const std::string& val); + + void __set_columnCount(const int32_t val); + + bool operator == (const TRowSet & rhs) const + { + if (!(startRowOffset == rhs.startRowOffset)) + return false; + if (!(rows == rhs.rows)) + return false; + if (__isset.columns != rhs.__isset.columns) + return false; + else if (__isset.columns && !(columns == rhs.columns)) + return false; + if (__isset.binaryColumns != rhs.__isset.binaryColumns) + return false; + else if (__isset.binaryColumns && !(binaryColumns == rhs.binaryColumns)) + return false; + if (__isset.columnCount != rhs.__isset.columnCount) + return false; + else if (__isset.columnCount && !(columnCount == rhs.columnCount)) + return false; + return true; + } + bool operator != (const TRowSet &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TRowSet & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TRowSet &a, TRowSet &b); + +std::ostream& operator<<(std::ostream& out, const TRowSet& obj); + +typedef struct _TStatus__isset { + _TStatus__isset() : infoMessages(false), sqlState(false), errorCode(false), errorMessage(false) {} + bool infoMessages :1; + bool sqlState :1; + bool errorCode :1; + bool errorMessage :1; +} _TStatus__isset; + +class TStatus : public virtual ::apache::thrift::TBase { + public: + + TStatus(const TStatus&); + TStatus& operator=(const TStatus&); + TStatus() : statusCode((TStatusCode::type)0), sqlState(), errorCode(0), errorMessage() { + } + + virtual ~TStatus() throw(); + TStatusCode::type statusCode; + std::vector infoMessages; + std::string sqlState; + int32_t errorCode; + std::string errorMessage; + + _TStatus__isset __isset; + + void __set_statusCode(const TStatusCode::type val); + + void __set_infoMessages(const std::vector & val); + + void __set_sqlState(const std::string& val); + + void __set_errorCode(const int32_t val); + + void __set_errorMessage(const std::string& val); + + bool operator == (const TStatus & rhs) const + { + if (!(statusCode == rhs.statusCode)) + return false; + if (__isset.infoMessages != rhs.__isset.infoMessages) + return false; + else if (__isset.infoMessages && !(infoMessages == rhs.infoMessages)) + return false; + if (__isset.sqlState != rhs.__isset.sqlState) + return false; + else if (__isset.sqlState && !(sqlState == rhs.sqlState)) + return false; + if (__isset.errorCode != rhs.__isset.errorCode) + return false; + else if (__isset.errorCode && !(errorCode == rhs.errorCode)) + return false; + if (__isset.errorMessage != rhs.__isset.errorMessage) + return false; + else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) + return false; + return true; + } + bool operator != (const TStatus &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TStatus & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TStatus &a, TStatus &b); + +std::ostream& operator<<(std::ostream& out, const TStatus& obj); + + +class THandleIdentifier : public virtual ::apache::thrift::TBase { + public: + + THandleIdentifier(const THandleIdentifier&); + THandleIdentifier& operator=(const THandleIdentifier&); + THandleIdentifier() : guid(), secret() { + } + + virtual ~THandleIdentifier() throw(); + std::string guid; + std::string secret; + + void __set_guid(const std::string& val); + + void __set_secret(const std::string& val); + + bool operator == (const THandleIdentifier & rhs) const + { + if (!(guid == rhs.guid)) + return false; + if (!(secret == rhs.secret)) + return false; + return true; + } + bool operator != (const THandleIdentifier &rhs) const { + return !(*this == rhs); + } + + bool operator < (const THandleIdentifier & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(THandleIdentifier &a, THandleIdentifier &b); + +std::ostream& operator<<(std::ostream& out, const THandleIdentifier& obj); + + +class TSessionHandle : public virtual ::apache::thrift::TBase { + public: + + TSessionHandle(const TSessionHandle&); + TSessionHandle& operator=(const TSessionHandle&); + TSessionHandle() { + } + + virtual ~TSessionHandle() throw(); + THandleIdentifier sessionId; + + void __set_sessionId(const THandleIdentifier& val); + + bool operator == (const TSessionHandle & rhs) const + { + if (!(sessionId == rhs.sessionId)) + return false; + return true; + } + bool operator != (const TSessionHandle &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TSessionHandle & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TSessionHandle &a, TSessionHandle &b); + +std::ostream& operator<<(std::ostream& out, const TSessionHandle& obj); + +typedef struct _TOperationHandle__isset { + _TOperationHandle__isset() : modifiedRowCount(false) {} + bool modifiedRowCount :1; +} _TOperationHandle__isset; + +class TOperationHandle : public virtual ::apache::thrift::TBase { + public: + + TOperationHandle(const TOperationHandle&); + TOperationHandle& operator=(const TOperationHandle&); + TOperationHandle() : operationType((TOperationType::type)0), hasResultSet(0), modifiedRowCount(0) { + } + + virtual ~TOperationHandle() throw(); + THandleIdentifier operationId; + TOperationType::type operationType; + bool hasResultSet; + double modifiedRowCount; + + _TOperationHandle__isset __isset; + + void __set_operationId(const THandleIdentifier& val); + + void __set_operationType(const TOperationType::type val); + + void __set_hasResultSet(const bool val); + + void __set_modifiedRowCount(const double val); + + bool operator == (const TOperationHandle & rhs) const + { + if (!(operationId == rhs.operationId)) + return false; + if (!(operationType == rhs.operationType)) + return false; + if (!(hasResultSet == rhs.hasResultSet)) + return false; + if (__isset.modifiedRowCount != rhs.__isset.modifiedRowCount) + return false; + else if (__isset.modifiedRowCount && !(modifiedRowCount == rhs.modifiedRowCount)) + return false; + return true; + } + bool operator != (const TOperationHandle &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TOperationHandle & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TOperationHandle &a, TOperationHandle &b); + +std::ostream& operator<<(std::ostream& out, const TOperationHandle& obj); + +typedef struct _TOpenSessionReq__isset { + _TOpenSessionReq__isset() : username(false), password(false), configuration(false) {} + bool username :1; + bool password :1; + bool configuration :1; +} _TOpenSessionReq__isset; + +class TOpenSessionReq : public virtual ::apache::thrift::TBase { + public: + + TOpenSessionReq(const TOpenSessionReq&); + TOpenSessionReq& operator=(const TOpenSessionReq&); + TOpenSessionReq() : client_protocol((TProtocolVersion::type)9), username(), password() { + client_protocol = (TProtocolVersion::type)9; + + } + + virtual ~TOpenSessionReq() throw(); + TProtocolVersion::type client_protocol; + std::string username; + std::string password; + std::map configuration; + + _TOpenSessionReq__isset __isset; + + void __set_client_protocol(const TProtocolVersion::type val); + + void __set_username(const std::string& val); + + void __set_password(const std::string& val); + + void __set_configuration(const std::map & val); + + bool operator == (const TOpenSessionReq & rhs) const + { + if (!(client_protocol == rhs.client_protocol)) + return false; + if (__isset.username != rhs.__isset.username) + return false; + else if (__isset.username && !(username == rhs.username)) + return false; + if (__isset.password != rhs.__isset.password) + return false; + else if (__isset.password && !(password == rhs.password)) + return false; + if (__isset.configuration != rhs.__isset.configuration) + return false; + else if (__isset.configuration && !(configuration == rhs.configuration)) + return false; + return true; + } + bool operator != (const TOpenSessionReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TOpenSessionReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TOpenSessionReq &a, TOpenSessionReq &b); + +std::ostream& operator<<(std::ostream& out, const TOpenSessionReq& obj); + +typedef struct _TOpenSessionResp__isset { + _TOpenSessionResp__isset() : sessionHandle(false), configuration(false) {} + bool sessionHandle :1; + bool configuration :1; +} _TOpenSessionResp__isset; + +class TOpenSessionResp : public virtual ::apache::thrift::TBase { + public: + + TOpenSessionResp(const TOpenSessionResp&); + TOpenSessionResp& operator=(const TOpenSessionResp&); + TOpenSessionResp() : serverProtocolVersion((TProtocolVersion::type)9) { + serverProtocolVersion = (TProtocolVersion::type)9; + + } + + virtual ~TOpenSessionResp() throw(); + TStatus status; + TProtocolVersion::type serverProtocolVersion; + TSessionHandle sessionHandle; + std::map configuration; + + _TOpenSessionResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_serverProtocolVersion(const TProtocolVersion::type val); + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_configuration(const std::map & val); + + bool operator == (const TOpenSessionResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (!(serverProtocolVersion == rhs.serverProtocolVersion)) + return false; + if (__isset.sessionHandle != rhs.__isset.sessionHandle) + return false; + else if (__isset.sessionHandle && !(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.configuration != rhs.__isset.configuration) + return false; + else if (__isset.configuration && !(configuration == rhs.configuration)) + return false; + return true; + } + bool operator != (const TOpenSessionResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TOpenSessionResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TOpenSessionResp &a, TOpenSessionResp &b); + +std::ostream& operator<<(std::ostream& out, const TOpenSessionResp& obj); + +typedef struct _TSetClientInfoReq__isset { + _TSetClientInfoReq__isset() : configuration(false) {} + bool configuration :1; +} _TSetClientInfoReq__isset; + +class TSetClientInfoReq : public virtual ::apache::thrift::TBase { + public: + + TSetClientInfoReq(const TSetClientInfoReq&); + TSetClientInfoReq& operator=(const TSetClientInfoReq&); + TSetClientInfoReq() { + } + + virtual ~TSetClientInfoReq() throw(); + TSessionHandle sessionHandle; + std::map configuration; + + _TSetClientInfoReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_configuration(const std::map & val); + + bool operator == (const TSetClientInfoReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.configuration != rhs.__isset.configuration) + return false; + else if (__isset.configuration && !(configuration == rhs.configuration)) + return false; + return true; + } + bool operator != (const TSetClientInfoReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TSetClientInfoReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TSetClientInfoReq &a, TSetClientInfoReq &b); + +std::ostream& operator<<(std::ostream& out, const TSetClientInfoReq& obj); + + +class TSetClientInfoResp : public virtual ::apache::thrift::TBase { + public: + + TSetClientInfoResp(const TSetClientInfoResp&); + TSetClientInfoResp& operator=(const TSetClientInfoResp&); + TSetClientInfoResp() { + } + + virtual ~TSetClientInfoResp() throw(); + TStatus status; + + void __set_status(const TStatus& val); + + bool operator == (const TSetClientInfoResp & rhs) const + { + if (!(status == rhs.status)) + return false; + return true; + } + bool operator != (const TSetClientInfoResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TSetClientInfoResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TSetClientInfoResp &a, TSetClientInfoResp &b); + +std::ostream& operator<<(std::ostream& out, const TSetClientInfoResp& obj); + + +class TCloseSessionReq : public virtual ::apache::thrift::TBase { + public: + + TCloseSessionReq(const TCloseSessionReq&); + TCloseSessionReq& operator=(const TCloseSessionReq&); + TCloseSessionReq() { + } + + virtual ~TCloseSessionReq() throw(); + TSessionHandle sessionHandle; + + void __set_sessionHandle(const TSessionHandle& val); + + bool operator == (const TCloseSessionReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + return true; + } + bool operator != (const TCloseSessionReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCloseSessionReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCloseSessionReq &a, TCloseSessionReq &b); + +std::ostream& operator<<(std::ostream& out, const TCloseSessionReq& obj); + + +class TCloseSessionResp : public virtual ::apache::thrift::TBase { + public: + + TCloseSessionResp(const TCloseSessionResp&); + TCloseSessionResp& operator=(const TCloseSessionResp&); + TCloseSessionResp() { + } + + virtual ~TCloseSessionResp() throw(); + TStatus status; + + void __set_status(const TStatus& val); + + bool operator == (const TCloseSessionResp & rhs) const + { + if (!(status == rhs.status)) + return false; + return true; + } + bool operator != (const TCloseSessionResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCloseSessionResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCloseSessionResp &a, TCloseSessionResp &b); + +std::ostream& operator<<(std::ostream& out, const TCloseSessionResp& obj); + +typedef struct _TGetInfoValue__isset { + _TGetInfoValue__isset() : stringValue(false), smallIntValue(false), integerBitmask(false), integerFlag(false), binaryValue(false), lenValue(false) {} + bool stringValue :1; + bool smallIntValue :1; + bool integerBitmask :1; + bool integerFlag :1; + bool binaryValue :1; + bool lenValue :1; +} _TGetInfoValue__isset; + +class TGetInfoValue : public virtual ::apache::thrift::TBase { + public: + + TGetInfoValue(const TGetInfoValue&); + TGetInfoValue& operator=(const TGetInfoValue&); + TGetInfoValue() : stringValue(), smallIntValue(0), integerBitmask(0), integerFlag(0), binaryValue(0), lenValue(0) { + } + + virtual ~TGetInfoValue() throw(); + std::string stringValue; + int16_t smallIntValue; + int32_t integerBitmask; + int32_t integerFlag; + int32_t binaryValue; + int64_t lenValue; + + _TGetInfoValue__isset __isset; + + void __set_stringValue(const std::string& val); + + void __set_smallIntValue(const int16_t val); + + void __set_integerBitmask(const int32_t val); + + void __set_integerFlag(const int32_t val); + + void __set_binaryValue(const int32_t val); + + void __set_lenValue(const int64_t val); + + bool operator == (const TGetInfoValue & rhs) const + { + if (__isset.stringValue != rhs.__isset.stringValue) + return false; + else if (__isset.stringValue && !(stringValue == rhs.stringValue)) + return false; + if (__isset.smallIntValue != rhs.__isset.smallIntValue) + return false; + else if (__isset.smallIntValue && !(smallIntValue == rhs.smallIntValue)) + return false; + if (__isset.integerBitmask != rhs.__isset.integerBitmask) + return false; + else if (__isset.integerBitmask && !(integerBitmask == rhs.integerBitmask)) + return false; + if (__isset.integerFlag != rhs.__isset.integerFlag) + return false; + else if (__isset.integerFlag && !(integerFlag == rhs.integerFlag)) + return false; + if (__isset.binaryValue != rhs.__isset.binaryValue) + return false; + else if (__isset.binaryValue && !(binaryValue == rhs.binaryValue)) + return false; + if (__isset.lenValue != rhs.__isset.lenValue) + return false; + else if (__isset.lenValue && !(lenValue == rhs.lenValue)) + return false; + return true; + } + bool operator != (const TGetInfoValue &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetInfoValue & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetInfoValue &a, TGetInfoValue &b); + +std::ostream& operator<<(std::ostream& out, const TGetInfoValue& obj); + + +class TGetInfoReq : public virtual ::apache::thrift::TBase { + public: + + TGetInfoReq(const TGetInfoReq&); + TGetInfoReq& operator=(const TGetInfoReq&); + TGetInfoReq() : infoType((TGetInfoType::type)0) { + } + + virtual ~TGetInfoReq() throw(); + TSessionHandle sessionHandle; + TGetInfoType::type infoType; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_infoType(const TGetInfoType::type val); + + bool operator == (const TGetInfoReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (!(infoType == rhs.infoType)) + return false; + return true; + } + bool operator != (const TGetInfoReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetInfoReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetInfoReq &a, TGetInfoReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetInfoReq& obj); + + +class TGetInfoResp : public virtual ::apache::thrift::TBase { + public: + + TGetInfoResp(const TGetInfoResp&); + TGetInfoResp& operator=(const TGetInfoResp&); + TGetInfoResp() { + } + + virtual ~TGetInfoResp() throw(); + TStatus status; + TGetInfoValue infoValue; + + void __set_status(const TStatus& val); + + void __set_infoValue(const TGetInfoValue& val); + + bool operator == (const TGetInfoResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (!(infoValue == rhs.infoValue)) + return false; + return true; + } + bool operator != (const TGetInfoResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetInfoResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetInfoResp &a, TGetInfoResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetInfoResp& obj); + +typedef struct _TExecuteStatementReq__isset { + _TExecuteStatementReq__isset() : confOverlay(false), runAsync(true), queryTimeout(true) {} + bool confOverlay :1; + bool runAsync :1; + bool queryTimeout :1; +} _TExecuteStatementReq__isset; + +class TExecuteStatementReq : public virtual ::apache::thrift::TBase { + public: + + TExecuteStatementReq(const TExecuteStatementReq&); + TExecuteStatementReq& operator=(const TExecuteStatementReq&); + TExecuteStatementReq() : statement(), runAsync(false), queryTimeout(0LL) { + } + + virtual ~TExecuteStatementReq() throw(); + TSessionHandle sessionHandle; + std::string statement; + std::map confOverlay; + bool runAsync; + int64_t queryTimeout; + + _TExecuteStatementReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_statement(const std::string& val); + + void __set_confOverlay(const std::map & val); + + void __set_runAsync(const bool val); + + void __set_queryTimeout(const int64_t val); + + bool operator == (const TExecuteStatementReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (!(statement == rhs.statement)) + return false; + if (__isset.confOverlay != rhs.__isset.confOverlay) + return false; + else if (__isset.confOverlay && !(confOverlay == rhs.confOverlay)) + return false; + if (__isset.runAsync != rhs.__isset.runAsync) + return false; + else if (__isset.runAsync && !(runAsync == rhs.runAsync)) + return false; + if (__isset.queryTimeout != rhs.__isset.queryTimeout) + return false; + else if (__isset.queryTimeout && !(queryTimeout == rhs.queryTimeout)) + return false; + return true; + } + bool operator != (const TExecuteStatementReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TExecuteStatementReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TExecuteStatementReq &a, TExecuteStatementReq &b); + +std::ostream& operator<<(std::ostream& out, const TExecuteStatementReq& obj); + +typedef struct _TExecuteStatementResp__isset { + _TExecuteStatementResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TExecuteStatementResp__isset; + +class TExecuteStatementResp : public virtual ::apache::thrift::TBase { + public: + + TExecuteStatementResp(const TExecuteStatementResp&); + TExecuteStatementResp& operator=(const TExecuteStatementResp&); + TExecuteStatementResp() { + } + + virtual ~TExecuteStatementResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TExecuteStatementResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TExecuteStatementResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TExecuteStatementResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TExecuteStatementResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TExecuteStatementResp &a, TExecuteStatementResp &b); + +std::ostream& operator<<(std::ostream& out, const TExecuteStatementResp& obj); + + +class TGetTypeInfoReq : public virtual ::apache::thrift::TBase { + public: + + TGetTypeInfoReq(const TGetTypeInfoReq&); + TGetTypeInfoReq& operator=(const TGetTypeInfoReq&); + TGetTypeInfoReq() { + } + + virtual ~TGetTypeInfoReq() throw(); + TSessionHandle sessionHandle; + + void __set_sessionHandle(const TSessionHandle& val); + + bool operator == (const TGetTypeInfoReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + return true; + } + bool operator != (const TGetTypeInfoReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetTypeInfoReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetTypeInfoReq &a, TGetTypeInfoReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetTypeInfoReq& obj); + +typedef struct _TGetTypeInfoResp__isset { + _TGetTypeInfoResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetTypeInfoResp__isset; + +class TGetTypeInfoResp : public virtual ::apache::thrift::TBase { + public: + + TGetTypeInfoResp(const TGetTypeInfoResp&); + TGetTypeInfoResp& operator=(const TGetTypeInfoResp&); + TGetTypeInfoResp() { + } + + virtual ~TGetTypeInfoResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetTypeInfoResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetTypeInfoResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetTypeInfoResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetTypeInfoResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetTypeInfoResp &a, TGetTypeInfoResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetTypeInfoResp& obj); + + +class TGetCatalogsReq : public virtual ::apache::thrift::TBase { + public: + + TGetCatalogsReq(const TGetCatalogsReq&); + TGetCatalogsReq& operator=(const TGetCatalogsReq&); + TGetCatalogsReq() { + } + + virtual ~TGetCatalogsReq() throw(); + TSessionHandle sessionHandle; + + void __set_sessionHandle(const TSessionHandle& val); + + bool operator == (const TGetCatalogsReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + return true; + } + bool operator != (const TGetCatalogsReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetCatalogsReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetCatalogsReq &a, TGetCatalogsReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetCatalogsReq& obj); + +typedef struct _TGetCatalogsResp__isset { + _TGetCatalogsResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetCatalogsResp__isset; + +class TGetCatalogsResp : public virtual ::apache::thrift::TBase { + public: + + TGetCatalogsResp(const TGetCatalogsResp&); + TGetCatalogsResp& operator=(const TGetCatalogsResp&); + TGetCatalogsResp() { + } + + virtual ~TGetCatalogsResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetCatalogsResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetCatalogsResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetCatalogsResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetCatalogsResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetCatalogsResp &a, TGetCatalogsResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetCatalogsResp& obj); + +typedef struct _TGetSchemasReq__isset { + _TGetSchemasReq__isset() : catalogName(false), schemaName(false) {} + bool catalogName :1; + bool schemaName :1; +} _TGetSchemasReq__isset; + +class TGetSchemasReq : public virtual ::apache::thrift::TBase { + public: + + TGetSchemasReq(const TGetSchemasReq&); + TGetSchemasReq& operator=(const TGetSchemasReq&); + TGetSchemasReq() : catalogName(), schemaName() { + } + + virtual ~TGetSchemasReq() throw(); + TSessionHandle sessionHandle; + TIdentifier catalogName; + TPatternOrIdentifier schemaName; + + _TGetSchemasReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_catalogName(const TIdentifier& val); + + void __set_schemaName(const TPatternOrIdentifier& val); + + bool operator == (const TGetSchemasReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.schemaName != rhs.__isset.schemaName) + return false; + else if (__isset.schemaName && !(schemaName == rhs.schemaName)) + return false; + return true; + } + bool operator != (const TGetSchemasReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetSchemasReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetSchemasReq &a, TGetSchemasReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetSchemasReq& obj); + +typedef struct _TGetSchemasResp__isset { + _TGetSchemasResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetSchemasResp__isset; + +class TGetSchemasResp : public virtual ::apache::thrift::TBase { + public: + + TGetSchemasResp(const TGetSchemasResp&); + TGetSchemasResp& operator=(const TGetSchemasResp&); + TGetSchemasResp() { + } + + virtual ~TGetSchemasResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetSchemasResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetSchemasResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetSchemasResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetSchemasResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetSchemasResp &a, TGetSchemasResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetSchemasResp& obj); + +typedef struct _TGetTablesReq__isset { + _TGetTablesReq__isset() : catalogName(false), schemaName(false), tableName(false), tableTypes(false) {} + bool catalogName :1; + bool schemaName :1; + bool tableName :1; + bool tableTypes :1; +} _TGetTablesReq__isset; + +class TGetTablesReq : public virtual ::apache::thrift::TBase { + public: + + TGetTablesReq(const TGetTablesReq&); + TGetTablesReq& operator=(const TGetTablesReq&); + TGetTablesReq() : catalogName(), schemaName(), tableName() { + } + + virtual ~TGetTablesReq() throw(); + TSessionHandle sessionHandle; + TPatternOrIdentifier catalogName; + TPatternOrIdentifier schemaName; + TPatternOrIdentifier tableName; + std::vector tableTypes; + + _TGetTablesReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_catalogName(const TPatternOrIdentifier& val); + + void __set_schemaName(const TPatternOrIdentifier& val); + + void __set_tableName(const TPatternOrIdentifier& val); + + void __set_tableTypes(const std::vector & val); + + bool operator == (const TGetTablesReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.schemaName != rhs.__isset.schemaName) + return false; + else if (__isset.schemaName && !(schemaName == rhs.schemaName)) + return false; + if (__isset.tableName != rhs.__isset.tableName) + return false; + else if (__isset.tableName && !(tableName == rhs.tableName)) + return false; + if (__isset.tableTypes != rhs.__isset.tableTypes) + return false; + else if (__isset.tableTypes && !(tableTypes == rhs.tableTypes)) + return false; + return true; + } + bool operator != (const TGetTablesReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetTablesReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetTablesReq &a, TGetTablesReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetTablesReq& obj); + +typedef struct _TGetTablesResp__isset { + _TGetTablesResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetTablesResp__isset; + +class TGetTablesResp : public virtual ::apache::thrift::TBase { + public: + + TGetTablesResp(const TGetTablesResp&); + TGetTablesResp& operator=(const TGetTablesResp&); + TGetTablesResp() { + } + + virtual ~TGetTablesResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetTablesResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetTablesResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetTablesResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetTablesResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetTablesResp &a, TGetTablesResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetTablesResp& obj); + + +class TGetTableTypesReq : public virtual ::apache::thrift::TBase { + public: + + TGetTableTypesReq(const TGetTableTypesReq&); + TGetTableTypesReq& operator=(const TGetTableTypesReq&); + TGetTableTypesReq() { + } + + virtual ~TGetTableTypesReq() throw(); + TSessionHandle sessionHandle; + + void __set_sessionHandle(const TSessionHandle& val); + + bool operator == (const TGetTableTypesReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + return true; + } + bool operator != (const TGetTableTypesReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetTableTypesReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetTableTypesReq &a, TGetTableTypesReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetTableTypesReq& obj); + +typedef struct _TGetTableTypesResp__isset { + _TGetTableTypesResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetTableTypesResp__isset; + +class TGetTableTypesResp : public virtual ::apache::thrift::TBase { + public: + + TGetTableTypesResp(const TGetTableTypesResp&); + TGetTableTypesResp& operator=(const TGetTableTypesResp&); + TGetTableTypesResp() { + } + + virtual ~TGetTableTypesResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetTableTypesResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetTableTypesResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetTableTypesResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetTableTypesResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetTableTypesResp &a, TGetTableTypesResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetTableTypesResp& obj); + +typedef struct _TGetColumnsReq__isset { + _TGetColumnsReq__isset() : catalogName(false), schemaName(false), tableName(false), columnName(false) {} + bool catalogName :1; + bool schemaName :1; + bool tableName :1; + bool columnName :1; +} _TGetColumnsReq__isset; + +class TGetColumnsReq : public virtual ::apache::thrift::TBase { + public: + + TGetColumnsReq(const TGetColumnsReq&); + TGetColumnsReq& operator=(const TGetColumnsReq&); + TGetColumnsReq() : catalogName(), schemaName(), tableName(), columnName() { + } + + virtual ~TGetColumnsReq() throw(); + TSessionHandle sessionHandle; + TIdentifier catalogName; + TPatternOrIdentifier schemaName; + TPatternOrIdentifier tableName; + TPatternOrIdentifier columnName; + + _TGetColumnsReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_catalogName(const TIdentifier& val); + + void __set_schemaName(const TPatternOrIdentifier& val); + + void __set_tableName(const TPatternOrIdentifier& val); + + void __set_columnName(const TPatternOrIdentifier& val); + + bool operator == (const TGetColumnsReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.schemaName != rhs.__isset.schemaName) + return false; + else if (__isset.schemaName && !(schemaName == rhs.schemaName)) + return false; + if (__isset.tableName != rhs.__isset.tableName) + return false; + else if (__isset.tableName && !(tableName == rhs.tableName)) + return false; + if (__isset.columnName != rhs.__isset.columnName) + return false; + else if (__isset.columnName && !(columnName == rhs.columnName)) + return false; + return true; + } + bool operator != (const TGetColumnsReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetColumnsReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetColumnsReq &a, TGetColumnsReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetColumnsReq& obj); + +typedef struct _TGetColumnsResp__isset { + _TGetColumnsResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetColumnsResp__isset; + +class TGetColumnsResp : public virtual ::apache::thrift::TBase { + public: + + TGetColumnsResp(const TGetColumnsResp&); + TGetColumnsResp& operator=(const TGetColumnsResp&); + TGetColumnsResp() { + } + + virtual ~TGetColumnsResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetColumnsResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetColumnsResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetColumnsResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetColumnsResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetColumnsResp &a, TGetColumnsResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetColumnsResp& obj); + +typedef struct _TGetFunctionsReq__isset { + _TGetFunctionsReq__isset() : catalogName(false), schemaName(false) {} + bool catalogName :1; + bool schemaName :1; +} _TGetFunctionsReq__isset; + +class TGetFunctionsReq : public virtual ::apache::thrift::TBase { + public: + + TGetFunctionsReq(const TGetFunctionsReq&); + TGetFunctionsReq& operator=(const TGetFunctionsReq&); + TGetFunctionsReq() : catalogName(), schemaName(), functionName() { + } + + virtual ~TGetFunctionsReq() throw(); + TSessionHandle sessionHandle; + TIdentifier catalogName; + TPatternOrIdentifier schemaName; + TPatternOrIdentifier functionName; + + _TGetFunctionsReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_catalogName(const TIdentifier& val); + + void __set_schemaName(const TPatternOrIdentifier& val); + + void __set_functionName(const TPatternOrIdentifier& val); + + bool operator == (const TGetFunctionsReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.schemaName != rhs.__isset.schemaName) + return false; + else if (__isset.schemaName && !(schemaName == rhs.schemaName)) + return false; + if (!(functionName == rhs.functionName)) + return false; + return true; + } + bool operator != (const TGetFunctionsReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetFunctionsReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetFunctionsReq &a, TGetFunctionsReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetFunctionsReq& obj); + +typedef struct _TGetFunctionsResp__isset { + _TGetFunctionsResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetFunctionsResp__isset; + +class TGetFunctionsResp : public virtual ::apache::thrift::TBase { + public: + + TGetFunctionsResp(const TGetFunctionsResp&); + TGetFunctionsResp& operator=(const TGetFunctionsResp&); + TGetFunctionsResp() { + } + + virtual ~TGetFunctionsResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetFunctionsResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetFunctionsResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetFunctionsResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetFunctionsResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetFunctionsResp &a, TGetFunctionsResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetFunctionsResp& obj); + +typedef struct _TGetPrimaryKeysReq__isset { + _TGetPrimaryKeysReq__isset() : catalogName(false), schemaName(false), tableName(false) {} + bool catalogName :1; + bool schemaName :1; + bool tableName :1; +} _TGetPrimaryKeysReq__isset; + +class TGetPrimaryKeysReq : public virtual ::apache::thrift::TBase { + public: + + TGetPrimaryKeysReq(const TGetPrimaryKeysReq&); + TGetPrimaryKeysReq& operator=(const TGetPrimaryKeysReq&); + TGetPrimaryKeysReq() : catalogName(), schemaName(), tableName() { + } + + virtual ~TGetPrimaryKeysReq() throw(); + TSessionHandle sessionHandle; + TIdentifier catalogName; + TIdentifier schemaName; + TIdentifier tableName; + + _TGetPrimaryKeysReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_catalogName(const TIdentifier& val); + + void __set_schemaName(const TIdentifier& val); + + void __set_tableName(const TIdentifier& val); + + bool operator == (const TGetPrimaryKeysReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.catalogName != rhs.__isset.catalogName) + return false; + else if (__isset.catalogName && !(catalogName == rhs.catalogName)) + return false; + if (__isset.schemaName != rhs.__isset.schemaName) + return false; + else if (__isset.schemaName && !(schemaName == rhs.schemaName)) + return false; + if (__isset.tableName != rhs.__isset.tableName) + return false; + else if (__isset.tableName && !(tableName == rhs.tableName)) + return false; + return true; + } + bool operator != (const TGetPrimaryKeysReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetPrimaryKeysReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetPrimaryKeysReq &a, TGetPrimaryKeysReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysReq& obj); + +typedef struct _TGetPrimaryKeysResp__isset { + _TGetPrimaryKeysResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetPrimaryKeysResp__isset; + +class TGetPrimaryKeysResp : public virtual ::apache::thrift::TBase { + public: + + TGetPrimaryKeysResp(const TGetPrimaryKeysResp&); + TGetPrimaryKeysResp& operator=(const TGetPrimaryKeysResp&); + TGetPrimaryKeysResp() { + } + + virtual ~TGetPrimaryKeysResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetPrimaryKeysResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetPrimaryKeysResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetPrimaryKeysResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetPrimaryKeysResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetPrimaryKeysResp &a, TGetPrimaryKeysResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysResp& obj); + +typedef struct _TGetCrossReferenceReq__isset { + _TGetCrossReferenceReq__isset() : parentCatalogName(false), parentSchemaName(false), parentTableName(false), foreignCatalogName(false), foreignSchemaName(false), foreignTableName(false) {} + bool parentCatalogName :1; + bool parentSchemaName :1; + bool parentTableName :1; + bool foreignCatalogName :1; + bool foreignSchemaName :1; + bool foreignTableName :1; +} _TGetCrossReferenceReq__isset; + +class TGetCrossReferenceReq : public virtual ::apache::thrift::TBase { + public: + + TGetCrossReferenceReq(const TGetCrossReferenceReq&); + TGetCrossReferenceReq& operator=(const TGetCrossReferenceReq&); + TGetCrossReferenceReq() : parentCatalogName(), parentSchemaName(), parentTableName(), foreignCatalogName(), foreignSchemaName(), foreignTableName() { + } + + virtual ~TGetCrossReferenceReq() throw(); + TSessionHandle sessionHandle; + TIdentifier parentCatalogName; + TIdentifier parentSchemaName; + TIdentifier parentTableName; + TIdentifier foreignCatalogName; + TIdentifier foreignSchemaName; + TIdentifier foreignTableName; + + _TGetCrossReferenceReq__isset __isset; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_parentCatalogName(const TIdentifier& val); + + void __set_parentSchemaName(const TIdentifier& val); + + void __set_parentTableName(const TIdentifier& val); + + void __set_foreignCatalogName(const TIdentifier& val); + + void __set_foreignSchemaName(const TIdentifier& val); + + void __set_foreignTableName(const TIdentifier& val); + + bool operator == (const TGetCrossReferenceReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (__isset.parentCatalogName != rhs.__isset.parentCatalogName) + return false; + else if (__isset.parentCatalogName && !(parentCatalogName == rhs.parentCatalogName)) + return false; + if (__isset.parentSchemaName != rhs.__isset.parentSchemaName) + return false; + else if (__isset.parentSchemaName && !(parentSchemaName == rhs.parentSchemaName)) + return false; + if (__isset.parentTableName != rhs.__isset.parentTableName) + return false; + else if (__isset.parentTableName && !(parentTableName == rhs.parentTableName)) + return false; + if (__isset.foreignCatalogName != rhs.__isset.foreignCatalogName) + return false; + else if (__isset.foreignCatalogName && !(foreignCatalogName == rhs.foreignCatalogName)) + return false; + if (__isset.foreignSchemaName != rhs.__isset.foreignSchemaName) + return false; + else if (__isset.foreignSchemaName && !(foreignSchemaName == rhs.foreignSchemaName)) + return false; + if (__isset.foreignTableName != rhs.__isset.foreignTableName) + return false; + else if (__isset.foreignTableName && !(foreignTableName == rhs.foreignTableName)) + return false; + return true; + } + bool operator != (const TGetCrossReferenceReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetCrossReferenceReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetCrossReferenceReq &a, TGetCrossReferenceReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceReq& obj); + +typedef struct _TGetCrossReferenceResp__isset { + _TGetCrossReferenceResp__isset() : operationHandle(false) {} + bool operationHandle :1; +} _TGetCrossReferenceResp__isset; + +class TGetCrossReferenceResp : public virtual ::apache::thrift::TBase { + public: + + TGetCrossReferenceResp(const TGetCrossReferenceResp&); + TGetCrossReferenceResp& operator=(const TGetCrossReferenceResp&); + TGetCrossReferenceResp() { + } + + virtual ~TGetCrossReferenceResp() throw(); + TStatus status; + TOperationHandle operationHandle; + + _TGetCrossReferenceResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetCrossReferenceResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationHandle != rhs.__isset.operationHandle) + return false; + else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetCrossReferenceResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetCrossReferenceResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetCrossReferenceResp &a, TGetCrossReferenceResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceResp& obj); + +typedef struct _TGetOperationStatusReq__isset { + _TGetOperationStatusReq__isset() : getProgressUpdate(false) {} + bool getProgressUpdate :1; +} _TGetOperationStatusReq__isset; + +class TGetOperationStatusReq : public virtual ::apache::thrift::TBase { + public: + + TGetOperationStatusReq(const TGetOperationStatusReq&); + TGetOperationStatusReq& operator=(const TGetOperationStatusReq&); + TGetOperationStatusReq() : getProgressUpdate(0) { + } + + virtual ~TGetOperationStatusReq() throw(); + TOperationHandle operationHandle; + bool getProgressUpdate; + + _TGetOperationStatusReq__isset __isset; + + void __set_operationHandle(const TOperationHandle& val); + + void __set_getProgressUpdate(const bool val); + + bool operator == (const TGetOperationStatusReq & rhs) const + { + if (!(operationHandle == rhs.operationHandle)) + return false; + if (__isset.getProgressUpdate != rhs.__isset.getProgressUpdate) + return false; + else if (__isset.getProgressUpdate && !(getProgressUpdate == rhs.getProgressUpdate)) + return false; + return true; + } + bool operator != (const TGetOperationStatusReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetOperationStatusReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetOperationStatusReq &a, TGetOperationStatusReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetOperationStatusReq& obj); + +typedef struct _TGetOperationStatusResp__isset { + _TGetOperationStatusResp__isset() : operationState(false), sqlState(false), errorCode(false), errorMessage(false), taskStatus(false), operationStarted(false), operationCompleted(false), hasResultSet(false), progressUpdateResponse(false) {} + bool operationState :1; + bool sqlState :1; + bool errorCode :1; + bool errorMessage :1; + bool taskStatus :1; + bool operationStarted :1; + bool operationCompleted :1; + bool hasResultSet :1; + bool progressUpdateResponse :1; +} _TGetOperationStatusResp__isset; + +class TGetOperationStatusResp : public virtual ::apache::thrift::TBase { + public: + + TGetOperationStatusResp(const TGetOperationStatusResp&); + TGetOperationStatusResp& operator=(const TGetOperationStatusResp&); + TGetOperationStatusResp() : operationState((TOperationState::type)0), sqlState(), errorCode(0), errorMessage(), taskStatus(), operationStarted(0), operationCompleted(0), hasResultSet(0) { + } + + virtual ~TGetOperationStatusResp() throw(); + TStatus status; + TOperationState::type operationState; + std::string sqlState; + int32_t errorCode; + std::string errorMessage; + std::string taskStatus; + int64_t operationStarted; + int64_t operationCompleted; + bool hasResultSet; + TProgressUpdateResp progressUpdateResponse; + + _TGetOperationStatusResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_operationState(const TOperationState::type val); + + void __set_sqlState(const std::string& val); + + void __set_errorCode(const int32_t val); + + void __set_errorMessage(const std::string& val); + + void __set_taskStatus(const std::string& val); + + void __set_operationStarted(const int64_t val); + + void __set_operationCompleted(const int64_t val); + + void __set_hasResultSet(const bool val); + + void __set_progressUpdateResponse(const TProgressUpdateResp& val); + + bool operator == (const TGetOperationStatusResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.operationState != rhs.__isset.operationState) + return false; + else if (__isset.operationState && !(operationState == rhs.operationState)) + return false; + if (__isset.sqlState != rhs.__isset.sqlState) + return false; + else if (__isset.sqlState && !(sqlState == rhs.sqlState)) + return false; + if (__isset.errorCode != rhs.__isset.errorCode) + return false; + else if (__isset.errorCode && !(errorCode == rhs.errorCode)) + return false; + if (__isset.errorMessage != rhs.__isset.errorMessage) + return false; + else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) + return false; + if (__isset.taskStatus != rhs.__isset.taskStatus) + return false; + else if (__isset.taskStatus && !(taskStatus == rhs.taskStatus)) + return false; + if (__isset.operationStarted != rhs.__isset.operationStarted) + return false; + else if (__isset.operationStarted && !(operationStarted == rhs.operationStarted)) + return false; + if (__isset.operationCompleted != rhs.__isset.operationCompleted) + return false; + else if (__isset.operationCompleted && !(operationCompleted == rhs.operationCompleted)) + return false; + if (__isset.hasResultSet != rhs.__isset.hasResultSet) + return false; + else if (__isset.hasResultSet && !(hasResultSet == rhs.hasResultSet)) + return false; + if (__isset.progressUpdateResponse != rhs.__isset.progressUpdateResponse) + return false; + else if (__isset.progressUpdateResponse && !(progressUpdateResponse == rhs.progressUpdateResponse)) + return false; + return true; + } + bool operator != (const TGetOperationStatusResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetOperationStatusResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetOperationStatusResp &a, TGetOperationStatusResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetOperationStatusResp& obj); + + +class TCancelOperationReq : public virtual ::apache::thrift::TBase { + public: + + TCancelOperationReq(const TCancelOperationReq&); + TCancelOperationReq& operator=(const TCancelOperationReq&); + TCancelOperationReq() { + } + + virtual ~TCancelOperationReq() throw(); + TOperationHandle operationHandle; + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TCancelOperationReq & rhs) const + { + if (!(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TCancelOperationReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCancelOperationReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCancelOperationReq &a, TCancelOperationReq &b); + +std::ostream& operator<<(std::ostream& out, const TCancelOperationReq& obj); + + +class TCancelOperationResp : public virtual ::apache::thrift::TBase { + public: + + TCancelOperationResp(const TCancelOperationResp&); + TCancelOperationResp& operator=(const TCancelOperationResp&); + TCancelOperationResp() { + } + + virtual ~TCancelOperationResp() throw(); + TStatus status; + + void __set_status(const TStatus& val); + + bool operator == (const TCancelOperationResp & rhs) const + { + if (!(status == rhs.status)) + return false; + return true; + } + bool operator != (const TCancelOperationResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCancelOperationResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCancelOperationResp &a, TCancelOperationResp &b); + +std::ostream& operator<<(std::ostream& out, const TCancelOperationResp& obj); + + +class TCloseOperationReq : public virtual ::apache::thrift::TBase { + public: + + TCloseOperationReq(const TCloseOperationReq&); + TCloseOperationReq& operator=(const TCloseOperationReq&); + TCloseOperationReq() { + } + + virtual ~TCloseOperationReq() throw(); + TOperationHandle operationHandle; + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TCloseOperationReq & rhs) const + { + if (!(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TCloseOperationReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCloseOperationReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCloseOperationReq &a, TCloseOperationReq &b); + +std::ostream& operator<<(std::ostream& out, const TCloseOperationReq& obj); + + +class TCloseOperationResp : public virtual ::apache::thrift::TBase { + public: + + TCloseOperationResp(const TCloseOperationResp&); + TCloseOperationResp& operator=(const TCloseOperationResp&); + TCloseOperationResp() { + } + + virtual ~TCloseOperationResp() throw(); + TStatus status; + + void __set_status(const TStatus& val); + + bool operator == (const TCloseOperationResp & rhs) const + { + if (!(status == rhs.status)) + return false; + return true; + } + bool operator != (const TCloseOperationResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCloseOperationResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCloseOperationResp &a, TCloseOperationResp &b); + +std::ostream& operator<<(std::ostream& out, const TCloseOperationResp& obj); + + +class TGetResultSetMetadataReq : public virtual ::apache::thrift::TBase { + public: + + TGetResultSetMetadataReq(const TGetResultSetMetadataReq&); + TGetResultSetMetadataReq& operator=(const TGetResultSetMetadataReq&); + TGetResultSetMetadataReq() { + } + + virtual ~TGetResultSetMetadataReq() throw(); + TOperationHandle operationHandle; + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetResultSetMetadataReq & rhs) const + { + if (!(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetResultSetMetadataReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetResultSetMetadataReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetResultSetMetadataReq &a, TGetResultSetMetadataReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataReq& obj); + +typedef struct _TGetResultSetMetadataResp__isset { + _TGetResultSetMetadataResp__isset() : schema(false) {} + bool schema :1; +} _TGetResultSetMetadataResp__isset; + +class TGetResultSetMetadataResp : public virtual ::apache::thrift::TBase { + public: + + TGetResultSetMetadataResp(const TGetResultSetMetadataResp&); + TGetResultSetMetadataResp& operator=(const TGetResultSetMetadataResp&); + TGetResultSetMetadataResp() { + } + + virtual ~TGetResultSetMetadataResp() throw(); + TStatus status; + TTableSchema schema; + + _TGetResultSetMetadataResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_schema(const TTableSchema& val); + + bool operator == (const TGetResultSetMetadataResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.schema != rhs.__isset.schema) + return false; + else if (__isset.schema && !(schema == rhs.schema)) + return false; + return true; + } + bool operator != (const TGetResultSetMetadataResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetResultSetMetadataResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetResultSetMetadataResp &a, TGetResultSetMetadataResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataResp& obj); + +typedef struct _TFetchResultsReq__isset { + _TFetchResultsReq__isset() : fetchType(true) {} + bool fetchType :1; +} _TFetchResultsReq__isset; + +class TFetchResultsReq : public virtual ::apache::thrift::TBase { + public: + + TFetchResultsReq(const TFetchResultsReq&); + TFetchResultsReq& operator=(const TFetchResultsReq&); + TFetchResultsReq() : orientation((TFetchOrientation::type)0), maxRows(0), fetchType(0) { + orientation = (TFetchOrientation::type)0; + + } + + virtual ~TFetchResultsReq() throw(); + TOperationHandle operationHandle; + TFetchOrientation::type orientation; + int64_t maxRows; + int16_t fetchType; + + _TFetchResultsReq__isset __isset; + + void __set_operationHandle(const TOperationHandle& val); + + void __set_orientation(const TFetchOrientation::type val); + + void __set_maxRows(const int64_t val); + + void __set_fetchType(const int16_t val); + + bool operator == (const TFetchResultsReq & rhs) const + { + if (!(operationHandle == rhs.operationHandle)) + return false; + if (!(orientation == rhs.orientation)) + return false; + if (!(maxRows == rhs.maxRows)) + return false; + if (__isset.fetchType != rhs.__isset.fetchType) + return false; + else if (__isset.fetchType && !(fetchType == rhs.fetchType)) + return false; + return true; + } + bool operator != (const TFetchResultsReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TFetchResultsReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TFetchResultsReq &a, TFetchResultsReq &b); + +std::ostream& operator<<(std::ostream& out, const TFetchResultsReq& obj); + +typedef struct _TFetchResultsResp__isset { + _TFetchResultsResp__isset() : hasMoreRows(false), results(false) {} + bool hasMoreRows :1; + bool results :1; +} _TFetchResultsResp__isset; + +class TFetchResultsResp : public virtual ::apache::thrift::TBase { + public: + + TFetchResultsResp(const TFetchResultsResp&); + TFetchResultsResp& operator=(const TFetchResultsResp&); + TFetchResultsResp() : hasMoreRows(0) { + } + + virtual ~TFetchResultsResp() throw(); + TStatus status; + bool hasMoreRows; + TRowSet results; + + _TFetchResultsResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_hasMoreRows(const bool val); + + void __set_results(const TRowSet& val); + + bool operator == (const TFetchResultsResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.hasMoreRows != rhs.__isset.hasMoreRows) + return false; + else if (__isset.hasMoreRows && !(hasMoreRows == rhs.hasMoreRows)) + return false; + if (__isset.results != rhs.__isset.results) + return false; + else if (__isset.results && !(results == rhs.results)) + return false; + return true; + } + bool operator != (const TFetchResultsResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TFetchResultsResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TFetchResultsResp &a, TFetchResultsResp &b); + +std::ostream& operator<<(std::ostream& out, const TFetchResultsResp& obj); + + +class TGetDelegationTokenReq : public virtual ::apache::thrift::TBase { + public: + + TGetDelegationTokenReq(const TGetDelegationTokenReq&); + TGetDelegationTokenReq& operator=(const TGetDelegationTokenReq&); + TGetDelegationTokenReq() : owner(), renewer() { + } + + virtual ~TGetDelegationTokenReq() throw(); + TSessionHandle sessionHandle; + std::string owner; + std::string renewer; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_owner(const std::string& val); + + void __set_renewer(const std::string& val); + + bool operator == (const TGetDelegationTokenReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (!(owner == rhs.owner)) + return false; + if (!(renewer == rhs.renewer)) + return false; + return true; + } + bool operator != (const TGetDelegationTokenReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetDelegationTokenReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetDelegationTokenReq &a, TGetDelegationTokenReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenReq& obj); + +typedef struct _TGetDelegationTokenResp__isset { + _TGetDelegationTokenResp__isset() : delegationToken(false) {} + bool delegationToken :1; +} _TGetDelegationTokenResp__isset; + +class TGetDelegationTokenResp : public virtual ::apache::thrift::TBase { + public: + + TGetDelegationTokenResp(const TGetDelegationTokenResp&); + TGetDelegationTokenResp& operator=(const TGetDelegationTokenResp&); + TGetDelegationTokenResp() : delegationToken() { + } + + virtual ~TGetDelegationTokenResp() throw(); + TStatus status; + std::string delegationToken; + + _TGetDelegationTokenResp__isset __isset; + + void __set_status(const TStatus& val); + + void __set_delegationToken(const std::string& val); + + bool operator == (const TGetDelegationTokenResp & rhs) const + { + if (!(status == rhs.status)) + return false; + if (__isset.delegationToken != rhs.__isset.delegationToken) + return false; + else if (__isset.delegationToken && !(delegationToken == rhs.delegationToken)) + return false; + return true; + } + bool operator != (const TGetDelegationTokenResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetDelegationTokenResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetDelegationTokenResp &a, TGetDelegationTokenResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenResp& obj); + + +class TCancelDelegationTokenReq : public virtual ::apache::thrift::TBase { + public: + + TCancelDelegationTokenReq(const TCancelDelegationTokenReq&); + TCancelDelegationTokenReq& operator=(const TCancelDelegationTokenReq&); + TCancelDelegationTokenReq() : delegationToken() { + } + + virtual ~TCancelDelegationTokenReq() throw(); + TSessionHandle sessionHandle; + std::string delegationToken; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_delegationToken(const std::string& val); + + bool operator == (const TCancelDelegationTokenReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (!(delegationToken == rhs.delegationToken)) + return false; + return true; + } + bool operator != (const TCancelDelegationTokenReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCancelDelegationTokenReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCancelDelegationTokenReq &a, TCancelDelegationTokenReq &b); + +std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenReq& obj); + + +class TCancelDelegationTokenResp : public virtual ::apache::thrift::TBase { + public: + + TCancelDelegationTokenResp(const TCancelDelegationTokenResp&); + TCancelDelegationTokenResp& operator=(const TCancelDelegationTokenResp&); + TCancelDelegationTokenResp() { + } + + virtual ~TCancelDelegationTokenResp() throw(); + TStatus status; + + void __set_status(const TStatus& val); + + bool operator == (const TCancelDelegationTokenResp & rhs) const + { + if (!(status == rhs.status)) + return false; + return true; + } + bool operator != (const TCancelDelegationTokenResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TCancelDelegationTokenResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TCancelDelegationTokenResp &a, TCancelDelegationTokenResp &b); + +std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenResp& obj); + + +class TRenewDelegationTokenReq : public virtual ::apache::thrift::TBase { + public: + + TRenewDelegationTokenReq(const TRenewDelegationTokenReq&); + TRenewDelegationTokenReq& operator=(const TRenewDelegationTokenReq&); + TRenewDelegationTokenReq() : delegationToken() { + } + + virtual ~TRenewDelegationTokenReq() throw(); + TSessionHandle sessionHandle; + std::string delegationToken; + + void __set_sessionHandle(const TSessionHandle& val); + + void __set_delegationToken(const std::string& val); + + bool operator == (const TRenewDelegationTokenReq & rhs) const + { + if (!(sessionHandle == rhs.sessionHandle)) + return false; + if (!(delegationToken == rhs.delegationToken)) + return false; + return true; + } + bool operator != (const TRenewDelegationTokenReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TRenewDelegationTokenReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TRenewDelegationTokenReq &a, TRenewDelegationTokenReq &b); + +std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenReq& obj); + + +class TRenewDelegationTokenResp : public virtual ::apache::thrift::TBase { + public: + + TRenewDelegationTokenResp(const TRenewDelegationTokenResp&); + TRenewDelegationTokenResp& operator=(const TRenewDelegationTokenResp&); + TRenewDelegationTokenResp() { + } + + virtual ~TRenewDelegationTokenResp() throw(); + TStatus status; + + void __set_status(const TStatus& val); + + bool operator == (const TRenewDelegationTokenResp & rhs) const + { + if (!(status == rhs.status)) + return false; + return true; + } + bool operator != (const TRenewDelegationTokenResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TRenewDelegationTokenResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b); + +std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenResp& obj); + + +class TProgressUpdateResp : public virtual ::apache::thrift::TBase { + public: + + TProgressUpdateResp(const TProgressUpdateResp&); + TProgressUpdateResp& operator=(const TProgressUpdateResp&); + TProgressUpdateResp() : progressedPercentage(0), status((TJobExecutionStatus::type)0), footerSummary(), startTime(0) { + } + + virtual ~TProgressUpdateResp() throw(); + std::vector headerNames; + std::vector > rows; + double progressedPercentage; + TJobExecutionStatus::type status; + std::string footerSummary; + int64_t startTime; + + void __set_headerNames(const std::vector & val); + + void __set_rows(const std::vector > & val); + + void __set_progressedPercentage(const double val); + + void __set_status(const TJobExecutionStatus::type val); + + void __set_footerSummary(const std::string& val); + + void __set_startTime(const int64_t val); + + bool operator == (const TProgressUpdateResp & rhs) const + { + if (!(headerNames == rhs.headerNames)) + return false; + if (!(rows == rhs.rows)) + return false; + if (!(progressedPercentage == rhs.progressedPercentage)) + return false; + if (!(status == rhs.status)) + return false; + if (!(footerSummary == rhs.footerSummary)) + return false; + if (!(startTime == rhs.startTime)) + return false; + return true; + } + bool operator != (const TProgressUpdateResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TProgressUpdateResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TProgressUpdateResp &a, TProgressUpdateResp &b); + +std::ostream& operator<<(std::ostream& out, const TProgressUpdateResp& obj); + + +class TGetQueryIdReq : public virtual ::apache::thrift::TBase { + public: + + TGetQueryIdReq(const TGetQueryIdReq&); + TGetQueryIdReq& operator=(const TGetQueryIdReq&); + TGetQueryIdReq() { + } + + virtual ~TGetQueryIdReq() throw(); + TOperationHandle operationHandle; + + void __set_operationHandle(const TOperationHandle& val); + + bool operator == (const TGetQueryIdReq & rhs) const + { + if (!(operationHandle == rhs.operationHandle)) + return false; + return true; + } + bool operator != (const TGetQueryIdReq &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetQueryIdReq & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetQueryIdReq &a, TGetQueryIdReq &b); + +std::ostream& operator<<(std::ostream& out, const TGetQueryIdReq& obj); + + +class TGetQueryIdResp : public virtual ::apache::thrift::TBase { + public: + + TGetQueryIdResp(const TGetQueryIdResp&); + TGetQueryIdResp& operator=(const TGetQueryIdResp&); + TGetQueryIdResp() : queryId() { + } + + virtual ~TGetQueryIdResp() throw(); + std::string queryId; + + void __set_queryId(const std::string& val); + + bool operator == (const TGetQueryIdResp & rhs) const + { + if (!(queryId == rhs.queryId)) + return false; + return true; + } + bool operator != (const TGetQueryIdResp &rhs) const { + return !(*this == rhs); + } + + bool operator < (const TGetQueryIdResp & ) const; + + uint32_t read(::apache::thrift::protocol::TProtocol* iprot); + uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; + + virtual void printTo(std::ostream& out) const; +}; + +void swap(TGetQueryIdResp &a, TGetQueryIdResp &b); + +std::ostream& operator<<(std::ostream& out, const TGetQueryIdResp& obj); + +}}}}} // namespace + +#endif diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java index 50b54a9162b7..8c860e2d016d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java @@ -1,40 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry"); private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TArrayTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TArrayTypeEntryTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TArrayTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TArrayTypeEntryTupleSchemeFactory(); private int objectTypePtr; // required @@ -42,10 +22,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { OBJECT_TYPE_PTR((short)1, "objectTypePtr"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -53,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OBJECT_TYPE_PTR @@ -68,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -91,7 +73,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -99,12 +81,12 @@ public String getFieldName() { // isset id assignments private static final int __OBJECTTYPEPTR_ISSET_ID = 0; private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap); } @@ -147,55 +129,56 @@ public void setObjectTypePtr(int objectTypePtr) { } public void unsetObjectTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); } /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */ public boolean isSetObjectTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); } public void setObjectTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OBJECT_TYPE_PTR: if (value == null) { unsetObjectTypePtr(); } else { - setObjectTypePtr((Integer)value); + setObjectTypePtr((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OBJECT_TYPE_PTR: return getObjectTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case OBJECT_TYPE_PTR: return isSetObjectTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TArrayTypeEntry) @@ -206,6 +189,8 @@ public boolean equals(Object that) { public boolean equals(TArrayTypeEntry that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_objectTypePtr = true; boolean that_present_objectTypePtr = true; @@ -221,14 +206,11 @@ public boolean equals(TArrayTypeEntry that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_objectTypePtr = true; - list.add(present_objectTypePtr); - if (present_objectTypePtr) - list.add(objectTypePtr); + hashCode = hashCode * 8191 + objectTypePtr; - return list.hashCode(); + return hashCode; } @Override @@ -239,7 +221,7 @@ public int compareTo(TArrayTypeEntry other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); + lastComparison = java.lang.Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -252,21 +234,22 @@ public int compareTo(TArrayTypeEntry other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TArrayTypeEntry("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TArrayTypeEntry("); boolean first = true; sb.append("objectTypePtr:"); @@ -293,7 +276,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -303,13 +286,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TArrayTypeEntryStandardSchemeFactory implements SchemeFactory { + private static class TArrayTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TArrayTypeEntryStandardScheme getScheme() { return new TArrayTypeEntryStandardScheme(); } } - private static class TArrayTypeEntryStandardScheme extends StandardScheme { + private static class TArrayTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -351,27 +334,30 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TArrayTypeEntry st } - private static class TArrayTypeEntryTupleSchemeFactory implements SchemeFactory { + private static class TArrayTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TArrayTypeEntryTupleScheme getScheme() { return new TArrayTypeEntryTupleScheme(); } } - private static class TArrayTypeEntryTupleScheme extends TupleScheme { + private static class TArrayTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI32(struct.objectTypePtr); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.objectTypePtr = iprot.readI32(); struct.setObjectTypePtrIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java index e23aa1d5dc5b..592f1609df82 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBinaryColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBinaryColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBinaryColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBinaryColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryColumn.class, metaDataMap); } @@ -119,8 +100,8 @@ public TBinaryColumn() { } public TBinaryColumn( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TBinaryColumn( */ public TBinaryColumn(TBinaryColumn other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } - public void addToValues(ByteBuffer elem) { + public void addToValues(java.nio.ByteBuffer elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TBinaryColumn) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TBinaryColumn that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TBinaryColumn that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TBinaryColumn other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TBinaryColumn other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TBinaryColumn other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBinaryColumn("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TBinaryColumn("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TBinaryColumnStandardSchemeFactory implements SchemeFactory { + private static class TBinaryColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TBinaryColumnStandardScheme getScheme() { return new TBinaryColumnStandardScheme(); } } - private static class TBinaryColumnStandardScheme extends StandardScheme { + private static class TBinaryColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,8 +426,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - struct.values = new ArrayList(_list110.size); - ByteBuffer _elem111; + struct.values = new java.util.ArrayList(_list110.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem111; for (int _i112 = 0; _i112 < _list110.size; ++_i112) { _elem111 = iprot.readBinary(); @@ -476,7 +465,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBinaryColumn stru oprot.writeFieldBegin(VALUES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (ByteBuffer _iter113 : struct.values) + for (java.nio.ByteBuffer _iter113 : struct.values) { oprot.writeBinary(_iter113); } @@ -495,20 +484,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBinaryColumn stru } - private static class TBinaryColumnTupleSchemeFactory implements SchemeFactory { + private static class TBinaryColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TBinaryColumnTupleScheme getScheme() { return new TBinaryColumnTupleScheme(); } } - private static class TBinaryColumnTupleScheme extends TupleScheme { + private static class TBinaryColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); - for (ByteBuffer _iter114 : struct.values) + for (java.nio.ByteBuffer _iter114 : struct.values) { oprot.writeBinary(_iter114); } @@ -518,11 +507,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new ArrayList(_list115.size); - ByteBuffer _elem116; + struct.values = new java.util.ArrayList(_list115.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem116; for (int _i117 = 0; _i117 < _list115.size; ++_i117) { _elem116 = iprot.readBinary(); @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java index c1b0f77cccf5..2ecee7b80d8c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBoolColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBoolColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolColumn.class, metaDataMap); } @@ -119,8 +100,8 @@ public TBoolColumn() { } public TBoolColumn( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TBoolColumn( */ public TBoolColumn(TBoolColumn other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(boolean elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TBoolColumn) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TBoolColumn that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TBoolColumn that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TBoolColumn other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TBoolColumn other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TBoolColumn other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBoolColumn("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolColumn("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TBoolColumnStandardSchemeFactory implements SchemeFactory { + private static class TBoolColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TBoolColumnStandardScheme getScheme() { return new TBoolColumnStandardScheme(); } } - private static class TBoolColumnStandardScheme extends StandardScheme { + private static class TBoolColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,7 +426,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); - struct.values = new ArrayList(_list54.size); + struct.values = new java.util.ArrayList(_list54.size); boolean _elem55; for (int _i56 = 0; _i56 < _list54.size; ++_i56) { @@ -495,17 +484,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolColumn struct } - private static class TBoolColumnTupleSchemeFactory implements SchemeFactory { + private static class TBoolColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TBoolColumnTupleScheme getScheme() { return new TBoolColumnTupleScheme(); } } - private static class TBoolColumnTupleScheme extends TupleScheme { + private static class TBoolColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (boolean _iter58 : struct.values) @@ -518,10 +507,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); - struct.values = new ArrayList(_list59.size); + struct.values = new java.util.ArrayList(_list59.size); boolean _elem60; for (int _i61 = 0; _i61 < _list59.size; ++_i61) { @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java index 4640838ee2f4..b08f37e99546 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java @@ -1,41 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBoolValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBoolValueTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolValueTupleSchemeFactory(); private boolean value; // optional @@ -43,10 +22,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { VALUE((short)1, "value"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -54,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -69,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +73,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -101,12 +82,12 @@ public String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolValue.class, metaDataMap); } @@ -141,55 +122,56 @@ public void setValue(boolean value) { } public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((Boolean)value); + setValue((java.lang.Boolean)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUE: return isValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TBoolValue) @@ -200,6 +182,8 @@ public boolean equals(Object that) { public boolean equals(TBoolValue that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -215,14 +199,13 @@ public boolean equals(TBoolValue that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + ((value) ? 131071 : 524287); - return list.hashCode(); + return hashCode; } @Override @@ -233,7 +216,7 @@ public int compareTo(TBoolValue other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -246,21 +229,22 @@ public int compareTo(TBoolValue other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBoolValue("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolValue("); boolean first = true; if (isSetValue()) { @@ -285,7 +269,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -295,13 +279,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TBoolValueStandardSchemeFactory implements SchemeFactory { + private static class TBoolValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TBoolValueStandardScheme getScheme() { return new TBoolValueStandardScheme(); } } - private static class TBoolValueStandardScheme extends StandardScheme { + private static class TBoolValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -345,18 +329,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolValue struct) } - private static class TBoolValueTupleSchemeFactory implements SchemeFactory { + private static class TBoolValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TBoolValueTupleScheme getScheme() { return new TBoolValueTupleScheme(); } } - private static class TBoolValueTupleScheme extends TupleScheme { + private static class TBoolValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -368,8 +352,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readBool(); struct.setValueIsSet(true); @@ -377,5 +361,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) t } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java index a0a4cfcf049f..d5739c3e00f5 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TByteColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TByteColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteColumn.class, metaDataMap); } @@ -119,8 +100,8 @@ public TByteColumn() { } public TByteColumn( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TByteColumn( */ public TByteColumn(TByteColumn other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(byte elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TByteColumn) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TByteColumn that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TByteColumn that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TByteColumn other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TByteColumn other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TByteColumn other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TByteColumn("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteColumn("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TByteColumnStandardSchemeFactory implements SchemeFactory { + private static class TByteColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TByteColumnStandardScheme getScheme() { return new TByteColumnStandardScheme(); } } - private static class TByteColumnStandardScheme extends StandardScheme { + private static class TByteColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,7 +426,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); - struct.values = new ArrayList(_list62.size); + struct.values = new java.util.ArrayList(_list62.size); byte _elem63; for (int _i64 = 0; _i64 < _list62.size; ++_i64) { @@ -495,17 +484,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TByteColumn struct } - private static class TByteColumnTupleSchemeFactory implements SchemeFactory { + private static class TByteColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TByteColumnTupleScheme getScheme() { return new TByteColumnTupleScheme(); } } - private static class TByteColumnTupleScheme extends TupleScheme { + private static class TByteColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (byte _iter66 : struct.values) @@ -518,10 +507,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); - struct.values = new ArrayList(_list67.size); + struct.values = new java.util.ArrayList(_list67.size); byte _elem68; for (int _i69 = 0; _i69 < _list67.size; ++_i69) { @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java index cc638dc99af8..2c3510ce9258 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java @@ -1,41 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TByteValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TByteValueTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteValueTupleSchemeFactory(); private byte value; // optional @@ -43,10 +22,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { VALUE((short)1, "value"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -54,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -69,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +73,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -101,12 +82,12 @@ public String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteValue.class, metaDataMap); } @@ -141,55 +122,56 @@ public void setValue(byte value) { } public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((Byte)value); + setValue((java.lang.Byte)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TByteValue) @@ -200,6 +182,8 @@ public boolean equals(Object that) { public boolean equals(TByteValue that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -215,14 +199,13 @@ public boolean equals(TByteValue that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + (int) (value); - return list.hashCode(); + return hashCode; } @Override @@ -233,7 +216,7 @@ public int compareTo(TByteValue other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -246,21 +229,22 @@ public int compareTo(TByteValue other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TByteValue("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteValue("); boolean first = true; if (isSetValue()) { @@ -285,7 +269,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -295,13 +279,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TByteValueStandardSchemeFactory implements SchemeFactory { + private static class TByteValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TByteValueStandardScheme getScheme() { return new TByteValueStandardScheme(); } } - private static class TByteValueStandardScheme extends StandardScheme { + private static class TByteValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -345,18 +329,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TByteValue struct) } - private static class TByteValueTupleSchemeFactory implements SchemeFactory { + private static class TByteValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TByteValueTupleScheme getScheme() { return new TByteValueTupleScheme(); } } - private static class TByteValueTupleScheme extends TupleScheme { + private static class TByteValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -368,8 +352,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readByte(); struct.setValueIsSet(true); @@ -377,5 +361,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) t } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java index 35210c081bfc..46a465ca7132 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java @@ -1,37 +1,16 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCLIService { - - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public interface Iface { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCLIService { + + public interface Iface { public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException; @@ -81,58 +60,58 @@ } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public interface AsyncIface { + public interface AsyncIface { - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void ExecuteStatement(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 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; + public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Client extends org.apache.thrift.TServiceClient implements Iface { - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Factory implements org.apache.thrift.TServiceClientFactory { + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { public Factory() {} public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); @@ -681,8 +660,8 @@ public TSetClientInfoResp recv_SetClientInfo() throws org.apache.thrift.TExcepti } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { @@ -698,16 +677,16 @@ public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, super(protocolFactory, clientManager, transport); } - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); OpenSession_call method_call = new OpenSession_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { private TOpenSessionReq req; - public OpenSession_call(TOpenSessionReq 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 { + public OpenSession_call(TOpenSessionReq 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; } @@ -722,7 +701,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TOpenSessionResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -730,16 +709,16 @@ public TOpenSessionResp getResult() throws org.apache.thrift.TException { } } - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { private TCloseSessionReq req; - public CloseSession_call(TCloseSessionReq 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 { + public CloseSession_call(TCloseSessionReq 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; } @@ -754,7 +733,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCloseSessionResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -762,16 +741,16 @@ public TCloseSessionResp getResult() throws org.apache.thrift.TException { } } - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetInfo_call method_call = new GetInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetInfoReq req; - public GetInfo_call(TGetInfoReq 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 { + public GetInfo_call(TGetInfoReq 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; } @@ -786,7 +765,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetInfoResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -794,16 +773,16 @@ public TGetInfoResp getResult() throws org.apache.thrift.TException { } } - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); ExecuteStatement_call method_call = new ExecuteStatement_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { private TExecuteStatementReq req; - public ExecuteStatement_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 { + public ExecuteStatement_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; } @@ -818,7 +797,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TExecuteStatementResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -826,16 +805,16 @@ public TExecuteStatementResp getResult() throws org.apache.thrift.TException { } } - public void GetTypeInfo(TGetTypeInfoReq 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 { checkReady(); GetTypeInfo_call method_call = new GetTypeInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetTypeInfoReq req; - public GetTypeInfo_call(TGetTypeInfoReq 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 { + public GetTypeInfo_call(TGetTypeInfoReq 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; } @@ -850,7 +829,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -858,16 +837,16 @@ public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { } } - public void GetCatalogs(TGetCatalogsReq 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 { checkReady(); GetCatalogs_call method_call = new GetCatalogs_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetCatalogsReq req; - public GetCatalogs_call(TGetCatalogsReq 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 { + public GetCatalogs_call(TGetCatalogsReq 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; } @@ -882,7 +861,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetCatalogsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -890,16 +869,16 @@ public TGetCatalogsResp getResult() throws org.apache.thrift.TException { } } - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetSchemas_call method_call = new GetSchemas_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetSchemasReq req; - public GetSchemas_call(TGetSchemasReq 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 { + public GetSchemas_call(TGetSchemasReq 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; } @@ -914,7 +893,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetSchemasResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -922,16 +901,16 @@ public TGetSchemasResp getResult() throws org.apache.thrift.TException { } } - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetTables_call method_call = new GetTables_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetTablesReq req; - public GetTables_call(TGetTablesReq 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 { + public GetTables_call(TGetTablesReq 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; } @@ -946,7 +925,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetTablesResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -954,16 +933,16 @@ public TGetTablesResp getResult() throws org.apache.thrift.TException { } } - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetTableTypes_call method_call = new GetTableTypes_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetTableTypesReq req; - public GetTableTypes_call(TGetTableTypesReq 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 { + public GetTableTypes_call(TGetTableTypesReq 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; } @@ -978,7 +957,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetTableTypesResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -986,16 +965,16 @@ public TGetTableTypesResp getResult() throws org.apache.thrift.TException { } } - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetColumns_call method_call = new GetColumns_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetColumnsReq req; - public GetColumns_call(TGetColumnsReq 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 { + public GetColumns_call(TGetColumnsReq 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; } @@ -1010,7 +989,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetColumnsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1018,16 +997,16 @@ public TGetColumnsResp getResult() throws org.apache.thrift.TException { } } - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetFunctions_call method_call = new GetFunctions_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetFunctionsReq req; - public GetFunctions_call(TGetFunctionsReq 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 { + public GetFunctions_call(TGetFunctionsReq 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; } @@ -1042,7 +1021,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetFunctionsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1050,16 +1029,16 @@ public TGetFunctionsResp getResult() throws org.apache.thrift.TException { } } - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetPrimaryKeys_call method_call = new GetPrimaryKeys_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetPrimaryKeysReq req; - public GetPrimaryKeys_call(TGetPrimaryKeysReq 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 { + public GetPrimaryKeys_call(TGetPrimaryKeysReq 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; } @@ -1074,7 +1053,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetPrimaryKeysResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1082,16 +1061,16 @@ public TGetPrimaryKeysResp getResult() throws org.apache.thrift.TException { } } - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetCrossReference_call method_call = new GetCrossReference_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetCrossReferenceReq req; - public GetCrossReference_call(TGetCrossReferenceReq 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 { + public GetCrossReference_call(TGetCrossReferenceReq 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; } @@ -1106,7 +1085,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetCrossReferenceResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1114,16 +1093,16 @@ public TGetCrossReferenceResp getResult() throws org.apache.thrift.TException { } } - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetOperationStatus_call method_call = new GetOperationStatus_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetOperationStatusReq req; - public GetOperationStatus_call(TGetOperationStatusReq 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 { + public GetOperationStatus_call(TGetOperationStatusReq 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; } @@ -1138,7 +1117,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1146,16 +1125,16 @@ public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { } } - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CancelOperation_call method_call = new CancelOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { private TCancelOperationReq req; - public CancelOperation_call(TCancelOperationReq 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 { + public CancelOperation_call(TCancelOperationReq 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; } @@ -1170,7 +1149,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCancelOperationResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1178,16 +1157,16 @@ public TCancelOperationResp getResult() throws org.apache.thrift.TException { } } - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CloseOperation_call method_call = new CloseOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { private TCloseOperationReq req; - public CloseOperation_call(TCloseOperationReq 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 { + public CloseOperation_call(TCloseOperationReq 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; } @@ -1202,7 +1181,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCloseOperationResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1210,16 +1189,16 @@ public TCloseOperationResp getResult() throws org.apache.thrift.TException { } } - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetResultSetMetadata_call method_call = new GetResultSetMetadata_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetResultSetMetadataReq req; - public GetResultSetMetadata_call(TGetResultSetMetadataReq 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 { + public GetResultSetMetadata_call(TGetResultSetMetadataReq 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; } @@ -1234,7 +1213,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1242,16 +1221,16 @@ public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException } } - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); FetchResults_call method_call = new FetchResults_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { private TFetchResultsReq req; - public FetchResults_call(TFetchResultsReq 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 { + public FetchResults_call(TFetchResultsReq 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; } @@ -1266,7 +1245,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TFetchResultsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1274,16 +1253,16 @@ public TFetchResultsResp getResult() throws org.apache.thrift.TException { } } - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetDelegationToken_call method_call = new GetDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetDelegationTokenReq req; - public GetDelegationToken_call(TGetDelegationTokenReq 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 { + public GetDelegationToken_call(TGetDelegationTokenReq 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; } @@ -1298,7 +1277,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1306,16 +1285,16 @@ public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { } } - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CancelDelegationToken_call method_call = new CancelDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { private TCancelDelegationTokenReq req; - public CancelDelegationToken_call(TCancelDelegationTokenReq 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 { + public CancelDelegationToken_call(TCancelDelegationTokenReq 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; } @@ -1330,7 +1309,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1338,16 +1317,16 @@ public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TExceptio } } - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); RenewDelegationToken_call method_call = new RenewDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { private TRenewDelegationTokenReq req; - public RenewDelegationToken_call(TRenewDelegationTokenReq 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 { + public RenewDelegationToken_call(TRenewDelegationTokenReq 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; } @@ -1362,7 +1341,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1370,16 +1349,16 @@ public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException } } - public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetQueryId_call method_call = new GetQueryId_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetQueryId_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetQueryIdReq req; - public GetQueryId_call(TGetQueryIdReq 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 { + public GetQueryId_call(TGetQueryIdReq 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; } @@ -1394,7 +1373,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetQueryIdResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1402,16 +1381,16 @@ public TGetQueryIdResp getResult() throws org.apache.thrift.TException { } } - public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); SetClientInfo_call method_call = new SetClientInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class SetClientInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private TSetClientInfoReq req; - public SetClientInfo_call(TSetClientInfoReq 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 { + public SetClientInfo_call(TSetClientInfoReq 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; } @@ -1426,7 +1405,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TSetClientInfoResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); + throw new java.lang.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); @@ -1436,17 +1415,17 @@ public TSetClientInfoResp getResult() throws org.apache.thrift.TException { } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); + super(iface, getProcessMap(new java.util.HashMap>())); } - protected Processor(I iface, Map> processMap) { + protected Processor(I iface, java.util.Map> processMap) { super(iface, getProcessMap(processMap)); } - private static Map> getProcessMap(Map> processMap) { + private static java.util.Map> getProcessMap(java.util.Map> processMap) { processMap.put("OpenSession", new OpenSession()); processMap.put("CloseSession", new CloseSession()); processMap.put("GetInfo", new GetInfo()); @@ -1473,7 +1452,7 @@ protected Processor(I iface, Map extends org.apache.thrift.ProcessFunction { + public static class OpenSession extends org.apache.thrift.ProcessFunction { public OpenSession() { super("OpenSession"); } @@ -1486,6 +1465,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public OpenSession_result getResult(I iface, OpenSession_args args) throws org.apache.thrift.TException { OpenSession_result result = new OpenSession_result(); result.success = iface.OpenSession(args.req); @@ -1493,7 +1477,7 @@ public OpenSession_result getResult(I iface, OpenSession_args args) throws org.a } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession extends org.apache.thrift.ProcessFunction { + public static class CloseSession extends org.apache.thrift.ProcessFunction { public CloseSession() { super("CloseSession"); } @@ -1506,6 +1490,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { CloseSession_result result = new CloseSession_result(); result.success = iface.CloseSession(args.req); @@ -1513,7 +1502,7 @@ public CloseSession_result getResult(I iface, CloseSession_args args) throws org } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo extends org.apache.thrift.ProcessFunction { + public static class GetInfo extends org.apache.thrift.ProcessFunction { public GetInfo() { super("GetInfo"); } @@ -1526,6 +1515,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.thrift.TException { GetInfo_result result = new GetInfo_result(); result.success = iface.GetInfo(args.req); @@ -1533,7 +1527,7 @@ public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.th } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement extends org.apache.thrift.ProcessFunction { + public static class ExecuteStatement extends org.apache.thrift.ProcessFunction { public ExecuteStatement() { super("ExecuteStatement"); } @@ -1546,6 +1540,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) throws org.apache.thrift.TException { ExecuteStatement_result result = new ExecuteStatement_result(); result.success = iface.ExecuteStatement(args.req); @@ -1553,7 +1552,7 @@ public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) th } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { + public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { public GetTypeInfo() { super("GetTypeInfo"); } @@ -1566,6 +1565,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.apache.thrift.TException { GetTypeInfo_result result = new GetTypeInfo_result(); result.success = iface.GetTypeInfo(args.req); @@ -1573,7 +1577,7 @@ public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.a } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs extends org.apache.thrift.ProcessFunction { + public static class GetCatalogs extends org.apache.thrift.ProcessFunction { public GetCatalogs() { super("GetCatalogs"); } @@ -1586,6 +1590,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.apache.thrift.TException { GetCatalogs_result result = new GetCatalogs_result(); result.success = iface.GetCatalogs(args.req); @@ -1593,7 +1602,7 @@ public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.a } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas extends org.apache.thrift.ProcessFunction { + public static class GetSchemas extends org.apache.thrift.ProcessFunction { public GetSchemas() { super("GetSchemas"); } @@ -1606,6 +1615,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apache.thrift.TException { GetSchemas_result result = new GetSchemas_result(); result.success = iface.GetSchemas(args.req); @@ -1613,7 +1627,7 @@ public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apa } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables extends org.apache.thrift.ProcessFunction { + public static class GetTables extends org.apache.thrift.ProcessFunction { public GetTables() { super("GetTables"); } @@ -1626,6 +1640,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetTables_result getResult(I iface, GetTables_args args) throws org.apache.thrift.TException { GetTables_result result = new GetTables_result(); result.success = iface.GetTables(args.req); @@ -1633,7 +1652,7 @@ public GetTables_result getResult(I iface, GetTables_args args) throws org.apach } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes extends org.apache.thrift.ProcessFunction { + public static class GetTableTypes extends org.apache.thrift.ProcessFunction { public GetTableTypes() { super("GetTableTypes"); } @@ -1646,6 +1665,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws org.apache.thrift.TException { GetTableTypes_result result = new GetTableTypes_result(); result.success = iface.GetTableTypes(args.req); @@ -1653,7 +1677,7 @@ public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws o } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns extends org.apache.thrift.ProcessFunction { + public static class GetColumns extends org.apache.thrift.ProcessFunction { public GetColumns() { super("GetColumns"); } @@ -1666,6 +1690,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apache.thrift.TException { GetColumns_result result = new GetColumns_result(); result.success = iface.GetColumns(args.req); @@ -1673,7 +1702,7 @@ public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apa } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions extends org.apache.thrift.ProcessFunction { + public static class GetFunctions extends org.apache.thrift.ProcessFunction { public GetFunctions() { super("GetFunctions"); } @@ -1686,6 +1715,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org.apache.thrift.TException { GetFunctions_result result = new GetFunctions_result(); result.success = iface.GetFunctions(args.req); @@ -1693,7 +1727,7 @@ public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys extends org.apache.thrift.ProcessFunction { + public static class GetPrimaryKeys extends org.apache.thrift.ProcessFunction { public GetPrimaryKeys() { super("GetPrimaryKeys"); } @@ -1706,6 +1740,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetPrimaryKeys_result getResult(I iface, GetPrimaryKeys_args args) throws org.apache.thrift.TException { GetPrimaryKeys_result result = new GetPrimaryKeys_result(); result.success = iface.GetPrimaryKeys(args.req); @@ -1713,7 +1752,7 @@ public GetPrimaryKeys_result getResult(I iface, GetPrimaryKeys_args args) throws } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference extends org.apache.thrift.ProcessFunction { + public static class GetCrossReference extends org.apache.thrift.ProcessFunction { public GetCrossReference() { super("GetCrossReference"); } @@ -1726,6 +1765,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetCrossReference_result getResult(I iface, GetCrossReference_args args) throws org.apache.thrift.TException { GetCrossReference_result result = new GetCrossReference_result(); result.success = iface.GetCrossReference(args.req); @@ -1733,7 +1777,7 @@ public GetCrossReference_result getResult(I iface, GetCrossReference_args args) } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus extends org.apache.thrift.ProcessFunction { + public static class GetOperationStatus extends org.apache.thrift.ProcessFunction { public GetOperationStatus() { super("GetOperationStatus"); } @@ -1746,6 +1790,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args) throws org.apache.thrift.TException { GetOperationStatus_result result = new GetOperationStatus_result(); result.success = iface.GetOperationStatus(args.req); @@ -1753,7 +1802,7 @@ public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation extends org.apache.thrift.ProcessFunction { + public static class CancelOperation extends org.apache.thrift.ProcessFunction { public CancelOperation() { super("CancelOperation"); } @@ -1766,6 +1815,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public CancelOperation_result getResult(I iface, CancelOperation_args args) throws org.apache.thrift.TException { CancelOperation_result result = new CancelOperation_result(); result.success = iface.CancelOperation(args.req); @@ -1773,7 +1827,7 @@ public CancelOperation_result getResult(I iface, CancelOperation_args args) thro } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation extends org.apache.thrift.ProcessFunction { + public static class CloseOperation extends org.apache.thrift.ProcessFunction { public CloseOperation() { super("CloseOperation"); } @@ -1786,6 +1840,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public CloseOperation_result getResult(I iface, CloseOperation_args args) throws org.apache.thrift.TException { CloseOperation_result result = new CloseOperation_result(); result.success = iface.CloseOperation(args.req); @@ -1793,7 +1852,7 @@ public CloseOperation_result getResult(I iface, CloseOperation_args args) throws } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata extends org.apache.thrift.ProcessFunction { + public static class GetResultSetMetadata extends org.apache.thrift.ProcessFunction { public GetResultSetMetadata() { super("GetResultSetMetadata"); } @@ -1806,6 +1865,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args args) throws org.apache.thrift.TException { GetResultSetMetadata_result result = new GetResultSetMetadata_result(); result.success = iface.GetResultSetMetadata(args.req); @@ -1813,7 +1877,7 @@ public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults extends org.apache.thrift.ProcessFunction { + public static class FetchResults extends org.apache.thrift.ProcessFunction { public FetchResults() { super("FetchResults"); } @@ -1826,6 +1890,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public FetchResults_result getResult(I iface, FetchResults_args args) throws org.apache.thrift.TException { FetchResults_result result = new FetchResults_result(); result.success = iface.FetchResults(args.req); @@ -1833,7 +1902,7 @@ public FetchResults_result getResult(I iface, FetchResults_args args) throws org } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken extends org.apache.thrift.ProcessFunction { + public static class GetDelegationToken extends org.apache.thrift.ProcessFunction { public GetDelegationToken() { super("GetDelegationToken"); } @@ -1846,6 +1915,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args) throws org.apache.thrift.TException { GetDelegationToken_result result = new GetDelegationToken_result(); result.success = iface.GetDelegationToken(args.req); @@ -1853,7 +1927,7 @@ public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken extends org.apache.thrift.ProcessFunction { + public static class CancelDelegationToken extends org.apache.thrift.ProcessFunction { public CancelDelegationToken() { super("CancelDelegationToken"); } @@ -1866,6 +1940,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_args args) throws org.apache.thrift.TException { CancelDelegationToken_result result = new CancelDelegationToken_result(); result.success = iface.CancelDelegationToken(args.req); @@ -1873,7 +1952,7 @@ public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_arg } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken extends org.apache.thrift.ProcessFunction { + public static class RenewDelegationToken extends org.apache.thrift.ProcessFunction { public RenewDelegationToken() { super("RenewDelegationToken"); } @@ -1886,6 +1965,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args args) throws org.apache.thrift.TException { RenewDelegationToken_result result = new RenewDelegationToken_result(); result.success = iface.RenewDelegationToken(args.req); @@ -1893,7 +1977,7 @@ public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId extends org.apache.thrift.ProcessFunction { + public static class GetQueryId extends org.apache.thrift.ProcessFunction { public GetQueryId() { super("GetQueryId"); } @@ -1906,6 +1990,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public GetQueryId_result getResult(I iface, GetQueryId_args args) throws org.apache.thrift.TException { GetQueryId_result result = new GetQueryId_result(); result.success = iface.GetQueryId(args.req); @@ -1913,7 +2002,7 @@ public GetQueryId_result getResult(I iface, GetQueryId_args args) throws org.apa } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo extends org.apache.thrift.ProcessFunction { + public static class SetClientInfo extends org.apache.thrift.ProcessFunction { public SetClientInfo() { super("SetClientInfo"); } @@ -1926,6 +2015,11 @@ protected boolean isOneway() { return false; } + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + public SetClientInfo_result getResult(I iface, SetClientInfo_args args) throws org.apache.thrift.TException { SetClientInfo_result result = new SetClientInfo_result(); result.success = iface.SetClientInfo(args.req); @@ -1935,17 +2029,17 @@ public SetClientInfo_result getResult(I iface, SetClientInfo_args args) throws o } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { - super(iface, getProcessMap(new HashMap>())); + super(iface, getProcessMap(new java.util.HashMap>())); } - protected AsyncProcessor(I iface, Map> processMap) { + protected AsyncProcessor(I iface, java.util.Map> processMap) { super(iface, getProcessMap(processMap)); } - private static Map> getProcessMap(Map> processMap) { + private static java.util.Map> getProcessMap(java.util.Map> processMap) { processMap.put("OpenSession", new OpenSession()); processMap.put("CloseSession", new CloseSession()); processMap.put("GetInfo", new GetInfo()); @@ -1972,7 +2066,7 @@ protected AsyncProcessor(I iface, Map extends org.apache.thrift.AsyncProcessFunction { + public static class OpenSession extends org.apache.thrift.AsyncProcessFunction { public OpenSession() { super("OpenSession"); } @@ -1981,35 +2075,45 @@ public OpenSession_args getEmptyArgsInstance() { return new OpenSession_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TOpenSessionResp o) { OpenSession_result result = new OpenSession_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; OpenSession_result result = new OpenSession_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2018,12 +2122,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.OpenSession(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession extends org.apache.thrift.AsyncProcessFunction { + public static class CloseSession extends org.apache.thrift.AsyncProcessFunction { public CloseSession() { super("CloseSession"); } @@ -2032,35 +2136,45 @@ public CloseSession_args getEmptyArgsInstance() { return new CloseSession_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TCloseSessionResp o) { CloseSession_result result = new CloseSession_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; CloseSession_result result = new CloseSession_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2069,12 +2183,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.CloseSession(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo extends org.apache.thrift.AsyncProcessFunction { + public static class GetInfo extends org.apache.thrift.AsyncProcessFunction { public GetInfo() { super("GetInfo"); } @@ -2083,35 +2197,45 @@ public GetInfo_args getEmptyArgsInstance() { return new GetInfo_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetInfoResp o) { GetInfo_result result = new GetInfo_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetInfo_result result = new GetInfo_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2120,12 +2244,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetInfo(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement extends org.apache.thrift.AsyncProcessFunction { + public static class ExecuteStatement extends org.apache.thrift.AsyncProcessFunction { public ExecuteStatement() { super("ExecuteStatement"); } @@ -2134,35 +2258,45 @@ public ExecuteStatement_args getEmptyArgsInstance() { return new ExecuteStatement_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TExecuteStatementResp o) { ExecuteStatement_result result = new ExecuteStatement_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; ExecuteStatement_result result = new ExecuteStatement_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2171,12 +2305,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.ExecuteStatement(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo extends org.apache.thrift.AsyncProcessFunction { + public static class GetTypeInfo extends org.apache.thrift.AsyncProcessFunction { public GetTypeInfo() { super("GetTypeInfo"); } @@ -2185,35 +2319,45 @@ public GetTypeInfo_args getEmptyArgsInstance() { return new GetTypeInfo_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetTypeInfoResp o) { GetTypeInfo_result result = new GetTypeInfo_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetTypeInfo_result result = new GetTypeInfo_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2222,12 +2366,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetTypeInfo(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs extends org.apache.thrift.AsyncProcessFunction { + public static class GetCatalogs extends org.apache.thrift.AsyncProcessFunction { public GetCatalogs() { super("GetCatalogs"); } @@ -2236,35 +2380,45 @@ public GetCatalogs_args getEmptyArgsInstance() { return new GetCatalogs_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetCatalogsResp o) { GetCatalogs_result result = new GetCatalogs_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetCatalogs_result result = new GetCatalogs_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2273,12 +2427,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetCatalogs(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas extends org.apache.thrift.AsyncProcessFunction { + public static class GetSchemas extends org.apache.thrift.AsyncProcessFunction { public GetSchemas() { super("GetSchemas"); } @@ -2287,35 +2441,45 @@ public GetSchemas_args getEmptyArgsInstance() { return new GetSchemas_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetSchemasResp o) { GetSchemas_result result = new GetSchemas_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetSchemas_result result = new GetSchemas_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2324,12 +2488,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetSchemas(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables extends org.apache.thrift.AsyncProcessFunction { + public static class GetTables extends org.apache.thrift.AsyncProcessFunction { public GetTables() { super("GetTables"); } @@ -2338,35 +2502,45 @@ public GetTables_args getEmptyArgsInstance() { return new GetTables_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetTablesResp o) { GetTables_result result = new GetTables_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetTables_result result = new GetTables_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2375,12 +2549,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetTables(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes extends org.apache.thrift.AsyncProcessFunction { + public static class GetTableTypes extends org.apache.thrift.AsyncProcessFunction { public GetTableTypes() { super("GetTableTypes"); } @@ -2389,35 +2563,45 @@ public GetTableTypes_args getEmptyArgsInstance() { return new GetTableTypes_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetTableTypesResp o) { GetTableTypes_result result = new GetTableTypes_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetTableTypes_result result = new GetTableTypes_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2426,12 +2610,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetTableTypes(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns extends org.apache.thrift.AsyncProcessFunction { + public static class GetColumns extends org.apache.thrift.AsyncProcessFunction { public GetColumns() { super("GetColumns"); } @@ -2440,35 +2624,45 @@ public GetColumns_args getEmptyArgsInstance() { return new GetColumns_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetColumnsResp o) { GetColumns_result result = new GetColumns_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetColumns_result result = new GetColumns_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2477,12 +2671,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetColumns(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions extends org.apache.thrift.AsyncProcessFunction { + public static class GetFunctions extends org.apache.thrift.AsyncProcessFunction { public GetFunctions() { super("GetFunctions"); } @@ -2491,35 +2685,45 @@ public GetFunctions_args getEmptyArgsInstance() { return new GetFunctions_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetFunctionsResp o) { GetFunctions_result result = new GetFunctions_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetFunctions_result result = new GetFunctions_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2528,12 +2732,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetFunctions(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys extends org.apache.thrift.AsyncProcessFunction { + public static class GetPrimaryKeys extends org.apache.thrift.AsyncProcessFunction { public GetPrimaryKeys() { super("GetPrimaryKeys"); } @@ -2542,35 +2746,45 @@ public GetPrimaryKeys_args getEmptyArgsInstance() { return new GetPrimaryKeys_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetPrimaryKeysResp o) { GetPrimaryKeys_result result = new GetPrimaryKeys_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2579,12 +2793,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetPrimaryKeys(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference extends org.apache.thrift.AsyncProcessFunction { + public static class GetCrossReference extends org.apache.thrift.AsyncProcessFunction { public GetCrossReference() { super("GetCrossReference"); } @@ -2593,35 +2807,45 @@ public GetCrossReference_args getEmptyArgsInstance() { return new GetCrossReference_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetCrossReferenceResp o) { GetCrossReference_result result = new GetCrossReference_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetCrossReference_result result = new GetCrossReference_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2630,12 +2854,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetCrossReference(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus extends org.apache.thrift.AsyncProcessFunction { + public static class GetOperationStatus extends org.apache.thrift.AsyncProcessFunction { public GetOperationStatus() { super("GetOperationStatus"); } @@ -2644,35 +2868,45 @@ public GetOperationStatus_args getEmptyArgsInstance() { return new GetOperationStatus_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetOperationStatusResp o) { GetOperationStatus_result result = new GetOperationStatus_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetOperationStatus_result result = new GetOperationStatus_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2681,12 +2915,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetOperationStatus(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation extends org.apache.thrift.AsyncProcessFunction { + public static class CancelOperation extends org.apache.thrift.AsyncProcessFunction { public CancelOperation() { super("CancelOperation"); } @@ -2695,35 +2929,45 @@ public CancelOperation_args getEmptyArgsInstance() { return new CancelOperation_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TCancelOperationResp o) { CancelOperation_result result = new CancelOperation_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; CancelOperation_result result = new CancelOperation_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2732,12 +2976,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.CancelOperation(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation extends org.apache.thrift.AsyncProcessFunction { + public static class CloseOperation extends org.apache.thrift.AsyncProcessFunction { public CloseOperation() { super("CloseOperation"); } @@ -2746,35 +2990,45 @@ public CloseOperation_args getEmptyArgsInstance() { return new CloseOperation_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TCloseOperationResp o) { CloseOperation_result result = new CloseOperation_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; CloseOperation_result result = new CloseOperation_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2783,12 +3037,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.CloseOperation(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata extends org.apache.thrift.AsyncProcessFunction { + public static class GetResultSetMetadata extends org.apache.thrift.AsyncProcessFunction { public GetResultSetMetadata() { super("GetResultSetMetadata"); } @@ -2797,35 +3051,45 @@ public GetResultSetMetadata_args getEmptyArgsInstance() { return new GetResultSetMetadata_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetResultSetMetadataResp o) { GetResultSetMetadata_result result = new GetResultSetMetadata_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2834,12 +3098,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetResultSetMetadata(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults extends org.apache.thrift.AsyncProcessFunction { + public static class FetchResults extends org.apache.thrift.AsyncProcessFunction { public FetchResults() { super("FetchResults"); } @@ -2848,35 +3112,45 @@ public FetchResults_args getEmptyArgsInstance() { return new FetchResults_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TFetchResultsResp o) { FetchResults_result result = new FetchResults_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; FetchResults_result result = new FetchResults_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2885,12 +3159,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.FetchResults(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public static class GetDelegationToken extends org.apache.thrift.AsyncProcessFunction { public GetDelegationToken() { super("GetDelegationToken"); } @@ -2899,35 +3173,45 @@ public GetDelegationToken_args getEmptyArgsInstance() { return new GetDelegationToken_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetDelegationTokenResp o) { GetDelegationToken_result result = new GetDelegationToken_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetDelegationToken_result result = new GetDelegationToken_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2936,12 +3220,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetDelegationToken(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public static class CancelDelegationToken extends org.apache.thrift.AsyncProcessFunction { public CancelDelegationToken() { super("CancelDelegationToken"); } @@ -2950,35 +3234,45 @@ public CancelDelegationToken_args getEmptyArgsInstance() { return new CancelDelegationToken_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TCancelDelegationTokenResp o) { CancelDelegationToken_result result = new CancelDelegationToken_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; CancelDelegationToken_result result = new CancelDelegationToken_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -2987,12 +3281,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.CancelDelegationToken(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public static class RenewDelegationToken extends org.apache.thrift.AsyncProcessFunction { public RenewDelegationToken() { super("RenewDelegationToken"); } @@ -3001,35 +3295,45 @@ public RenewDelegationToken_args getEmptyArgsInstance() { return new RenewDelegationToken_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TRenewDelegationTokenResp o) { RenewDelegationToken_result result = new RenewDelegationToken_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; RenewDelegationToken_result result = new RenewDelegationToken_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -3038,12 +3342,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.RenewDelegationToken(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId extends org.apache.thrift.AsyncProcessFunction { + public static class GetQueryId extends org.apache.thrift.AsyncProcessFunction { public GetQueryId() { super("GetQueryId"); } @@ -3052,35 +3356,45 @@ public GetQueryId_args getEmptyArgsInstance() { return new GetQueryId_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TGetQueryIdResp o) { GetQueryId_result result = new GetQueryId_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; GetQueryId_result result = new GetQueryId_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -3089,12 +3403,12 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetQueryId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, GetQueryId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.GetQueryId(args.req,resultHandler); } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo extends org.apache.thrift.AsyncProcessFunction { + public static class SetClientInfo extends org.apache.thrift.AsyncProcessFunction { public SetClientInfo() { super("SetClientInfo"); } @@ -3103,35 +3417,45 @@ public SetClientInfo_args getEmptyArgsInstance() { return new SetClientInfo_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { + return new org.apache.thrift.async.AsyncMethodCallback() { public void onComplete(TSetClientInfoResp o) { SetClientInfo_result result = new SetClientInfo_result(); result.success = o; try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); } - fb.close(); } - public void onError(Exception e) { + public void onError(java.lang.Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; + org.apache.thrift.TSerializable msg; SetClientInfo_result result = new SetClientInfo_result(); - { + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); } - fb.close(); } }; } @@ -3140,34 +3464,31 @@ protected boolean isOneway() { return false; } - public void start(I iface, SetClientInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + public void start(I iface, SetClientInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { iface.SetClientInfo(args.req,resultHandler); } } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 OpenSession_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OpenSession_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OpenSession_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OpenSession_argsTupleSchemeFactory(); - private TOpenSessionReq req; // required + private @org.apache.thrift.annotation.Nullable TOpenSessionReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -3175,6 +3496,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -3190,21 +3512,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -3213,18 +3536,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TOpenSessionReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_args.class, metaDataMap); } @@ -3256,11 +3579,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TOpenSessionReq getReq() { return this.req; } - public void setReq(TOpenSessionReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TOpenSessionReq req) { this.req = req; } @@ -3279,7 +3603,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -3292,30 +3616,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof OpenSession_args) @@ -3326,6 +3651,8 @@ public boolean equals(Object that) { public boolean equals(OpenSession_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -3341,14 +3668,13 @@ public boolean equals(OpenSession_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -3359,7 +3685,7 @@ public int compareTo(OpenSession_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -3372,21 +3698,22 @@ public int compareTo(OpenSession_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("OpenSession_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_args("); boolean first = true; sb.append("req:"); @@ -3416,7 +3743,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -3424,13 +3751,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class OpenSession_argsStandardSchemeFactory implements SchemeFactory { + private static class OpenSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public OpenSession_argsStandardScheme getScheme() { return new OpenSession_argsStandardScheme(); } } - private static class OpenSession_argsStandardScheme extends StandardScheme { + private static class OpenSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -3475,18 +3802,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_args s } - private static class OpenSession_argsTupleSchemeFactory implements SchemeFactory { + private static class OpenSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public OpenSession_argsTupleScheme getScheme() { return new OpenSession_argsTupleScheme(); } } - private static class OpenSession_argsTupleScheme extends TupleScheme { + private static class OpenSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -3498,8 +3825,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args st @Override public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TOpenSessionReq(); struct.req.read(iprot); @@ -3508,29 +3835,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_args str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 OpenSession_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OpenSession_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OpenSession_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OpenSession_resultTupleSchemeFactory(); - private TOpenSessionResp success; // required + private @org.apache.thrift.annotation.Nullable TOpenSessionResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -3538,6 +3865,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -3553,21 +3881,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -3576,18 +3905,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TOpenSessionResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_result.class, metaDataMap); } @@ -3619,11 +3948,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TOpenSessionResp getSuccess() { return this.success; } - public void setSuccess(TOpenSessionResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TOpenSessionResp success) { this.success = success; } @@ -3642,7 +3972,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -3655,30 +3985,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof OpenSession_result) @@ -3689,6 +4020,8 @@ public boolean equals(Object that) { public boolean equals(OpenSession_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -3704,14 +4037,13 @@ public boolean equals(OpenSession_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -3722,7 +4054,7 @@ public int compareTo(OpenSession_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -3735,21 +4067,22 @@ public int compareTo(OpenSession_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("OpenSession_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_result("); boolean first = true; sb.append("success:"); @@ -3779,7 +4112,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -3787,13 +4120,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class OpenSession_resultStandardSchemeFactory implements SchemeFactory { + private static class OpenSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public OpenSession_resultStandardScheme getScheme() { return new OpenSession_resultStandardScheme(); } } - private static class OpenSession_resultStandardScheme extends StandardScheme { + private static class OpenSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -3838,18 +4171,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_result } - private static class OpenSession_resultTupleSchemeFactory implements SchemeFactory { + private static class OpenSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public OpenSession_resultTupleScheme getScheme() { return new OpenSession_resultTupleScheme(); } } - private static class OpenSession_resultTupleScheme extends TupleScheme { + private static class OpenSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -3861,8 +4194,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TOpenSessionResp(); struct.success.read(iprot); @@ -3871,29 +4204,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_result s } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 CloseSession_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseSession_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseSession_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseSession_argsTupleSchemeFactory(); - private TCloseSessionReq req; // required + private @org.apache.thrift.annotation.Nullable TCloseSessionReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -3901,6 +4234,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -3916,21 +4250,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -3939,18 +4274,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseSessionReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_args.class, metaDataMap); } @@ -3982,11 +4317,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TCloseSessionReq getReq() { return this.req; } - public void setReq(TCloseSessionReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TCloseSessionReq req) { this.req = req; } @@ -4005,7 +4341,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -4018,30 +4354,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CloseSession_args) @@ -4052,6 +4389,8 @@ public boolean equals(Object that) { public boolean equals(CloseSession_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -4067,14 +4406,13 @@ public boolean equals(CloseSession_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -4085,7 +4423,7 @@ public int compareTo(CloseSession_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -4098,21 +4436,22 @@ public int compareTo(CloseSession_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseSession_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_args("); boolean first = true; sb.append("req:"); @@ -4142,7 +4481,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -4150,13 +4489,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseSession_argsStandardSchemeFactory implements SchemeFactory { + private static class CloseSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseSession_argsStandardScheme getScheme() { return new CloseSession_argsStandardScheme(); } } - private static class CloseSession_argsStandardScheme extends StandardScheme { + private static class CloseSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -4201,18 +4540,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_args } - private static class CloseSession_argsTupleSchemeFactory implements SchemeFactory { + private static class CloseSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseSession_argsTupleScheme getScheme() { return new CloseSession_argsTupleScheme(); } } - private static class CloseSession_argsTupleScheme extends TupleScheme { + private static class CloseSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -4224,8 +4563,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args s @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCloseSessionReq(); struct.req.read(iprot); @@ -4234,29 +4573,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_args st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 CloseSession_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseSession_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseSession_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseSession_resultTupleSchemeFactory(); - private TCloseSessionResp success; // required + private @org.apache.thrift.annotation.Nullable TCloseSessionResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -4264,6 +4603,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -4279,21 +4619,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -4302,18 +4643,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseSessionResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_result.class, metaDataMap); } @@ -4345,11 +4686,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TCloseSessionResp getSuccess() { return this.success; } - public void setSuccess(TCloseSessionResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseSessionResp success) { this.success = success; } @@ -4368,7 +4710,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -4381,30 +4723,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CloseSession_result) @@ -4415,6 +4758,8 @@ public boolean equals(Object that) { public boolean equals(CloseSession_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -4430,14 +4775,13 @@ public boolean equals(CloseSession_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -4448,7 +4792,7 @@ public int compareTo(CloseSession_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -4461,21 +4805,22 @@ public int compareTo(CloseSession_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseSession_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_result("); boolean first = true; sb.append("success:"); @@ -4505,7 +4850,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -4513,13 +4858,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseSession_resultStandardSchemeFactory implements SchemeFactory { + private static class CloseSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseSession_resultStandardScheme getScheme() { return new CloseSession_resultStandardScheme(); } } - private static class CloseSession_resultStandardScheme extends StandardScheme { + private static class CloseSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -4564,18 +4909,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_resul } - private static class CloseSession_resultTupleSchemeFactory implements SchemeFactory { + private static class CloseSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseSession_resultTupleScheme getScheme() { return new CloseSession_resultTupleScheme(); } } - private static class CloseSession_resultTupleScheme extends TupleScheme { + private static class CloseSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -4587,8 +4932,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCloseSessionResp(); struct.success.read(iprot); @@ -4597,29 +4942,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_result } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 GetInfo_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetInfo_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetInfo_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetInfo_argsTupleSchemeFactory(); - private TGetInfoReq req; // required + private @org.apache.thrift.annotation.Nullable TGetInfoReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -4627,6 +4972,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -4642,21 +4988,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -4665,18 +5012,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetInfoReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_args.class, metaDataMap); } @@ -4708,11 +5055,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetInfoReq getReq() { return this.req; } - public void setReq(TGetInfoReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetInfoReq req) { this.req = req; } @@ -4731,7 +5079,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -4744,30 +5092,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetInfo_args) @@ -4778,6 +5127,8 @@ public boolean equals(Object that) { public boolean equals(GetInfo_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -4793,14 +5144,13 @@ public boolean equals(GetInfo_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -4811,7 +5161,7 @@ public int compareTo(GetInfo_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -4824,21 +5174,22 @@ public int compareTo(GetInfo_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetInfo_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_args("); boolean first = true; sb.append("req:"); @@ -4868,7 +5219,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -4876,13 +5227,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetInfo_argsStandardSchemeFactory implements SchemeFactory { + private static class GetInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetInfo_argsStandardScheme getScheme() { return new GetInfo_argsStandardScheme(); } } - private static class GetInfo_argsStandardScheme extends StandardScheme { + private static class GetInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -4927,18 +5278,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_args struc } - private static class GetInfo_argsTupleSchemeFactory implements SchemeFactory { + private static class GetInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetInfo_argsTupleScheme getScheme() { return new GetInfo_argsTupleScheme(); } } - private static class GetInfo_argsTupleScheme extends TupleScheme { + private static class GetInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -4950,8 +5301,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetInfoReq(); struct.req.read(iprot); @@ -4960,29 +5311,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 GetInfo_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetInfo_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetInfo_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetInfo_resultTupleSchemeFactory(); - private TGetInfoResp success; // required + private @org.apache.thrift.annotation.Nullable TGetInfoResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -4990,6 +5341,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -5005,21 +5357,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -5028,18 +5381,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetInfoResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_result.class, metaDataMap); } @@ -5071,11 +5424,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetInfoResp getSuccess() { return this.success; } - public void setSuccess(TGetInfoResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetInfoResp success) { this.success = success; } @@ -5094,7 +5448,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -5107,30 +5461,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetInfo_result) @@ -5141,6 +5496,8 @@ public boolean equals(Object that) { public boolean equals(GetInfo_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -5156,14 +5513,13 @@ public boolean equals(GetInfo_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -5174,7 +5530,7 @@ public int compareTo(GetInfo_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -5187,21 +5543,22 @@ public int compareTo(GetInfo_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetInfo_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_result("); boolean first = true; sb.append("success:"); @@ -5231,7 +5588,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -5239,13 +5596,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetInfo_resultStandardSchemeFactory implements SchemeFactory { + private static class GetInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetInfo_resultStandardScheme getScheme() { return new GetInfo_resultStandardScheme(); } } - private static class GetInfo_resultStandardScheme extends StandardScheme { + private static class GetInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -5290,18 +5647,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_result str } - private static class GetInfo_resultTupleSchemeFactory implements SchemeFactory { + private static class GetInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetInfo_resultTupleScheme getScheme() { return new GetInfo_resultTupleScheme(); } } - private static class GetInfo_resultTupleScheme extends TupleScheme { + private static class GetInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -5313,8 +5670,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetInfoResp(); struct.success.read(iprot); @@ -5323,29 +5680,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struc } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 ExecuteStatement_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExecuteStatement_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExecuteStatement_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExecuteStatement_argsTupleSchemeFactory(); - private TExecuteStatementReq req; // required + private @org.apache.thrift.annotation.Nullable 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -5353,6 +5710,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -5368,21 +5726,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -5391,18 +5750,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_args.class, metaDataMap); } @@ -5434,11 +5793,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TExecuteStatementReq getReq() { return this.req; } - public void setReq(TExecuteStatementReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TExecuteStatementReq req) { this.req = req; } @@ -5457,7 +5817,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -5470,30 +5830,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ExecuteStatement_args) @@ -5504,6 +5865,8 @@ public boolean equals(Object that) { public boolean equals(ExecuteStatement_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -5519,14 +5882,13 @@ public boolean equals(ExecuteStatement_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -5537,7 +5899,7 @@ public int compareTo(ExecuteStatement_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -5550,21 +5912,22 @@ public int compareTo(ExecuteStatement_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ExecuteStatement_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_args("); boolean first = true; sb.append("req:"); @@ -5594,7 +5957,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -5602,13 +5965,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class ExecuteStatement_argsStandardSchemeFactory implements SchemeFactory { + private static class ExecuteStatement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ExecuteStatement_argsStandardScheme getScheme() { return new ExecuteStatement_argsStandardScheme(); } } - private static class ExecuteStatement_argsStandardScheme extends StandardScheme { + private static class ExecuteStatement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -5653,18 +6016,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_a } - private static class ExecuteStatement_argsTupleSchemeFactory implements SchemeFactory { + private static class ExecuteStatement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ExecuteStatement_argsTupleScheme getScheme() { return new ExecuteStatement_argsTupleScheme(); } } - private static class ExecuteStatement_argsTupleScheme extends TupleScheme { + private static class ExecuteStatement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -5676,8 +6039,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_ar @Override public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TExecuteStatementReq(); struct.req.read(iprot); @@ -5686,29 +6049,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_arg } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 ExecuteStatement_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExecuteStatement_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExecuteStatement_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExecuteStatement_resultTupleSchemeFactory(); - private TExecuteStatementResp success; // required + private @org.apache.thrift.annotation.Nullable TExecuteStatementResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -5716,6 +6079,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -5731,21 +6095,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -5754,18 +6119,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TExecuteStatementResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_result.class, metaDataMap); } @@ -5797,11 +6162,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TExecuteStatementResp getSuccess() { return this.success; } - public void setSuccess(TExecuteStatementResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TExecuteStatementResp success) { this.success = success; } @@ -5820,7 +6186,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -5833,30 +6199,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof ExecuteStatement_result) @@ -5867,6 +6234,8 @@ public boolean equals(Object that) { public boolean equals(ExecuteStatement_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -5882,14 +6251,13 @@ public boolean equals(ExecuteStatement_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -5900,7 +6268,7 @@ public int compareTo(ExecuteStatement_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -5913,21 +6281,22 @@ public int compareTo(ExecuteStatement_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("ExecuteStatement_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_result("); boolean first = true; sb.append("success:"); @@ -5957,7 +6326,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -5965,13 +6334,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class ExecuteStatement_resultStandardSchemeFactory implements SchemeFactory { + private static class ExecuteStatement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ExecuteStatement_resultStandardScheme getScheme() { return new ExecuteStatement_resultStandardScheme(); } } - private static class ExecuteStatement_resultStandardScheme extends StandardScheme { + private static class ExecuteStatement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -6016,18 +6385,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_r } - private static class ExecuteStatement_resultTupleSchemeFactory implements SchemeFactory { + private static class ExecuteStatement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public ExecuteStatement_resultTupleScheme getScheme() { return new ExecuteStatement_resultTupleScheme(); } } - private static class ExecuteStatement_resultTupleScheme extends TupleScheme { + private static class ExecuteStatement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -6039,8 +6408,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_re @Override public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TExecuteStatementResp(); struct.success.read(iprot); @@ -6049,29 +6418,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_res } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 GetTypeInfo_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTypeInfo_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTypeInfo_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTypeInfo_argsTupleSchemeFactory(); - private TGetTypeInfoReq req; // required + private @org.apache.thrift.annotation.Nullable TGetTypeInfoReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -6079,6 +6448,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -6094,21 +6464,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -6117,18 +6488,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTypeInfoReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_args.class, metaDataMap); } @@ -6160,11 +6531,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetTypeInfoReq getReq() { return this.req; } - public void setReq(TGetTypeInfoReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetTypeInfoReq req) { this.req = req; } @@ -6183,7 +6555,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -6196,30 +6568,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetTypeInfo_args) @@ -6230,6 +6603,8 @@ public boolean equals(Object that) { public boolean equals(GetTypeInfo_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -6245,14 +6620,13 @@ public boolean equals(GetTypeInfo_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -6263,7 +6637,7 @@ public int compareTo(GetTypeInfo_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -6276,21 +6650,22 @@ public int compareTo(GetTypeInfo_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTypeInfo_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_args("); boolean first = true; sb.append("req:"); @@ -6320,7 +6695,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -6328,13 +6703,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTypeInfo_argsStandardSchemeFactory implements SchemeFactory { + private static class GetTypeInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTypeInfo_argsStandardScheme getScheme() { return new GetTypeInfo_argsStandardScheme(); } } - private static class GetTypeInfo_argsStandardScheme extends StandardScheme { + private static class GetTypeInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -6379,18 +6754,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_args s } - private static class GetTypeInfo_argsTupleSchemeFactory implements SchemeFactory { + private static class GetTypeInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTypeInfo_argsTupleScheme getScheme() { return new GetTypeInfo_argsTupleScheme(); } } - private static class GetTypeInfo_argsTupleScheme extends TupleScheme { + private static class GetTypeInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -6402,8 +6777,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args st @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetTypeInfoReq(); struct.req.read(iprot); @@ -6412,29 +6787,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 GetTypeInfo_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTypeInfo_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTypeInfo_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTypeInfo_resultTupleSchemeFactory(); - private TGetTypeInfoResp success; // required + private @org.apache.thrift.annotation.Nullable TGetTypeInfoResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -6442,6 +6817,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -6457,21 +6833,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -6480,18 +6857,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTypeInfoResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_result.class, metaDataMap); } @@ -6523,11 +6900,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetTypeInfoResp getSuccess() { return this.success; } - public void setSuccess(TGetTypeInfoResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTypeInfoResp success) { this.success = success; } @@ -6546,7 +6924,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -6559,30 +6937,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetTypeInfo_result) @@ -6593,6 +6972,8 @@ public boolean equals(Object that) { public boolean equals(GetTypeInfo_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -6608,14 +6989,13 @@ public boolean equals(GetTypeInfo_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -6626,7 +7006,7 @@ public int compareTo(GetTypeInfo_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -6639,21 +7019,22 @@ public int compareTo(GetTypeInfo_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTypeInfo_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_result("); boolean first = true; sb.append("success:"); @@ -6683,7 +7064,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -6691,13 +7072,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTypeInfo_resultStandardSchemeFactory implements SchemeFactory { + private static class GetTypeInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTypeInfo_resultStandardScheme getScheme() { return new GetTypeInfo_resultStandardScheme(); } } - private static class GetTypeInfo_resultStandardScheme extends StandardScheme { + private static class GetTypeInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -6742,18 +7123,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_result } - private static class GetTypeInfo_resultTupleSchemeFactory implements SchemeFactory { + private static class GetTypeInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTypeInfo_resultTupleScheme getScheme() { return new GetTypeInfo_resultTupleScheme(); } } - private static class GetTypeInfo_resultTupleScheme extends TupleScheme { + private static class GetTypeInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -6765,8 +7146,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetTypeInfoResp(); struct.success.read(iprot); @@ -6775,29 +7156,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result s } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 GetCatalogs_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCatalogs_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCatalogs_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCatalogs_argsTupleSchemeFactory(); - private TGetCatalogsReq req; // required + private @org.apache.thrift.annotation.Nullable TGetCatalogsReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -6805,6 +7186,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -6820,21 +7202,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -6843,18 +7226,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCatalogsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_args.class, metaDataMap); } @@ -6886,11 +7269,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetCatalogsReq getReq() { return this.req; } - public void setReq(TGetCatalogsReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetCatalogsReq req) { this.req = req; } @@ -6909,7 +7293,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -6922,30 +7306,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetCatalogs_args) @@ -6956,6 +7341,8 @@ public boolean equals(Object that) { public boolean equals(GetCatalogs_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -6971,14 +7358,13 @@ public boolean equals(GetCatalogs_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -6989,7 +7375,7 @@ public int compareTo(GetCatalogs_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -7002,21 +7388,22 @@ public int compareTo(GetCatalogs_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCatalogs_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_args("); boolean first = true; sb.append("req:"); @@ -7046,7 +7433,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -7054,13 +7441,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCatalogs_argsStandardSchemeFactory implements SchemeFactory { + private static class GetCatalogs_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCatalogs_argsStandardScheme getScheme() { return new GetCatalogs_argsStandardScheme(); } } - private static class GetCatalogs_argsStandardScheme extends StandardScheme { + private static class GetCatalogs_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -7105,18 +7492,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_args s } - private static class GetCatalogs_argsTupleSchemeFactory implements SchemeFactory { + private static class GetCatalogs_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCatalogs_argsTupleScheme getScheme() { return new GetCatalogs_argsTupleScheme(); } } - private static class GetCatalogs_argsTupleScheme extends TupleScheme { + private static class GetCatalogs_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -7128,8 +7515,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args st @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetCatalogsReq(); struct.req.read(iprot); @@ -7138,29 +7525,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 GetCatalogs_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCatalogs_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCatalogs_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCatalogs_resultTupleSchemeFactory(); - private TGetCatalogsResp success; // required + private @org.apache.thrift.annotation.Nullable TGetCatalogsResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -7168,6 +7555,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -7183,21 +7571,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -7206,18 +7595,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCatalogsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_result.class, metaDataMap); } @@ -7249,11 +7638,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetCatalogsResp getSuccess() { return this.success; } - public void setSuccess(TGetCatalogsResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCatalogsResp success) { this.success = success; } @@ -7272,7 +7662,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -7285,30 +7675,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetCatalogs_result) @@ -7319,6 +7710,8 @@ public boolean equals(Object that) { public boolean equals(GetCatalogs_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -7334,14 +7727,13 @@ public boolean equals(GetCatalogs_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -7352,7 +7744,7 @@ public int compareTo(GetCatalogs_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -7365,21 +7757,22 @@ public int compareTo(GetCatalogs_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCatalogs_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_result("); boolean first = true; sb.append("success:"); @@ -7409,7 +7802,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -7417,13 +7810,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCatalogs_resultStandardSchemeFactory implements SchemeFactory { + private static class GetCatalogs_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCatalogs_resultStandardScheme getScheme() { return new GetCatalogs_resultStandardScheme(); } } - private static class GetCatalogs_resultStandardScheme extends StandardScheme { + private static class GetCatalogs_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -7468,18 +7861,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_result } - private static class GetCatalogs_resultTupleSchemeFactory implements SchemeFactory { + private static class GetCatalogs_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCatalogs_resultTupleScheme getScheme() { return new GetCatalogs_resultTupleScheme(); } } - private static class GetCatalogs_resultTupleScheme extends TupleScheme { + private static class GetCatalogs_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -7491,8 +7884,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetCatalogsResp(); struct.success.read(iprot); @@ -7501,29 +7894,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result s } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 GetSchemas_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetSchemas_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetSchemas_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetSchemas_argsTupleSchemeFactory(); - private TGetSchemasReq req; // required + private @org.apache.thrift.annotation.Nullable TGetSchemasReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -7531,6 +7924,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -7546,21 +7940,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -7569,18 +7964,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetSchemasReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_args.class, metaDataMap); } @@ -7612,11 +8007,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetSchemasReq getReq() { return this.req; } - public void setReq(TGetSchemasReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetSchemasReq req) { this.req = req; } @@ -7635,7 +8031,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -7648,30 +8044,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetSchemas_args) @@ -7682,6 +8079,8 @@ public boolean equals(Object that) { public boolean equals(GetSchemas_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -7697,14 +8096,13 @@ public boolean equals(GetSchemas_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -7715,7 +8113,7 @@ public int compareTo(GetSchemas_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -7728,21 +8126,22 @@ public int compareTo(GetSchemas_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetSchemas_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_args("); boolean first = true; sb.append("req:"); @@ -7772,7 +8171,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -7780,13 +8179,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetSchemas_argsStandardSchemeFactory implements SchemeFactory { + private static class GetSchemas_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetSchemas_argsStandardScheme getScheme() { return new GetSchemas_argsStandardScheme(); } } - private static class GetSchemas_argsStandardScheme extends StandardScheme { + private static class GetSchemas_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -7831,18 +8230,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_args st } - private static class GetSchemas_argsTupleSchemeFactory implements SchemeFactory { + private static class GetSchemas_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetSchemas_argsTupleScheme getScheme() { return new GetSchemas_argsTupleScheme(); } } - private static class GetSchemas_argsTupleScheme extends TupleScheme { + private static class GetSchemas_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -7854,8 +8253,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args str @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetSchemasReq(); struct.req.read(iprot); @@ -7864,29 +8263,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 GetSchemas_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetSchemas_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetSchemas_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetSchemas_resultTupleSchemeFactory(); - private TGetSchemasResp success; // required + private @org.apache.thrift.annotation.Nullable TGetSchemasResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -7894,6 +8293,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -7909,21 +8309,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -7932,18 +8333,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetSchemasResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_result.class, metaDataMap); } @@ -7975,11 +8376,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetSchemasResp getSuccess() { return this.success; } - public void setSuccess(TGetSchemasResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetSchemasResp success) { this.success = success; } @@ -7998,7 +8400,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -8011,30 +8413,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetSchemas_result) @@ -8045,6 +8448,8 @@ public boolean equals(Object that) { public boolean equals(GetSchemas_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -8060,14 +8465,13 @@ public boolean equals(GetSchemas_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -8078,7 +8482,7 @@ public int compareTo(GetSchemas_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -8091,21 +8495,22 @@ public int compareTo(GetSchemas_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetSchemas_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_result("); boolean first = true; sb.append("success:"); @@ -8135,7 +8540,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -8143,13 +8548,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetSchemas_resultStandardSchemeFactory implements SchemeFactory { + private static class GetSchemas_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetSchemas_resultStandardScheme getScheme() { return new GetSchemas_resultStandardScheme(); } } - private static class GetSchemas_resultStandardScheme extends StandardScheme { + private static class GetSchemas_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -8194,18 +8599,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_result } - private static class GetSchemas_resultTupleSchemeFactory implements SchemeFactory { + private static class GetSchemas_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetSchemas_resultTupleScheme getScheme() { return new GetSchemas_resultTupleScheme(); } } - private static class GetSchemas_resultTupleScheme extends TupleScheme { + private static class GetSchemas_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -8217,8 +8622,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetSchemasResp(); struct.success.read(iprot); @@ -8227,29 +8632,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 GetTables_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTables_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTables_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTables_argsTupleSchemeFactory(); - private TGetTablesReq req; // required + private @org.apache.thrift.annotation.Nullable TGetTablesReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -8257,6 +8662,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -8272,21 +8678,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -8295,18 +8702,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTablesReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_args.class, metaDataMap); } @@ -8338,11 +8745,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetTablesReq getReq() { return this.req; } - public void setReq(TGetTablesReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetTablesReq req) { this.req = req; } @@ -8361,7 +8769,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -8374,30 +8782,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetTables_args) @@ -8408,6 +8817,8 @@ public boolean equals(Object that) { public boolean equals(GetTables_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -8423,14 +8834,13 @@ public boolean equals(GetTables_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -8441,7 +8851,7 @@ public int compareTo(GetTables_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -8454,21 +8864,22 @@ public int compareTo(GetTables_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTables_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_args("); boolean first = true; sb.append("req:"); @@ -8498,7 +8909,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -8506,13 +8917,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTables_argsStandardSchemeFactory implements SchemeFactory { + private static class GetTables_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTables_argsStandardScheme getScheme() { return new GetTables_argsStandardScheme(); } } - private static class GetTables_argsStandardScheme extends StandardScheme { + private static class GetTables_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -8557,18 +8968,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_args str } - private static class GetTables_argsTupleSchemeFactory implements SchemeFactory { + private static class GetTables_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTables_argsTupleScheme getScheme() { return new GetTables_argsTupleScheme(); } } - private static class GetTables_argsTupleScheme extends TupleScheme { + private static class GetTables_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -8580,8 +8991,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetTablesReq(); struct.req.read(iprot); @@ -8590,29 +9001,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_args struc } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 GetTables_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTables_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTables_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTables_resultTupleSchemeFactory(); - private TGetTablesResp success; // required + private @org.apache.thrift.annotation.Nullable TGetTablesResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -8620,6 +9031,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -8635,21 +9047,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -8658,18 +9071,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTablesResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_result.class, metaDataMap); } @@ -8701,11 +9114,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetTablesResp getSuccess() { return this.success; } - public void setSuccess(TGetTablesResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTablesResp success) { this.success = success; } @@ -8724,7 +9138,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -8737,30 +9151,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetTables_result) @@ -8771,6 +9186,8 @@ public boolean equals(Object that) { public boolean equals(GetTables_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -8786,14 +9203,13 @@ public boolean equals(GetTables_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -8804,7 +9220,7 @@ public int compareTo(GetTables_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -8817,21 +9233,22 @@ public int compareTo(GetTables_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTables_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_result("); boolean first = true; sb.append("success:"); @@ -8861,7 +9278,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -8869,13 +9286,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTables_resultStandardSchemeFactory implements SchemeFactory { + private static class GetTables_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTables_resultStandardScheme getScheme() { return new GetTables_resultStandardScheme(); } } - private static class GetTables_resultStandardScheme extends StandardScheme { + private static class GetTables_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -8920,18 +9337,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_result s } - private static class GetTables_resultTupleSchemeFactory implements SchemeFactory { + private static class GetTables_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTables_resultTupleScheme getScheme() { return new GetTables_resultTupleScheme(); } } - private static class GetTables_resultTupleScheme extends TupleScheme { + private static class GetTables_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -8943,8 +9360,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result st @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetTablesResp(); struct.success.read(iprot); @@ -8953,29 +9370,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_result str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 GetTableTypes_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTableTypes_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTableTypes_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTableTypes_argsTupleSchemeFactory(); - private TGetTableTypesReq req; // required + private @org.apache.thrift.annotation.Nullable TGetTableTypesReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -8983,6 +9400,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -8998,21 +9416,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -9021,18 +9440,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTableTypesReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_args.class, metaDataMap); } @@ -9064,11 +9483,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetTableTypesReq getReq() { return this.req; } - public void setReq(TGetTableTypesReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetTableTypesReq req) { this.req = req; } @@ -9087,7 +9507,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -9100,30 +9520,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetTableTypes_args) @@ -9134,6 +9555,8 @@ public boolean equals(Object that) { public boolean equals(GetTableTypes_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -9149,14 +9572,13 @@ public boolean equals(GetTableTypes_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -9167,7 +9589,7 @@ public int compareTo(GetTableTypes_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -9180,21 +9602,22 @@ public int compareTo(GetTableTypes_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTableTypes_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_args("); boolean first = true; sb.append("req:"); @@ -9224,7 +9647,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -9232,13 +9655,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTableTypes_argsStandardSchemeFactory implements SchemeFactory { + private static class GetTableTypes_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTableTypes_argsStandardScheme getScheme() { return new GetTableTypes_argsStandardScheme(); } } - private static class GetTableTypes_argsStandardScheme extends StandardScheme { + private static class GetTableTypes_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -9283,18 +9706,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_args } - private static class GetTableTypes_argsTupleSchemeFactory implements SchemeFactory { + private static class GetTableTypes_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTableTypes_argsTupleScheme getScheme() { return new GetTableTypes_argsTupleScheme(); } } - private static class GetTableTypes_argsTupleScheme extends TupleScheme { + private static class GetTableTypes_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -9306,8 +9729,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetTableTypesReq(); struct.req.read(iprot); @@ -9316,29 +9739,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args s } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 GetTableTypes_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTableTypes_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTableTypes_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTableTypes_resultTupleSchemeFactory(); - private TGetTableTypesResp success; // required + private @org.apache.thrift.annotation.Nullable TGetTableTypesResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -9346,6 +9769,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -9361,21 +9785,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -9384,18 +9809,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTableTypesResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_result.class, metaDataMap); } @@ -9427,11 +9852,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetTableTypesResp getSuccess() { return this.success; } - public void setSuccess(TGetTableTypesResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTableTypesResp success) { this.success = success; } @@ -9450,7 +9876,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -9463,30 +9889,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetTableTypes_result) @@ -9497,6 +9924,8 @@ public boolean equals(Object that) { public boolean equals(GetTableTypes_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -9512,14 +9941,13 @@ public boolean equals(GetTableTypes_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -9530,7 +9958,7 @@ public int compareTo(GetTableTypes_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -9543,21 +9971,22 @@ public int compareTo(GetTableTypes_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTableTypes_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_result("); boolean first = true; sb.append("success:"); @@ -9587,7 +10016,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -9595,13 +10024,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTableTypes_resultStandardSchemeFactory implements SchemeFactory { + private static class GetTableTypes_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTableTypes_resultStandardScheme getScheme() { return new GetTableTypes_resultStandardScheme(); } } - private static class GetTableTypes_resultStandardScheme extends StandardScheme { + private static class GetTableTypes_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -9646,18 +10075,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_resu } - private static class GetTableTypes_resultTupleSchemeFactory implements SchemeFactory { + private static class GetTableTypes_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetTableTypes_resultTupleScheme getScheme() { return new GetTableTypes_resultTupleScheme(); } } - private static class GetTableTypes_resultTupleScheme extends TupleScheme { + private static class GetTableTypes_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -9669,8 +10098,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_resul @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetTableTypesResp(); struct.success.read(iprot); @@ -9679,29 +10108,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 GetColumns_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetColumns_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetColumns_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetColumns_argsTupleSchemeFactory(); - private TGetColumnsReq req; // required + private @org.apache.thrift.annotation.Nullable TGetColumnsReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -9709,6 +10138,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -9724,21 +10154,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -9747,18 +10178,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetColumnsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_args.class, metaDataMap); } @@ -9790,11 +10221,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetColumnsReq getReq() { return this.req; } - public void setReq(TGetColumnsReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetColumnsReq req) { this.req = req; } @@ -9813,7 +10245,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -9826,30 +10258,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetColumns_args) @@ -9860,6 +10293,8 @@ public boolean equals(Object that) { public boolean equals(GetColumns_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -9875,14 +10310,13 @@ public boolean equals(GetColumns_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -9893,7 +10327,7 @@ public int compareTo(GetColumns_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -9906,21 +10340,22 @@ public int compareTo(GetColumns_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetColumns_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_args("); boolean first = true; sb.append("req:"); @@ -9950,7 +10385,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -9958,13 +10393,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetColumns_argsStandardSchemeFactory implements SchemeFactory { + private static class GetColumns_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetColumns_argsStandardScheme getScheme() { return new GetColumns_argsStandardScheme(); } } - private static class GetColumns_argsStandardScheme extends StandardScheme { + private static class GetColumns_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -10009,18 +10444,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_args st } - private static class GetColumns_argsTupleSchemeFactory implements SchemeFactory { + private static class GetColumns_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetColumns_argsTupleScheme getScheme() { return new GetColumns_argsTupleScheme(); } } - private static class GetColumns_argsTupleScheme extends TupleScheme { + private static class GetColumns_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -10032,8 +10467,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args str @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetColumnsReq(); struct.req.read(iprot); @@ -10042,29 +10477,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_args stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 GetColumns_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetColumns_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetColumns_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetColumns_resultTupleSchemeFactory(); - private TGetColumnsResp success; // required + private @org.apache.thrift.annotation.Nullable TGetColumnsResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -10072,6 +10507,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -10087,21 +10523,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -10110,18 +10547,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetColumnsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_result.class, metaDataMap); } @@ -10153,11 +10590,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetColumnsResp getSuccess() { return this.success; } - public void setSuccess(TGetColumnsResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetColumnsResp success) { this.success = success; } @@ -10176,7 +10614,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -10189,30 +10627,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetColumns_result) @@ -10223,6 +10662,8 @@ public boolean equals(Object that) { public boolean equals(GetColumns_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -10238,14 +10679,13 @@ public boolean equals(GetColumns_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -10256,7 +10696,7 @@ public int compareTo(GetColumns_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -10269,21 +10709,22 @@ public int compareTo(GetColumns_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetColumns_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_result("); boolean first = true; sb.append("success:"); @@ -10313,7 +10754,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -10321,13 +10762,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetColumns_resultStandardSchemeFactory implements SchemeFactory { + private static class GetColumns_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetColumns_resultStandardScheme getScheme() { return new GetColumns_resultStandardScheme(); } } - private static class GetColumns_resultStandardScheme extends StandardScheme { + private static class GetColumns_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -10372,18 +10813,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_result } - private static class GetColumns_resultTupleSchemeFactory implements SchemeFactory { + private static class GetColumns_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetColumns_resultTupleScheme getScheme() { return new GetColumns_resultTupleScheme(); } } - private static class GetColumns_resultTupleScheme extends TupleScheme { + private static class GetColumns_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -10395,8 +10836,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetColumnsResp(); struct.success.read(iprot); @@ -10405,29 +10846,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_result st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 GetFunctions_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetFunctions_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetFunctions_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetFunctions_argsTupleSchemeFactory(); - private TGetFunctionsReq req; // required + private @org.apache.thrift.annotation.Nullable TGetFunctionsReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -10435,6 +10876,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -10450,21 +10892,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -10473,18 +10916,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetFunctionsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_args.class, metaDataMap); } @@ -10516,11 +10959,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetFunctionsReq getReq() { return this.req; } - public void setReq(TGetFunctionsReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetFunctionsReq req) { this.req = req; } @@ -10539,7 +10983,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -10552,30 +10996,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetFunctions_args) @@ -10586,6 +11031,8 @@ public boolean equals(Object that) { public boolean equals(GetFunctions_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -10601,14 +11048,13 @@ public boolean equals(GetFunctions_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -10619,7 +11065,7 @@ public int compareTo(GetFunctions_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -10632,21 +11078,22 @@ public int compareTo(GetFunctions_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetFunctions_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_args("); boolean first = true; sb.append("req:"); @@ -10676,7 +11123,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -10684,13 +11131,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetFunctions_argsStandardSchemeFactory implements SchemeFactory { + private static class GetFunctions_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetFunctions_argsStandardScheme getScheme() { return new GetFunctions_argsStandardScheme(); } } - private static class GetFunctions_argsStandardScheme extends StandardScheme { + private static class GetFunctions_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -10735,18 +11182,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_args } - private static class GetFunctions_argsTupleSchemeFactory implements SchemeFactory { + private static class GetFunctions_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetFunctions_argsTupleScheme getScheme() { return new GetFunctions_argsTupleScheme(); } } - private static class GetFunctions_argsTupleScheme extends TupleScheme { + private static class GetFunctions_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -10758,8 +11205,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetFunctionsReq(); struct.req.read(iprot); @@ -10768,29 +11215,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 GetFunctions_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetFunctions_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetFunctions_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetFunctions_resultTupleSchemeFactory(); - private TGetFunctionsResp success; // required + private @org.apache.thrift.annotation.Nullable TGetFunctionsResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -10798,6 +11245,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -10813,21 +11261,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -10836,18 +11285,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetFunctionsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_result.class, metaDataMap); } @@ -10879,11 +11328,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetFunctionsResp getSuccess() { return this.success; } - public void setSuccess(TGetFunctionsResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetFunctionsResp success) { this.success = success; } @@ -10902,7 +11352,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -10915,30 +11365,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetFunctions_result) @@ -10949,6 +11400,8 @@ public boolean equals(Object that) { public boolean equals(GetFunctions_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -10964,14 +11417,13 @@ public boolean equals(GetFunctions_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -10982,7 +11434,7 @@ public int compareTo(GetFunctions_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -10995,21 +11447,22 @@ public int compareTo(GetFunctions_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetFunctions_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_result("); boolean first = true; sb.append("success:"); @@ -11039,7 +11492,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -11047,13 +11500,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetFunctions_resultStandardSchemeFactory implements SchemeFactory { + private static class GetFunctions_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetFunctions_resultStandardScheme getScheme() { return new GetFunctions_resultStandardScheme(); } } - private static class GetFunctions_resultStandardScheme extends StandardScheme { + private static class GetFunctions_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -11098,18 +11551,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_resul } - private static class GetFunctions_resultTupleSchemeFactory implements SchemeFactory { + private static class GetFunctions_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetFunctions_resultTupleScheme getScheme() { return new GetFunctions_resultTupleScheme(); } } - private static class GetFunctions_resultTupleScheme extends TupleScheme { + private static class GetFunctions_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -11121,8 +11574,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetFunctionsResp(); struct.success.read(iprot); @@ -11131,29 +11584,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 GetPrimaryKeys_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetPrimaryKeys_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetPrimaryKeys_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetPrimaryKeys_argsTupleSchemeFactory(); - private TGetPrimaryKeysReq req; // required + private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -11161,6 +11614,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -11176,21 +11630,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -11199,18 +11654,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetPrimaryKeysReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_args.class, metaDataMap); } @@ -11242,11 +11697,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetPrimaryKeysReq getReq() { return this.req; } - public void setReq(TGetPrimaryKeysReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq req) { this.req = req; } @@ -11265,7 +11721,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -11278,30 +11734,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetPrimaryKeys_args) @@ -11312,6 +11769,8 @@ public boolean equals(Object that) { public boolean equals(GetPrimaryKeys_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -11327,14 +11786,13 @@ public boolean equals(GetPrimaryKeys_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -11345,7 +11803,7 @@ public int compareTo(GetPrimaryKeys_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -11358,21 +11816,22 @@ public int compareTo(GetPrimaryKeys_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetPrimaryKeys_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_args("); boolean first = true; sb.append("req:"); @@ -11402,7 +11861,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -11410,13 +11869,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetPrimaryKeys_argsStandardSchemeFactory implements SchemeFactory { + private static class GetPrimaryKeys_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetPrimaryKeys_argsStandardScheme getScheme() { return new GetPrimaryKeys_argsStandardScheme(); } } - private static class GetPrimaryKeys_argsStandardScheme extends StandardScheme { + private static class GetPrimaryKeys_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -11461,18 +11920,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetPrimaryKeys_arg } - private static class GetPrimaryKeys_argsTupleSchemeFactory implements SchemeFactory { + private static class GetPrimaryKeys_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetPrimaryKeys_argsTupleScheme getScheme() { return new GetPrimaryKeys_argsTupleScheme(); } } - private static class GetPrimaryKeys_argsTupleScheme extends TupleScheme { + private static class GetPrimaryKeys_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -11484,8 +11943,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetPrimaryKeysReq(); struct.req.read(iprot); @@ -11494,29 +11953,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 GetPrimaryKeys_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetPrimaryKeys_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetPrimaryKeys_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetPrimaryKeys_resultTupleSchemeFactory(); - private TGetPrimaryKeysResp success; // required + private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -11524,6 +11983,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -11539,21 +11999,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -11562,18 +12023,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetPrimaryKeysResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_result.class, metaDataMap); } @@ -11605,11 +12066,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetPrimaryKeysResp getSuccess() { return this.success; } - public void setSuccess(TGetPrimaryKeysResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp success) { this.success = success; } @@ -11628,7 +12090,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -11641,30 +12103,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetPrimaryKeys_result) @@ -11675,6 +12138,8 @@ public boolean equals(Object that) { public boolean equals(GetPrimaryKeys_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -11690,14 +12155,13 @@ public boolean equals(GetPrimaryKeys_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -11708,7 +12172,7 @@ public int compareTo(GetPrimaryKeys_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -11721,21 +12185,22 @@ public int compareTo(GetPrimaryKeys_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetPrimaryKeys_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_result("); boolean first = true; sb.append("success:"); @@ -11765,7 +12230,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -11773,13 +12238,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetPrimaryKeys_resultStandardSchemeFactory implements SchemeFactory { + private static class GetPrimaryKeys_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetPrimaryKeys_resultStandardScheme getScheme() { return new GetPrimaryKeys_resultStandardScheme(); } } - private static class GetPrimaryKeys_resultStandardScheme extends StandardScheme { + private static class GetPrimaryKeys_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -11824,18 +12289,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetPrimaryKeys_res } - private static class GetPrimaryKeys_resultTupleSchemeFactory implements SchemeFactory { + private static class GetPrimaryKeys_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetPrimaryKeys_resultTupleScheme getScheme() { return new GetPrimaryKeys_resultTupleScheme(); } } - private static class GetPrimaryKeys_resultTupleScheme extends TupleScheme { + private static class GetPrimaryKeys_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -11847,8 +12312,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_resu @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetPrimaryKeysResp(); struct.success.read(iprot); @@ -11857,29 +12322,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_resul } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetCrossReference_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 GetCrossReference_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCrossReference_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCrossReference_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCrossReference_argsTupleSchemeFactory(); - private TGetCrossReferenceReq req; // required + private @org.apache.thrift.annotation.Nullable TGetCrossReferenceReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -11887,6 +12352,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -11902,21 +12368,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -11925,18 +12392,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCrossReferenceReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_args.class, metaDataMap); } @@ -11968,11 +12435,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetCrossReferenceReq getReq() { return this.req; } - public void setReq(TGetCrossReferenceReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetCrossReferenceReq req) { this.req = req; } @@ -11991,7 +12459,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -12004,30 +12472,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetCrossReference_args) @@ -12038,6 +12507,8 @@ public boolean equals(Object that) { public boolean equals(GetCrossReference_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -12053,14 +12524,13 @@ public boolean equals(GetCrossReference_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -12071,7 +12541,7 @@ public int compareTo(GetCrossReference_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -12084,21 +12554,22 @@ public int compareTo(GetCrossReference_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCrossReference_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_args("); boolean first = true; sb.append("req:"); @@ -12128,7 +12599,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -12136,13 +12607,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCrossReference_argsStandardSchemeFactory implements SchemeFactory { + private static class GetCrossReference_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCrossReference_argsStandardScheme getScheme() { return new GetCrossReference_argsStandardScheme(); } } - private static class GetCrossReference_argsStandardScheme extends StandardScheme { + private static class GetCrossReference_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -12187,18 +12658,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCrossReference_ } - private static class GetCrossReference_argsTupleSchemeFactory implements SchemeFactory { + private static class GetCrossReference_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCrossReference_argsTupleScheme getScheme() { return new GetCrossReference_argsTupleScheme(); } } - private static class GetCrossReference_argsTupleScheme extends TupleScheme { + private static class GetCrossReference_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -12210,8 +12681,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_a @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetCrossReferenceReq(); struct.req.read(iprot); @@ -12220,29 +12691,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_ar } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetCrossReference_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetCrossReference_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 GetCrossReference_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCrossReference_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCrossReference_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCrossReference_resultTupleSchemeFactory(); - private TGetCrossReferenceResp success; // required + private @org.apache.thrift.annotation.Nullable TGetCrossReferenceResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -12250,6 +12721,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -12265,21 +12737,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -12288,18 +12761,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCrossReferenceResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_result.class, metaDataMap); } @@ -12331,11 +12804,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetCrossReferenceResp getSuccess() { return this.success; } - public void setSuccess(TGetCrossReferenceResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCrossReferenceResp success) { this.success = success; } @@ -12354,7 +12828,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -12367,30 +12841,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetCrossReference_result) @@ -12401,6 +12876,8 @@ public boolean equals(Object that) { public boolean equals(GetCrossReference_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -12416,14 +12893,13 @@ public boolean equals(GetCrossReference_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -12434,7 +12910,7 @@ public int compareTo(GetCrossReference_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -12447,21 +12923,22 @@ public int compareTo(GetCrossReference_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCrossReference_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_result("); boolean first = true; sb.append("success:"); @@ -12491,7 +12968,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -12499,13 +12976,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCrossReference_resultStandardSchemeFactory implements SchemeFactory { + private static class GetCrossReference_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCrossReference_resultStandardScheme getScheme() { return new GetCrossReference_resultStandardScheme(); } } - private static class GetCrossReference_resultStandardScheme extends StandardScheme { + private static class GetCrossReference_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -12550,18 +13027,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCrossReference_ } - private static class GetCrossReference_resultTupleSchemeFactory implements SchemeFactory { + private static class GetCrossReference_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetCrossReference_resultTupleScheme getScheme() { return new GetCrossReference_resultTupleScheme(); } } - private static class GetCrossReference_resultTupleScheme extends TupleScheme { + private static class GetCrossReference_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -12573,8 +13050,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_r @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetCrossReferenceResp(); struct.success.read(iprot); @@ -12583,29 +13060,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_re } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 GetOperationStatus_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetOperationStatus_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetOperationStatus_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetOperationStatus_argsTupleSchemeFactory(); - private TGetOperationStatusReq req; // required + private @org.apache.thrift.annotation.Nullable TGetOperationStatusReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -12613,6 +13090,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -12628,21 +13106,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -12651,18 +13130,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetOperationStatusReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_args.class, metaDataMap); } @@ -12694,11 +13173,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetOperationStatusReq getReq() { return this.req; } - public void setReq(TGetOperationStatusReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetOperationStatusReq req) { this.req = req; } @@ -12717,7 +13197,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -12730,30 +13210,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetOperationStatus_args) @@ -12764,6 +13245,8 @@ public boolean equals(Object that) { public boolean equals(GetOperationStatus_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -12779,14 +13262,13 @@ public boolean equals(GetOperationStatus_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -12797,7 +13279,7 @@ public int compareTo(GetOperationStatus_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -12810,21 +13292,22 @@ public int compareTo(GetOperationStatus_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetOperationStatus_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_args("); boolean first = true; sb.append("req:"); @@ -12854,7 +13337,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -12862,13 +13345,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetOperationStatus_argsStandardSchemeFactory implements SchemeFactory { + private static class GetOperationStatus_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetOperationStatus_argsStandardScheme getScheme() { return new GetOperationStatus_argsStandardScheme(); } } - private static class GetOperationStatus_argsStandardScheme extends StandardScheme { + private static class GetOperationStatus_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -12913,18 +13396,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus } - private static class GetOperationStatus_argsTupleSchemeFactory implements SchemeFactory { + private static class GetOperationStatus_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetOperationStatus_argsTupleScheme getScheme() { return new GetOperationStatus_argsTupleScheme(); } } - private static class GetOperationStatus_argsTupleScheme extends TupleScheme { + private static class GetOperationStatus_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -12936,8 +13419,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetOperationStatusReq(); struct.req.read(iprot); @@ -12946,29 +13429,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_a } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 GetOperationStatus_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetOperationStatus_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetOperationStatus_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetOperationStatus_resultTupleSchemeFactory(); - private TGetOperationStatusResp success; // required + private @org.apache.thrift.annotation.Nullable TGetOperationStatusResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -12976,6 +13459,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -12991,21 +13475,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -13014,18 +13499,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetOperationStatusResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_result.class, metaDataMap); } @@ -13057,11 +13542,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetOperationStatusResp getSuccess() { return this.success; } - public void setSuccess(TGetOperationStatusResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetOperationStatusResp success) { this.success = success; } @@ -13080,7 +13566,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -13093,30 +13579,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetOperationStatus_result) @@ -13127,6 +13614,8 @@ public boolean equals(Object that) { public boolean equals(GetOperationStatus_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -13142,14 +13631,13 @@ public boolean equals(GetOperationStatus_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -13160,7 +13648,7 @@ public int compareTo(GetOperationStatus_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -13173,21 +13661,22 @@ public int compareTo(GetOperationStatus_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetOperationStatus_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_result("); boolean first = true; sb.append("success:"); @@ -13217,7 +13706,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -13225,13 +13714,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetOperationStatus_resultStandardSchemeFactory implements SchemeFactory { + private static class GetOperationStatus_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetOperationStatus_resultStandardScheme getScheme() { return new GetOperationStatus_resultStandardScheme(); } } - private static class GetOperationStatus_resultStandardScheme extends StandardScheme { + private static class GetOperationStatus_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -13276,18 +13765,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus } - private static class GetOperationStatus_resultTupleSchemeFactory implements SchemeFactory { + private static class GetOperationStatus_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetOperationStatus_resultTupleScheme getScheme() { return new GetOperationStatus_resultTupleScheme(); } } - private static class GetOperationStatus_resultTupleScheme extends TupleScheme { + private static class GetOperationStatus_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -13299,8 +13788,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetOperationStatusResp(); struct.success.read(iprot); @@ -13309,29 +13798,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_r } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 CancelOperation_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelOperation_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelOperation_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelOperation_argsTupleSchemeFactory(); - private TCancelOperationReq req; // required + private @org.apache.thrift.annotation.Nullable TCancelOperationReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -13339,6 +13828,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -13354,21 +13844,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -13377,18 +13868,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelOperationReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_args.class, metaDataMap); } @@ -13420,11 +13911,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TCancelOperationReq getReq() { return this.req; } - public void setReq(TCancelOperationReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TCancelOperationReq req) { this.req = req; } @@ -13443,7 +13935,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -13456,30 +13948,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CancelOperation_args) @@ -13490,6 +13983,8 @@ public boolean equals(Object that) { public boolean equals(CancelOperation_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -13505,14 +14000,13 @@ public boolean equals(CancelOperation_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -13523,7 +14017,7 @@ public int compareTo(CancelOperation_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -13536,21 +14030,22 @@ public int compareTo(CancelOperation_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelOperation_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_args("); boolean first = true; sb.append("req:"); @@ -13580,7 +14075,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -13588,13 +14083,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelOperation_argsStandardSchemeFactory implements SchemeFactory { + private static class CancelOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelOperation_argsStandardScheme getScheme() { return new CancelOperation_argsStandardScheme(); } } - private static class CancelOperation_argsStandardScheme extends StandardScheme { + private static class CancelOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -13639,18 +14134,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_ar } - private static class CancelOperation_argsTupleSchemeFactory implements SchemeFactory { + private static class CancelOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelOperation_argsTupleScheme getScheme() { return new CancelOperation_argsTupleScheme(); } } - private static class CancelOperation_argsTupleScheme extends TupleScheme { + private static class CancelOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -13662,8 +14157,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_arg @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCancelOperationReq(); struct.req.read(iprot); @@ -13672,29 +14167,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 CancelOperation_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelOperation_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelOperation_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelOperation_resultTupleSchemeFactory(); - private TCancelOperationResp success; // required + private @org.apache.thrift.annotation.Nullable TCancelOperationResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -13702,6 +14197,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -13717,21 +14213,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -13740,18 +14237,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelOperationResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_result.class, metaDataMap); } @@ -13783,11 +14280,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TCancelOperationResp getSuccess() { return this.success; } - public void setSuccess(TCancelOperationResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelOperationResp success) { this.success = success; } @@ -13806,7 +14304,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -13819,30 +14317,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CancelOperation_result) @@ -13853,6 +14352,8 @@ public boolean equals(Object that) { public boolean equals(CancelOperation_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -13868,14 +14369,13 @@ public boolean equals(CancelOperation_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -13886,7 +14386,7 @@ public int compareTo(CancelOperation_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -13899,21 +14399,22 @@ public int compareTo(CancelOperation_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelOperation_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_result("); boolean first = true; sb.append("success:"); @@ -13943,7 +14444,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -13951,13 +14452,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelOperation_resultStandardSchemeFactory implements SchemeFactory { + private static class CancelOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelOperation_resultStandardScheme getScheme() { return new CancelOperation_resultStandardScheme(); } } - private static class CancelOperation_resultStandardScheme extends StandardScheme { + private static class CancelOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -14002,18 +14503,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_re } - private static class CancelOperation_resultTupleSchemeFactory implements SchemeFactory { + private static class CancelOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelOperation_resultTupleScheme getScheme() { return new CancelOperation_resultTupleScheme(); } } - private static class CancelOperation_resultTupleScheme extends TupleScheme { + private static class CancelOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -14025,8 +14526,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_res @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCancelOperationResp(); struct.success.read(iprot); @@ -14035,29 +14536,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_resu } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 CloseOperation_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseOperation_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseOperation_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseOperation_argsTupleSchemeFactory(); - private TCloseOperationReq req; // required + private @org.apache.thrift.annotation.Nullable TCloseOperationReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -14065,6 +14566,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -14080,21 +14582,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -14103,18 +14606,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseOperationReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_args.class, metaDataMap); } @@ -14146,11 +14649,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TCloseOperationReq getReq() { return this.req; } - public void setReq(TCloseOperationReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TCloseOperationReq req) { this.req = req; } @@ -14169,7 +14673,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -14182,30 +14686,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CloseOperation_args) @@ -14216,6 +14721,8 @@ public boolean equals(Object that) { public boolean equals(CloseOperation_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -14231,14 +14738,13 @@ public boolean equals(CloseOperation_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -14249,7 +14755,7 @@ public int compareTo(CloseOperation_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -14262,21 +14768,22 @@ public int compareTo(CloseOperation_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseOperation_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_args("); boolean first = true; sb.append("req:"); @@ -14306,7 +14813,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -14314,13 +14821,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseOperation_argsStandardSchemeFactory implements SchemeFactory { + private static class CloseOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseOperation_argsStandardScheme getScheme() { return new CloseOperation_argsStandardScheme(); } } - private static class CloseOperation_argsStandardScheme extends StandardScheme { + private static class CloseOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -14365,18 +14872,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_arg } - private static class CloseOperation_argsTupleSchemeFactory implements SchemeFactory { + private static class CloseOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseOperation_argsTupleScheme getScheme() { return new CloseOperation_argsTupleScheme(); } } - private static class CloseOperation_argsTupleScheme extends TupleScheme { + private static class CloseOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -14388,8 +14895,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCloseOperationReq(); struct.req.read(iprot); @@ -14398,29 +14905,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 CloseOperation_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseOperation_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseOperation_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseOperation_resultTupleSchemeFactory(); - private TCloseOperationResp success; // required + private @org.apache.thrift.annotation.Nullable TCloseOperationResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -14428,6 +14935,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -14443,21 +14951,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -14466,18 +14975,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseOperationResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_result.class, metaDataMap); } @@ -14509,11 +15018,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TCloseOperationResp getSuccess() { return this.success; } - public void setSuccess(TCloseOperationResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseOperationResp success) { this.success = success; } @@ -14532,7 +15042,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -14545,30 +15055,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CloseOperation_result) @@ -14579,6 +15090,8 @@ public boolean equals(Object that) { public boolean equals(CloseOperation_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -14594,14 +15107,13 @@ public boolean equals(CloseOperation_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -14612,7 +15124,7 @@ public int compareTo(CloseOperation_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -14625,21 +15137,22 @@ public int compareTo(CloseOperation_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseOperation_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_result("); boolean first = true; sb.append("success:"); @@ -14669,7 +15182,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -14677,13 +15190,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseOperation_resultStandardSchemeFactory implements SchemeFactory { + private static class CloseOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseOperation_resultStandardScheme getScheme() { return new CloseOperation_resultStandardScheme(); } } - private static class CloseOperation_resultStandardScheme extends StandardScheme { + private static class CloseOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -14728,18 +15241,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_res } - private static class CloseOperation_resultTupleSchemeFactory implements SchemeFactory { + private static class CloseOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CloseOperation_resultTupleScheme getScheme() { return new CloseOperation_resultTupleScheme(); } } - private static class CloseOperation_resultTupleScheme extends TupleScheme { + private static class CloseOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -14751,8 +15264,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_resu @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCloseOperationResp(); struct.success.read(iprot); @@ -14761,29 +15274,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_resul } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 GetResultSetMetadata_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetResultSetMetadata_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_argsTupleSchemeFactory(); - private TGetResultSetMetadataReq req; // required + private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -14791,6 +15304,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -14806,21 +15320,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -14829,18 +15344,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetResultSetMetadataReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_args.class, metaDataMap); } @@ -14872,11 +15387,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetResultSetMetadataReq getReq() { return this.req; } - public void setReq(TGetResultSetMetadataReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq req) { this.req = req; } @@ -14895,7 +15411,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -14908,30 +15424,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetResultSetMetadata_args) @@ -14942,6 +15459,8 @@ public boolean equals(Object that) { public boolean equals(GetResultSetMetadata_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -14957,14 +15476,13 @@ public boolean equals(GetResultSetMetadata_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -14975,7 +15493,7 @@ public int compareTo(GetResultSetMetadata_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -14988,21 +15506,22 @@ public int compareTo(GetResultSetMetadata_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetResultSetMetadata_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_args("); boolean first = true; sb.append("req:"); @@ -15032,7 +15551,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -15040,13 +15559,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetResultSetMetadata_argsStandardSchemeFactory implements SchemeFactory { + private static class GetResultSetMetadata_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetResultSetMetadata_argsStandardScheme getScheme() { return new GetResultSetMetadata_argsStandardScheme(); } } - private static class GetResultSetMetadata_argsStandardScheme extends StandardScheme { + private static class GetResultSetMetadata_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -15091,18 +15610,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetada } - private static class GetResultSetMetadata_argsTupleSchemeFactory implements SchemeFactory { + private static class GetResultSetMetadata_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetResultSetMetadata_argsTupleScheme getScheme() { return new GetResultSetMetadata_argsTupleScheme(); } } - private static class GetResultSetMetadata_argsTupleScheme extends TupleScheme { + private static class GetResultSetMetadata_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -15114,8 +15633,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadat @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetResultSetMetadataReq(); struct.req.read(iprot); @@ -15124,29 +15643,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 GetResultSetMetadata_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetResultSetMetadata_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_resultTupleSchemeFactory(); - private TGetResultSetMetadataResp success; // required + private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -15154,6 +15673,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -15169,21 +15689,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -15192,18 +15713,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetResultSetMetadataResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_result.class, metaDataMap); } @@ -15235,11 +15756,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetResultSetMetadataResp getSuccess() { return this.success; } - public void setSuccess(TGetResultSetMetadataResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp success) { this.success = success; } @@ -15258,7 +15780,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -15271,30 +15793,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetResultSetMetadata_result) @@ -15305,6 +15828,8 @@ public boolean equals(Object that) { public boolean equals(GetResultSetMetadata_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -15320,14 +15845,13 @@ public boolean equals(GetResultSetMetadata_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -15338,7 +15862,7 @@ public int compareTo(GetResultSetMetadata_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -15351,21 +15875,22 @@ public int compareTo(GetResultSetMetadata_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetResultSetMetadata_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_result("); boolean first = true; sb.append("success:"); @@ -15395,7 +15920,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -15403,13 +15928,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetResultSetMetadata_resultStandardSchemeFactory implements SchemeFactory { + private static class GetResultSetMetadata_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetResultSetMetadata_resultStandardScheme getScheme() { return new GetResultSetMetadata_resultStandardScheme(); } } - private static class GetResultSetMetadata_resultStandardScheme extends StandardScheme { + private static class GetResultSetMetadata_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -15454,18 +15979,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetada } - private static class GetResultSetMetadata_resultTupleSchemeFactory implements SchemeFactory { + private static class GetResultSetMetadata_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetResultSetMetadata_resultTupleScheme getScheme() { return new GetResultSetMetadata_resultTupleScheme(); } } - private static class GetResultSetMetadata_resultTupleScheme extends TupleScheme { + private static class GetResultSetMetadata_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -15477,8 +16002,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadat @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetResultSetMetadataResp(); struct.success.read(iprot); @@ -15487,29 +16012,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 FetchResults_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new FetchResults_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FetchResults_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FetchResults_argsTupleSchemeFactory(); - private TFetchResultsReq req; // required + private @org.apache.thrift.annotation.Nullable TFetchResultsReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -15517,6 +16042,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -15532,21 +16058,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -15555,18 +16082,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TFetchResultsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_args.class, metaDataMap); } @@ -15598,11 +16125,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TFetchResultsReq getReq() { return this.req; } - public void setReq(TFetchResultsReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TFetchResultsReq req) { this.req = req; } @@ -15621,7 +16149,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -15634,30 +16162,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof FetchResults_args) @@ -15668,6 +16197,8 @@ public boolean equals(Object that) { public boolean equals(FetchResults_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -15683,14 +16214,13 @@ public boolean equals(FetchResults_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -15701,7 +16231,7 @@ public int compareTo(FetchResults_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -15714,21 +16244,22 @@ public int compareTo(FetchResults_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("FetchResults_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_args("); boolean first = true; sb.append("req:"); @@ -15758,7 +16289,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -15766,13 +16297,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class FetchResults_argsStandardSchemeFactory implements SchemeFactory { + private static class FetchResults_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public FetchResults_argsStandardScheme getScheme() { return new FetchResults_argsStandardScheme(); } } - private static class FetchResults_argsStandardScheme extends StandardScheme { + private static class FetchResults_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -15817,18 +16348,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_args } - private static class FetchResults_argsTupleSchemeFactory implements SchemeFactory { + private static class FetchResults_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public FetchResults_argsTupleScheme getScheme() { return new FetchResults_argsTupleScheme(); } } - private static class FetchResults_argsTupleScheme extends TupleScheme { + private static class FetchResults_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -15840,8 +16371,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args s @Override public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TFetchResultsReq(); struct.req.read(iprot); @@ -15850,29 +16381,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_args st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 FetchResults_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new FetchResults_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FetchResults_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FetchResults_resultTupleSchemeFactory(); - private TFetchResultsResp success; // required + private @org.apache.thrift.annotation.Nullable TFetchResultsResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -15880,6 +16411,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -15895,21 +16427,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -15918,18 +16451,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TFetchResultsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_result.class, metaDataMap); } @@ -15961,11 +16494,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TFetchResultsResp getSuccess() { return this.success; } - public void setSuccess(TFetchResultsResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TFetchResultsResp success) { this.success = success; } @@ -15984,7 +16518,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -15997,30 +16531,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof FetchResults_result) @@ -16031,6 +16566,8 @@ public boolean equals(Object that) { public boolean equals(FetchResults_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -16046,14 +16583,13 @@ public boolean equals(FetchResults_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -16064,7 +16600,7 @@ public int compareTo(FetchResults_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -16077,21 +16613,22 @@ public int compareTo(FetchResults_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("FetchResults_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_result("); boolean first = true; sb.append("success:"); @@ -16121,7 +16658,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -16129,13 +16666,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class FetchResults_resultStandardSchemeFactory implements SchemeFactory { + private static class FetchResults_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public FetchResults_resultStandardScheme getScheme() { return new FetchResults_resultStandardScheme(); } } - private static class FetchResults_resultStandardScheme extends StandardScheme { + private static class FetchResults_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -16180,18 +16717,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_resul } - private static class FetchResults_resultTupleSchemeFactory implements SchemeFactory { + private static class FetchResults_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public FetchResults_resultTupleScheme getScheme() { return new FetchResults_resultTupleScheme(); } } - private static class FetchResults_resultTupleScheme extends TupleScheme { + private static class FetchResults_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -16203,8 +16740,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TFetchResultsResp(); struct.success.read(iprot); @@ -16213,29 +16750,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 GetDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetDelegationToken_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetDelegationToken_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetDelegationToken_argsTupleSchemeFactory(); - private TGetDelegationTokenReq req; // required + private @org.apache.thrift.annotation.Nullable TGetDelegationTokenReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -16243,6 +16780,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -16258,21 +16796,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -16281,18 +16820,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_args.class, metaDataMap); } @@ -16324,11 +16863,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetDelegationTokenReq getReq() { return this.req; } - public void setReq(TGetDelegationTokenReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetDelegationTokenReq req) { this.req = req; } @@ -16347,7 +16887,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -16360,30 +16900,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetDelegationToken_args) @@ -16394,6 +16935,8 @@ public boolean equals(Object that) { public boolean equals(GetDelegationToken_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -16409,14 +16952,13 @@ public boolean equals(GetDelegationToken_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -16427,7 +16969,7 @@ public int compareTo(GetDelegationToken_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -16440,21 +16982,22 @@ public int compareTo(GetDelegationToken_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetDelegationToken_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_args("); boolean first = true; sb.append("req:"); @@ -16484,7 +17027,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -16492,13 +17035,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetDelegationToken_argsStandardSchemeFactory implements SchemeFactory { + private static class GetDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetDelegationToken_argsStandardScheme getScheme() { return new GetDelegationToken_argsStandardScheme(); } } - private static class GetDelegationToken_argsStandardScheme extends StandardScheme { + private static class GetDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -16543,18 +17086,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken } - private static class GetDelegationToken_argsTupleSchemeFactory implements SchemeFactory { + private static class GetDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetDelegationToken_argsTupleScheme getScheme() { return new GetDelegationToken_argsTupleScheme(); } } - private static class GetDelegationToken_argsTupleScheme extends TupleScheme { + private static class GetDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -16566,8 +17109,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetDelegationTokenReq(); struct.req.read(iprot); @@ -16576,29 +17119,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_a } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 GetDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetDelegationToken_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetDelegationToken_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetDelegationToken_resultTupleSchemeFactory(); - private TGetDelegationTokenResp success; // required + private @org.apache.thrift.annotation.Nullable TGetDelegationTokenResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -16606,6 +17149,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -16621,21 +17165,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -16644,18 +17189,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_result.class, metaDataMap); } @@ -16687,11 +17232,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetDelegationTokenResp getSuccess() { return this.success; } - public void setSuccess(TGetDelegationTokenResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetDelegationTokenResp success) { this.success = success; } @@ -16710,7 +17256,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -16723,30 +17269,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetDelegationToken_result) @@ -16757,6 +17304,8 @@ public boolean equals(Object that) { public boolean equals(GetDelegationToken_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -16772,14 +17321,13 @@ public boolean equals(GetDelegationToken_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -16790,7 +17338,7 @@ public int compareTo(GetDelegationToken_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -16803,21 +17351,22 @@ public int compareTo(GetDelegationToken_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetDelegationToken_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_result("); boolean first = true; sb.append("success:"); @@ -16847,7 +17396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -16855,13 +17404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetDelegationToken_resultStandardSchemeFactory implements SchemeFactory { + private static class GetDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetDelegationToken_resultStandardScheme getScheme() { return new GetDelegationToken_resultStandardScheme(); } } - private static class GetDelegationToken_resultStandardScheme extends StandardScheme { + private static class GetDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -16906,18 +17455,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken } - private static class GetDelegationToken_resultTupleSchemeFactory implements SchemeFactory { + private static class GetDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetDelegationToken_resultTupleScheme getScheme() { return new GetDelegationToken_resultTupleScheme(); } } - private static class GetDelegationToken_resultTupleScheme extends TupleScheme { + private static class GetDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -16929,8 +17478,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetDelegationTokenResp(); struct.success.read(iprot); @@ -16939,29 +17488,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_r } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 CancelDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelDelegationToken_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_argsTupleSchemeFactory(); - private TCancelDelegationTokenReq req; // required + private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -16969,6 +17518,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -16984,21 +17534,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -17007,18 +17558,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_args.class, metaDataMap); } @@ -17050,11 +17601,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TCancelDelegationTokenReq getReq() { return this.req; } - public void setReq(TCancelDelegationTokenReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq req) { this.req = req; } @@ -17073,7 +17625,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -17086,30 +17638,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CancelDelegationToken_args) @@ -17120,6 +17673,8 @@ public boolean equals(Object that) { public boolean equals(CancelDelegationToken_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -17135,14 +17690,13 @@ public boolean equals(CancelDelegationToken_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -17153,7 +17707,7 @@ public int compareTo(CancelDelegationToken_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -17166,21 +17720,22 @@ public int compareTo(CancelDelegationToken_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelDelegationToken_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_args("); boolean first = true; sb.append("req:"); @@ -17210,7 +17765,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -17218,13 +17773,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelDelegationToken_argsStandardSchemeFactory implements SchemeFactory { + private static class CancelDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelDelegationToken_argsStandardScheme getScheme() { return new CancelDelegationToken_argsStandardScheme(); } } - private static class CancelDelegationToken_argsStandardScheme extends StandardScheme { + private static class CancelDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -17269,18 +17824,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationTo } - private static class CancelDelegationToken_argsTupleSchemeFactory implements SchemeFactory { + private static class CancelDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelDelegationToken_argsTupleScheme getScheme() { return new CancelDelegationToken_argsTupleScheme(); } } - private static class CancelDelegationToken_argsTupleScheme extends TupleScheme { + private static class CancelDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -17292,8 +17847,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationTok @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCancelDelegationTokenReq(); struct.req.read(iprot); @@ -17302,29 +17857,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToke } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 CancelDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelDelegationToken_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_resultTupleSchemeFactory(); - private TCancelDelegationTokenResp success; // required + private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -17332,6 +17887,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -17347,21 +17903,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -17370,18 +17927,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_result.class, metaDataMap); } @@ -17413,11 +17970,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TCancelDelegationTokenResp getSuccess() { return this.success; } - public void setSuccess(TCancelDelegationTokenResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp success) { this.success = success; } @@ -17436,7 +17994,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -17449,30 +18007,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof CancelDelegationToken_result) @@ -17483,6 +18042,8 @@ public boolean equals(Object that) { public boolean equals(CancelDelegationToken_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -17498,14 +18059,13 @@ public boolean equals(CancelDelegationToken_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -17516,7 +18076,7 @@ public int compareTo(CancelDelegationToken_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -17529,21 +18089,22 @@ public int compareTo(CancelDelegationToken_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelDelegationToken_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_result("); boolean first = true; sb.append("success:"); @@ -17573,7 +18134,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -17581,13 +18142,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelDelegationToken_resultStandardSchemeFactory implements SchemeFactory { + private static class CancelDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelDelegationToken_resultStandardScheme getScheme() { return new CancelDelegationToken_resultStandardScheme(); } } - private static class CancelDelegationToken_resultStandardScheme extends StandardScheme { + private static class CancelDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -17632,18 +18193,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationTo } - private static class CancelDelegationToken_resultTupleSchemeFactory implements SchemeFactory { + private static class CancelDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public CancelDelegationToken_resultTupleScheme getScheme() { return new CancelDelegationToken_resultTupleScheme(); } } - private static class CancelDelegationToken_resultTupleScheme extends TupleScheme { + private static class CancelDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -17655,8 +18216,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationTok @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCancelDelegationTokenResp(); struct.success.read(iprot); @@ -17665,29 +18226,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToke } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 RenewDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RenewDelegationToken_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_argsTupleSchemeFactory(); - private TRenewDelegationTokenReq req; // required + private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -17695,6 +18256,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -17710,21 +18272,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -17733,18 +18296,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TRenewDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_args.class, metaDataMap); } @@ -17776,11 +18339,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TRenewDelegationTokenReq getReq() { return this.req; } - public void setReq(TRenewDelegationTokenReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq req) { this.req = req; } @@ -17799,7 +18363,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -17812,30 +18376,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof RenewDelegationToken_args) @@ -17846,6 +18411,8 @@ public boolean equals(Object that) { public boolean equals(RenewDelegationToken_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -17861,14 +18428,13 @@ public boolean equals(RenewDelegationToken_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -17879,7 +18445,7 @@ public int compareTo(RenewDelegationToken_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -17892,21 +18458,22 @@ public int compareTo(RenewDelegationToken_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("RenewDelegationToken_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_args("); boolean first = true; sb.append("req:"); @@ -17936,7 +18503,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -17944,13 +18511,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class RenewDelegationToken_argsStandardSchemeFactory implements SchemeFactory { + private static class RenewDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public RenewDelegationToken_argsStandardScheme getScheme() { return new RenewDelegationToken_argsStandardScheme(); } } - private static class RenewDelegationToken_argsStandardScheme extends StandardScheme { + private static class RenewDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -17995,18 +18562,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationTok } - private static class RenewDelegationToken_argsTupleSchemeFactory implements SchemeFactory { + private static class RenewDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public RenewDelegationToken_argsTupleScheme getScheme() { return new RenewDelegationToken_argsTupleScheme(); } } - private static class RenewDelegationToken_argsTupleScheme extends TupleScheme { + private static class RenewDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -18018,8 +18585,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToke @Override public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TRenewDelegationTokenReq(); struct.req.read(iprot); @@ -18028,29 +18595,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 RenewDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RenewDelegationToken_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_resultTupleSchemeFactory(); - private TRenewDelegationTokenResp success; // required + private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -18058,6 +18625,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -18073,21 +18641,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -18096,18 +18665,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TRenewDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_result.class, metaDataMap); } @@ -18139,11 +18708,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TRenewDelegationTokenResp getSuccess() { return this.success; } - public void setSuccess(TRenewDelegationTokenResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp success) { this.success = success; } @@ -18162,7 +18732,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -18175,30 +18745,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof RenewDelegationToken_result) @@ -18209,6 +18780,8 @@ public boolean equals(Object that) { public boolean equals(RenewDelegationToken_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -18224,14 +18797,13 @@ public boolean equals(RenewDelegationToken_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -18242,7 +18814,7 @@ public int compareTo(RenewDelegationToken_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -18255,21 +18827,22 @@ public int compareTo(RenewDelegationToken_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("RenewDelegationToken_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_result("); boolean first = true; sb.append("success:"); @@ -18299,7 +18872,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -18307,13 +18880,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class RenewDelegationToken_resultStandardSchemeFactory implements SchemeFactory { + private static class RenewDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public RenewDelegationToken_resultStandardScheme getScheme() { return new RenewDelegationToken_resultStandardScheme(); } } - private static class RenewDelegationToken_resultStandardScheme extends StandardScheme { + private static class RenewDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -18358,18 +18931,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationTok } - private static class RenewDelegationToken_resultTupleSchemeFactory implements SchemeFactory { + private static class RenewDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public RenewDelegationToken_resultTupleScheme getScheme() { return new RenewDelegationToken_resultTupleScheme(); } } - private static class RenewDelegationToken_resultTupleScheme extends TupleScheme { + private static class RenewDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -18381,8 +18954,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToke @Override public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TRenewDelegationTokenResp(); struct.success.read(iprot); @@ -18391,29 +18964,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetQueryId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 GetQueryId_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetQueryId_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetQueryId_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetQueryId_argsTupleSchemeFactory(); - private TGetQueryIdReq req; // required + private @org.apache.thrift.annotation.Nullable TGetQueryIdReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -18421,6 +18994,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -18436,21 +19010,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -18459,18 +19034,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetQueryIdReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_args.class, metaDataMap); } @@ -18502,11 +19077,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TGetQueryIdReq getReq() { return this.req; } - public void setReq(TGetQueryIdReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TGetQueryIdReq req) { this.req = req; } @@ -18525,7 +19101,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -18538,30 +19114,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetQueryId_args) @@ -18572,6 +19149,8 @@ public boolean equals(Object that) { public boolean equals(GetQueryId_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -18587,14 +19166,13 @@ public boolean equals(GetQueryId_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -18605,7 +19183,7 @@ public int compareTo(GetQueryId_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -18618,21 +19196,22 @@ public int compareTo(GetQueryId_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetQueryId_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_args("); boolean first = true; sb.append("req:"); @@ -18662,7 +19241,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -18670,13 +19249,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetQueryId_argsStandardSchemeFactory implements SchemeFactory { + private static class GetQueryId_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetQueryId_argsStandardScheme getScheme() { return new GetQueryId_argsStandardScheme(); } } - private static class GetQueryId_argsStandardScheme extends StandardScheme { + private static class GetQueryId_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -18721,18 +19300,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetQueryId_args st } - private static class GetQueryId_argsTupleSchemeFactory implements SchemeFactory { + private static class GetQueryId_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetQueryId_argsTupleScheme getScheme() { return new GetQueryId_argsTupleScheme(); } } - private static class GetQueryId_argsTupleScheme extends TupleScheme { + private static class GetQueryId_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -18744,8 +19323,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args str @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetQueryIdReq(); struct.req.read(iprot); @@ -18754,29 +19333,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class GetQueryId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class GetQueryId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 GetQueryId_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetQueryId_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetQueryId_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetQueryId_resultTupleSchemeFactory(); - private TGetQueryIdResp success; // required + private @org.apache.thrift.annotation.Nullable TGetQueryIdResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -18784,6 +19363,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -18799,21 +19379,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -18822,18 +19403,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetQueryIdResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_result.class, metaDataMap); } @@ -18865,11 +19446,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TGetQueryIdResp getSuccess() { return this.success; } - public void setSuccess(TGetQueryIdResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetQueryIdResp success) { this.success = success; } @@ -18888,7 +19470,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -18901,30 +19483,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof GetQueryId_result) @@ -18935,6 +19518,8 @@ public boolean equals(Object that) { public boolean equals(GetQueryId_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -18950,14 +19535,13 @@ public boolean equals(GetQueryId_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -18968,7 +19552,7 @@ public int compareTo(GetQueryId_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -18981,21 +19565,22 @@ public int compareTo(GetQueryId_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetQueryId_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_result("); boolean first = true; sb.append("success:"); @@ -19025,7 +19610,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -19033,13 +19618,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetQueryId_resultStandardSchemeFactory implements SchemeFactory { + private static class GetQueryId_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetQueryId_resultStandardScheme getScheme() { return new GetQueryId_resultStandardScheme(); } } - private static class GetQueryId_resultStandardScheme extends StandardScheme { + private static class GetQueryId_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -19084,18 +19669,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetQueryId_result } - private static class GetQueryId_resultTupleSchemeFactory implements SchemeFactory { + private static class GetQueryId_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public GetQueryId_resultTupleScheme getScheme() { return new GetQueryId_resultTupleScheme(); } } - private static class GetQueryId_resultTupleScheme extends TupleScheme { + private static class GetQueryId_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -19107,8 +19692,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetQueryIdResp(); struct.success.read(iprot); @@ -19117,29 +19702,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class SetClientInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 SetClientInfo_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SetClientInfo_argsTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SetClientInfo_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SetClientInfo_argsTupleSchemeFactory(); - private TSetClientInfoReq req; // required + private @org.apache.thrift.annotation.Nullable TSetClientInfoReq 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -19147,6 +19732,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -19162,21 +19748,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -19185,18 +19772,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TSetClientInfoReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_args.class, metaDataMap); } @@ -19228,11 +19815,12 @@ public void clear() { this.req = null; } + @org.apache.thrift.annotation.Nullable public TSetClientInfoReq getReq() { return this.req; } - public void setReq(TSetClientInfoReq req) { + public void setReq(@org.apache.thrift.annotation.Nullable TSetClientInfoReq req) { this.req = req; } @@ -19251,7 +19839,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case REQ: if (value == null) { @@ -19264,30 +19852,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof SetClientInfo_args) @@ -19298,6 +19887,8 @@ public boolean equals(Object that) { public boolean equals(SetClientInfo_args that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -19313,14 +19904,13 @@ public boolean equals(SetClientInfo_args that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -19331,7 +19921,7 @@ public int compareTo(SetClientInfo_args other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -19344,21 +19934,22 @@ public int compareTo(SetClientInfo_args other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("SetClientInfo_args("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_args("); boolean first = true; sb.append("req:"); @@ -19388,7 +19979,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -19396,13 +19987,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class SetClientInfo_argsStandardSchemeFactory implements SchemeFactory { + private static class SetClientInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SetClientInfo_argsStandardScheme getScheme() { return new SetClientInfo_argsStandardScheme(); } } - private static class SetClientInfo_argsStandardScheme extends StandardScheme { + private static class SetClientInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -19447,18 +20038,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, SetClientInfo_args } - private static class SetClientInfo_argsTupleSchemeFactory implements SchemeFactory { + private static class SetClientInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SetClientInfo_argsTupleScheme getScheme() { return new SetClientInfo_argsTupleScheme(); } } - private static class SetClientInfo_argsTupleScheme extends TupleScheme { + private static class SetClientInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -19470,8 +20061,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TSetClientInfoReq(); struct.req.read(iprot); @@ -19480,29 +20071,29 @@ public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args s } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } - @org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public static class SetClientInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + public static class SetClientInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 SetClientInfo_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new SetClientInfo_resultTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SetClientInfo_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SetClientInfo_resultTupleSchemeFactory(); - private TSetClientInfoResp success; // required + private @org.apache.thrift.annotation.Nullable TSetClientInfoResp 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(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -19510,6 +20101,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -19525,21 +20117,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -19548,18 +20141,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TSetClientInfoResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_result.class, metaDataMap); } @@ -19591,11 +20184,12 @@ public void clear() { this.success = null; } + @org.apache.thrift.annotation.Nullable public TSetClientInfoResp getSuccess() { return this.success; } - public void setSuccess(TSetClientInfoResp success) { + public void setSuccess(@org.apache.thrift.annotation.Nullable TSetClientInfoResp success) { this.success = success; } @@ -19614,7 +20208,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -19627,30 +20221,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof SetClientInfo_result) @@ -19661,6 +20256,8 @@ public boolean equals(Object that) { public boolean equals(SetClientInfo_result that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -19676,14 +20273,13 @@ public boolean equals(SetClientInfo_result that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -19694,7 +20290,7 @@ public int compareTo(SetClientInfo_result other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -19707,21 +20303,22 @@ public int compareTo(SetClientInfo_result other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("SetClientInfo_result("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_result("); boolean first = true; sb.append("success:"); @@ -19751,7 +20348,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -19759,13 +20356,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class SetClientInfo_resultStandardSchemeFactory implements SchemeFactory { + private static class SetClientInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SetClientInfo_resultStandardScheme getScheme() { return new SetClientInfo_resultStandardScheme(); } } - private static class SetClientInfo_resultStandardScheme extends StandardScheme { + private static class SetClientInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -19810,18 +20407,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, SetClientInfo_resu } - private static class SetClientInfo_resultTupleSchemeFactory implements SchemeFactory { + private static class SetClientInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public SetClientInfo_resultTupleScheme getScheme() { return new SetClientInfo_resultTupleScheme(); } } - private static class SetClientInfo_resultTupleScheme extends TupleScheme { + private static class SetClientInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -19833,8 +20430,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_resul @Override public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TSetClientInfoResp(); struct.success.read(iprot); @@ -19843,6 +20440,9 @@ public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java index 9503fd4708e0..2a46ad57531e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java @@ -1,86 +1,81 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -import java.util.Map; -import java.util.HashMap; -import java.util.Set; -import java.util.HashSet; +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class TCLIServiceConstants { -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCLIServiceConstants { - - public static final Set PRIMITIVE_TYPES = new HashSet(); + public static final java.util.Set PRIMITIVE_TYPES = java.util.EnumSet.noneOf(TTypeId.class); static { - PRIMITIVE_TYPES.add(TTypeId.BOOLEAN_TYPE); - PRIMITIVE_TYPES.add(TTypeId.TINYINT_TYPE); - PRIMITIVE_TYPES.add(TTypeId.SMALLINT_TYPE); - PRIMITIVE_TYPES.add(TTypeId.INT_TYPE); - PRIMITIVE_TYPES.add(TTypeId.BIGINT_TYPE); - PRIMITIVE_TYPES.add(TTypeId.FLOAT_TYPE); - PRIMITIVE_TYPES.add(TTypeId.DOUBLE_TYPE); - PRIMITIVE_TYPES.add(TTypeId.STRING_TYPE); - PRIMITIVE_TYPES.add(TTypeId.TIMESTAMP_TYPE); - PRIMITIVE_TYPES.add(TTypeId.BINARY_TYPE); - PRIMITIVE_TYPES.add(TTypeId.DECIMAL_TYPE); - PRIMITIVE_TYPES.add(TTypeId.NULL_TYPE); - PRIMITIVE_TYPES.add(TTypeId.DATE_TYPE); - PRIMITIVE_TYPES.add(TTypeId.VARCHAR_TYPE); - PRIMITIVE_TYPES.add(TTypeId.CHAR_TYPE); - PRIMITIVE_TYPES.add(TTypeId.INTERVAL_YEAR_MONTH_TYPE); - PRIMITIVE_TYPES.add(TTypeId.INTERVAL_DAY_TIME_TYPE); - PRIMITIVE_TYPES.add(TTypeId.TIMESTAMPLOCALTZ_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.BOOLEAN_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.TINYINT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.SMALLINT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.INT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.BIGINT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.FLOAT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.DOUBLE_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.STRING_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMP_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.BINARY_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.DECIMAL_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.NULL_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.DATE_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.VARCHAR_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.CHAR_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE); } - public static final Set COMPLEX_TYPES = new HashSet(); + public static final java.util.Set COMPLEX_TYPES = java.util.EnumSet.noneOf(TTypeId.class); static { - COMPLEX_TYPES.add(TTypeId.ARRAY_TYPE); - COMPLEX_TYPES.add(TTypeId.MAP_TYPE); - COMPLEX_TYPES.add(TTypeId.STRUCT_TYPE); - COMPLEX_TYPES.add(TTypeId.UNION_TYPE); - COMPLEX_TYPES.add(TTypeId.USER_DEFINED_TYPE); + COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.ARRAY_TYPE); + COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.MAP_TYPE); + COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.STRUCT_TYPE); + COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.UNION_TYPE); + COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.USER_DEFINED_TYPE); } - public static final Set COLLECTION_TYPES = new HashSet(); + public static final java.util.Set COLLECTION_TYPES = java.util.EnumSet.noneOf(TTypeId.class); static { - COLLECTION_TYPES.add(TTypeId.ARRAY_TYPE); - COLLECTION_TYPES.add(TTypeId.MAP_TYPE); + COLLECTION_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.ARRAY_TYPE); + COLLECTION_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.MAP_TYPE); } - public static final Map TYPE_NAMES = new HashMap(); + public static final java.util.Map TYPE_NAMES = new java.util.EnumMap(TTypeId.class); static { - TYPE_NAMES.put(TTypeId.BOOLEAN_TYPE, "BOOLEAN"); - TYPE_NAMES.put(TTypeId.TINYINT_TYPE, "TINYINT"); - TYPE_NAMES.put(TTypeId.SMALLINT_TYPE, "SMALLINT"); - TYPE_NAMES.put(TTypeId.INT_TYPE, "INT"); - TYPE_NAMES.put(TTypeId.BIGINT_TYPE, "BIGINT"); - TYPE_NAMES.put(TTypeId.FLOAT_TYPE, "FLOAT"); - TYPE_NAMES.put(TTypeId.DOUBLE_TYPE, "DOUBLE"); - TYPE_NAMES.put(TTypeId.STRING_TYPE, "STRING"); - TYPE_NAMES.put(TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); - TYPE_NAMES.put(TTypeId.BINARY_TYPE, "BINARY"); - TYPE_NAMES.put(TTypeId.ARRAY_TYPE, "ARRAY"); - TYPE_NAMES.put(TTypeId.MAP_TYPE, "MAP"); - TYPE_NAMES.put(TTypeId.STRUCT_TYPE, "STRUCT"); - TYPE_NAMES.put(TTypeId.UNION_TYPE, "UNIONTYPE"); - TYPE_NAMES.put(TTypeId.DECIMAL_TYPE, "DECIMAL"); - TYPE_NAMES.put(TTypeId.NULL_TYPE, "NULL"); - TYPE_NAMES.put(TTypeId.DATE_TYPE, "DATE"); - TYPE_NAMES.put(TTypeId.VARCHAR_TYPE, "VARCHAR"); - TYPE_NAMES.put(TTypeId.CHAR_TYPE, "CHAR"); - TYPE_NAMES.put(TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); - TYPE_NAMES.put(TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); - TYPE_NAMES.put(TTypeId.TIMESTAMPLOCALTZ_TYPE, "TIMESTAMP WITH LOCAL TIME ZONE"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.ARRAY_TYPE, "ARRAY"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.BIGINT_TYPE, "BIGINT"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.BINARY_TYPE, "BINARY"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.BOOLEAN_TYPE, "BOOLEAN"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.CHAR_TYPE, "CHAR"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.DATE_TYPE, "DATE"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.DECIMAL_TYPE, "DECIMAL"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.DOUBLE_TYPE, "DOUBLE"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.FLOAT_TYPE, "FLOAT"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.INT_TYPE, "INT"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.MAP_TYPE, "MAP"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.NULL_TYPE, "NULL"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.SMALLINT_TYPE, "SMALLINT"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.STRING_TYPE, "STRING"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.STRUCT_TYPE, "STRUCT"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE, "TIMESTAMP WITH LOCAL TIME ZONE"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.TINYINT_TYPE, "TINYINT"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.UNION_TYPE, "UNIONTYPE"); + TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.VARCHAR_TYPE, "VARCHAR"); } - public static final String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; + public static final java.lang.String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; - public static final String PRECISION = "precision"; + public static final java.lang.String PRECISION = "precision"; - public static final String SCALE = "scale"; + public static final java.lang.String SCALE = "scale"; } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java index 7cd0a6df9cd2..c0e79e71d06f 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java @@ -1,53 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenReq"); 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelDelegationTokenReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String delegationToken; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), DELEGATION_TOKEN((short)2, "delegationToken"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -55,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -72,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -95,20 +78,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenReq.class, metaDataMap); } @@ -117,7 +100,7 @@ public TCancelDelegationTokenReq() { public TCancelDelegationTokenReq( TSessionHandle sessionHandle, - String delegationToken) + java.lang.String delegationToken) { this(); this.sessionHandle = sessionHandle; @@ -146,11 +129,12 @@ public void clear() { this.delegationToken = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -169,11 +153,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getDelegationToken() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getDelegationToken() { return this.delegationToken; } - public void setDelegationToken(String delegationToken) { + public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { this.delegationToken = delegationToken; } @@ -192,7 +177,7 @@ public void setDelegationTokenIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -206,14 +191,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetDelegationToken(); } else { - setDelegationToken((String)value); + setDelegationToken((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -222,13 +208,13 @@ public Object getFieldValue(_Fields field) { return getDelegationToken(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +223,11 @@ public boolean isSet(_Fields field) { case DELEGATION_TOKEN: return isSetDelegationToken(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCancelDelegationTokenReq) @@ -252,6 +238,8 @@ public boolean equals(Object that) { public boolean equals(TCancelDelegationTokenReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -276,19 +264,17 @@ public boolean equals(TCancelDelegationTokenReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_delegationToken = true && (isSetDelegationToken()); - list.add(present_delegationToken); - if (present_delegationToken) - list.add(delegationToken); + hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); + if (isSetDelegationToken()) + hashCode = hashCode * 8191 + delegationToken.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +285,7 @@ public int compareTo(TCancelDelegationTokenReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +295,7 @@ public int compareTo(TCancelDelegationTokenReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +308,22 @@ public int compareTo(TCancelDelegationTokenReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelDelegationTokenReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenReq("); boolean first = true; sb.append("sessionHandle:"); @@ -382,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -390,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelDelegationTokenReqStandardSchemeFactory implements SchemeFactory { + private static class TCancelDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelDelegationTokenReqStandardScheme getScheme() { return new TCancelDelegationTokenReqStandardScheme(); } } - private static class TCancelDelegationTokenReqStandardScheme extends StandardScheme { + private static class TCancelDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -454,24 +441,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationT } - private static class TCancelDelegationTokenReqTupleSchemeFactory implements SchemeFactory { + private static class TCancelDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelDelegationTokenReqTupleScheme getScheme() { return new TCancelDelegationTokenReqTupleScheme(); } } - private static class TCancelDelegationTokenReqTupleScheme extends TupleScheme { + private static class TCancelDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.delegationToken); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); @@ -480,5 +467,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTok } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java index c8e0b5677bfc..22b18f2aa9ca 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelDelegationTokenRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenRespTupleSchemeFactory(); - private TStatus status; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { STATUS((short)1, "status"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.status = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -156,7 +140,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCancelDelegationTokenResp) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TCancelDelegationTokenResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -218,14 +205,13 @@ public boolean equals(TCancelDelegationTokenResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TCancelDelegationTokenResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TCancelDelegationTokenResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelDelegationTokenResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenResp("); boolean first = true; sb.append("status:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelDelegationTokenRespStandardSchemeFactory implements SchemeFactory { + private static class TCancelDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelDelegationTokenRespStandardScheme getScheme() { return new TCancelDelegationTokenRespStandardScheme(); } } - private static class TCancelDelegationTokenRespStandardScheme extends StandardScheme { + private static class TCancelDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationT } - private static class TCancelDelegationTokenRespTupleSchemeFactory implements SchemeFactory { + private static class TCancelDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelDelegationTokenRespTupleScheme getScheme() { return new TCancelDelegationTokenRespTupleScheme(); } } - private static class TCancelDelegationTokenRespTupleScheme extends TupleScheme { + private static class TCancelDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java index 552721c0ff12..ef0ced4ae7b0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq"); 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)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelOperationReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelOperationReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationReqTupleSchemeFactory(); - private TOperationHandle operationHandle; // required + private @org.apache.thrift.annotation.Nullable 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -156,7 +140,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCancelOperationReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TCancelOperationReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -218,14 +205,13 @@ public boolean equals(TCancelOperationReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TCancelOperationReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TCancelOperationReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelOperationReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationReq("); boolean first = true; sb.append("operationHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelOperationReqStandardSchemeFactory implements SchemeFactory { + private static class TCancelOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelOperationReqStandardScheme getScheme() { return new TCancelOperationReqStandardScheme(); } } - private static class TCancelOperationReqStandardScheme extends StandardScheme { + private static class TCancelOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationRe } - private static class TCancelOperationReqTupleSchemeFactory implements SchemeFactory { + private static class TCancelOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelOperationReqTupleScheme getScheme() { return new TCancelOperationReqTupleScheme(); } } - private static class TCancelOperationReqTupleScheme extends TupleScheme { + private static class TCancelOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java index 83ef79c0d2e9..5b352b3fca1a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelOperationRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelOperationRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationRespTupleSchemeFactory(); - private TStatus status; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { STATUS((short)1, "status"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationResp.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.status = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -156,7 +140,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCancelOperationResp) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TCancelOperationResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -218,14 +205,13 @@ public boolean equals(TCancelOperationResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TCancelOperationResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TCancelOperationResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelOperationResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationResp("); boolean first = true; sb.append("status:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelOperationRespStandardSchemeFactory implements SchemeFactory { + private static class TCancelOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelOperationRespStandardScheme getScheme() { return new TCancelOperationRespStandardScheme(); } } - private static class TCancelOperationRespStandardScheme extends StandardScheme { + private static class TCancelOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationRe } - private static class TCancelOperationRespTupleSchemeFactory implements SchemeFactory { + private static class TCancelOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCancelOperationRespTupleScheme getScheme() { return new TCancelOperationRespTupleScheme(); } } - private static class TCancelOperationRespTupleScheme extends TupleScheme { + private static class TCancelOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java index 7e8e968c3960..bcae7b3b5e9d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationReq"); 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)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseOperationReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseOperationReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationReqTupleSchemeFactory(); - private TOperationHandle operationHandle; // required + private @org.apache.thrift.annotation.Nullable 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -156,7 +140,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCloseOperationReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TCloseOperationReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -218,14 +205,13 @@ public boolean equals(TCloseOperationReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TCloseOperationReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TCloseOperationReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseOperationReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationReq("); boolean first = true; sb.append("operationHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseOperationReqStandardSchemeFactory implements SchemeFactory { + private static class TCloseOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseOperationReqStandardScheme getScheme() { return new TCloseOperationReqStandardScheme(); } } - private static class TCloseOperationReqStandardScheme extends StandardScheme { + private static class TCloseOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationReq } - private static class TCloseOperationReqTupleSchemeFactory implements SchemeFactory { + private static class TCloseOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseOperationReqTupleScheme getScheme() { return new TCloseOperationReqTupleScheme(); } } - private static class TCloseOperationReqTupleScheme extends TupleScheme { + private static class TCloseOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java index 6d27642561ba..da4f84aa443d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseOperationRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseOperationRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationRespTupleSchemeFactory(); - private TStatus status; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { STATUS((short)1, "status"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationResp.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.status = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -156,7 +140,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCloseOperationResp) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TCloseOperationResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -218,14 +205,13 @@ public boolean equals(TCloseOperationResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TCloseOperationResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TCloseOperationResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseOperationResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationResp("); boolean first = true; sb.append("status:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseOperationRespStandardSchemeFactory implements SchemeFactory { + private static class TCloseOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseOperationRespStandardScheme getScheme() { return new TCloseOperationRespStandardScheme(); } } - private static class TCloseOperationRespStandardScheme extends StandardScheme { + private static class TCloseOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationRes } - private static class TCloseOperationRespTupleSchemeFactory implements SchemeFactory { + private static class TCloseOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseOperationRespTupleScheme getScheme() { return new TCloseOperationRespTupleScheme(); } } - private static class TCloseOperationRespTupleScheme extends TupleScheme { + private static class TCloseOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java index 938a470901cd..61d1b3b9830a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionReq"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseSessionReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseSessionReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.sessionHandle = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -156,7 +140,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCloseSessionReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TCloseSessionReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -218,14 +205,13 @@ public boolean equals(TCloseSessionReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TCloseSessionReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TCloseSessionReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseSessionReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionReq("); boolean first = true; sb.append("sessionHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseSessionReqStandardSchemeFactory implements SchemeFactory { + private static class TCloseSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseSessionReqStandardScheme getScheme() { return new TCloseSessionReqStandardScheme(); } } - private static class TCloseSessionReqStandardScheme extends StandardScheme { + private static class TCloseSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionReq s } - private static class TCloseSessionReqTupleSchemeFactory implements SchemeFactory { + private static class TCloseSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseSessionReqTupleScheme getScheme() { return new TCloseSessionReqTupleScheme(); } } - private static class TCloseSessionReqTupleScheme extends TupleScheme { + private static class TCloseSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java index c84013587594..31ae25fcd494 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseSessionRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseSessionRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionRespTupleSchemeFactory(); - private TStatus status; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { STATUS((short)1, "status"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionResp.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.status = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -156,7 +140,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TCloseSessionResp) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TCloseSessionResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -218,14 +205,13 @@ public boolean equals(TCloseSessionResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TCloseSessionResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TCloseSessionResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseSessionResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionResp("); boolean first = true; sb.append("status:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseSessionRespStandardSchemeFactory implements SchemeFactory { + private static class TCloseSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseSessionRespStandardScheme getScheme() { return new TCloseSessionRespStandardScheme(); } } - private static class TCloseSessionRespStandardScheme extends StandardScheme { + private static class TCloseSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionResp } - private static class TCloseSessionRespTupleSchemeFactory implements SchemeFactory { + private static class TCloseSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TCloseSessionRespTupleScheme getScheme() { return new TCloseSessionRespTupleScheme(); } } - private static class TCloseSessionRespTupleScheme extends TupleScheme { + private static class TCloseSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java index 02070f2f16b2..dc3a7ee249ba 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java @@ -1,23 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -import org.apache.thrift.protocol.TProtocolException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TColumn extends org.apache.thrift.TUnion { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TColumn extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); @@ -39,10 +30,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { STRING_VAL((short)7, "stringVal"), BINARY_VAL((short)8, "binaryVal"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -50,6 +41,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // BOOL_VAL @@ -79,21 +71,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -102,31 +95,31 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolColumn.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteColumn.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Column.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Column.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Column.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleColumn.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringColumn.class))); - tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryColumn.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); } @@ -134,7 +127,7 @@ public TColumn() { super(); } - public TColumn(_Fields setField, Object value) { + public TColumn(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -195,55 +188,55 @@ public static TColumn binaryVal(TBinaryColumn value) { @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case BOOL_VAL: if (value instanceof TBoolColumn) { break; } - throw new ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); case BYTE_VAL: if (value instanceof TByteColumn) { break; } - throw new ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); case I16_VAL: if (value instanceof TI16Column) { break; } - throw new ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); case I32_VAL: if (value instanceof TI32Column) { break; } - throw new ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); case I64_VAL: if (value instanceof TI64Column) { break; } - throw new ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); case DOUBLE_VAL: if (value instanceof TDoubleColumn) { break; } - throw new ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); case STRING_VAL: if (value instanceof TStringColumn) { break; } - throw new ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); case BINARY_VAL: if (value instanceof TBinaryColumn) { break; } - throw new ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { @@ -328,7 +321,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip return null; } default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -372,12 +365,12 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr binaryVal.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { @@ -422,10 +415,10 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot binaryVal.read(iprot); return binaryVal; default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -465,7 +458,7 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) binaryVal.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -489,7 +482,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case BINARY_VAL: return BINARY_VAL_FIELD_DESC; default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @@ -503,6 +496,7 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -512,12 +506,12 @@ public TBoolColumn getBoolVal() { if (getSetField() == _Fields.BOOL_VAL) { return (TBoolColumn)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setBoolVal(TBoolColumn value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.BOOL_VAL; value_ = value; } @@ -526,12 +520,12 @@ public TByteColumn getByteVal() { if (getSetField() == _Fields.BYTE_VAL) { return (TByteColumn)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setByteVal(TByteColumn value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.BYTE_VAL; value_ = value; } @@ -540,12 +534,12 @@ public TI16Column getI16Val() { if (getSetField() == _Fields.I16_VAL) { return (TI16Column)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI16Val(TI16Column value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.I16_VAL; value_ = value; } @@ -554,12 +548,12 @@ public TI32Column getI32Val() { if (getSetField() == _Fields.I32_VAL) { return (TI32Column)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI32Val(TI32Column value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.I32_VAL; value_ = value; } @@ -568,12 +562,12 @@ public TI64Column getI64Val() { if (getSetField() == _Fields.I64_VAL) { return (TI64Column)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI64Val(TI64Column value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.I64_VAL; value_ = value; } @@ -582,12 +576,12 @@ public TDoubleColumn getDoubleVal() { if (getSetField() == _Fields.DOUBLE_VAL) { return (TDoubleColumn)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setDoubleVal(TDoubleColumn value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.DOUBLE_VAL; value_ = value; } @@ -596,12 +590,12 @@ public TStringColumn getStringVal() { if (getSetField() == _Fields.STRING_VAL) { return (TStringColumn)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setStringVal(TStringColumn value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.STRING_VAL; value_ = value; } @@ -610,12 +604,12 @@ public TBinaryColumn getBinaryVal() { if (getSetField() == _Fields.BINARY_VAL) { return (TBinaryColumn)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setBinaryVal(TBinaryColumn value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.BINARY_VAL; value_ = value; } @@ -660,7 +654,7 @@ public boolean isSetBinaryVal() { } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof TColumn) { return equals((TColumn)other); } else { @@ -684,12 +678,12 @@ public int compareTo(TColumn other) { @Override public int hashCode() { - List list = new ArrayList(); + java.util.List list = new java.util.ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); + java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -707,7 +701,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java index d9b230bdbd15..c537a3f5637c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java @@ -1,32 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnDesc"); private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)1); @@ -34,16 +16,13 @@ private static final org.apache.thrift.protocol.TField POSITION_FIELD_DESC = new org.apache.thrift.protocol.TField("position", org.apache.thrift.protocol.TType.I32, (short)3); private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TColumnDescStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TColumnDescTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TColumnDescStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TColumnDescTupleSchemeFactory(); - private String columnName; // required - private TTypeDesc typeDesc; // required + private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // required + private @org.apache.thrift.annotation.Nullable TTypeDesc typeDesc; // required private int position; // required - private String comment; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String comment; // 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 { @@ -52,10 +31,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { POSITION((short)3, "position"), COMMENT((short)4, "comment"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -63,6 +42,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // COLUMN_NAME @@ -84,21 +64,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -107,7 +88,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -116,9 +97,9 @@ public String getFieldName() { private static final int __POSITION_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.COMMENT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TYPE_DESC, new org.apache.thrift.meta_data.FieldMetaData("typeDesc", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -127,7 +108,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); } @@ -135,7 +116,7 @@ public TColumnDesc() { } public TColumnDesc( - String columnName, + java.lang.String columnName, TTypeDesc typeDesc, int position) { @@ -176,11 +157,12 @@ public void clear() { this.comment = null; } - public String getColumnName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getColumnName() { return this.columnName; } - public void setColumnName(String columnName) { + public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { this.columnName = columnName; } @@ -199,11 +181,12 @@ public void setColumnNameIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TTypeDesc getTypeDesc() { return this.typeDesc; } - public void setTypeDesc(TTypeDesc typeDesc) { + public void setTypeDesc(@org.apache.thrift.annotation.Nullable TTypeDesc typeDesc) { this.typeDesc = typeDesc; } @@ -232,23 +215,24 @@ public void setPosition(int position) { } public void unsetPosition() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); } /** Returns true if field position is set (has been assigned a value) and false otherwise */ public boolean isSetPosition() { - return EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); } public void setPositionIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); } - public String getComment() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getComment() { return this.comment; } - public void setComment(String comment) { + public void setComment(@org.apache.thrift.annotation.Nullable java.lang.String comment) { this.comment = comment; } @@ -267,13 +251,13 @@ public void setCommentIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case COLUMN_NAME: if (value == null) { unsetColumnName(); } else { - setColumnName((String)value); + setColumnName((java.lang.String)value); } break; @@ -289,7 +273,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetPosition(); } else { - setPosition((Integer)value); + setPosition((java.lang.Integer)value); } break; @@ -297,14 +281,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetComment(); } else { - setComment((String)value); + setComment((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case COLUMN_NAME: return getColumnName(); @@ -319,13 +304,13 @@ public Object getFieldValue(_Fields field) { return getComment(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -338,11 +323,11 @@ public boolean isSet(_Fields field) { case COMMENT: return isSetComment(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TColumnDesc) @@ -353,6 +338,8 @@ public boolean equals(Object that) { public boolean equals(TColumnDesc that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_columnName = true && this.isSetColumnName(); boolean that_present_columnName = true && that.isSetColumnName(); @@ -395,29 +382,23 @@ public boolean equals(TColumnDesc that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_columnName = true && (isSetColumnName()); - list.add(present_columnName); - if (present_columnName) - list.add(columnName); + hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); + if (isSetColumnName()) + hashCode = hashCode * 8191 + columnName.hashCode(); - boolean present_typeDesc = true && (isSetTypeDesc()); - list.add(present_typeDesc); - if (present_typeDesc) - list.add(typeDesc); + hashCode = hashCode * 8191 + ((isSetTypeDesc()) ? 131071 : 524287); + if (isSetTypeDesc()) + hashCode = hashCode * 8191 + typeDesc.hashCode(); - boolean present_position = true; - list.add(present_position); - if (present_position) - list.add(position); + hashCode = hashCode * 8191 + position; - boolean present_comment = true && (isSetComment()); - list.add(present_comment); - if (present_comment) - list.add(comment); + hashCode = hashCode * 8191 + ((isSetComment()) ? 131071 : 524287); + if (isSetComment()) + hashCode = hashCode * 8191 + comment.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -428,7 +409,7 @@ public int compareTo(TColumnDesc other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); if (lastComparison != 0) { return lastComparison; } @@ -438,7 +419,7 @@ public int compareTo(TColumnDesc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); + lastComparison = java.lang.Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); if (lastComparison != 0) { return lastComparison; } @@ -448,7 +429,7 @@ public int compareTo(TColumnDesc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); + lastComparison = java.lang.Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); if (lastComparison != 0) { return lastComparison; } @@ -458,7 +439,7 @@ public int compareTo(TColumnDesc other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); + lastComparison = java.lang.Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); if (lastComparison != 0) { return lastComparison; } @@ -471,21 +452,22 @@ public int compareTo(TColumnDesc other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TColumnDesc("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TColumnDesc("); boolean first = true; sb.append("columnName:"); @@ -549,7 +531,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -559,13 +541,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TColumnDescStandardSchemeFactory implements SchemeFactory { + private static class TColumnDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TColumnDescStandardScheme getScheme() { return new TColumnDescStandardScheme(); } } - private static class TColumnDescStandardScheme extends StandardScheme { + private static class TColumnDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -649,21 +631,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TColumnDesc struct } - private static class TColumnDescTupleSchemeFactory implements SchemeFactory { + private static class TColumnDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TColumnDescTupleScheme getScheme() { return new TColumnDescTupleScheme(); } } - private static class TColumnDescTupleScheme extends TupleScheme { + private static class TColumnDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.columnName); struct.typeDesc.write(oprot); oprot.writeI32(struct.position); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetComment()) { optionals.set(0); } @@ -675,7 +657,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.columnName = iprot.readString(); struct.setColumnNameIsSet(true); struct.typeDesc = new TTypeDesc(); @@ -683,7 +665,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) struct.setTypeDescIsSet(true); struct.position = iprot.readI32(); struct.setPositionIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.comment = iprot.readString(); struct.setCommentIsSet(true); @@ -691,5 +673,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java index f20773c6da49..61cceebeb8da 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java @@ -1,23 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -import org.apache.thrift.protocol.TProtocolException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TColumnValue extends org.apache.thrift.TUnion { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TColumnValue extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); @@ -37,10 +28,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DOUBLE_VAL((short)6, "doubleVal"), STRING_VAL((short)7, "stringVal"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -48,6 +39,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // BOOL_VAL @@ -75,21 +67,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -98,29 +91,29 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolValue.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteValue.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Value.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Value.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Value.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); } @@ -128,7 +121,7 @@ public TColumnValue() { super(); } - public TColumnValue(_Fields setField, Object value) { + public TColumnValue(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -183,50 +176,50 @@ public static TColumnValue stringVal(TStringValue value) { @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case BOOL_VAL: if (value instanceof TBoolValue) { break; } - throw new ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); case BYTE_VAL: if (value instanceof TByteValue) { break; } - throw new ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); case I16_VAL: if (value instanceof TI16Value) { break; } - throw new ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); case I32_VAL: if (value instanceof TI32Value) { break; } - throw new ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); case I64_VAL: if (value instanceof TI64Value) { break; } - throw new ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); case DOUBLE_VAL: if (value instanceof TDoubleValue) { break; } - throw new ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); case STRING_VAL: if (value instanceof TStringValue) { break; } - throw new ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { @@ -301,7 +294,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip return null; } default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -341,12 +334,12 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr stringVal.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { @@ -386,10 +379,10 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot stringVal.read(iprot); return stringVal; default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -425,7 +418,7 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) stringVal.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -447,7 +440,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case STRING_VAL: return STRING_VAL_FIELD_DESC; default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @@ -461,6 +454,7 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -470,12 +464,12 @@ public TBoolValue getBoolVal() { if (getSetField() == _Fields.BOOL_VAL) { return (TBoolValue)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setBoolVal(TBoolValue value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.BOOL_VAL; value_ = value; } @@ -484,12 +478,12 @@ public TByteValue getByteVal() { if (getSetField() == _Fields.BYTE_VAL) { return (TByteValue)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setByteVal(TByteValue value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.BYTE_VAL; value_ = value; } @@ -498,12 +492,12 @@ public TI16Value getI16Val() { if (getSetField() == _Fields.I16_VAL) { return (TI16Value)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI16Val(TI16Value value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.I16_VAL; value_ = value; } @@ -512,12 +506,12 @@ public TI32Value getI32Val() { if (getSetField() == _Fields.I32_VAL) { return (TI32Value)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI32Val(TI32Value value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.I32_VAL; value_ = value; } @@ -526,12 +520,12 @@ public TI64Value getI64Val() { if (getSetField() == _Fields.I64_VAL) { return (TI64Value)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI64Val(TI64Value value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.I64_VAL; value_ = value; } @@ -540,12 +534,12 @@ public TDoubleValue getDoubleVal() { if (getSetField() == _Fields.DOUBLE_VAL) { return (TDoubleValue)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setDoubleVal(TDoubleValue value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.DOUBLE_VAL; value_ = value; } @@ -554,12 +548,12 @@ public TStringValue getStringVal() { if (getSetField() == _Fields.STRING_VAL) { return (TStringValue)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setStringVal(TStringValue value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.STRING_VAL; value_ = value; } @@ -599,7 +593,7 @@ public boolean isSetStringVal() { } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof TColumnValue) { return equals((TColumnValue)other); } else { @@ -623,12 +617,12 @@ public int compareTo(TColumnValue other) { @Override public int hashCode() { - List list = new ArrayList(); + java.util.List list = new java.util.ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); + java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -646,7 +640,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java index e81d388da487..bec4619c91a3 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TDoubleColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TDoubleColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleColumn.class, metaDataMap); } @@ -119,8 +100,8 @@ public TDoubleColumn() { } public TDoubleColumn( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TDoubleColumn( */ public TDoubleColumn(TDoubleColumn other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(double elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TDoubleColumn) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TDoubleColumn that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TDoubleColumn that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TDoubleColumn other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TDoubleColumn other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TDoubleColumn other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TDoubleColumn("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleColumn("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TDoubleColumnStandardSchemeFactory implements SchemeFactory { + private static class TDoubleColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDoubleColumnStandardScheme getScheme() { return new TDoubleColumnStandardScheme(); } } - private static class TDoubleColumnStandardScheme extends StandardScheme { + private static class TDoubleColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,7 +426,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); - struct.values = new ArrayList(_list94.size); + struct.values = new java.util.ArrayList(_list94.size); double _elem95; for (int _i96 = 0; _i96 < _list94.size; ++_i96) { @@ -495,17 +484,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleColumn stru } - private static class TDoubleColumnTupleSchemeFactory implements SchemeFactory { + private static class TDoubleColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDoubleColumnTupleScheme getScheme() { return new TDoubleColumnTupleScheme(); } } - private static class TDoubleColumnTupleScheme extends TupleScheme { + private static class TDoubleColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (double _iter98 : struct.values) @@ -518,10 +507,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); - struct.values = new ArrayList(_list99.size); + struct.values = new java.util.ArrayList(_list99.size); double _elem100; for (int _i101 = 0; _i101 < _list99.size; ++_i101) { @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java index 31b02f11ab40..04c9dbe9db42 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java @@ -1,41 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TDoubleValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TDoubleValueTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleValueTupleSchemeFactory(); private double value; // optional @@ -43,10 +22,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { VALUE((short)1, "value"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -54,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -69,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +73,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -101,12 +82,12 @@ public String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleValue.class, metaDataMap); } @@ -141,55 +122,56 @@ public void setValue(double value) { } public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((Double)value); + setValue((java.lang.Double)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TDoubleValue) @@ -200,6 +182,8 @@ public boolean equals(Object that) { public boolean equals(TDoubleValue that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -215,14 +199,13 @@ public boolean equals(TDoubleValue that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); - return list.hashCode(); + return hashCode; } @Override @@ -233,7 +216,7 @@ public int compareTo(TDoubleValue other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -246,21 +229,22 @@ public int compareTo(TDoubleValue other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TDoubleValue("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleValue("); boolean first = true; if (isSetValue()) { @@ -285,7 +269,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -295,13 +279,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TDoubleValueStandardSchemeFactory implements SchemeFactory { + private static class TDoubleValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDoubleValueStandardScheme getScheme() { return new TDoubleValueStandardScheme(); } } - private static class TDoubleValueStandardScheme extends StandardScheme { + private static class TDoubleValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -345,18 +329,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleValue struc } - private static class TDoubleValueTupleSchemeFactory implements SchemeFactory { + private static class TDoubleValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TDoubleValueTupleScheme getScheme() { return new TDoubleValueTupleScheme(); } } - private static class TDoubleValueTupleScheme extends TupleScheme { + private static class TDoubleValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -368,8 +352,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readDouble(); struct.setValueIsSet(true); @@ -377,5 +361,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java index 796b0b57d367..bd8dacf147eb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java @@ -1,32 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq"); 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); @@ -35,15 +17,12 @@ private static final org.apache.thrift.protocol.TField RUN_ASYNC_FIELD_DESC = new org.apache.thrift.protocol.TField("runAsync", org.apache.thrift.protocol.TType.BOOL, (short)4); private static final org.apache.thrift.protocol.TField QUERY_TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("queryTimeout", org.apache.thrift.protocol.TType.I64, (short)5); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TExecuteStatementReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TExecuteStatementReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExecuteStatementReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExecuteStatementReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String statement; // required - private Map confOverlay; // optional + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String statement; // required + private @org.apache.thrift.annotation.Nullable java.util.Map confOverlay; // optional private boolean runAsync; // optional private long queryTimeout; // optional @@ -55,10 +34,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RUN_ASYNC((short)4, "runAsync"), QUERY_TIMEOUT((short)5, "queryTimeout"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -66,6 +45,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -89,21 +69,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -112,7 +93,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -122,9 +103,9 @@ public String getFieldName() { private static final int __QUERYTIMEOUT_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC,_Fields.QUERY_TIMEOUT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -137,7 +118,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.QUERY_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("queryTimeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap); } @@ -150,7 +131,7 @@ public TExecuteStatementReq() { public TExecuteStatementReq( TSessionHandle sessionHandle, - String statement) + java.lang.String statement) { this(); this.sessionHandle = sessionHandle; @@ -169,7 +150,7 @@ public TExecuteStatementReq(TExecuteStatementReq other) { this.statement = other.statement; } if (other.isSetConfOverlay()) { - Map __this__confOverlay = new HashMap(other.confOverlay); + java.util.Map __this__confOverlay = new java.util.HashMap(other.confOverlay); this.confOverlay = __this__confOverlay; } this.runAsync = other.runAsync; @@ -191,11 +172,12 @@ public void clear() { } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -214,11 +196,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getStatement() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getStatement() { return this.statement; } - public void setStatement(String statement) { + public void setStatement(@org.apache.thrift.annotation.Nullable java.lang.String statement) { this.statement = statement; } @@ -241,18 +224,19 @@ public int getConfOverlaySize() { return (this.confOverlay == null) ? 0 : this.confOverlay.size(); } - public void putToConfOverlay(String key, String val) { + public void putToConfOverlay(java.lang.String key, java.lang.String val) { if (this.confOverlay == null) { - this.confOverlay = new HashMap(); + this.confOverlay = new java.util.HashMap(); } this.confOverlay.put(key, val); } - public Map getConfOverlay() { + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfOverlay() { return this.confOverlay; } - public void setConfOverlay(Map confOverlay) { + public void setConfOverlay(@org.apache.thrift.annotation.Nullable java.util.Map confOverlay) { this.confOverlay = confOverlay; } @@ -281,16 +265,16 @@ public void setRunAsync(boolean runAsync) { } public void unsetRunAsync() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); } /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */ public boolean isSetRunAsync() { - return EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); } public void setRunAsyncIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); } public long getQueryTimeout() { @@ -303,19 +287,19 @@ public void setQueryTimeout(long queryTimeout) { } public void unsetQueryTimeout() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); } /** Returns true if field queryTimeout is set (has been assigned a value) and false otherwise */ public boolean isSetQueryTimeout() { - return EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); } public void setQueryTimeoutIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -329,7 +313,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetStatement(); } else { - setStatement((String)value); + setStatement((java.lang.String)value); } break; @@ -337,7 +321,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetConfOverlay(); } else { - setConfOverlay((Map)value); + setConfOverlay((java.util.Map)value); } break; @@ -345,7 +329,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetRunAsync(); } else { - setRunAsync((Boolean)value); + setRunAsync((java.lang.Boolean)value); } break; @@ -353,14 +337,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetQueryTimeout(); } else { - setQueryTimeout((Long)value); + setQueryTimeout((java.lang.Long)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -378,13 +363,13 @@ public Object getFieldValue(_Fields field) { return getQueryTimeout(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -399,11 +384,11 @@ public boolean isSet(_Fields field) { case QUERY_TIMEOUT: return isSetQueryTimeout(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TExecuteStatementReq) @@ -414,6 +399,8 @@ public boolean equals(Object that) { public boolean equals(TExecuteStatementReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -465,34 +452,29 @@ public boolean equals(TExecuteStatementReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_statement = true && (isSetStatement()); - list.add(present_statement); - if (present_statement) - list.add(statement); + hashCode = hashCode * 8191 + ((isSetStatement()) ? 131071 : 524287); + if (isSetStatement()) + hashCode = hashCode * 8191 + statement.hashCode(); - boolean present_confOverlay = true && (isSetConfOverlay()); - list.add(present_confOverlay); - if (present_confOverlay) - list.add(confOverlay); + hashCode = hashCode * 8191 + ((isSetConfOverlay()) ? 131071 : 524287); + if (isSetConfOverlay()) + hashCode = hashCode * 8191 + confOverlay.hashCode(); - boolean present_runAsync = true && (isSetRunAsync()); - list.add(present_runAsync); - if (present_runAsync) - list.add(runAsync); + hashCode = hashCode * 8191 + ((isSetRunAsync()) ? 131071 : 524287); + if (isSetRunAsync()) + hashCode = hashCode * 8191 + ((runAsync) ? 131071 : 524287); - boolean present_queryTimeout = true && (isSetQueryTimeout()); - list.add(present_queryTimeout); - if (present_queryTimeout) - list.add(queryTimeout); + hashCode = hashCode * 8191 + ((isSetQueryTimeout()) ? 131071 : 524287); + if (isSetQueryTimeout()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(queryTimeout); - return list.hashCode(); + return hashCode; } @Override @@ -503,7 +485,7 @@ public int compareTo(TExecuteStatementReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -513,7 +495,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); + lastComparison = java.lang.Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); if (lastComparison != 0) { return lastComparison; } @@ -523,7 +505,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); + lastComparison = java.lang.Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); if (lastComparison != 0) { return lastComparison; } @@ -533,7 +515,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); + lastComparison = java.lang.Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); if (lastComparison != 0) { return lastComparison; } @@ -543,7 +525,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); + lastComparison = java.lang.Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); if (lastComparison != 0) { return lastComparison; } @@ -556,21 +538,22 @@ public int compareTo(TExecuteStatementReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TExecuteStatementReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementReq("); boolean first = true; sb.append("sessionHandle:"); @@ -638,7 +621,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -648,13 +631,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TExecuteStatementReqStandardSchemeFactory implements SchemeFactory { + private static class TExecuteStatementReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TExecuteStatementReqStandardScheme getScheme() { return new TExecuteStatementReqStandardScheme(); } } - private static class TExecuteStatementReqStandardScheme extends StandardScheme { + private static class TExecuteStatementReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -687,9 +670,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementRe if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map172 = iprot.readMapBegin(); - struct.confOverlay = new HashMap(2*_map172.size); - String _key173; - String _val174; + struct.confOverlay = new java.util.HashMap(2*_map172.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key173; + @org.apache.thrift.annotation.Nullable java.lang.String _val174; for (int _i175 = 0; _i175 < _map172.size; ++_i175) { _key173 = iprot.readString(); @@ -747,7 +730,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); - for (Map.Entry _iter176 : struct.confOverlay.entrySet()) + for (java.util.Map.Entry _iter176 : struct.confOverlay.entrySet()) { oprot.writeString(_iter176.getKey()); oprot.writeString(_iter176.getValue()); @@ -773,20 +756,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR } - private static class TExecuteStatementReqTupleSchemeFactory implements SchemeFactory { + private static class TExecuteStatementReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TExecuteStatementReqTupleScheme getScheme() { return new TExecuteStatementReqTupleScheme(); } } - private static class TExecuteStatementReqTupleScheme extends TupleScheme { + private static class TExecuteStatementReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.statement); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetConfOverlay()) { optionals.set(0); } @@ -800,7 +783,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe if (struct.isSetConfOverlay()) { { oprot.writeI32(struct.confOverlay.size()); - for (Map.Entry _iter177 : struct.confOverlay.entrySet()) + for (java.util.Map.Entry _iter177 : struct.confOverlay.entrySet()) { oprot.writeString(_iter177.getKey()); oprot.writeString(_iter177.getValue()); @@ -817,19 +800,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe @Override public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); struct.statement = iprot.readString(); struct.setStatementIsSet(true); - BitSet incoming = iprot.readBitSet(3); + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.confOverlay = new HashMap(2*_map178.size); - String _key179; - String _val180; + struct.confOverlay = new java.util.HashMap(2*_map178.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key179; + @org.apache.thrift.annotation.Nullable java.lang.String _val180; for (int _i181 = 0; _i181 < _map178.size; ++_i181) { _key179 = iprot.readString(); @@ -850,5 +833,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java index 3045f0d0c6c2..b32ebd05cad0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TExecuteStatementRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TExecuteStatementRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExecuteStatementRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExecuteStatementRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TExecuteStatementResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TExecuteStatementResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TExecuteStatementResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TExecuteStatementResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TExecuteStatementResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TExecuteStatementResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TExecuteStatementResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TExecuteStatementRespStandardSchemeFactory implements SchemeFactory { + private static class TExecuteStatementRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TExecuteStatementRespStandardScheme getScheme() { return new TExecuteStatementRespStandardScheme(); } } - private static class TExecuteStatementRespStandardScheme extends StandardScheme { + private static class TExecuteStatementRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR } - private static class TExecuteStatementRespTupleSchemeFactory implements SchemeFactory { + private static class TExecuteStatementRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TExecuteStatementRespTupleScheme getScheme() { return new TExecuteStatementRespTupleScheme(); } } - private static class TExecuteStatementRespTupleScheme extends TupleScheme { + private static class TExecuteStatementRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe @Override public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRes } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java index aaef3d072e65..b1cb20fb5492 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TFetchOrientation implements org.apache.thrift.TEnum { FETCH_NEXT(0), FETCH_PRIOR(1), @@ -32,6 +33,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TFetchOrientation findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java index 5dd0ebb37f04..db1bd0fa58dc 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java @@ -1,32 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq"); 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)1); @@ -34,14 +16,11 @@ private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRows", org.apache.thrift.protocol.TType.I64, (short)3); private static final org.apache.thrift.protocol.TField FETCH_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchType", org.apache.thrift.protocol.TType.I16, (short)4); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFetchResultsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFetchResultsReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFetchResultsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFetchResultsReqTupleSchemeFactory(); - private TOperationHandle operationHandle; // required - private TFetchOrientation orientation; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required + private @org.apache.thrift.annotation.Nullable TFetchOrientation orientation; // required private long maxRows; // required private short fetchType; // optional @@ -56,10 +35,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { MAX_ROWS((short)3, "maxRows"), FETCH_TYPE((short)4, "fetchType"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -67,6 +46,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -88,21 +68,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -111,7 +92,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -121,9 +102,9 @@ public String getFieldName() { private static final int __FETCHTYPE_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.FETCH_TYPE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -132,12 +113,12 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap); } public TFetchResultsReq() { - this.orientation = TFetchOrientation.FETCH_NEXT; + this.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.FETCH_NEXT; this.fetchType = (short)0; @@ -177,7 +158,7 @@ public TFetchResultsReq deepCopy() { @Override public void clear() { this.operationHandle = null; - this.orientation = TFetchOrientation.FETCH_NEXT; + this.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.FETCH_NEXT; setMaxRowsIsSet(false); this.maxRows = 0; @@ -185,11 +166,12 @@ public void clear() { } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -212,6 +194,7 @@ public void setOperationHandleIsSet(boolean value) { * * @see TFetchOrientation */ + @org.apache.thrift.annotation.Nullable public TFetchOrientation getOrientation() { return this.orientation; } @@ -220,7 +203,7 @@ public TFetchOrientation getOrientation() { * * @see TFetchOrientation */ - public void setOrientation(TFetchOrientation orientation) { + public void setOrientation(@org.apache.thrift.annotation.Nullable TFetchOrientation orientation) { this.orientation = orientation; } @@ -249,16 +232,16 @@ public void setMaxRows(long maxRows) { } public void unsetMaxRows() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); } /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */ public boolean isSetMaxRows() { - return EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); } public void setMaxRowsIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); } public short getFetchType() { @@ -271,19 +254,19 @@ public void setFetchType(short fetchType) { } public void unsetFetchType() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); } /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */ public boolean isSetFetchType() { - return EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); } public void setFetchTypeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -305,7 +288,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetMaxRows(); } else { - setMaxRows((Long)value); + setMaxRows((java.lang.Long)value); } break; @@ -313,14 +296,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetFetchType(); } else { - setFetchType((Short)value); + setFetchType((java.lang.Short)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); @@ -335,13 +319,13 @@ public Object getFieldValue(_Fields field) { return getFetchType(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -354,11 +338,11 @@ public boolean isSet(_Fields field) { case FETCH_TYPE: return isSetFetchType(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFetchResultsReq) @@ -369,6 +353,8 @@ public boolean equals(Object that) { public boolean equals(TFetchResultsReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -411,29 +397,23 @@ public boolean equals(TFetchResultsReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - boolean present_orientation = true && (isSetOrientation()); - list.add(present_orientation); - if (present_orientation) - list.add(orientation.getValue()); + hashCode = hashCode * 8191 + ((isSetOrientation()) ? 131071 : 524287); + if (isSetOrientation()) + hashCode = hashCode * 8191 + orientation.getValue(); - boolean present_maxRows = true; - list.add(present_maxRows); - if (present_maxRows) - list.add(maxRows); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(maxRows); - boolean present_fetchType = true && (isSetFetchType()); - list.add(present_fetchType); - if (present_fetchType) - list.add(fetchType); + hashCode = hashCode * 8191 + ((isSetFetchType()) ? 131071 : 524287); + if (isSetFetchType()) + hashCode = hashCode * 8191 + fetchType; - return list.hashCode(); + return hashCode; } @Override @@ -444,7 +424,7 @@ public int compareTo(TFetchResultsReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -454,7 +434,7 @@ public int compareTo(TFetchResultsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); + lastComparison = java.lang.Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); if (lastComparison != 0) { return lastComparison; } @@ -464,7 +444,7 @@ public int compareTo(TFetchResultsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); + lastComparison = java.lang.Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); if (lastComparison != 0) { return lastComparison; } @@ -474,7 +454,7 @@ public int compareTo(TFetchResultsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); + lastComparison = java.lang.Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); if (lastComparison != 0) { return lastComparison; } @@ -487,21 +467,22 @@ public int compareTo(TFetchResultsReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFetchResultsReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsReq("); boolean first = true; sb.append("operationHandle:"); @@ -561,7 +542,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -571,13 +552,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TFetchResultsReqStandardSchemeFactory implements SchemeFactory { + private static class TFetchResultsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFetchResultsReqStandardScheme getScheme() { return new TFetchResultsReqStandardScheme(); } } - private static class TFetchResultsReqStandardScheme extends StandardScheme { + private static class TFetchResultsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -600,7 +581,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq st break; case 2: // ORIENTATION if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.orientation = TFetchOrientation.findByValue(iprot.readI32()); + struct.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.findByValue(iprot.readI32()); struct.setOrientationIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -659,21 +640,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsReq s } - private static class TFetchResultsReqTupleSchemeFactory implements SchemeFactory { + private static class TFetchResultsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFetchResultsReqTupleScheme getScheme() { return new TFetchResultsReqTupleScheme(); } } - private static class TFetchResultsReqTupleScheme extends TupleScheme { + private static class TFetchResultsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle.write(oprot); oprot.writeI32(struct.orientation.getValue()); oprot.writeI64(struct.maxRows); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetFetchType()) { optionals.set(0); } @@ -685,15 +666,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); - struct.orientation = TFetchOrientation.findByValue(iprot.readI32()); + struct.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.findByValue(iprot.readI32()); struct.setOrientationIsSet(true); struct.maxRows = iprot.readI64(); struct.setMaxRowsIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fetchType = iprot.readI16(); struct.setFetchTypeIsSet(true); @@ -701,5 +682,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java index ea15d1d86eb1..4effd2524d88 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java @@ -1,47 +1,26 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsResp"); 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 HAS_MORE_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMoreRows", org.apache.thrift.protocol.TType.BOOL, (short)2); private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFetchResultsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFetchResultsRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFetchResultsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFetchResultsRespTupleSchemeFactory(); - private TStatus status; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // required private boolean hasMoreRows; // optional - private TRowSet results; // optional + private @org.apache.thrift.annotation.Nullable TRowSet results; // 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 { @@ -49,10 +28,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HAS_MORE_ROWS((short)2, "hasMoreRows"), RESULTS((short)3, "results"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -60,6 +39,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -79,21 +59,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -102,7 +83,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -111,16 +92,16 @@ public String getFieldName() { private static final int __HASMOREROWS_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.HAS_MORE_ROWS,_Fields.RESULTS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.HAS_MORE_ROWS, new org.apache.thrift.meta_data.FieldMetaData("hasMoreRows", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsResp.class, metaDataMap); } @@ -160,11 +141,12 @@ public void clear() { this.results = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -193,23 +175,24 @@ public void setHasMoreRows(boolean hasMoreRows) { } public void unsetHasMoreRows() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); } /** Returns true if field hasMoreRows is set (has been assigned a value) and false otherwise */ public boolean isSetHasMoreRows() { - return EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); } public void setHasMoreRowsIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable public TRowSet getResults() { return this.results; } - public void setResults(TRowSet results) { + public void setResults(@org.apache.thrift.annotation.Nullable TRowSet results) { this.results = results; } @@ -228,7 +211,7 @@ public void setResultsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -242,7 +225,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetHasMoreRows(); } else { - setHasMoreRows((Boolean)value); + setHasMoreRows((java.lang.Boolean)value); } break; @@ -257,7 +240,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -269,13 +253,13 @@ public Object getFieldValue(_Fields field) { return getResults(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -286,11 +270,11 @@ public boolean isSet(_Fields field) { case RESULTS: return isSetResults(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TFetchResultsResp) @@ -301,6 +285,8 @@ public boolean equals(Object that) { public boolean equals(TFetchResultsResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -334,24 +320,21 @@ public boolean equals(TFetchResultsResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_hasMoreRows = true && (isSetHasMoreRows()); - list.add(present_hasMoreRows); - if (present_hasMoreRows) - list.add(hasMoreRows); + hashCode = hashCode * 8191 + ((isSetHasMoreRows()) ? 131071 : 524287); + if (isSetHasMoreRows()) + hashCode = hashCode * 8191 + ((hasMoreRows) ? 131071 : 524287); - boolean present_results = true && (isSetResults()); - list.add(present_results); - if (present_results) - list.add(results); + hashCode = hashCode * 8191 + ((isSetResults()) ? 131071 : 524287); + if (isSetResults()) + hashCode = hashCode * 8191 + results.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -362,7 +345,7 @@ public int compareTo(TFetchResultsResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -372,7 +355,7 @@ public int compareTo(TFetchResultsResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); + lastComparison = java.lang.Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); if (lastComparison != 0) { return lastComparison; } @@ -382,7 +365,7 @@ public int compareTo(TFetchResultsResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); + lastComparison = java.lang.Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); if (lastComparison != 0) { return lastComparison; } @@ -395,21 +378,22 @@ public int compareTo(TFetchResultsResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFetchResultsResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsResp("); boolean first = true; sb.append("status:"); @@ -462,7 +446,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -472,13 +456,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TFetchResultsRespStandardSchemeFactory implements SchemeFactory { + private static class TFetchResultsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFetchResultsRespStandardScheme getScheme() { return new TFetchResultsRespStandardScheme(); } } - private static class TFetchResultsRespStandardScheme extends StandardScheme { + private static class TFetchResultsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -552,19 +536,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsResp } - private static class TFetchResultsRespTupleSchemeFactory implements SchemeFactory { + private static class TFetchResultsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TFetchResultsRespTupleScheme getScheme() { return new TFetchResultsRespTupleScheme(); } } - private static class TFetchResultsRespTupleScheme extends TupleScheme { + private static class TFetchResultsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetHasMoreRows()) { optionals.set(0); } @@ -582,11 +566,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp s @Override public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(2); + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.hasMoreRows = iprot.readBool(); struct.setHasMoreRowsIsSet(true); @@ -599,5 +583,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java index d53c22e20949..b1894f76dfcc 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsReq"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCatalogsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCatalogsReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.sessionHandle = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -156,7 +140,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetCatalogsReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TGetCatalogsReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -218,14 +205,13 @@ public boolean equals(TGetCatalogsReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TGetCatalogsReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TGetCatalogsReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCatalogsReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsReq("); boolean first = true; sb.append("sessionHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCatalogsReqStandardSchemeFactory implements SchemeFactory { + private static class TGetCatalogsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCatalogsReqStandardScheme getScheme() { return new TGetCatalogsReqStandardScheme(); } } - private static class TGetCatalogsReqStandardScheme extends StandardScheme { + private static class TGetCatalogsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsReq st } - private static class TGetCatalogsReqTupleSchemeFactory implements SchemeFactory { + private static class TGetCatalogsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCatalogsReqTupleScheme getScheme() { return new TGetCatalogsReqTupleScheme(); } } - private static class TGetCatalogsReqTupleScheme extends TupleScheme { + private static class TGetCatalogsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java index 0f89dc4545e9..b0729bbd77d3 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCatalogsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCatalogsRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetCatalogsResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetCatalogsResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetCatalogsResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetCatalogsResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetCatalogsResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetCatalogsResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCatalogsResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCatalogsRespStandardSchemeFactory implements SchemeFactory { + private static class TGetCatalogsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCatalogsRespStandardScheme getScheme() { return new TGetCatalogsRespStandardScheme(); } } - private static class TGetCatalogsRespStandardScheme extends StandardScheme { + private static class TGetCatalogsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsResp s } - private static class TGetCatalogsRespTupleSchemeFactory implements SchemeFactory { + private static class TGetCatalogsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCatalogsRespTupleScheme getScheme() { return new TGetCatalogsRespTupleScheme(); } } - private static class TGetCatalogsRespTupleScheme extends TupleScheme { + private static class TGetCatalogsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java index 1b7d6cd97711..294e764f0099 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq"); 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); @@ -34,17 +17,14 @@ private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetColumnsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetColumnsReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetColumnsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetColumnsReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional - private String columnName; // optional + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // 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 { @@ -54,10 +34,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TABLE_NAME((short)4, "tableName"), COLUMN_NAME((short)5, "columnName"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -65,6 +45,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -88,21 +69,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -111,16 +93,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -131,7 +113,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap); } @@ -179,11 +161,12 @@ public void clear() { this.columnName = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -202,11 +185,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getCatalogName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { return this.catalogName; } - public void setCatalogName(String catalogName) { + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { this.catalogName = catalogName; } @@ -225,11 +209,12 @@ public void setCatalogNameIsSet(boolean value) { } } - public String getSchemaName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { return this.schemaName; } - public void setSchemaName(String schemaName) { + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { this.schemaName = schemaName; } @@ -248,11 +233,12 @@ public void setSchemaNameIsSet(boolean value) { } } - public String getTableName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getTableName() { return this.tableName; } - public void setTableName(String tableName) { + public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { this.tableName = tableName; } @@ -271,11 +257,12 @@ public void setTableNameIsSet(boolean value) { } } - public String getColumnName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getColumnName() { return this.columnName; } - public void setColumnName(String columnName) { + public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { this.columnName = columnName; } @@ -294,7 +281,7 @@ public void setColumnNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -308,7 +295,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetCatalogName(); } else { - setCatalogName((String)value); + setCatalogName((java.lang.String)value); } break; @@ -316,7 +303,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSchemaName(); } else { - setSchemaName((String)value); + setSchemaName((java.lang.String)value); } break; @@ -324,7 +311,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetTableName(); } else { - setTableName((String)value); + setTableName((java.lang.String)value); } break; @@ -332,14 +319,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetColumnName(); } else { - setColumnName((String)value); + setColumnName((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -357,13 +345,13 @@ public Object getFieldValue(_Fields field) { return getColumnName(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -378,11 +366,11 @@ public boolean isSet(_Fields field) { case COLUMN_NAME: return isSetColumnName(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetColumnsReq) @@ -393,6 +381,8 @@ public boolean equals(Object that) { public boolean equals(TGetColumnsReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -444,34 +434,29 @@ public boolean equals(TGetColumnsReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); - boolean present_tableName = true && (isSetTableName()); - list.add(present_tableName); - if (present_tableName) - list.add(tableName); + hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); + if (isSetTableName()) + hashCode = hashCode * 8191 + tableName.hashCode(); - boolean present_columnName = true && (isSetColumnName()); - list.add(present_columnName); - if (present_columnName) - list.add(columnName); + hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); + if (isSetColumnName()) + hashCode = hashCode * 8191 + columnName.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -482,7 +467,7 @@ public int compareTo(TGetColumnsReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -492,7 +477,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -502,7 +487,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -512,7 +497,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; } @@ -522,7 +507,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); if (lastComparison != 0) { return lastComparison; } @@ -535,21 +520,22 @@ public int compareTo(TGetColumnsReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetColumnsReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsReq("); boolean first = true; sb.append("sessionHandle:"); @@ -623,7 +609,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -631,13 +617,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetColumnsReqStandardSchemeFactory implements SchemeFactory { + private static class TGetColumnsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetColumnsReqStandardScheme getScheme() { return new TGetColumnsReqStandardScheme(); } } - private static class TGetColumnsReqStandardScheme extends StandardScheme { + private static class TGetColumnsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -742,19 +728,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsReq str } - private static class TGetColumnsReqTupleSchemeFactory implements SchemeFactory { + private static class TGetColumnsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetColumnsReqTupleScheme getScheme() { return new TGetColumnsReqTupleScheme(); } } - private static class TGetColumnsReqTupleScheme extends TupleScheme { + private static class TGetColumnsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -784,11 +770,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -808,5 +794,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struc } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java index 953e57ba4ec7..250fa04cc845 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetColumnsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetColumnsRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetColumnsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetColumnsRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetColumnsResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetColumnsResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetColumnsResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetColumnsResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetColumnsResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetColumnsResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetColumnsResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetColumnsRespStandardSchemeFactory implements SchemeFactory { + private static class TGetColumnsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetColumnsRespStandardScheme getScheme() { return new TGetColumnsRespStandardScheme(); } } - private static class TGetColumnsRespStandardScheme extends StandardScheme { + private static class TGetColumnsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsResp st } - private static class TGetColumnsRespTupleSchemeFactory implements SchemeFactory { + private static class TGetColumnsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetColumnsRespTupleScheme getScheme() { return new TGetColumnsRespTupleScheme(); } } - private static class TGetColumnsRespTupleScheme extends TupleScheme { + private static class TGetColumnsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java index d91a032b8837..bbb80b057638 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCrossReferenceReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetCrossReferenceReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceReq"); 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); @@ -36,19 +19,16 @@ private static final org.apache.thrift.protocol.TField FOREIGN_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignSchemaName", org.apache.thrift.protocol.TType.STRING, (short)6); private static final org.apache.thrift.protocol.TField FOREIGN_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignTableName", org.apache.thrift.protocol.TType.STRING, (short)7); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCrossReferenceReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCrossReferenceReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCrossReferenceReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCrossReferenceReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String parentCatalogName; // optional - private String parentSchemaName; // optional - private String parentTableName; // optional - private String foreignCatalogName; // optional - private String foreignSchemaName; // optional - private String foreignTableName; // optional + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String parentTableName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String foreignTableName; // 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 { @@ -60,10 +40,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FOREIGN_SCHEMA_NAME((short)6, "foreignSchemaName"), FOREIGN_TABLE_NAME((short)7, "foreignTableName"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -71,6 +51,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -98,21 +79,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -121,16 +103,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.PARENT_CATALOG_NAME,_Fields.PARENT_SCHEMA_NAME,_Fields.PARENT_TABLE_NAME,_Fields.FOREIGN_CATALOG_NAME,_Fields.FOREIGN_SCHEMA_NAME,_Fields.FOREIGN_TABLE_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.PARENT_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -145,7 +127,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); tmpMap.put(_Fields.FOREIGN_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceReq.class, metaDataMap); } @@ -201,11 +183,12 @@ public void clear() { this.foreignTableName = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -224,11 +207,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getParentCatalogName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getParentCatalogName() { return this.parentCatalogName; } - public void setParentCatalogName(String parentCatalogName) { + public void setParentCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName) { this.parentCatalogName = parentCatalogName; } @@ -247,11 +231,12 @@ public void setParentCatalogNameIsSet(boolean value) { } } - public String getParentSchemaName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getParentSchemaName() { return this.parentSchemaName; } - public void setParentSchemaName(String parentSchemaName) { + public void setParentSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName) { this.parentSchemaName = parentSchemaName; } @@ -270,11 +255,12 @@ public void setParentSchemaNameIsSet(boolean value) { } } - public String getParentTableName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getParentTableName() { return this.parentTableName; } - public void setParentTableName(String parentTableName) { + public void setParentTableName(@org.apache.thrift.annotation.Nullable java.lang.String parentTableName) { this.parentTableName = parentTableName; } @@ -293,11 +279,12 @@ public void setParentTableNameIsSet(boolean value) { } } - public String getForeignCatalogName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getForeignCatalogName() { return this.foreignCatalogName; } - public void setForeignCatalogName(String foreignCatalogName) { + public void setForeignCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName) { this.foreignCatalogName = foreignCatalogName; } @@ -316,11 +303,12 @@ public void setForeignCatalogNameIsSet(boolean value) { } } - public String getForeignSchemaName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getForeignSchemaName() { return this.foreignSchemaName; } - public void setForeignSchemaName(String foreignSchemaName) { + public void setForeignSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName) { this.foreignSchemaName = foreignSchemaName; } @@ -339,11 +327,12 @@ public void setForeignSchemaNameIsSet(boolean value) { } } - public String getForeignTableName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getForeignTableName() { return this.foreignTableName; } - public void setForeignTableName(String foreignTableName) { + public void setForeignTableName(@org.apache.thrift.annotation.Nullable java.lang.String foreignTableName) { this.foreignTableName = foreignTableName; } @@ -362,7 +351,7 @@ public void setForeignTableNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -376,7 +365,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetParentCatalogName(); } else { - setParentCatalogName((String)value); + setParentCatalogName((java.lang.String)value); } break; @@ -384,7 +373,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetParentSchemaName(); } else { - setParentSchemaName((String)value); + setParentSchemaName((java.lang.String)value); } break; @@ -392,7 +381,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetParentTableName(); } else { - setParentTableName((String)value); + setParentTableName((java.lang.String)value); } break; @@ -400,7 +389,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetForeignCatalogName(); } else { - setForeignCatalogName((String)value); + setForeignCatalogName((java.lang.String)value); } break; @@ -408,7 +397,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetForeignSchemaName(); } else { - setForeignSchemaName((String)value); + setForeignSchemaName((java.lang.String)value); } break; @@ -416,14 +405,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetForeignTableName(); } else { - setForeignTableName((String)value); + setForeignTableName((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -447,13 +437,13 @@ public Object getFieldValue(_Fields field) { return getForeignTableName(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -472,11 +462,11 @@ public boolean isSet(_Fields field) { case FOREIGN_TABLE_NAME: return isSetForeignTableName(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetCrossReferenceReq) @@ -487,6 +477,8 @@ public boolean equals(Object that) { public boolean equals(TGetCrossReferenceReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -556,44 +548,37 @@ public boolean equals(TGetCrossReferenceReq that) { @Override public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_parentCatalogName = true && (isSetParentCatalogName()); - list.add(present_parentCatalogName); - if (present_parentCatalogName) - list.add(parentCatalogName); - - boolean present_parentSchemaName = true && (isSetParentSchemaName()); - list.add(present_parentSchemaName); - if (present_parentSchemaName) - list.add(parentSchemaName); - - boolean present_parentTableName = true && (isSetParentTableName()); - list.add(present_parentTableName); - if (present_parentTableName) - list.add(parentTableName); - - boolean present_foreignCatalogName = true && (isSetForeignCatalogName()); - list.add(present_foreignCatalogName); - if (present_foreignCatalogName) - list.add(foreignCatalogName); - - boolean present_foreignSchemaName = true && (isSetForeignSchemaName()); - list.add(present_foreignSchemaName); - if (present_foreignSchemaName) - list.add(foreignSchemaName); - - boolean present_foreignTableName = true && (isSetForeignTableName()); - list.add(present_foreignTableName); - if (present_foreignTableName) - list.add(foreignTableName); - - return list.hashCode(); + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetParentCatalogName()) ? 131071 : 524287); + if (isSetParentCatalogName()) + hashCode = hashCode * 8191 + parentCatalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetParentSchemaName()) ? 131071 : 524287); + if (isSetParentSchemaName()) + hashCode = hashCode * 8191 + parentSchemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetParentTableName()) ? 131071 : 524287); + if (isSetParentTableName()) + hashCode = hashCode * 8191 + parentTableName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetForeignCatalogName()) ? 131071 : 524287); + if (isSetForeignCatalogName()) + hashCode = hashCode * 8191 + foreignCatalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetForeignSchemaName()) ? 131071 : 524287); + if (isSetForeignSchemaName()) + hashCode = hashCode * 8191 + foreignSchemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetForeignTableName()) ? 131071 : 524287); + if (isSetForeignTableName()) + hashCode = hashCode * 8191 + foreignTableName.hashCode(); + + return hashCode; } @Override @@ -604,7 +589,7 @@ public int compareTo(TGetCrossReferenceReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -614,7 +599,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); + lastComparison = java.lang.Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -624,7 +609,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); + lastComparison = java.lang.Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -634,7 +619,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); + lastComparison = java.lang.Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); if (lastComparison != 0) { return lastComparison; } @@ -644,7 +629,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); + lastComparison = java.lang.Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -654,7 +639,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); + lastComparison = java.lang.Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -664,7 +649,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); + lastComparison = java.lang.Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); if (lastComparison != 0) { return lastComparison; } @@ -677,21 +662,22 @@ public int compareTo(TGetCrossReferenceReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCrossReferenceReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceReq("); boolean first = true; sb.append("sessionHandle:"); @@ -785,7 +771,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -793,13 +779,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCrossReferenceReqStandardSchemeFactory implements SchemeFactory { + private static class TGetCrossReferenceReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCrossReferenceReqStandardScheme getScheme() { return new TGetCrossReferenceReqStandardScheme(); } } - private static class TGetCrossReferenceReqStandardScheme extends StandardScheme { + private static class TGetCrossReferenceReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -934,19 +920,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCrossReference } - private static class TGetCrossReferenceReqTupleSchemeFactory implements SchemeFactory { + private static class TGetCrossReferenceReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCrossReferenceReqTupleScheme getScheme() { return new TGetCrossReferenceReqTupleScheme(); } } - private static class TGetCrossReferenceReqTupleScheme extends TupleScheme { + private static class TGetCrossReferenceReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetParentCatalogName()) { optionals.set(0); } @@ -988,11 +974,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceR @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(6); + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.parentCatalogName = iprot.readString(); struct.setParentCatalogNameIsSet(true); @@ -1020,5 +1006,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceRe } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java index df989dc73957..1a47e3effc08 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetCrossReferenceResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetCrossReferenceResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCrossReferenceRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCrossReferenceRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCrossReferenceRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCrossReferenceRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetCrossReferenceResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetCrossReferenceResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetCrossReferenceResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetCrossReferenceResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetCrossReferenceResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetCrossReferenceResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCrossReferenceResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCrossReferenceRespStandardSchemeFactory implements SchemeFactory { + private static class TGetCrossReferenceRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCrossReferenceRespStandardScheme getScheme() { return new TGetCrossReferenceRespStandardScheme(); } } - private static class TGetCrossReferenceRespStandardScheme extends StandardScheme { + private static class TGetCrossReferenceRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCrossReference } - private static class TGetCrossReferenceRespTupleSchemeFactory implements SchemeFactory { + private static class TGetCrossReferenceRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetCrossReferenceRespTupleScheme getScheme() { return new TGetCrossReferenceRespTupleScheme(); } } - private static class TGetCrossReferenceRespTupleScheme extends TupleScheme { + private static class TGetCrossReferenceRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceR @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceRe } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java index 5769aafc36c5..bb1353bea247 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java @@ -1,45 +1,26 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq"); 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 OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField RENEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("renewer", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetDelegationTokenReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetDelegationTokenReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetDelegationTokenReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String owner; // required - private String renewer; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String owner; // required + private @org.apache.thrift.annotation.Nullable java.lang.String renewer; // 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 { @@ -47,10 +28,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { OWNER((short)2, "owner"), RENEWER((short)3, "renewer"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -58,6 +39,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -77,21 +59,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -100,22 +83,22 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap); } @@ -124,8 +107,8 @@ public TGetDelegationTokenReq() { public TGetDelegationTokenReq( TSessionHandle sessionHandle, - String owner, - String renewer) + java.lang.String owner, + java.lang.String renewer) { this(); this.sessionHandle = sessionHandle; @@ -159,11 +142,12 @@ public void clear() { this.renewer = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -182,11 +166,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getOwner() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getOwner() { return this.owner; } - public void setOwner(String owner) { + public void setOwner(@org.apache.thrift.annotation.Nullable java.lang.String owner) { this.owner = owner; } @@ -205,11 +190,12 @@ public void setOwnerIsSet(boolean value) { } } - public String getRenewer() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getRenewer() { return this.renewer; } - public void setRenewer(String renewer) { + public void setRenewer(@org.apache.thrift.annotation.Nullable java.lang.String renewer) { this.renewer = renewer; } @@ -228,7 +214,7 @@ public void setRenewerIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -242,7 +228,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetOwner(); } else { - setOwner((String)value); + setOwner((java.lang.String)value); } break; @@ -250,14 +236,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetRenewer(); } else { - setRenewer((String)value); + setRenewer((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -269,13 +256,13 @@ public Object getFieldValue(_Fields field) { return getRenewer(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -286,11 +273,11 @@ public boolean isSet(_Fields field) { case RENEWER: return isSetRenewer(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetDelegationTokenReq) @@ -301,6 +288,8 @@ public boolean equals(Object that) { public boolean equals(TGetDelegationTokenReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -334,24 +323,21 @@ public boolean equals(TGetDelegationTokenReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_owner = true && (isSetOwner()); - list.add(present_owner); - if (present_owner) - list.add(owner); + hashCode = hashCode * 8191 + ((isSetOwner()) ? 131071 : 524287); + if (isSetOwner()) + hashCode = hashCode * 8191 + owner.hashCode(); - boolean present_renewer = true && (isSetRenewer()); - list.add(present_renewer); - if (present_renewer) - list.add(renewer); + hashCode = hashCode * 8191 + ((isSetRenewer()) ? 131071 : 524287); + if (isSetRenewer()) + hashCode = hashCode * 8191 + renewer.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -362,7 +348,7 @@ public int compareTo(TGetDelegationTokenReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -372,7 +358,7 @@ public int compareTo(TGetDelegationTokenReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); + lastComparison = java.lang.Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); if (lastComparison != 0) { return lastComparison; } @@ -382,7 +368,7 @@ public int compareTo(TGetDelegationTokenReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); + lastComparison = java.lang.Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); if (lastComparison != 0) { return lastComparison; } @@ -395,21 +381,22 @@ public int compareTo(TGetDelegationTokenReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetDelegationTokenReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenReq("); boolean first = true; sb.append("sessionHandle:"); @@ -467,7 +454,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -475,13 +462,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetDelegationTokenReqStandardSchemeFactory implements SchemeFactory { + private static class TGetDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetDelegationTokenReqStandardScheme getScheme() { return new TGetDelegationTokenReqStandardScheme(); } } - private static class TGetDelegationTokenReqStandardScheme extends StandardScheme { + private static class TGetDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -552,17 +539,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationToke } - private static class TGetDelegationTokenReqTupleSchemeFactory implements SchemeFactory { + private static class TGetDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetDelegationTokenReqTupleScheme getScheme() { return new TGetDelegationTokenReqTupleScheme(); } } - private static class TGetDelegationTokenReqTupleScheme extends TupleScheme { + private static class TGetDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.owner); oprot.writeString(struct.renewer); @@ -570,7 +557,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationToken @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); @@ -581,5 +568,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenR } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java index a5574a1ffff1..06b10185938c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenResp"); 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetDelegationTokenRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetDelegationTokenRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetDelegationTokenRespTupleSchemeFactory(); - private TStatus status; // required - private String delegationToken; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), DELEGATION_TOKEN((short)2, "delegationToken"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.DELEGATION_TOKEN}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.delegationToken = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } - public String getDelegationToken() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getDelegationToken() { return this.delegationToken; } - public void setDelegationToken(String delegationToken) { + public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { this.delegationToken = delegationToken; } @@ -192,7 +176,7 @@ public void setDelegationTokenIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -206,14 +190,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetDelegationToken(); } else { - setDelegationToken((String)value); + setDelegationToken((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getDelegationToken(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case DELEGATION_TOKEN: return isSetDelegationToken(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetDelegationTokenResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetDelegationTokenResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetDelegationTokenResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_delegationToken = true && (isSetDelegationToken()); - list.add(present_delegationToken); - if (present_delegationToken) - list.add(delegationToken); + hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); + if (isSetDelegationToken()) + hashCode = hashCode * 8191 + delegationToken.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetDelegationTokenResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetDelegationTokenResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetDelegationTokenResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetDelegationTokenResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenResp("); boolean first = true; sb.append("status:"); @@ -380,7 +366,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -388,13 +374,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetDelegationTokenRespStandardSchemeFactory implements SchemeFactory { + private static class TGetDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetDelegationTokenRespStandardScheme getScheme() { return new TGetDelegationTokenRespStandardScheme(); } } - private static class TGetDelegationTokenRespStandardScheme extends StandardScheme { + private static class TGetDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -454,19 +440,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationToke } - private static class TGetDelegationTokenRespTupleSchemeFactory implements SchemeFactory { + private static class TGetDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetDelegationTokenRespTupleScheme getScheme() { return new TGetDelegationTokenRespTupleScheme(); } } - private static class TGetDelegationTokenRespTupleScheme extends TupleScheme { + private static class TGetDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetDelegationToken()) { optionals.set(0); } @@ -478,11 +464,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationToken @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.delegationToken = iprot.readString(); struct.setDelegationTokenIsSet(true); @@ -490,5 +476,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenR } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java index 68b533ba893c..3195cf0c22ec 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsReq"); 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); @@ -33,16 +16,13 @@ private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetFunctionsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetFunctionsReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetFunctionsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetFunctionsReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String functionName; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String functionName; // 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 { @@ -51,10 +31,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SCHEMA_NAME((short)3, "schemaName"), FUNCTION_NAME((short)4, "functionName"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -62,6 +42,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -83,21 +64,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -106,16 +88,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -124,7 +106,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsReq.class, metaDataMap); } @@ -133,7 +115,7 @@ public TGetFunctionsReq() { public TGetFunctionsReq( TSessionHandle sessionHandle, - String functionName) + java.lang.String functionName) { this(); this.sessionHandle = sessionHandle; @@ -170,11 +152,12 @@ public void clear() { this.functionName = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -193,11 +176,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getCatalogName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { return this.catalogName; } - public void setCatalogName(String catalogName) { + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { this.catalogName = catalogName; } @@ -216,11 +200,12 @@ public void setCatalogNameIsSet(boolean value) { } } - public String getSchemaName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { return this.schemaName; } - public void setSchemaName(String schemaName) { + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { this.schemaName = schemaName; } @@ -239,11 +224,12 @@ public void setSchemaNameIsSet(boolean value) { } } - public String getFunctionName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getFunctionName() { return this.functionName; } - public void setFunctionName(String functionName) { + public void setFunctionName(@org.apache.thrift.annotation.Nullable java.lang.String functionName) { this.functionName = functionName; } @@ -262,7 +248,7 @@ public void setFunctionNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -276,7 +262,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetCatalogName(); } else { - setCatalogName((String)value); + setCatalogName((java.lang.String)value); } break; @@ -284,7 +270,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSchemaName(); } else { - setSchemaName((String)value); + setSchemaName((java.lang.String)value); } break; @@ -292,14 +278,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetFunctionName(); } else { - setFunctionName((String)value); + setFunctionName((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -314,13 +301,13 @@ public Object getFieldValue(_Fields field) { return getFunctionName(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -333,11 +320,11 @@ public boolean isSet(_Fields field) { case FUNCTION_NAME: return isSetFunctionName(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetFunctionsReq) @@ -348,6 +335,8 @@ public boolean equals(Object that) { public boolean equals(TGetFunctionsReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -390,29 +379,25 @@ public boolean equals(TGetFunctionsReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); - boolean present_functionName = true && (isSetFunctionName()); - list.add(present_functionName); - if (present_functionName) - list.add(functionName); + hashCode = hashCode * 8191 + ((isSetFunctionName()) ? 131071 : 524287); + if (isSetFunctionName()) + hashCode = hashCode * 8191 + functionName.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -423,7 +408,7 @@ public int compareTo(TGetFunctionsReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -433,7 +418,7 @@ public int compareTo(TGetFunctionsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -443,7 +428,7 @@ public int compareTo(TGetFunctionsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -453,7 +438,7 @@ public int compareTo(TGetFunctionsReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); + lastComparison = java.lang.Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); if (lastComparison != 0) { return lastComparison; } @@ -466,21 +451,22 @@ public int compareTo(TGetFunctionsReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetFunctionsReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsReq("); boolean first = true; sb.append("sessionHandle:"); @@ -546,7 +532,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -554,13 +540,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetFunctionsReqStandardSchemeFactory implements SchemeFactory { + private static class TGetFunctionsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetFunctionsReqStandardScheme getScheme() { return new TGetFunctionsReqStandardScheme(); } } - private static class TGetFunctionsReqStandardScheme extends StandardScheme { + private static class TGetFunctionsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -648,20 +634,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsReq s } - private static class TGetFunctionsReqTupleSchemeFactory implements SchemeFactory { + private static class TGetFunctionsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetFunctionsReqTupleScheme getScheme() { return new TGetFunctionsReqTupleScheme(); } } - private static class TGetFunctionsReqTupleScheme extends TupleScheme { + private static class TGetFunctionsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.functionName); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -679,13 +665,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); struct.functionName = iprot.readString(); struct.setFunctionNameIsSet(true); - BitSet incoming = iprot.readBitSet(2); + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -697,5 +683,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java index af1a30ceb44e..9299b81b20d6 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetFunctionsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetFunctionsRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetFunctionsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetFunctionsRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetFunctionsResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetFunctionsResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetFunctionsResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetFunctionsResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetFunctionsResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetFunctionsResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetFunctionsResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetFunctionsRespStandardSchemeFactory implements SchemeFactory { + private static class TGetFunctionsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetFunctionsRespStandardScheme getScheme() { return new TGetFunctionsRespStandardScheme(); } } - private static class TGetFunctionsRespStandardScheme extends StandardScheme { + private static class TGetFunctionsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsResp } - private static class TGetFunctionsRespTupleSchemeFactory implements SchemeFactory { + private static class TGetFunctionsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetFunctionsRespTupleScheme getScheme() { return new TGetFunctionsRespTupleScheme(); } } - private static class TGetFunctionsRespTupleScheme extends TupleScheme { + private static class TGetFunctionsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp s @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java index 9fe4a2228111..f9a6a5a88c24 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java @@ -1,43 +1,24 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoReq"); 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 INFO_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoType", org.apache.thrift.protocol.TType.I32, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetInfoReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetInfoReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private TGetInfoType infoType; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable TGetInfoType infoType; // 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 { @@ -48,10 +29,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { */ INFO_TYPE((short)2, "infoType"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -59,6 +40,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -76,21 +58,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -99,20 +82,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.INFO_TYPE, new org.apache.thrift.meta_data.FieldMetaData("infoType", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGetInfoType.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoReq.class, metaDataMap); } @@ -150,11 +133,12 @@ public void clear() { this.infoType = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -177,6 +161,7 @@ public void setSessionHandleIsSet(boolean value) { * * @see TGetInfoType */ + @org.apache.thrift.annotation.Nullable public TGetInfoType getInfoType() { return this.infoType; } @@ -185,7 +170,7 @@ public TGetInfoType getInfoType() { * * @see TGetInfoType */ - public void setInfoType(TGetInfoType infoType) { + public void setInfoType(@org.apache.thrift.annotation.Nullable TGetInfoType infoType) { this.infoType = infoType; } @@ -204,7 +189,7 @@ public void setInfoTypeIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -225,7 +210,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -234,13 +220,13 @@ public Object getFieldValue(_Fields field) { return getInfoType(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -249,11 +235,11 @@ public boolean isSet(_Fields field) { case INFO_TYPE: return isSetInfoType(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetInfoReq) @@ -264,6 +250,8 @@ public boolean equals(Object that) { public boolean equals(TGetInfoReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -288,19 +276,17 @@ public boolean equals(TGetInfoReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_infoType = true && (isSetInfoType()); - list.add(present_infoType); - if (present_infoType) - list.add(infoType.getValue()); + hashCode = hashCode * 8191 + ((isSetInfoType()) ? 131071 : 524287); + if (isSetInfoType()) + hashCode = hashCode * 8191 + infoType.getValue(); - return list.hashCode(); + return hashCode; } @Override @@ -311,7 +297,7 @@ public int compareTo(TGetInfoReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -321,7 +307,7 @@ public int compareTo(TGetInfoReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); + lastComparison = java.lang.Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); if (lastComparison != 0) { return lastComparison; } @@ -334,21 +320,22 @@ public int compareTo(TGetInfoReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetInfoReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoReq("); boolean first = true; sb.append("sessionHandle:"); @@ -394,7 +381,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -402,13 +389,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetInfoReqStandardSchemeFactory implements SchemeFactory { + private static class TGetInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetInfoReqStandardScheme getScheme() { return new TGetInfoReqStandardScheme(); } } - private static class TGetInfoReqStandardScheme extends StandardScheme { + private static class TGetInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -431,7 +418,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq struct) break; case 2: // INFO_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.infoType = TGetInfoType.findByValue(iprot.readI32()); + struct.infoType = org.apache.spark.service.rpc.thrift.TGetInfoType.findByValue(iprot.readI32()); struct.setInfoTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -466,31 +453,34 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoReq struct } - private static class TGetInfoReqTupleSchemeFactory implements SchemeFactory { + private static class TGetInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetInfoReqTupleScheme getScheme() { return new TGetInfoReqTupleScheme(); } } - private static class TGetInfoReqTupleScheme extends TupleScheme { + private static class TGetInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeI32(struct.infoType.getValue()); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - struct.infoType = TGetInfoType.findByValue(iprot.readI32()); + struct.infoType = org.apache.spark.service.rpc.thrift.TGetInfoType.findByValue(iprot.readI32()); struct.setInfoTypeIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java index 0cc5e3a744d4..3ef40fba7e91 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java @@ -1,53 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp"); 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 INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetInfoRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetInfoRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoRespTupleSchemeFactory(); - private TStatus status; // required - private TGetInfoValue infoValue; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TGetInfoValue infoValue; // 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 { STATUS((short)1, "status"), INFO_VALUE((short)2, "infoValue"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -55,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -72,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -95,20 +78,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap); } @@ -146,11 +129,12 @@ public void clear() { this.infoValue = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +153,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TGetInfoValue getInfoValue() { return this.infoValue; } - public void setInfoValue(TGetInfoValue infoValue) { + public void setInfoValue(@org.apache.thrift.annotation.Nullable TGetInfoValue infoValue) { this.infoValue = infoValue; } @@ -192,7 +177,7 @@ public void setInfoValueIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +198,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +208,13 @@ public Object getFieldValue(_Fields field) { return getInfoValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +223,11 @@ public boolean isSet(_Fields field) { case INFO_VALUE: return isSetInfoValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetInfoResp) @@ -252,6 +238,8 @@ public boolean equals(Object that) { public boolean equals(TGetInfoResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +264,17 @@ public boolean equals(TGetInfoResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_infoValue = true && (isSetInfoValue()); - list.add(present_infoValue); - if (present_infoValue) - list.add(infoValue); + hashCode = hashCode * 8191 + ((isSetInfoValue()) ? 131071 : 524287); + if (isSetInfoValue()) + hashCode = hashCode * 8191 + infoValue.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +285,7 @@ public int compareTo(TGetInfoResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +295,7 @@ public int compareTo(TGetInfoResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); + lastComparison = java.lang.Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +308,22 @@ public int compareTo(TGetInfoResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetInfoResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoResp("); boolean first = true; sb.append("status:"); @@ -382,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -390,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetInfoRespStandardSchemeFactory implements SchemeFactory { + private static class TGetInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetInfoRespStandardScheme getScheme() { return new TGetInfoRespStandardScheme(); } } - private static class TGetInfoRespStandardScheme extends StandardScheme { + private static class TGetInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -455,24 +442,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoResp struc } - private static class TGetInfoRespTupleSchemeFactory implements SchemeFactory { + private static class TGetInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetInfoRespTupleScheme getScheme() { return new TGetInfoRespTupleScheme(); } } - private static class TGetInfoRespTupleScheme extends TupleScheme { + private static class TGetInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); struct.infoValue.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); @@ -482,5 +469,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java index 053c78c99b8d..a09d0b1fa15c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TGetInfoType implements org.apache.thrift.TEnum { CLI_MAX_DRIVER_CONNECTIONS(0), CLI_MAX_CONCURRENT_ACTIVITIES(1), @@ -74,6 +75,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TGetInfoType findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java index f1ae085f3b47..602d0d8dfc43 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java @@ -1,23 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -import org.apache.thrift.protocol.TProtocolException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetInfoValue extends org.apache.thrift.TUnion { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetInfoValue extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoValue"); private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField SMALL_INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("smallIntValue", org.apache.thrift.protocol.TType.I16, (short)2); @@ -35,10 +26,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { BINARY_VALUE((short)5, "binaryValue"), LEN_VALUE((short)6, "lenValue"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -46,6 +37,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STRING_VALUE @@ -71,21 +63,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -94,27 +87,27 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoValue.class, metaDataMap); } @@ -122,7 +115,7 @@ public TGetInfoValue() { super(); } - public TGetInfoValue(_Fields setField, Object value) { + public TGetInfoValue(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -133,7 +126,7 @@ public TGetInfoValue deepCopy() { return new TGetInfoValue(this); } - public static TGetInfoValue stringValue(String value) { + public static TGetInfoValue stringValue(java.lang.String value) { TGetInfoValue x = new TGetInfoValue(); x.setStringValue(value); return x; @@ -171,51 +164,51 @@ public static TGetInfoValue lenValue(long value) { @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case STRING_VALUE: - if (value instanceof String) { + if (value instanceof java.lang.String) { break; } - throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); case SMALL_INT_VALUE: - if (value instanceof Short) { + if (value instanceof java.lang.Short) { break; } - throw new ClassCastException("Was expecting value of type Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); case INTEGER_BITMASK: - if (value instanceof Integer) { + if (value instanceof java.lang.Integer) { break; } - throw new ClassCastException("Was expecting value of type Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); case INTEGER_FLAG: - if (value instanceof Integer) { + if (value instanceof java.lang.Integer) { break; } - throw new ClassCastException("Was expecting value of type Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); case BINARY_VALUE: - if (value instanceof Integer) { + if (value instanceof java.lang.Integer) { break; } - throw new ClassCastException("Was expecting value of type Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); case LEN_VALUE: - if (value instanceof Long) { + if (value instanceof java.lang.Long) { break; } - throw new ClassCastException("Was expecting value of type Long for field 'lenValue', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Long for field 'lenValue', but got " + value.getClass().getSimpleName()); default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { case STRING_VALUE: if (field.type == STRING_VALUE_FIELD_DESC.type) { - String stringValue; + java.lang.String stringValue; stringValue = iprot.readString(); return stringValue; } else { @@ -224,7 +217,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip } case SMALL_INT_VALUE: if (field.type == SMALL_INT_VALUE_FIELD_DESC.type) { - Short smallIntValue; + java.lang.Short smallIntValue; smallIntValue = iprot.readI16(); return smallIntValue; } else { @@ -233,7 +226,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip } case INTEGER_BITMASK: if (field.type == INTEGER_BITMASK_FIELD_DESC.type) { - Integer integerBitmask; + java.lang.Integer integerBitmask; integerBitmask = iprot.readI32(); return integerBitmask; } else { @@ -242,7 +235,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip } case INTEGER_FLAG: if (field.type == INTEGER_FLAG_FIELD_DESC.type) { - Integer integerFlag; + java.lang.Integer integerFlag; integerFlag = iprot.readI32(); return integerFlag; } else { @@ -251,7 +244,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip } case BINARY_VALUE: if (field.type == BINARY_VALUE_FIELD_DESC.type) { - Integer binaryValue; + java.lang.Integer binaryValue; binaryValue = iprot.readI32(); return binaryValue; } else { @@ -260,7 +253,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip } case LEN_VALUE: if (field.type == LEN_VALUE_FIELD_DESC.type) { - Long lenValue; + java.lang.Long lenValue; lenValue = iprot.readI64(); return lenValue; } else { @@ -268,7 +261,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip return null; } default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -280,68 +273,68 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case STRING_VALUE: - String stringValue = (String)value_; + java.lang.String stringValue = (java.lang.String)value_; oprot.writeString(stringValue); return; case SMALL_INT_VALUE: - Short smallIntValue = (Short)value_; + java.lang.Short smallIntValue = (java.lang.Short)value_; oprot.writeI16(smallIntValue); return; case INTEGER_BITMASK: - Integer integerBitmask = (Integer)value_; + java.lang.Integer integerBitmask = (java.lang.Integer)value_; oprot.writeI32(integerBitmask); return; case INTEGER_FLAG: - Integer integerFlag = (Integer)value_; + java.lang.Integer integerFlag = (java.lang.Integer)value_; oprot.writeI32(integerFlag); return; case BINARY_VALUE: - Integer binaryValue = (Integer)value_; + java.lang.Integer binaryValue = (java.lang.Integer)value_; oprot.writeI32(binaryValue); return; case LEN_VALUE: - Long lenValue = (Long)value_; + java.lang.Long lenValue = (java.lang.Long)value_; oprot.writeI64(lenValue); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case STRING_VALUE: - String stringValue; + java.lang.String stringValue; stringValue = iprot.readString(); return stringValue; case SMALL_INT_VALUE: - Short smallIntValue; + java.lang.Short smallIntValue; smallIntValue = iprot.readI16(); return smallIntValue; case INTEGER_BITMASK: - Integer integerBitmask; + java.lang.Integer integerBitmask; integerBitmask = iprot.readI32(); return integerBitmask; case INTEGER_FLAG: - Integer integerFlag; + java.lang.Integer integerFlag; integerFlag = iprot.readI32(); return integerFlag; case BINARY_VALUE: - Integer binaryValue; + java.lang.Integer binaryValue; binaryValue = iprot.readI32(); return binaryValue; case LEN_VALUE: - Long lenValue; + java.lang.Long lenValue; lenValue = iprot.readI64(); return lenValue; default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -349,31 +342,31 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case STRING_VALUE: - String stringValue = (String)value_; + java.lang.String stringValue = (java.lang.String)value_; oprot.writeString(stringValue); return; case SMALL_INT_VALUE: - Short smallIntValue = (Short)value_; + java.lang.Short smallIntValue = (java.lang.Short)value_; oprot.writeI16(smallIntValue); return; case INTEGER_BITMASK: - Integer integerBitmask = (Integer)value_; + java.lang.Integer integerBitmask = (java.lang.Integer)value_; oprot.writeI32(integerBitmask); return; case INTEGER_FLAG: - Integer integerFlag = (Integer)value_; + java.lang.Integer integerFlag = (java.lang.Integer)value_; oprot.writeI32(integerFlag); return; case BINARY_VALUE: - Integer binaryValue = (Integer)value_; + java.lang.Integer binaryValue = (java.lang.Integer)value_; oprot.writeI32(binaryValue); return; case LEN_VALUE: - Long lenValue = (Long)value_; + java.lang.Long lenValue = (java.lang.Long)value_; oprot.writeI64(lenValue); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -393,7 +386,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case LEN_VALUE: return LEN_VALUE_FIELD_DESC; default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @@ -407,30 +400,31 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public String getStringValue() { + public java.lang.String getStringValue() { if (getSetField() == _Fields.STRING_VALUE) { - return (String)getFieldValue(); + return (java.lang.String)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } - public void setStringValue(String value) { - if (value == null) throw new NullPointerException(); + public void setStringValue(java.lang.String value) { + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.STRING_VALUE; value_ = value; } public short getSmallIntValue() { if (getSetField() == _Fields.SMALL_INT_VALUE) { - return (Short)getFieldValue(); + return (java.lang.Short)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -441,9 +435,9 @@ public void setSmallIntValue(short value) { public int getIntegerBitmask() { if (getSetField() == _Fields.INTEGER_BITMASK) { - return (Integer)getFieldValue(); + return (java.lang.Integer)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -454,9 +448,9 @@ public void setIntegerBitmask(int value) { public int getIntegerFlag() { if (getSetField() == _Fields.INTEGER_FLAG) { - return (Integer)getFieldValue(); + return (java.lang.Integer)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -467,9 +461,9 @@ public void setIntegerFlag(int value) { public int getBinaryValue() { if (getSetField() == _Fields.BINARY_VALUE) { - return (Integer)getFieldValue(); + return (java.lang.Integer)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -480,9 +474,9 @@ public void setBinaryValue(int value) { public long getLenValue() { if (getSetField() == _Fields.LEN_VALUE) { - return (Long)getFieldValue(); + return (java.lang.Long)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -521,7 +515,7 @@ public boolean isSetLenValue() { } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof TGetInfoValue) { return equals((TGetInfoValue)other); } else { @@ -545,12 +539,12 @@ public int compareTo(TGetInfoValue other) { @Override public int hashCode() { - List list = new ArrayList(); + java.util.List list = new java.util.ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); + java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -568,7 +562,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java index 9a1a03840229..f66d30b0d367 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java @@ -1,44 +1,23 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusReq"); 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)1); private static final org.apache.thrift.protocol.TField GET_PROGRESS_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("getProgressUpdate", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetOperationStatusReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetOperationStatusReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetOperationStatusReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetOperationStatusReqTupleSchemeFactory(); - private TOperationHandle operationHandle; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required private boolean getProgressUpdate; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -46,10 +25,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { OPERATION_HANDLE((short)1, "operationHandle"), GET_PROGRESS_UPDATE((short)2, "getProgressUpdate"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,7 +78,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -106,14 +87,14 @@ public String getFieldName() { private static final int __GETPROGRESSUPDATE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.GET_PROGRESS_UPDATE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.GET_PROGRESS_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("getProgressUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusReq.class, metaDataMap); } @@ -149,11 +130,12 @@ public void clear() { this.getProgressUpdate = false; } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -182,19 +164,19 @@ public void setGetProgressUpdate(boolean getProgressUpdate) { } public void unsetGetProgressUpdate() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); } /** Returns true if field getProgressUpdate is set (has been assigned a value) and false otherwise */ public boolean isSetGetProgressUpdate() { - return EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); } public void setGetProgressUpdateIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -208,14 +190,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetGetProgressUpdate(); } else { - setGetProgressUpdate((Boolean)value); + setGetProgressUpdate((java.lang.Boolean)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); @@ -224,13 +207,13 @@ public Object getFieldValue(_Fields field) { return isGetProgressUpdate(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -239,11 +222,11 @@ public boolean isSet(_Fields field) { case GET_PROGRESS_UPDATE: return isSetGetProgressUpdate(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetOperationStatusReq) @@ -254,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetOperationStatusReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -278,19 +263,17 @@ public boolean equals(TGetOperationStatusReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - boolean present_getProgressUpdate = true && (isSetGetProgressUpdate()); - list.add(present_getProgressUpdate); - if (present_getProgressUpdate) - list.add(getProgressUpdate); + hashCode = hashCode * 8191 + ((isSetGetProgressUpdate()) ? 131071 : 524287); + if (isSetGetProgressUpdate()) + hashCode = hashCode * 8191 + ((getProgressUpdate) ? 131071 : 524287); - return list.hashCode(); + return hashCode; } @Override @@ -301,7 +284,7 @@ public int compareTo(TGetOperationStatusReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -311,7 +294,7 @@ public int compareTo(TGetOperationStatusReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); + lastComparison = java.lang.Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); if (lastComparison != 0) { return lastComparison; } @@ -324,21 +307,22 @@ public int compareTo(TGetOperationStatusReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetOperationStatusReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusReq("); boolean first = true; sb.append("operationHandle:"); @@ -378,7 +362,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -388,13 +372,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetOperationStatusReqStandardSchemeFactory implements SchemeFactory { + private static class TGetOperationStatusReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetOperationStatusReqStandardScheme getScheme() { return new TGetOperationStatusReqStandardScheme(); } } - private static class TGetOperationStatusReqStandardScheme extends StandardScheme { + private static class TGetOperationStatusReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -452,19 +436,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatu } - private static class TGetOperationStatusReqTupleSchemeFactory implements SchemeFactory { + private static class TGetOperationStatusReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetOperationStatusReqTupleScheme getScheme() { return new TGetOperationStatusReqTupleScheme(); } } - private static class TGetOperationStatusReqTupleScheme extends TupleScheme { + private static class TGetOperationStatusReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetGetProgressUpdate()) { optionals.set(0); } @@ -476,11 +460,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatus @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.getProgressUpdate = iprot.readBool(); struct.setGetProgressUpdateIsSet(true); @@ -488,5 +472,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusR } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java index fad75ca5fb54..75694a786dc9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java @@ -1,32 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusResp"); 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); @@ -40,22 +22,19 @@ private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)9); private static final org.apache.thrift.protocol.TField PROGRESS_UPDATE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressUpdateResponse", org.apache.thrift.protocol.TType.STRUCT, (short)10); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetOperationStatusRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetOperationStatusRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetOperationStatusRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetOperationStatusRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationState operationState; // optional - private String sqlState; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationState operationState; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional private int errorCode; // optional - private String errorMessage; // optional - private String taskStatus; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String taskStatus; // optional private long operationStarted; // optional private long operationCompleted; // optional private boolean hasResultSet; // optional - private TProgressUpdateResp progressUpdateResponse; // optional + private @org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse; // 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 { @@ -74,10 +53,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HAS_RESULT_SET((short)9, "hasResultSet"), PROGRESS_UPDATE_RESPONSE((short)10, "progressUpdateResponse"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -85,6 +64,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -118,21 +98,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -141,7 +122,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -153,9 +134,9 @@ public String getFieldName() { private static final int __HASRESULTSET_ISSET_ID = 3; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET,_Fields.PROGRESS_UPDATE_RESPONSE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -176,7 +157,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.PROGRESS_UPDATE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("progressUpdateResponse", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TProgressUpdateResp"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap); } @@ -215,7 +196,7 @@ public TGetOperationStatusResp(TGetOperationStatusResp other) { this.operationCompleted = other.operationCompleted; this.hasResultSet = other.hasResultSet; if (other.isSetProgressUpdateResponse()) { - this.progressUpdateResponse = other.progressUpdateResponse; + this.progressUpdateResponse = new TProgressUpdateResp(other.progressUpdateResponse); } } @@ -241,11 +222,12 @@ public void clear() { this.progressUpdateResponse = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -268,6 +250,7 @@ public void setStatusIsSet(boolean value) { * * @see TOperationState */ + @org.apache.thrift.annotation.Nullable public TOperationState getOperationState() { return this.operationState; } @@ -276,7 +259,7 @@ public TOperationState getOperationState() { * * @see TOperationState */ - public void setOperationState(TOperationState operationState) { + public void setOperationState(@org.apache.thrift.annotation.Nullable TOperationState operationState) { this.operationState = operationState; } @@ -295,11 +278,12 @@ public void setOperationStateIsSet(boolean value) { } } - public String getSqlState() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getSqlState() { return this.sqlState; } - public void setSqlState(String sqlState) { + public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { this.sqlState = sqlState; } @@ -328,23 +312,24 @@ public void setErrorCode(int errorCode) { } public void unsetErrorCode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ public boolean isSetErrorCode() { - return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); } - public String getErrorMessage() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getErrorMessage() { return this.errorMessage; } - public void setErrorMessage(String errorMessage) { + public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { this.errorMessage = errorMessage; } @@ -363,11 +348,12 @@ public void setErrorMessageIsSet(boolean value) { } } - public String getTaskStatus() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getTaskStatus() { return this.taskStatus; } - public void setTaskStatus(String taskStatus) { + public void setTaskStatus(@org.apache.thrift.annotation.Nullable java.lang.String taskStatus) { this.taskStatus = taskStatus; } @@ -396,16 +382,16 @@ public void setOperationStarted(long operationStarted) { } public void unsetOperationStarted() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); } /** Returns true if field operationStarted is set (has been assigned a value) and false otherwise */ public boolean isSetOperationStarted() { - return EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); } public void setOperationStartedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); } public long getOperationCompleted() { @@ -418,16 +404,16 @@ public void setOperationCompleted(long operationCompleted) { } public void unsetOperationCompleted() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); } /** Returns true if field operationCompleted is set (has been assigned a value) and false otherwise */ public boolean isSetOperationCompleted() { - return EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); } public void setOperationCompletedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); } public boolean isHasResultSet() { @@ -440,23 +426,24 @@ public void setHasResultSet(boolean hasResultSet) { } public void unsetHasResultSet() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ public boolean isSetHasResultSet() { - return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); } + @org.apache.thrift.annotation.Nullable public TProgressUpdateResp getProgressUpdateResponse() { return this.progressUpdateResponse; } - public void setProgressUpdateResponse(TProgressUpdateResp progressUpdateResponse) { + public void setProgressUpdateResponse(@org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse) { this.progressUpdateResponse = progressUpdateResponse; } @@ -475,7 +462,7 @@ public void setProgressUpdateResponseIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -497,7 +484,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSqlState(); } else { - setSqlState((String)value); + setSqlState((java.lang.String)value); } break; @@ -505,7 +492,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetErrorCode(); } else { - setErrorCode((Integer)value); + setErrorCode((java.lang.Integer)value); } break; @@ -513,7 +500,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetErrorMessage(); } else { - setErrorMessage((String)value); + setErrorMessage((java.lang.String)value); } break; @@ -521,7 +508,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetTaskStatus(); } else { - setTaskStatus((String)value); + setTaskStatus((java.lang.String)value); } break; @@ -529,7 +516,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetOperationStarted(); } else { - setOperationStarted((Long)value); + setOperationStarted((java.lang.Long)value); } break; @@ -537,7 +524,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetOperationCompleted(); } else { - setOperationCompleted((Long)value); + setOperationCompleted((java.lang.Long)value); } break; @@ -545,7 +532,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetHasResultSet(); } else { - setHasResultSet((Boolean)value); + setHasResultSet((java.lang.Boolean)value); } break; @@ -560,7 +547,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -593,13 +581,13 @@ public Object getFieldValue(_Fields field) { return getProgressUpdateResponse(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -624,11 +612,11 @@ public boolean isSet(_Fields field) { case PROGRESS_UPDATE_RESPONSE: return isSetProgressUpdateResponse(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetOperationStatusResp) @@ -639,6 +627,8 @@ public boolean equals(Object that) { public boolean equals(TGetOperationStatusResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -735,59 +725,49 @@ public boolean equals(TGetOperationStatusResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationState = true && (isSetOperationState()); - list.add(present_operationState); - if (present_operationState) - list.add(operationState.getValue()); + hashCode = hashCode * 8191 + ((isSetOperationState()) ? 131071 : 524287); + if (isSetOperationState()) + hashCode = hashCode * 8191 + operationState.getValue(); - boolean present_sqlState = true && (isSetSqlState()); - list.add(present_sqlState); - if (present_sqlState) - list.add(sqlState); + hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); + if (isSetSqlState()) + hashCode = hashCode * 8191 + sqlState.hashCode(); - boolean present_errorCode = true && (isSetErrorCode()); - list.add(present_errorCode); - if (present_errorCode) - list.add(errorCode); + hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); + if (isSetErrorCode()) + hashCode = hashCode * 8191 + errorCode; - boolean present_errorMessage = true && (isSetErrorMessage()); - list.add(present_errorMessage); - if (present_errorMessage) - list.add(errorMessage); + hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); + if (isSetErrorMessage()) + hashCode = hashCode * 8191 + errorMessage.hashCode(); - boolean present_taskStatus = true && (isSetTaskStatus()); - list.add(present_taskStatus); - if (present_taskStatus) - list.add(taskStatus); + hashCode = hashCode * 8191 + ((isSetTaskStatus()) ? 131071 : 524287); + if (isSetTaskStatus()) + hashCode = hashCode * 8191 + taskStatus.hashCode(); - boolean present_operationStarted = true && (isSetOperationStarted()); - list.add(present_operationStarted); - if (present_operationStarted) - list.add(operationStarted); + hashCode = hashCode * 8191 + ((isSetOperationStarted()) ? 131071 : 524287); + if (isSetOperationStarted()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationStarted); - boolean present_operationCompleted = true && (isSetOperationCompleted()); - list.add(present_operationCompleted); - if (present_operationCompleted) - list.add(operationCompleted); + hashCode = hashCode * 8191 + ((isSetOperationCompleted()) ? 131071 : 524287); + if (isSetOperationCompleted()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationCompleted); - boolean present_hasResultSet = true && (isSetHasResultSet()); - list.add(present_hasResultSet); - if (present_hasResultSet) - list.add(hasResultSet); + hashCode = hashCode * 8191 + ((isSetHasResultSet()) ? 131071 : 524287); + if (isSetHasResultSet()) + hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); - boolean present_progressUpdateResponse = true && (isSetProgressUpdateResponse()); - list.add(present_progressUpdateResponse); - if (present_progressUpdateResponse) - list.add(progressUpdateResponse); + hashCode = hashCode * 8191 + ((isSetProgressUpdateResponse()) ? 131071 : 524287); + if (isSetProgressUpdateResponse()) + hashCode = hashCode * 8191 + progressUpdateResponse.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -798,7 +778,7 @@ public int compareTo(TGetOperationStatusResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -808,7 +788,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); if (lastComparison != 0) { return lastComparison; } @@ -818,7 +798,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); if (lastComparison != 0) { return lastComparison; } @@ -828,7 +808,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); if (lastComparison != 0) { return lastComparison; } @@ -838,7 +818,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); if (lastComparison != 0) { return lastComparison; } @@ -848,7 +828,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); if (lastComparison != 0) { return lastComparison; } @@ -858,7 +838,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); if (lastComparison != 0) { return lastComparison; } @@ -868,7 +848,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); if (lastComparison != 0) { return lastComparison; } @@ -878,7 +858,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); if (lastComparison != 0) { return lastComparison; } @@ -888,7 +868,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); + lastComparison = java.lang.Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); if (lastComparison != 0) { return lastComparison; } @@ -901,21 +881,22 @@ public int compareTo(TGetOperationStatusResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetOperationStatusResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusResp("); boolean first = true; sb.append("status:"); @@ -1023,7 +1004,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -1033,13 +1014,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetOperationStatusRespStandardSchemeFactory implements SchemeFactory { + private static class TGetOperationStatusRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetOperationStatusRespStandardScheme getScheme() { return new TGetOperationStatusRespStandardScheme(); } } - private static class TGetOperationStatusRespStandardScheme extends StandardScheme { + private static class TGetOperationStatusRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -1062,7 +1043,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatus break; case 2: // OPERATION_STATE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationState = TOperationState.findByValue(iprot.readI32()); + struct.operationState = org.apache.spark.service.rpc.thrift.TOperationState.findByValue(iprot.readI32()); struct.setOperationStateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -1212,19 +1193,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatu } - private static class TGetOperationStatusRespTupleSchemeFactory implements SchemeFactory { + private static class TGetOperationStatusRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetOperationStatusRespTupleScheme getScheme() { return new TGetOperationStatusRespTupleScheme(); } } - private static class TGetOperationStatusRespTupleScheme extends TupleScheme { + private static class TGetOperationStatusRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationState()) { optionals.set(0); } @@ -1284,13 +1265,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatus @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(9); + java.util.BitSet incoming = iprot.readBitSet(9); if (incoming.get(0)) { - struct.operationState = TOperationState.findByValue(iprot.readI32()); + struct.operationState = org.apache.spark.service.rpc.thrift.TOperationState.findByValue(iprot.readI32()); struct.setOperationStateIsSet(true); } if (incoming.get(1)) { @@ -1329,5 +1310,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusR } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java index eb8f5e41018a..460f88bfe2e3 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysReq"); 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); @@ -33,16 +16,13 @@ private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetPrimaryKeysReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetPrimaryKeysReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetPrimaryKeysReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetPrimaryKeysReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // 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 { @@ -51,10 +31,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SCHEMA_NAME((short)3, "schemaName"), TABLE_NAME((short)4, "tableName"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -62,6 +42,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -83,21 +64,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -106,16 +88,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -124,7 +106,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysReq.class, metaDataMap); } @@ -168,11 +150,12 @@ public void clear() { this.tableName = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -191,11 +174,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getCatalogName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { return this.catalogName; } - public void setCatalogName(String catalogName) { + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { this.catalogName = catalogName; } @@ -214,11 +198,12 @@ public void setCatalogNameIsSet(boolean value) { } } - public String getSchemaName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { return this.schemaName; } - public void setSchemaName(String schemaName) { + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { this.schemaName = schemaName; } @@ -237,11 +222,12 @@ public void setSchemaNameIsSet(boolean value) { } } - public String getTableName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getTableName() { return this.tableName; } - public void setTableName(String tableName) { + public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { this.tableName = tableName; } @@ -260,7 +246,7 @@ public void setTableNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -274,7 +260,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetCatalogName(); } else { - setCatalogName((String)value); + setCatalogName((java.lang.String)value); } break; @@ -282,7 +268,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSchemaName(); } else { - setSchemaName((String)value); + setSchemaName((java.lang.String)value); } break; @@ -290,14 +276,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetTableName(); } else { - setTableName((String)value); + setTableName((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -312,13 +299,13 @@ public Object getFieldValue(_Fields field) { return getTableName(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -331,11 +318,11 @@ public boolean isSet(_Fields field) { case TABLE_NAME: return isSetTableName(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetPrimaryKeysReq) @@ -346,6 +333,8 @@ public boolean equals(Object that) { public boolean equals(TGetPrimaryKeysReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -388,29 +377,25 @@ public boolean equals(TGetPrimaryKeysReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); - boolean present_tableName = true && (isSetTableName()); - list.add(present_tableName); - if (present_tableName) - list.add(tableName); + hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); + if (isSetTableName()) + hashCode = hashCode * 8191 + tableName.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -421,7 +406,7 @@ public int compareTo(TGetPrimaryKeysReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -431,7 +416,7 @@ public int compareTo(TGetPrimaryKeysReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -441,7 +426,7 @@ public int compareTo(TGetPrimaryKeysReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -451,7 +436,7 @@ public int compareTo(TGetPrimaryKeysReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; } @@ -464,21 +449,22 @@ public int compareTo(TGetPrimaryKeysReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetPrimaryKeysReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysReq("); boolean first = true; sb.append("sessionHandle:"); @@ -542,7 +528,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -550,13 +536,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetPrimaryKeysReqStandardSchemeFactory implements SchemeFactory { + private static class TGetPrimaryKeysReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetPrimaryKeysReqStandardScheme getScheme() { return new TGetPrimaryKeysReqStandardScheme(); } } - private static class TGetPrimaryKeysReqStandardScheme extends StandardScheme { + private static class TGetPrimaryKeysReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -646,19 +632,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetPrimaryKeysReq } - private static class TGetPrimaryKeysReqTupleSchemeFactory implements SchemeFactory { + private static class TGetPrimaryKeysReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetPrimaryKeysReqTupleScheme getScheme() { return new TGetPrimaryKeysReqTupleScheme(); } } - private static class TGetPrimaryKeysReqTupleScheme extends TupleScheme { + private static class TGetPrimaryKeysReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -682,11 +668,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(3); + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -702,5 +688,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq s } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java index 825ac6523d82..9295f403d325 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetPrimaryKeysResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetPrimaryKeysResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetPrimaryKeysRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetPrimaryKeysRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetPrimaryKeysRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetPrimaryKeysRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetPrimaryKeysResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetPrimaryKeysResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetPrimaryKeysResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetPrimaryKeysResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetPrimaryKeysResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetPrimaryKeysResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetPrimaryKeysResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetPrimaryKeysRespStandardSchemeFactory implements SchemeFactory { + private static class TGetPrimaryKeysRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetPrimaryKeysRespStandardScheme getScheme() { return new TGetPrimaryKeysRespStandardScheme(); } } - private static class TGetPrimaryKeysRespStandardScheme extends StandardScheme { + private static class TGetPrimaryKeysRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetPrimaryKeysRes } - private static class TGetPrimaryKeysRespTupleSchemeFactory implements SchemeFactory { + private static class TGetPrimaryKeysRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetPrimaryKeysRespTupleScheme getScheme() { return new TGetPrimaryKeysRespTupleScheme(); } } - private static class TGetPrimaryKeysRespTupleScheme extends TupleScheme { + private static class TGetPrimaryKeysRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java index 15ed94626ffa..59ca55e89684 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetQueryIdReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetQueryIdReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdReq"); 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)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetQueryIdReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetQueryIdReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdReqTupleSchemeFactory(); - private TOperationHandle operationHandle; // required + private @org.apache.thrift.annotation.Nullable 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -156,7 +140,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetQueryIdReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TGetQueryIdReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -218,14 +205,13 @@ public boolean equals(TGetQueryIdReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TGetQueryIdReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TGetQueryIdReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetQueryIdReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdReq("); boolean first = true; sb.append("operationHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetQueryIdReqStandardSchemeFactory implements SchemeFactory { + private static class TGetQueryIdReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetQueryIdReqStandardScheme getScheme() { return new TGetQueryIdReqStandardScheme(); } } - private static class TGetQueryIdReqStandardScheme extends StandardScheme { + private static class TGetQueryIdReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetQueryIdReq str } - private static class TGetQueryIdReqTupleSchemeFactory implements SchemeFactory { + private static class TGetQueryIdReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetQueryIdReqTupleScheme getScheme() { return new TGetQueryIdReqTupleScheme(); } } - private static class TGetQueryIdReqTupleScheme extends TupleScheme { + private static class TGetQueryIdReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java index 575d91e4b6a2..72066ba4e4a1 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetQueryIdResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetQueryIdResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdResp"); private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetQueryIdRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetQueryIdRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdRespTupleSchemeFactory(); - private String queryId; // required + private @org.apache.thrift.annotation.Nullable java.lang.String queryId; // 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 { QUERY_ID((short)1, "queryId"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // QUERY_ID @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdResp.class, metaDataMap); } @@ -109,7 +92,7 @@ public TGetQueryIdResp() { } public TGetQueryIdResp( - String queryId) + java.lang.String queryId) { this(); this.queryId = queryId; @@ -133,11 +116,12 @@ public void clear() { this.queryId = null; } - public String getQueryId() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getQueryId() { return this.queryId; } - public void setQueryId(String queryId) { + public void setQueryId(@org.apache.thrift.annotation.Nullable java.lang.String queryId) { this.queryId = queryId; } @@ -156,43 +140,44 @@ public void setQueryIdIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case QUERY_ID: if (value == null) { unsetQueryId(); } else { - setQueryId((String)value); + setQueryId((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case QUERY_ID: return getQueryId(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case QUERY_ID: return isSetQueryId(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetQueryIdResp) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TGetQueryIdResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_queryId = true && this.isSetQueryId(); boolean that_present_queryId = true && that.isSetQueryId(); @@ -218,14 +205,13 @@ public boolean equals(TGetQueryIdResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_queryId = true && (isSetQueryId()); - list.add(present_queryId); - if (present_queryId) - list.add(queryId); + hashCode = hashCode * 8191 + ((isSetQueryId()) ? 131071 : 524287); + if (isSetQueryId()) + hashCode = hashCode * 8191 + queryId.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TGetQueryIdResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetQueryId()).compareTo(other.isSetQueryId()); + lastComparison = java.lang.Boolean.valueOf(isSetQueryId()).compareTo(other.isSetQueryId()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TGetQueryIdResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetQueryIdResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdResp("); boolean first = true; sb.append("queryId:"); @@ -294,7 +281,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -302,13 +289,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetQueryIdRespStandardSchemeFactory implements SchemeFactory { + private static class TGetQueryIdRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetQueryIdRespStandardScheme getScheme() { return new TGetQueryIdRespStandardScheme(); } } - private static class TGetQueryIdRespStandardScheme extends StandardScheme { + private static class TGetQueryIdRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -352,27 +339,30 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetQueryIdResp st } - private static class TGetQueryIdRespTupleSchemeFactory implements SchemeFactory { + private static class TGetQueryIdRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetQueryIdRespTupleScheme getScheme() { return new TGetQueryIdRespTupleScheme(); } } - private static class TGetQueryIdRespTupleScheme extends TupleScheme { + private static class TGetQueryIdRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.queryId); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.queryId = iprot.readString(); struct.setQueryIdIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java index d6d12215e5ea..d9958dccb5eb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataReq"); 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)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetResultSetMetadataReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetResultSetMetadataReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataReqTupleSchemeFactory(); - private TOperationHandle operationHandle; // required + private @org.apache.thrift.annotation.Nullable 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -156,7 +140,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetResultSetMetadataReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TGetResultSetMetadataReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -218,14 +205,13 @@ public boolean equals(TGetResultSetMetadataReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TGetResultSetMetadataReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TGetResultSetMetadataReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetResultSetMetadataReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataReq("); boolean first = true; sb.append("operationHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetResultSetMetadataReqStandardSchemeFactory implements SchemeFactory { + private static class TGetResultSetMetadataReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetResultSetMetadataReqStandardScheme getScheme() { return new TGetResultSetMetadataReqStandardScheme(); } } - private static class TGetResultSetMetadataReqStandardScheme extends StandardScheme { + private static class TGetResultSetMetadataReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetad } - private static class TGetResultSetMetadataReqTupleSchemeFactory implements SchemeFactory { + private static class TGetResultSetMetadataReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetResultSetMetadataReqTupleScheme getScheme() { return new TGetResultSetMetadataReqTupleScheme(); } } - private static class TGetResultSetMetadataReqTupleScheme extends TupleScheme { + private static class TGetResultSetMetadataReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java index 46563acebd8d..fdd15e6df392 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataResp"); 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 SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetResultSetMetadataRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetResultSetMetadataRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataRespTupleSchemeFactory(); - private TStatus status; // required - private TTableSchema schema; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TTableSchema schema; // 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"), SCHEMA((short)2, "schema"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.SCHEMA}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableSchema.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.schema = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TTableSchema getSchema() { return this.schema; } - public void setSchema(TTableSchema schema) { + public void setSchema(@org.apache.thrift.annotation.Nullable TTableSchema schema) { this.schema = schema; } @@ -192,7 +176,7 @@ public void setSchemaIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getSchema(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case SCHEMA: return isSetSchema(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetResultSetMetadataResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetResultSetMetadataResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetResultSetMetadataResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_schema = true && (isSetSchema()); - list.add(present_schema); - if (present_schema) - list.add(schema); + hashCode = hashCode * 8191 + ((isSetSchema()) ? 131071 : 524287); + if (isSetSchema()) + hashCode = hashCode * 8191 + schema.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetResultSetMetadataResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetResultSetMetadataResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); + lastComparison = java.lang.Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetResultSetMetadataResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetResultSetMetadataResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetResultSetMetadataRespStandardSchemeFactory implements SchemeFactory { + private static class TGetResultSetMetadataRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetResultSetMetadataRespStandardScheme getScheme() { return new TGetResultSetMetadataRespStandardScheme(); } } - private static class TGetResultSetMetadataRespStandardScheme extends StandardScheme { + private static class TGetResultSetMetadataRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetad } - private static class TGetResultSetMetadataRespTupleSchemeFactory implements SchemeFactory { + private static class TGetResultSetMetadataRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetResultSetMetadataRespTupleScheme getScheme() { return new TGetResultSetMetadataRespTupleScheme(); } } - private static class TGetResultSetMetadataRespTupleScheme extends TupleScheme { + private static class TGetResultSetMetadataRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSchema()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetada @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.schema = new TTableSchema(); struct.schema.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadat } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java index e0e59666a818..dd59d0e8c463 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java @@ -1,46 +1,26 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasReq"); 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetSchemasReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetSchemasReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetSchemasReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetSchemasReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // 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 { @@ -48,10 +28,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { CATALOG_NAME((short)2, "catalogName"), SCHEMA_NAME((short)3, "schemaName"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -59,6 +39,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -78,21 +59,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -101,23 +83,23 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasReq.class, metaDataMap); } @@ -157,11 +139,12 @@ public void clear() { this.schemaName = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -180,11 +163,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getCatalogName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { return this.catalogName; } - public void setCatalogName(String catalogName) { + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { this.catalogName = catalogName; } @@ -203,11 +187,12 @@ public void setCatalogNameIsSet(boolean value) { } } - public String getSchemaName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { return this.schemaName; } - public void setSchemaName(String schemaName) { + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { this.schemaName = schemaName; } @@ -226,7 +211,7 @@ public void setSchemaNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -240,7 +225,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetCatalogName(); } else { - setCatalogName((String)value); + setCatalogName((java.lang.String)value); } break; @@ -248,14 +233,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSchemaName(); } else { - setSchemaName((String)value); + setSchemaName((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -267,13 +253,13 @@ public Object getFieldValue(_Fields field) { return getSchemaName(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -284,11 +270,11 @@ public boolean isSet(_Fields field) { case SCHEMA_NAME: return isSetSchemaName(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetSchemasReq) @@ -299,6 +285,8 @@ public boolean equals(Object that) { public boolean equals(TGetSchemasReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -332,24 +320,21 @@ public boolean equals(TGetSchemasReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -360,7 +345,7 @@ public int compareTo(TGetSchemasReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -370,7 +355,7 @@ public int compareTo(TGetSchemasReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -380,7 +365,7 @@ public int compareTo(TGetSchemasReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -393,21 +378,22 @@ public int compareTo(TGetSchemasReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetSchemasReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasReq("); boolean first = true; sb.append("sessionHandle:"); @@ -461,7 +447,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -469,13 +455,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetSchemasReqStandardSchemeFactory implements SchemeFactory { + private static class TGetSchemasReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetSchemasReqStandardScheme getScheme() { return new TGetSchemasReqStandardScheme(); } } - private static class TGetSchemasReqStandardScheme extends StandardScheme { + private static class TGetSchemasReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -550,19 +536,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasReq str } - private static class TGetSchemasReqTupleSchemeFactory implements SchemeFactory { + private static class TGetSchemasReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetSchemasReqTupleScheme getScheme() { return new TGetSchemasReqTupleScheme(); } } - private static class TGetSchemasReqTupleScheme extends TupleScheme { + private static class TGetSchemasReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -580,11 +566,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(2); + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -596,5 +582,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struc } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java index 9b301bd956fb..235767910058 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetSchemasRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetSchemasRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetSchemasRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetSchemasRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetSchemasResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetSchemasResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetSchemasResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetSchemasResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetSchemasResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetSchemasResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetSchemasResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetSchemasRespStandardSchemeFactory implements SchemeFactory { + private static class TGetSchemasRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetSchemasRespStandardScheme getScheme() { return new TGetSchemasRespStandardScheme(); } } - private static class TGetSchemasRespStandardScheme extends StandardScheme { + private static class TGetSchemasRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasResp st } - private static class TGetSchemasRespTupleSchemeFactory implements SchemeFactory { + private static class TGetSchemasRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetSchemasRespTupleScheme getScheme() { return new TGetSchemasRespTupleScheme(); } } - private static class TGetSchemasRespTupleScheme extends TupleScheme { + private static class TGetSchemasRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java index effd683ca631..e65143d4d057 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesReq"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTableTypesReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTableTypesReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.sessionHandle = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -156,7 +140,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetTableTypesReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TGetTableTypesReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -218,14 +205,13 @@ public boolean equals(TGetTableTypesReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TGetTableTypesReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TGetTableTypesReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTableTypesReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesReq("); boolean first = true; sb.append("sessionHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTableTypesReqStandardSchemeFactory implements SchemeFactory { + private static class TGetTableTypesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTableTypesReqStandardScheme getScheme() { return new TGetTableTypesReqStandardScheme(); } } - private static class TGetTableTypesReqStandardScheme extends StandardScheme { + private static class TGetTableTypesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesReq } - private static class TGetTableTypesReqTupleSchemeFactory implements SchemeFactory { + private static class TGetTableTypesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTableTypesReqTupleScheme getScheme() { return new TGetTableTypesReqTupleScheme(); } } - private static class TGetTableTypesReqTupleScheme extends TupleScheme { + private static class TGetTableTypesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java index 83793a149c4a..b945e1cb54fe 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTableTypesRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTableTypesRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetTableTypesResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetTableTypesResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetTableTypesResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetTableTypesResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetTableTypesResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetTableTypesResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTableTypesResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTableTypesRespStandardSchemeFactory implements SchemeFactory { + private static class TGetTableTypesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTableTypesRespStandardScheme getScheme() { return new TGetTableTypesRespStandardScheme(); } } - private static class TGetTableTypesRespStandardScheme extends StandardScheme { + private static class TGetTableTypesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesResp } - private static class TGetTableTypesRespTupleSchemeFactory implements SchemeFactory { + private static class TGetTableTypesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTableTypesRespTupleScheme getScheme() { return new TGetTableTypesRespTupleScheme(); } } - private static class TGetTableTypesRespTupleScheme extends TupleScheme { + private static class TGetTableTypesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp s } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java index fda1e2d93c01..d8d5ad982252 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq"); 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); @@ -34,17 +17,14 @@ private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField TABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("tableTypes", org.apache.thrift.protocol.TType.LIST, (short)5); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTablesReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTablesReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTablesReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTablesReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional - private List tableTypes; // optional + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional + private @org.apache.thrift.annotation.Nullable java.util.List tableTypes; // 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 { @@ -54,10 +34,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TABLE_NAME((short)4, "tableName"), TABLE_TYPES((short)5, "tableTypes"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -65,6 +45,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -88,21 +69,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -111,16 +93,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.TABLE_TYPES}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -132,7 +114,7 @@ public String getFieldName() { tmpMap.put(_Fields.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap); } @@ -163,7 +145,7 @@ public TGetTablesReq(TGetTablesReq other) { this.tableName = other.tableName; } if (other.isSetTableTypes()) { - List __this__tableTypes = new ArrayList(other.tableTypes); + java.util.List __this__tableTypes = new java.util.ArrayList(other.tableTypes); this.tableTypes = __this__tableTypes; } } @@ -181,11 +163,12 @@ public void clear() { this.tableTypes = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -204,11 +187,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getCatalogName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { return this.catalogName; } - public void setCatalogName(String catalogName) { + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { this.catalogName = catalogName; } @@ -227,11 +211,12 @@ public void setCatalogNameIsSet(boolean value) { } } - public String getSchemaName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { return this.schemaName; } - public void setSchemaName(String schemaName) { + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { this.schemaName = schemaName; } @@ -250,11 +235,12 @@ public void setSchemaNameIsSet(boolean value) { } } - public String getTableName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getTableName() { return this.tableName; } - public void setTableName(String tableName) { + public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { this.tableName = tableName; } @@ -277,22 +263,24 @@ public int getTableTypesSize() { return (this.tableTypes == null) ? 0 : this.tableTypes.size(); } - public java.util.Iterator getTableTypesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getTableTypesIterator() { return (this.tableTypes == null) ? null : this.tableTypes.iterator(); } - public void addToTableTypes(String elem) { + public void addToTableTypes(java.lang.String elem) { if (this.tableTypes == null) { - this.tableTypes = new ArrayList(); + this.tableTypes = new java.util.ArrayList(); } this.tableTypes.add(elem); } - public List getTableTypes() { + @org.apache.thrift.annotation.Nullable + public java.util.List getTableTypes() { return this.tableTypes; } - public void setTableTypes(List tableTypes) { + public void setTableTypes(@org.apache.thrift.annotation.Nullable java.util.List tableTypes) { this.tableTypes = tableTypes; } @@ -311,7 +299,7 @@ public void setTableTypesIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -325,7 +313,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetCatalogName(); } else { - setCatalogName((String)value); + setCatalogName((java.lang.String)value); } break; @@ -333,7 +321,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSchemaName(); } else { - setSchemaName((String)value); + setSchemaName((java.lang.String)value); } break; @@ -341,7 +329,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetTableName(); } else { - setTableName((String)value); + setTableName((java.lang.String)value); } break; @@ -349,14 +337,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetTableTypes(); } else { - setTableTypes((List)value); + setTableTypes((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -374,13 +363,13 @@ public Object getFieldValue(_Fields field) { return getTableTypes(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -395,11 +384,11 @@ public boolean isSet(_Fields field) { case TABLE_TYPES: return isSetTableTypes(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetTablesReq) @@ -410,6 +399,8 @@ public boolean equals(Object that) { public boolean equals(TGetTablesReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -461,34 +452,29 @@ public boolean equals(TGetTablesReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); - boolean present_tableName = true && (isSetTableName()); - list.add(present_tableName); - if (present_tableName) - list.add(tableName); + hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); + if (isSetTableName()) + hashCode = hashCode * 8191 + tableName.hashCode(); - boolean present_tableTypes = true && (isSetTableTypes()); - list.add(present_tableTypes); - if (present_tableTypes) - list.add(tableTypes); + hashCode = hashCode * 8191 + ((isSetTableTypes()) ? 131071 : 524287); + if (isSetTableTypes()) + hashCode = hashCode * 8191 + tableTypes.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -499,7 +485,7 @@ public int compareTo(TGetTablesReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -509,7 +495,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -519,7 +505,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -529,7 +515,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; } @@ -539,7 +525,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); + lastComparison = java.lang.Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); if (lastComparison != 0) { return lastComparison; } @@ -552,21 +538,22 @@ public int compareTo(TGetTablesReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTablesReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesReq("); boolean first = true; sb.append("sessionHandle:"); @@ -640,7 +627,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -648,13 +635,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTablesReqStandardSchemeFactory implements SchemeFactory { + private static class TGetTablesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTablesReqStandardScheme getScheme() { return new TGetTablesReqStandardScheme(); } } - private static class TGetTablesReqStandardScheme extends StandardScheme { + private static class TGetTablesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -703,8 +690,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(); - struct.tableTypes = new ArrayList(_list182.size); - String _elem183; + struct.tableTypes = new java.util.ArrayList(_list182.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem183; for (int _i184 = 0; _i184 < _list182.size; ++_i184) { _elem183 = iprot.readString(); @@ -761,7 +748,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq stru oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (String _iter185 : struct.tableTypes) + for (java.lang.String _iter185 : struct.tableTypes) { oprot.writeString(_iter185); } @@ -776,19 +763,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq stru } - private static class TGetTablesReqTupleSchemeFactory implements SchemeFactory { + private static class TGetTablesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTablesReqTupleScheme getScheme() { return new TGetTablesReqTupleScheme(); } } - private static class TGetTablesReqTupleScheme extends TupleScheme { + private static class TGetTablesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -814,7 +801,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struc if (struct.isSetTableTypes()) { { oprot.writeI32(struct.tableTypes.size()); - for (String _iter186 : struct.tableTypes) + for (java.lang.String _iter186 : struct.tableTypes) { oprot.writeString(_iter186); } @@ -824,11 +811,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -844,8 +831,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new ArrayList(_list187.size); - String _elem188; + struct.tableTypes = new java.util.ArrayList(_list187.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem188; for (int _i189 = 0; _i189 < _list187.size; ++_i189) { _elem188 = iprot.readString(); @@ -857,5 +844,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java index 4a4685572ece..a9d9c4b17674 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTablesRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTablesRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTablesRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTablesRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetTablesResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetTablesResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetTablesResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetTablesResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetTablesResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetTablesResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTablesResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTablesRespStandardSchemeFactory implements SchemeFactory { + private static class TGetTablesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTablesRespStandardScheme getScheme() { return new TGetTablesRespStandardScheme(); } } - private static class TGetTablesRespStandardScheme extends StandardScheme { + private static class TGetTablesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesResp str } - private static class TGetTablesRespTupleSchemeFactory implements SchemeFactory { + private static class TGetTablesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTablesRespTupleScheme getScheme() { return new TGetTablesRespTupleScheme(); } } - private static class TGetTablesRespTupleScheme extends TupleScheme { + private static class TGetTablesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struc } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java index 67f6ff3f8022..7ea7ad5da861 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoReq"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTypeInfoReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTypeInfoReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoReq.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.sessionHandle = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -156,7 +140,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetTypeInfoReq) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TGetTypeInfoReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -218,14 +205,13 @@ public boolean equals(TGetTypeInfoReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TGetTypeInfoReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TGetTypeInfoReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTypeInfoReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoReq("); boolean first = true; sb.append("sessionHandle:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTypeInfoReqStandardSchemeFactory implements SchemeFactory { + private static class TGetTypeInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTypeInfoReqStandardScheme getScheme() { return new TGetTypeInfoReqStandardScheme(); } } - private static class TGetTypeInfoReqStandardScheme extends StandardScheme { + private static class TGetTypeInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoReq st } - private static class TGetTypeInfoReqTupleSchemeFactory implements SchemeFactory { + private static class TGetTypeInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTypeInfoReqTupleScheme getScheme() { return new TGetTypeInfoReqTupleScheme(); } } - private static class TGetTypeInfoReqTupleScheme extends TupleScheme { + private static class TGetTypeInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java index 045d415f9509..12e4a53a81c7 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTypeInfoRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTypeInfoRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoRespTupleSchemeFactory(); - private TStatus status; // required - private TOperationHandle operationHandle; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoResp.class, metaDataMap); } @@ -146,11 +128,12 @@ public void clear() { this.operationHandle = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -169,11 +152,12 @@ public void setStatusIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(TOperationHandle operationHandle) { + public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -192,7 +176,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -213,7 +197,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -222,13 +207,13 @@ public Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +222,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TGetTypeInfoResp) @@ -252,6 +237,8 @@ public boolean equals(Object that) { public boolean equals(TGetTypeInfoResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -276,19 +263,17 @@ public boolean equals(TGetTypeInfoResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +284,7 @@ public int compareTo(TGetTypeInfoResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +294,7 @@ public int compareTo(TGetTypeInfoResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +307,22 @@ public int compareTo(TGetTypeInfoResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTypeInfoResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoResp("); boolean first = true; sb.append("status:"); @@ -383,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -391,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTypeInfoRespStandardSchemeFactory implements SchemeFactory { + private static class TGetTypeInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTypeInfoRespStandardScheme getScheme() { return new TGetTypeInfoRespStandardScheme(); } } - private static class TGetTypeInfoRespStandardScheme extends StandardScheme { + private static class TGetTypeInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -458,19 +444,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoResp s } - private static class TGetTypeInfoRespTupleSchemeFactory implements SchemeFactory { + private static class TGetTypeInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TGetTypeInfoRespTupleScheme getScheme() { return new TGetTypeInfoRespTupleScheme(); } } - private static class TGetTypeInfoRespTupleScheme extends TupleScheme { + private static class TGetTypeInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -482,11 +468,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -495,5 +481,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java index a77785f0dbcf..2635e6927477 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THandleIdentifier"); private static final org.apache.thrift.protocol.TField GUID_FIELD_DESC = new org.apache.thrift.protocol.TField("guid", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("secret", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new THandleIdentifierStandardSchemeFactory()); - schemes.put(TupleScheme.class, new THandleIdentifierTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new THandleIdentifierStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new THandleIdentifierTupleSchemeFactory(); - private ByteBuffer guid; // required - private ByteBuffer secret; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret; // 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 { GUID((short)1, "guid"), SECRET((short)2, "secret"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // GUID @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,20 +78,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.GUID, new org.apache.thrift.meta_data.FieldMetaData("guid", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THandleIdentifier.class, metaDataMap); } @@ -118,8 +99,8 @@ public THandleIdentifier() { } public THandleIdentifier( - ByteBuffer guid, - ByteBuffer secret) + java.nio.ByteBuffer guid, + java.nio.ByteBuffer secret) { this(); this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); @@ -153,15 +134,15 @@ public byte[] getGuid() { return guid == null ? null : guid.array(); } - public ByteBuffer bufferForGuid() { + public java.nio.ByteBuffer bufferForGuid() { return org.apache.thrift.TBaseHelper.copyBinary(guid); } public void setGuid(byte[] guid) { - this.guid = guid == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(guid, guid.length)); + this.guid = guid == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(guid.clone()); } - public void setGuid(ByteBuffer guid) { + public void setGuid(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid) { this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); } @@ -185,15 +166,15 @@ public byte[] getSecret() { return secret == null ? null : secret.array(); } - public ByteBuffer bufferForSecret() { + public java.nio.ByteBuffer bufferForSecret() { return org.apache.thrift.TBaseHelper.copyBinary(secret); } public void setSecret(byte[] secret) { - this.secret = secret == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(secret, secret.length)); + this.secret = secret == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(secret.clone()); } - public void setSecret(ByteBuffer secret) { + public void setSecret(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret) { this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); } @@ -212,13 +193,17 @@ public void setSecretIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case GUID: if (value == null) { unsetGuid(); } else { - setGuid((ByteBuffer)value); + if (value instanceof byte[]) { + setGuid((byte[])value); + } else { + setGuid((java.nio.ByteBuffer)value); + } } break; @@ -226,14 +211,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSecret(); } else { - setSecret((ByteBuffer)value); + if (value instanceof byte[]) { + setSecret((byte[])value); + } else { + setSecret((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case GUID: return getGuid(); @@ -242,13 +232,13 @@ public Object getFieldValue(_Fields field) { return getSecret(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -257,11 +247,11 @@ public boolean isSet(_Fields field) { case SECRET: return isSetSecret(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof THandleIdentifier) @@ -272,6 +262,8 @@ public boolean equals(Object that) { public boolean equals(THandleIdentifier that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_guid = true && this.isSetGuid(); boolean that_present_guid = true && that.isSetGuid(); @@ -296,19 +288,17 @@ public boolean equals(THandleIdentifier that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_guid = true && (isSetGuid()); - list.add(present_guid); - if (present_guid) - list.add(guid); + hashCode = hashCode * 8191 + ((isSetGuid()) ? 131071 : 524287); + if (isSetGuid()) + hashCode = hashCode * 8191 + guid.hashCode(); - boolean present_secret = true && (isSetSecret()); - list.add(present_secret); - if (present_secret) - list.add(secret); + hashCode = hashCode * 8191 + ((isSetSecret()) ? 131071 : 524287); + if (isSetSecret()) + hashCode = hashCode * 8191 + secret.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -319,7 +309,7 @@ public int compareTo(THandleIdentifier other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); + lastComparison = java.lang.Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); if (lastComparison != 0) { return lastComparison; } @@ -329,7 +319,7 @@ public int compareTo(THandleIdentifier other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); + lastComparison = java.lang.Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); if (lastComparison != 0) { return lastComparison; } @@ -342,21 +332,22 @@ public int compareTo(THandleIdentifier other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("THandleIdentifier("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("THandleIdentifier("); boolean first = true; sb.append("guid:"); @@ -399,7 +390,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -407,13 +398,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class THandleIdentifierStandardSchemeFactory implements SchemeFactory { + private static class THandleIdentifierStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public THandleIdentifierStandardScheme getScheme() { return new THandleIdentifierStandardScheme(); } } - private static class THandleIdentifierStandardScheme extends StandardScheme { + private static class THandleIdentifierStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, THandleIdentifier struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -470,24 +461,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, THandleIdentifier } - private static class THandleIdentifierTupleSchemeFactory implements SchemeFactory { + private static class THandleIdentifierTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public THandleIdentifierTupleScheme getScheme() { return new THandleIdentifierTupleScheme(); } } - private static class THandleIdentifierTupleScheme extends TupleScheme { + private static class THandleIdentifierTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeBinary(struct.guid); oprot.writeBinary(struct.secret); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.guid = iprot.readBinary(); struct.setGuidIsSet(true); struct.secret = iprot.readBinary(); @@ -495,5 +486,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java index d8c406e82b28..d705cdd5dd06 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Column"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI16ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI16ColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Column.class, metaDataMap); } @@ -119,8 +100,8 @@ public TI16Column() { } public TI16Column( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TI16Column( */ public TI16Column(TI16Column other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(short elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TI16Column) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TI16Column that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TI16Column that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TI16Column other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TI16Column other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TI16Column other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI16Column("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Column("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI16ColumnStandardSchemeFactory implements SchemeFactory { + private static class TI16ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI16ColumnStandardScheme getScheme() { return new TI16ColumnStandardScheme(); } } - private static class TI16ColumnStandardScheme extends StandardScheme { + private static class TI16ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,7 +426,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); - struct.values = new ArrayList(_list70.size); + struct.values = new java.util.ArrayList(_list70.size); short _elem71; for (int _i72 = 0; _i72 < _list70.size; ++_i72) { @@ -495,17 +484,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Column struct) } - private static class TI16ColumnTupleSchemeFactory implements SchemeFactory { + private static class TI16ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI16ColumnTupleScheme getScheme() { return new TI16ColumnTupleScheme(); } } - private static class TI16ColumnTupleScheme extends TupleScheme { + private static class TI16ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (short _iter74 : struct.values) @@ -518,10 +507,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); - struct.values = new ArrayList(_list75.size); + struct.values = new java.util.ArrayList(_list75.size); short _elem76; for (int _i77 = 0; _i77 < _list75.size; ++_i77) { @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) t } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java index 922c772b1be7..05448ba0acfd 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java @@ -1,41 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Value"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI16ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI16ValueTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ValueTupleSchemeFactory(); private short value; // optional @@ -43,10 +22,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { VALUE((short)1, "value"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -54,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -69,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +73,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -101,12 +82,12 @@ public String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Value.class, metaDataMap); } @@ -141,55 +122,56 @@ public void setValue(short value) { } public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((Short)value); + setValue((java.lang.Short)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TI16Value) @@ -200,6 +182,8 @@ public boolean equals(Object that) { public boolean equals(TI16Value that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -215,14 +199,13 @@ public boolean equals(TI16Value that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value; - return list.hashCode(); + return hashCode; } @Override @@ -233,7 +216,7 @@ public int compareTo(TI16Value other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -246,21 +229,22 @@ public int compareTo(TI16Value other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI16Value("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Value("); boolean first = true; if (isSetValue()) { @@ -285,7 +269,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -295,13 +279,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI16ValueStandardSchemeFactory implements SchemeFactory { + private static class TI16ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI16ValueStandardScheme getScheme() { return new TI16ValueStandardScheme(); } } - private static class TI16ValueStandardScheme extends StandardScheme { + private static class TI16ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -345,18 +329,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Value struct) } - private static class TI16ValueTupleSchemeFactory implements SchemeFactory { + private static class TI16ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI16ValueTupleScheme getScheme() { return new TI16ValueTupleScheme(); } } - private static class TI16ValueTupleScheme extends TupleScheme { + private static class TI16ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -368,8 +352,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readI16(); struct.setValueIsSet(true); @@ -377,5 +361,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) th } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java index af3fb009de2f..6e2784beefa8 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Column"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI32ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI32ColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Column.class, metaDataMap); } @@ -119,8 +100,8 @@ public TI32Column() { } public TI32Column( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TI32Column( */ public TI32Column(TI32Column other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(int elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TI32Column) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TI32Column that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TI32Column that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TI32Column other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TI32Column other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TI32Column other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI32Column("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Column("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI32ColumnStandardSchemeFactory implements SchemeFactory { + private static class TI32ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI32ColumnStandardScheme getScheme() { return new TI32ColumnStandardScheme(); } } - private static class TI32ColumnStandardScheme extends StandardScheme { + private static class TI32ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,7 +426,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); - struct.values = new ArrayList(_list78.size); + struct.values = new java.util.ArrayList(_list78.size); int _elem79; for (int _i80 = 0; _i80 < _list78.size; ++_i80) { @@ -495,17 +484,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Column struct) } - private static class TI32ColumnTupleSchemeFactory implements SchemeFactory { + private static class TI32ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI32ColumnTupleScheme getScheme() { return new TI32ColumnTupleScheme(); } } - private static class TI32ColumnTupleScheme extends TupleScheme { + private static class TI32ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (int _iter82 : struct.values) @@ -518,10 +507,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.values = new ArrayList(_list83.size); + struct.values = new java.util.ArrayList(_list83.size); int _elem84; for (int _i85 = 0; _i85 < _list83.size; ++_i85) { @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) t } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java index dd99282ee842..dfc3ef6f1496 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java @@ -1,41 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Value"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI32ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI32ValueTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ValueTupleSchemeFactory(); private int value; // optional @@ -43,10 +22,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { VALUE((short)1, "value"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -54,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -69,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +73,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -101,12 +82,12 @@ public String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Value.class, metaDataMap); } @@ -141,55 +122,56 @@ public void setValue(int value) { } public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((Integer)value); + setValue((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TI32Value) @@ -200,6 +182,8 @@ public boolean equals(Object that) { public boolean equals(TI32Value that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -215,14 +199,13 @@ public boolean equals(TI32Value that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value; - return list.hashCode(); + return hashCode; } @Override @@ -233,7 +216,7 @@ public int compareTo(TI32Value other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -246,21 +229,22 @@ public int compareTo(TI32Value other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI32Value("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Value("); boolean first = true; if (isSetValue()) { @@ -285,7 +269,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -295,13 +279,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI32ValueStandardSchemeFactory implements SchemeFactory { + private static class TI32ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI32ValueStandardScheme getScheme() { return new TI32ValueStandardScheme(); } } - private static class TI32ValueStandardScheme extends StandardScheme { + private static class TI32ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -345,18 +329,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Value struct) } - private static class TI32ValueTupleSchemeFactory implements SchemeFactory { + private static class TI32ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI32ValueTupleScheme getScheme() { return new TI32ValueTupleScheme(); } } - private static class TI32ValueTupleScheme extends TupleScheme { + private static class TI32ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -368,8 +352,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readI32(); struct.setValueIsSet(true); @@ -377,5 +361,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) th } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java index b58f2cd2b3d4..78cafb40653d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Column"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI64ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI64ColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Column.class, metaDataMap); } @@ -119,8 +100,8 @@ public TI64Column() { } public TI64Column( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TI64Column( */ public TI64Column(TI64Column other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(long elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TI64Column) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TI64Column that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TI64Column that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TI64Column other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TI64Column other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TI64Column other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI64Column("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Column("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI64ColumnStandardSchemeFactory implements SchemeFactory { + private static class TI64ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI64ColumnStandardScheme getScheme() { return new TI64ColumnStandardScheme(); } } - private static class TI64ColumnStandardScheme extends StandardScheme { + private static class TI64ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,7 +426,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); - struct.values = new ArrayList(_list86.size); + struct.values = new java.util.ArrayList(_list86.size); long _elem87; for (int _i88 = 0; _i88 < _list86.size; ++_i88) { @@ -495,17 +484,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Column struct) } - private static class TI64ColumnTupleSchemeFactory implements SchemeFactory { + private static class TI64ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI64ColumnTupleScheme getScheme() { return new TI64ColumnTupleScheme(); } } - private static class TI64ColumnTupleScheme extends TupleScheme { + private static class TI64ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (long _iter90 : struct.values) @@ -518,10 +507,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - struct.values = new ArrayList(_list91.size); + struct.values = new java.util.ArrayList(_list91.size); long _elem92; for (int _i93 = 0; _i93 < _list91.size; ++_i93) { @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) t } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java index b5e70a6485e0..06a4a09d453b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java @@ -1,41 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Value"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI64ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI64ValueTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ValueTupleSchemeFactory(); private long value; // optional @@ -43,10 +22,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { VALUE((short)1, "value"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -54,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -69,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +73,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -101,12 +82,12 @@ public String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Value.class, metaDataMap); } @@ -141,55 +122,56 @@ public void setValue(long value) { } public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((Long)value); + setValue((java.lang.Long)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TI64Value) @@ -200,6 +182,8 @@ public boolean equals(Object that) { public boolean equals(TI64Value that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -215,14 +199,13 @@ public boolean equals(TI64Value that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); - return list.hashCode(); + return hashCode; } @Override @@ -233,7 +216,7 @@ public int compareTo(TI64Value other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -246,21 +229,22 @@ public int compareTo(TI64Value other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI64Value("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Value("); boolean first = true; if (isSetValue()) { @@ -285,7 +269,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -295,13 +279,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI64ValueStandardSchemeFactory implements SchemeFactory { + private static class TI64ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI64ValueStandardScheme getScheme() { return new TI64ValueStandardScheme(); } } - private static class TI64ValueStandardScheme extends StandardScheme { + private static class TI64ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -345,18 +329,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Value struct) } - private static class TI64ValueTupleSchemeFactory implements SchemeFactory { + private static class TI64ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TI64ValueTupleScheme getScheme() { return new TI64ValueTupleScheme(); } } - private static class TI64ValueTupleScheme extends TupleScheme { + private static class TI64ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -368,8 +352,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readI64(); struct.setValueIsSet(true); @@ -377,5 +361,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) th } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java index 94092b13a42f..e8d7305ca228 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TJobExecutionStatus implements org.apache.thrift.TEnum { IN_PROGRESS(0), COMPLETE(1), @@ -29,6 +30,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TJobExecutionStatus findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java index df91742c32f4..28dfe72936ec 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java @@ -1,41 +1,21 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapTypeEntry"); private static final org.apache.thrift.protocol.TField KEY_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("keyTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField VALUE_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypePtr", org.apache.thrift.protocol.TType.I32, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TMapTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TMapTypeEntryTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TMapTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TMapTypeEntryTupleSchemeFactory(); private int keyTypePtr; // required private int valueTypePtr; // required @@ -45,10 +25,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { KEY_TYPE_PTR((short)1, "keyTypePtr"), VALUE_TYPE_PTR((short)2, "valueTypePtr"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // KEY_TYPE_PTR @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,7 +78,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -105,14 +87,14 @@ public String getFieldName() { private static final int __KEYTYPEPTR_ISSET_ID = 0; private static final int __VALUETYPEPTR_ISSET_ID = 1; private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.KEY_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("keyTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); tmpMap.put(_Fields.VALUE_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("valueTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapTypeEntry.class, metaDataMap); } @@ -161,16 +143,16 @@ public void setKeyTypePtr(int keyTypePtr) { } public void unsetKeyTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); } /** Returns true if field keyTypePtr is set (has been assigned a value) and false otherwise */ public boolean isSetKeyTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); } public void setKeyTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); } public int getValueTypePtr() { @@ -183,25 +165,25 @@ public void setValueTypePtr(int valueTypePtr) { } public void unsetValueTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); } /** Returns true if field valueTypePtr is set (has been assigned a value) and false otherwise */ public boolean isSetValueTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); } public void setValueTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case KEY_TYPE_PTR: if (value == null) { unsetKeyTypePtr(); } else { - setKeyTypePtr((Integer)value); + setKeyTypePtr((java.lang.Integer)value); } break; @@ -209,14 +191,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetValueTypePtr(); } else { - setValueTypePtr((Integer)value); + setValueTypePtr((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case KEY_TYPE_PTR: return getKeyTypePtr(); @@ -225,13 +208,13 @@ public Object getFieldValue(_Fields field) { return getValueTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -240,11 +223,11 @@ public boolean isSet(_Fields field) { case VALUE_TYPE_PTR: return isSetValueTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TMapTypeEntry) @@ -255,6 +238,8 @@ public boolean equals(Object that) { public boolean equals(TMapTypeEntry that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_keyTypePtr = true; boolean that_present_keyTypePtr = true; @@ -279,19 +264,13 @@ public boolean equals(TMapTypeEntry that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_keyTypePtr = true; - list.add(present_keyTypePtr); - if (present_keyTypePtr) - list.add(keyTypePtr); + hashCode = hashCode * 8191 + keyTypePtr; - boolean present_valueTypePtr = true; - list.add(present_valueTypePtr); - if (present_valueTypePtr) - list.add(valueTypePtr); + hashCode = hashCode * 8191 + valueTypePtr; - return list.hashCode(); + return hashCode; } @Override @@ -302,7 +281,7 @@ public int compareTo(TMapTypeEntry other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); + lastComparison = java.lang.Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -312,7 +291,7 @@ public int compareTo(TMapTypeEntry other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); + lastComparison = java.lang.Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -325,21 +304,22 @@ public int compareTo(TMapTypeEntry other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TMapTypeEntry("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TMapTypeEntry("); boolean first = true; sb.append("keyTypePtr:"); @@ -374,7 +354,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -384,13 +364,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TMapTypeEntryStandardSchemeFactory implements SchemeFactory { + private static class TMapTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TMapTypeEntryStandardScheme getScheme() { return new TMapTypeEntryStandardScheme(); } } - private static class TMapTypeEntryStandardScheme extends StandardScheme { + private static class TMapTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TMapTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -443,24 +423,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TMapTypeEntry stru } - private static class TMapTypeEntryTupleSchemeFactory implements SchemeFactory { + private static class TMapTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TMapTypeEntryTupleScheme getScheme() { return new TMapTypeEntryTupleScheme(); } } - private static class TMapTypeEntryTupleScheme extends TupleScheme { + private static class TMapTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI32(struct.keyTypePtr); oprot.writeI32(struct.valueTypePtr); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.keyTypePtr = iprot.readI32(); struct.setKeyTypePtrIsSet(true); struct.valueTypePtr = iprot.readI32(); @@ -468,5 +448,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java index 7ac70e897507..48d41c3ff0fc 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq"); private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1); @@ -33,16 +16,13 @@ private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)3); private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOpenSessionReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOpenSessionReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOpenSessionReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOpenSessionReqTupleSchemeFactory(); - private TProtocolVersion client_protocol; // required - private String username; // optional - private String password; // optional - private Map configuration; // optional + private @org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol; // required + private @org.apache.thrift.annotation.Nullable java.lang.String username; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String password; // optional + private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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 { @@ -55,10 +35,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PASSWORD((short)3, "password"), CONFIGURATION((short)4, "configuration"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -66,6 +46,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // CLIENT_PROTOCOL @@ -87,21 +68,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -110,16 +92,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -130,12 +112,12 @@ public String getFieldName() { new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap); } public TOpenSessionReq() { - this.client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + this.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; } @@ -160,7 +142,7 @@ public TOpenSessionReq(TOpenSessionReq other) { this.password = other.password; } if (other.isSetConfiguration()) { - Map __this__configuration = new HashMap(other.configuration); + java.util.Map __this__configuration = new java.util.HashMap(other.configuration); this.configuration = __this__configuration; } } @@ -171,7 +153,7 @@ public TOpenSessionReq deepCopy() { @Override public void clear() { - this.client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + this.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; this.username = null; this.password = null; @@ -182,6 +164,7 @@ public void clear() { * * @see TProtocolVersion */ + @org.apache.thrift.annotation.Nullable public TProtocolVersion getClient_protocol() { return this.client_protocol; } @@ -190,7 +173,7 @@ public TProtocolVersion getClient_protocol() { * * @see TProtocolVersion */ - public void setClient_protocol(TProtocolVersion client_protocol) { + public void setClient_protocol(@org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol) { this.client_protocol = client_protocol; } @@ -209,11 +192,12 @@ public void setClient_protocolIsSet(boolean value) { } } - public String getUsername() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getUsername() { return this.username; } - public void setUsername(String username) { + public void setUsername(@org.apache.thrift.annotation.Nullable java.lang.String username) { this.username = username; } @@ -232,11 +216,12 @@ public void setUsernameIsSet(boolean value) { } } - public String getPassword() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getPassword() { return this.password; } - public void setPassword(String password) { + public void setPassword(@org.apache.thrift.annotation.Nullable java.lang.String password) { this.password = password; } @@ -259,18 +244,19 @@ public int getConfigurationSize() { return (this.configuration == null) ? 0 : this.configuration.size(); } - public void putToConfiguration(String key, String val) { + public void putToConfiguration(java.lang.String key, java.lang.String val) { if (this.configuration == null) { - this.configuration = new HashMap(); + this.configuration = new java.util.HashMap(); } this.configuration.put(key, val); } - public Map getConfiguration() { + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfiguration() { return this.configuration; } - public void setConfiguration(Map configuration) { + public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { this.configuration = configuration; } @@ -289,7 +275,7 @@ public void setConfigurationIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case CLIENT_PROTOCOL: if (value == null) { @@ -303,7 +289,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetUsername(); } else { - setUsername((String)value); + setUsername((java.lang.String)value); } break; @@ -311,7 +297,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetPassword(); } else { - setPassword((String)value); + setPassword((java.lang.String)value); } break; @@ -319,14 +305,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetConfiguration(); } else { - setConfiguration((Map)value); + setConfiguration((java.util.Map)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case CLIENT_PROTOCOL: return getClient_protocol(); @@ -341,13 +328,13 @@ public Object getFieldValue(_Fields field) { return getConfiguration(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -360,11 +347,11 @@ public boolean isSet(_Fields field) { case CONFIGURATION: return isSetConfiguration(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TOpenSessionReq) @@ -375,6 +362,8 @@ public boolean equals(Object that) { public boolean equals(TOpenSessionReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_client_protocol = true && this.isSetClient_protocol(); boolean that_present_client_protocol = true && that.isSetClient_protocol(); @@ -417,29 +406,25 @@ public boolean equals(TOpenSessionReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_client_protocol = true && (isSetClient_protocol()); - list.add(present_client_protocol); - if (present_client_protocol) - list.add(client_protocol.getValue()); + hashCode = hashCode * 8191 + ((isSetClient_protocol()) ? 131071 : 524287); + if (isSetClient_protocol()) + hashCode = hashCode * 8191 + client_protocol.getValue(); - boolean present_username = true && (isSetUsername()); - list.add(present_username); - if (present_username) - list.add(username); + hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287); + if (isSetUsername()) + hashCode = hashCode * 8191 + username.hashCode(); - boolean present_password = true && (isSetPassword()); - list.add(present_password); - if (present_password) - list.add(password); + hashCode = hashCode * 8191 + ((isSetPassword()) ? 131071 : 524287); + if (isSetPassword()) + hashCode = hashCode * 8191 + password.hashCode(); - boolean present_configuration = true && (isSetConfiguration()); - list.add(present_configuration); - if (present_configuration) - list.add(configuration); + hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); + if (isSetConfiguration()) + hashCode = hashCode * 8191 + configuration.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -450,7 +435,7 @@ public int compareTo(TOpenSessionReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); + lastComparison = java.lang.Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); if (lastComparison != 0) { return lastComparison; } @@ -460,7 +445,7 @@ public int compareTo(TOpenSessionReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); if (lastComparison != 0) { return lastComparison; } @@ -470,7 +455,7 @@ public int compareTo(TOpenSessionReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + lastComparison = java.lang.Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); if (lastComparison != 0) { return lastComparison; } @@ -480,7 +465,7 @@ public int compareTo(TOpenSessionReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); if (lastComparison != 0) { return lastComparison; } @@ -493,21 +478,22 @@ public int compareTo(TOpenSessionReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOpenSessionReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionReq("); boolean first = true; sb.append("client_protocol:"); @@ -568,7 +554,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -576,13 +562,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TOpenSessionReqStandardSchemeFactory implements SchemeFactory { + private static class TOpenSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TOpenSessionReqStandardScheme getScheme() { return new TOpenSessionReqStandardScheme(); } } - private static class TOpenSessionReqStandardScheme extends StandardScheme { + private static class TOpenSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -596,7 +582,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq str switch (schemeField.id) { case 1: // CLIENT_PROTOCOL if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32()); + struct.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); struct.setClient_protocolIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -622,9 +608,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq str if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map142.size); - String _key143; - String _val144; + struct.configuration = new java.util.HashMap(2*_map142.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key143; + @org.apache.thrift.annotation.Nullable java.lang.String _val144; for (int _i145 = 0; _i145 < _map142.size; ++_i145) { _key143 = iprot.readString(); @@ -675,7 +661,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq st oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter146 : struct.configuration.entrySet()) + for (java.util.Map.Entry _iter146 : struct.configuration.entrySet()) { oprot.writeString(_iter146.getKey()); oprot.writeString(_iter146.getValue()); @@ -691,19 +677,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq st } - private static class TOpenSessionReqTupleSchemeFactory implements SchemeFactory { + private static class TOpenSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TOpenSessionReqTupleScheme getScheme() { return new TOpenSessionReqTupleScheme(); } } - private static class TOpenSessionReqTupleScheme extends TupleScheme { + private static class TOpenSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI32(struct.client_protocol.getValue()); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetUsername()) { optionals.set(0); } @@ -723,7 +709,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq str if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter147 : struct.configuration.entrySet()) + for (java.util.Map.Entry _iter147 : struct.configuration.entrySet()) { oprot.writeString(_iter147.getKey()); oprot.writeString(_iter147.getValue()); @@ -734,10 +720,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32()); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); struct.setClient_protocolIsSet(true); - BitSet incoming = iprot.readBitSet(3); + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.username = iprot.readString(); struct.setUsernameIsSet(true); @@ -749,9 +735,9 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq stru if (incoming.get(2)) { { org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map148.size); - String _key149; - String _val150; + struct.configuration = new java.util.HashMap(2*_map148.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key149; + @org.apache.thrift.annotation.Nullable java.lang.String _val150; for (int _i151 = 0; _i151 < _map148.size; ++_i151) { _key149 = iprot.readString(); @@ -764,5 +750,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java index d2c613c1bcd8..fb3a4225af3b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp"); 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); @@ -33,16 +16,13 @@ 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)3); private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOpenSessionRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOpenSessionRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOpenSessionRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOpenSessionRespTupleSchemeFactory(); - private TStatus status; // required - private TProtocolVersion serverProtocolVersion; // required - private TSessionHandle sessionHandle; // optional - private Map configuration; // optional + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // optional + private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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 { @@ -55,10 +35,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SESSION_HANDLE((short)3, "sessionHandle"), CONFIGURATION((short)4, "configuration"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -66,6 +46,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -87,21 +68,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -110,16 +92,16 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -130,12 +112,12 @@ public String getFieldName() { new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap); } public TOpenSessionResp() { - this.serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + this.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; } @@ -162,7 +144,7 @@ public TOpenSessionResp(TOpenSessionResp other) { this.sessionHandle = new TSessionHandle(other.sessionHandle); } if (other.isSetConfiguration()) { - Map __this__configuration = new HashMap(other.configuration); + java.util.Map __this__configuration = new java.util.HashMap(other.configuration); this.configuration = __this__configuration; } } @@ -174,17 +156,18 @@ public TOpenSessionResp deepCopy() { @Override public void clear() { this.status = null; - this.serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + this.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; this.sessionHandle = null; this.configuration = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -207,6 +190,7 @@ public void setStatusIsSet(boolean value) { * * @see TProtocolVersion */ + @org.apache.thrift.annotation.Nullable public TProtocolVersion getServerProtocolVersion() { return this.serverProtocolVersion; } @@ -215,7 +199,7 @@ public TProtocolVersion getServerProtocolVersion() { * * @see TProtocolVersion */ - public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) { + public void setServerProtocolVersion(@org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion) { this.serverProtocolVersion = serverProtocolVersion; } @@ -234,11 +218,12 @@ public void setServerProtocolVersionIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -261,18 +246,19 @@ public int getConfigurationSize() { return (this.configuration == null) ? 0 : this.configuration.size(); } - public void putToConfiguration(String key, String val) { + public void putToConfiguration(java.lang.String key, java.lang.String val) { if (this.configuration == null) { - this.configuration = new HashMap(); + this.configuration = new java.util.HashMap(); } this.configuration.put(key, val); } - public Map getConfiguration() { + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfiguration() { return this.configuration; } - public void setConfiguration(Map configuration) { + public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { this.configuration = configuration; } @@ -291,7 +277,7 @@ public void setConfigurationIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -321,14 +307,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetConfiguration(); } else { - setConfiguration((Map)value); + setConfiguration((java.util.Map)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -343,13 +330,13 @@ public Object getFieldValue(_Fields field) { return getConfiguration(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -362,11 +349,11 @@ public boolean isSet(_Fields field) { case CONFIGURATION: return isSetConfiguration(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TOpenSessionResp) @@ -377,6 +364,8 @@ public boolean equals(Object that) { public boolean equals(TOpenSessionResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -419,29 +408,25 @@ public boolean equals(TOpenSessionResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion()); - list.add(present_serverProtocolVersion); - if (present_serverProtocolVersion) - list.add(serverProtocolVersion.getValue()); + hashCode = hashCode * 8191 + ((isSetServerProtocolVersion()) ? 131071 : 524287); + if (isSetServerProtocolVersion()) + hashCode = hashCode * 8191 + serverProtocolVersion.getValue(); - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_configuration = true && (isSetConfiguration()); - list.add(present_configuration); - if (present_configuration) - list.add(configuration); + hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); + if (isSetConfiguration()) + hashCode = hashCode * 8191 + configuration.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -452,7 +437,7 @@ public int compareTo(TOpenSessionResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -462,7 +447,7 @@ public int compareTo(TOpenSessionResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); + lastComparison = java.lang.Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); if (lastComparison != 0) { return lastComparison; } @@ -472,7 +457,7 @@ public int compareTo(TOpenSessionResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -482,7 +467,7 @@ public int compareTo(TOpenSessionResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); if (lastComparison != 0) { return lastComparison; } @@ -495,21 +480,22 @@ public int compareTo(TOpenSessionResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOpenSessionResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionResp("); boolean first = true; sb.append("status:"); @@ -578,7 +564,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -586,13 +572,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TOpenSessionRespStandardSchemeFactory implements SchemeFactory { + private static class TOpenSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TOpenSessionRespStandardScheme getScheme() { return new TOpenSessionRespStandardScheme(); } } - private static class TOpenSessionRespStandardScheme extends StandardScheme { + private static class TOpenSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -615,7 +601,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp st break; case 2: // SERVER_PROTOCOL_VERSION if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32()); + struct.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); struct.setServerProtocolVersionIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -634,9 +620,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp st if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map152.size); - String _key153; - String _val154; + struct.configuration = new java.util.HashMap(2*_map152.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key153; + @org.apache.thrift.annotation.Nullable java.lang.String _val154; for (int _i155 = 0; _i155 < _map152.size; ++_i155) { _key153 = iprot.readString(); @@ -685,7 +671,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp s oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter156 : struct.configuration.entrySet()) + for (java.util.Map.Entry _iter156 : struct.configuration.entrySet()) { oprot.writeString(_iter156.getKey()); oprot.writeString(_iter156.getValue()); @@ -701,20 +687,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp s } - private static class TOpenSessionRespTupleSchemeFactory implements SchemeFactory { + private static class TOpenSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TOpenSessionRespTupleScheme getScheme() { return new TOpenSessionRespTupleScheme(); } } - private static class TOpenSessionRespTupleScheme extends TupleScheme { + private static class TOpenSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); oprot.writeI32(struct.serverProtocolVersion.getValue()); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetSessionHandle()) { optionals.set(0); } @@ -728,7 +714,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp st if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter157 : struct.configuration.entrySet()) + for (java.util.Map.Entry _iter157 : struct.configuration.entrySet()) { oprot.writeString(_iter157.getKey()); oprot.writeString(_iter157.getValue()); @@ -739,13 +725,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32()); + struct.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); struct.setServerProtocolVersionIsSet(true); - BitSet incoming = iprot.readBitSet(2); + java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); @@ -754,9 +740,9 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp str if (incoming.get(1)) { { org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map158.size); - String _key159; - String _val160; + struct.configuration = new java.util.HashMap(2*_map158.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key159; + @org.apache.thrift.annotation.Nullable java.lang.String _val160; for (int _i161 = 0; _i161 < _map158.size; ++_i161) { _key159 = iprot.readString(); @@ -769,5 +755,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java index df524485b721..2930a956e703 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java @@ -1,32 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle"); private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -34,14 +16,11 @@ private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3); private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (short)4); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOperationHandleStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOperationHandleTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOperationHandleStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOperationHandleTupleSchemeFactory(); - private THandleIdentifier operationId; // required - private TOperationType operationType; // required + private @org.apache.thrift.annotation.Nullable THandleIdentifier operationId; // required + private @org.apache.thrift.annotation.Nullable TOperationType operationType; // required private boolean hasResultSet; // required private double modifiedRowCount; // optional @@ -56,10 +35,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HAS_RESULT_SET((short)3, "hasResultSet"), MODIFIED_ROW_COUNT((short)4, "modifiedRowCount"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -67,6 +46,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_ID @@ -88,21 +68,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -111,7 +92,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -121,9 +102,9 @@ public String getFieldName() { private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -132,7 +113,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap); } @@ -180,11 +161,12 @@ public void clear() { this.modifiedRowCount = 0.0; } + @org.apache.thrift.annotation.Nullable public THandleIdentifier getOperationId() { return this.operationId; } - public void setOperationId(THandleIdentifier operationId) { + public void setOperationId(@org.apache.thrift.annotation.Nullable THandleIdentifier operationId) { this.operationId = operationId; } @@ -207,6 +189,7 @@ public void setOperationIdIsSet(boolean value) { * * @see TOperationType */ + @org.apache.thrift.annotation.Nullable public TOperationType getOperationType() { return this.operationType; } @@ -215,7 +198,7 @@ public TOperationType getOperationType() { * * @see TOperationType */ - public void setOperationType(TOperationType operationType) { + public void setOperationType(@org.apache.thrift.annotation.Nullable TOperationType operationType) { this.operationType = operationType; } @@ -244,16 +227,16 @@ public void setHasResultSet(boolean hasResultSet) { } public void unsetHasResultSet() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ public boolean isSetHasResultSet() { - return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); } public double getModifiedRowCount() { @@ -266,19 +249,19 @@ public void setModifiedRowCount(double modifiedRowCount) { } public void unsetModifiedRowCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); } /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */ public boolean isSetModifiedRowCount() { - return EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); } public void setModifiedRowCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case OPERATION_ID: if (value == null) { @@ -300,7 +283,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetHasResultSet(); } else { - setHasResultSet((Boolean)value); + setHasResultSet((java.lang.Boolean)value); } break; @@ -308,14 +291,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetModifiedRowCount(); } else { - setModifiedRowCount((Double)value); + setModifiedRowCount((java.lang.Double)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case OPERATION_ID: return getOperationId(); @@ -330,13 +314,13 @@ public Object getFieldValue(_Fields field) { return getModifiedRowCount(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -349,11 +333,11 @@ public boolean isSet(_Fields field) { case MODIFIED_ROW_COUNT: return isSetModifiedRowCount(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TOperationHandle) @@ -364,6 +348,8 @@ public boolean equals(Object that) { public boolean equals(TOperationHandle that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_operationId = true && this.isSetOperationId(); boolean that_present_operationId = true && that.isSetOperationId(); @@ -406,29 +392,23 @@ public boolean equals(TOperationHandle that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_operationId = true && (isSetOperationId()); - list.add(present_operationId); - if (present_operationId) - list.add(operationId); + hashCode = hashCode * 8191 + ((isSetOperationId()) ? 131071 : 524287); + if (isSetOperationId()) + hashCode = hashCode * 8191 + operationId.hashCode(); - boolean present_operationType = true && (isSetOperationType()); - list.add(present_operationType); - if (present_operationType) - list.add(operationType.getValue()); + hashCode = hashCode * 8191 + ((isSetOperationType()) ? 131071 : 524287); + if (isSetOperationType()) + hashCode = hashCode * 8191 + operationType.getValue(); - boolean present_hasResultSet = true; - list.add(present_hasResultSet); - if (present_hasResultSet) - list.add(hasResultSet); + hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); - boolean present_modifiedRowCount = true && (isSetModifiedRowCount()); - list.add(present_modifiedRowCount); - if (present_modifiedRowCount) - list.add(modifiedRowCount); + hashCode = hashCode * 8191 + ((isSetModifiedRowCount()) ? 131071 : 524287); + if (isSetModifiedRowCount()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(modifiedRowCount); - return list.hashCode(); + return hashCode; } @Override @@ -439,7 +419,7 @@ public int compareTo(TOperationHandle other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); if (lastComparison != 0) { return lastComparison; } @@ -449,7 +429,7 @@ public int compareTo(TOperationHandle other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); + lastComparison = java.lang.Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); if (lastComparison != 0) { return lastComparison; } @@ -459,7 +439,7 @@ public int compareTo(TOperationHandle other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); if (lastComparison != 0) { return lastComparison; } @@ -469,7 +449,7 @@ public int compareTo(TOperationHandle other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); + lastComparison = java.lang.Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); if (lastComparison != 0) { return lastComparison; } @@ -482,21 +462,22 @@ public int compareTo(TOperationHandle other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOperationHandle("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TOperationHandle("); boolean first = true; sb.append("operationId:"); @@ -556,7 +537,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -566,13 +547,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TOperationHandleStandardSchemeFactory implements SchemeFactory { + private static class TOperationHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TOperationHandleStandardScheme getScheme() { return new TOperationHandleStandardScheme(); } } - private static class TOperationHandleStandardScheme extends StandardScheme { + private static class TOperationHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -595,7 +576,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle st break; case 2: // OPERATION_TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationType = TOperationType.findByValue(iprot.readI32()); + struct.operationType = org.apache.spark.service.rpc.thrift.TOperationType.findByValue(iprot.readI32()); struct.setOperationTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -654,21 +635,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOperationHandle s } - private static class TOperationHandleTupleSchemeFactory implements SchemeFactory { + private static class TOperationHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TOperationHandleTupleScheme getScheme() { return new TOperationHandleTupleScheme(); } } - private static class TOperationHandleTupleScheme extends TupleScheme { + private static class TOperationHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationId.write(oprot); oprot.writeI32(struct.operationType.getValue()); oprot.writeBool(struct.hasResultSet); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetModifiedRowCount()) { optionals.set(0); } @@ -680,15 +661,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.operationId = new THandleIdentifier(); struct.operationId.read(iprot); struct.setOperationIdIsSet(true); - struct.operationType = TOperationType.findByValue(iprot.readI32()); + struct.operationType = org.apache.spark.service.rpc.thrift.TOperationType.findByValue(iprot.readI32()); struct.setOperationTypeIsSet(true); struct.hasResultSet = iprot.readBool(); struct.setHasResultSetIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.modifiedRowCount = iprot.readDouble(); struct.setModifiedRowCountIsSet(true); @@ -696,5 +677,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java index 7f62bdd1f282..68aed9d87b52 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TOperationState implements org.apache.thrift.TEnum { INITIALIZED_STATE(0), RUNNING_STATE(1), @@ -35,6 +36,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TOperationState findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java index ceb39742c3ae..b9769310ea82 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TOperationType implements org.apache.thrift.TEnum { EXECUTE_STATEMENT(0), GET_TYPE_INFO(1), @@ -35,6 +36,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TOperationType findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java index 27e17265b473..7145eaa44aa6 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java @@ -1,44 +1,24 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry"); private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TPrimitiveTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TPrimitiveTypeEntryTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPrimitiveTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPrimitiveTypeEntryTupleSchemeFactory(); - private TTypeId type; // required - private TTypeQualifiers typeQualifiers; // optional + private @org.apache.thrift.annotation.Nullable TTypeId type; // required + private @org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers; // 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 { @@ -49,10 +29,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TYPE((short)1, "type"), TYPE_QUALIFIERS((short)2, "typeQualifiers"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -60,6 +40,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TYPE @@ -77,21 +58,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -100,21 +82,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.TYPE_QUALIFIERS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class))); tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap); } @@ -154,6 +136,7 @@ public void clear() { * * @see TTypeId */ + @org.apache.thrift.annotation.Nullable public TTypeId getType() { return this.type; } @@ -162,7 +145,7 @@ public TTypeId getType() { * * @see TTypeId */ - public void setType(TTypeId type) { + public void setType(@org.apache.thrift.annotation.Nullable TTypeId type) { this.type = type; } @@ -181,11 +164,12 @@ public void setTypeIsSet(boolean value) { } } + @org.apache.thrift.annotation.Nullable public TTypeQualifiers getTypeQualifiers() { return this.typeQualifiers; } - public void setTypeQualifiers(TTypeQualifiers typeQualifiers) { + public void setTypeQualifiers(@org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers) { this.typeQualifiers = typeQualifiers; } @@ -204,7 +188,7 @@ public void setTypeQualifiersIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TYPE: if (value == null) { @@ -225,7 +209,8 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); @@ -234,13 +219,13 @@ public Object getFieldValue(_Fields field) { return getTypeQualifiers(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -249,11 +234,11 @@ public boolean isSet(_Fields field) { case TYPE_QUALIFIERS: return isSetTypeQualifiers(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TPrimitiveTypeEntry) @@ -264,6 +249,8 @@ public boolean equals(Object that) { public boolean equals(TPrimitiveTypeEntry that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); @@ -288,19 +275,17 @@ public boolean equals(TPrimitiveTypeEntry that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_type = true && (isSetType()); - list.add(present_type); - if (present_type) - list.add(type.getValue()); + hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); + if (isSetType()) + hashCode = hashCode * 8191 + type.getValue(); - boolean present_typeQualifiers = true && (isSetTypeQualifiers()); - list.add(present_typeQualifiers); - if (present_typeQualifiers) - list.add(typeQualifiers); + hashCode = hashCode * 8191 + ((isSetTypeQualifiers()) ? 131071 : 524287); + if (isSetTypeQualifiers()) + hashCode = hashCode * 8191 + typeQualifiers.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -311,7 +296,7 @@ public int compareTo(TPrimitiveTypeEntry other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); + lastComparison = java.lang.Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; } @@ -321,7 +306,7 @@ public int compareTo(TPrimitiveTypeEntry other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); + lastComparison = java.lang.Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); if (lastComparison != 0) { return lastComparison; } @@ -334,21 +319,22 @@ public int compareTo(TPrimitiveTypeEntry other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TPrimitiveTypeEntry("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TPrimitiveTypeEntry("); boolean first = true; sb.append("type:"); @@ -392,7 +378,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -400,13 +386,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TPrimitiveTypeEntryStandardSchemeFactory implements SchemeFactory { + private static class TPrimitiveTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPrimitiveTypeEntryStandardScheme getScheme() { return new TPrimitiveTypeEntryStandardScheme(); } } - private static class TPrimitiveTypeEntryStandardScheme extends StandardScheme { + private static class TPrimitiveTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -420,7 +406,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry switch (schemeField.id) { case 1: // TYPE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.type = TTypeId.findByValue(iprot.readI32()); + struct.type = org.apache.spark.service.rpc.thrift.TTypeId.findByValue(iprot.readI32()); struct.setTypeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -466,19 +452,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TPrimitiveTypeEntr } - private static class TPrimitiveTypeEntryTupleSchemeFactory implements SchemeFactory { + private static class TPrimitiveTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TPrimitiveTypeEntryTupleScheme getScheme() { return new TPrimitiveTypeEntryTupleScheme(); } } - private static class TPrimitiveTypeEntryTupleScheme extends TupleScheme { + private static class TPrimitiveTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI32(struct.type.getValue()); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetTypeQualifiers()) { optionals.set(0); } @@ -490,10 +476,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry @Override public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.type = TTypeId.findByValue(iprot.readI32()); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.type = org.apache.spark.service.rpc.thrift.TTypeId.findByValue(iprot.readI32()); struct.setTypeIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.typeQualifiers = new TTypeQualifiers(); struct.typeQualifiers.read(iprot); @@ -502,5 +488,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java index c8910d1ad190..852f944a10fd 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java @@ -1,31 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TProgressUpdateResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TProgressUpdateResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TProgressUpdateResp"); private static final org.apache.thrift.protocol.TField HEADER_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("headerNames", org.apache.thrift.protocol.TType.LIST, (short)1); @@ -35,17 +18,14 @@ private static final org.apache.thrift.protocol.TField FOOTER_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("footerSummary", org.apache.thrift.protocol.TType.STRING, (short)5); private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)6); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TProgressUpdateRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TProgressUpdateRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TProgressUpdateRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TProgressUpdateRespTupleSchemeFactory(); - private List headerNames; // required - private List> rows; // required + private @org.apache.thrift.annotation.Nullable java.util.List headerNames; // required + private @org.apache.thrift.annotation.Nullable java.util.List> rows; // required private double progressedPercentage; // required - private TJobExecutionStatus status; // required - private String footerSummary; // required + private @org.apache.thrift.annotation.Nullable TJobExecutionStatus status; // required + private @org.apache.thrift.annotation.Nullable java.lang.String footerSummary; // required private long startTime; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -61,10 +41,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FOOTER_SUMMARY((short)5, "footerSummary"), START_TIME((short)6, "startTime"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -72,6 +52,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // HEADER_NAMES @@ -97,21 +78,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -120,7 +102,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -129,9 +111,9 @@ public String getFieldName() { private static final int __PROGRESSEDPERCENTAGE_ISSET_ID = 0; private static final int __STARTTIME_ISSET_ID = 1; private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.HEADER_NAMES, new org.apache.thrift.meta_data.FieldMetaData("headerNames", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); @@ -147,7 +129,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TProgressUpdateResp.class, metaDataMap); } @@ -155,11 +137,11 @@ public TProgressUpdateResp() { } public TProgressUpdateResp( - List headerNames, - List> rows, + java.util.List headerNames, + java.util.List> rows, double progressedPercentage, TJobExecutionStatus status, - String footerSummary, + java.lang.String footerSummary, long startTime) { this(); @@ -179,13 +161,13 @@ public TProgressUpdateResp( public TProgressUpdateResp(TProgressUpdateResp other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHeaderNames()) { - List __this__headerNames = new ArrayList(other.headerNames); + java.util.List __this__headerNames = new java.util.ArrayList(other.headerNames); this.headerNames = __this__headerNames; } if (other.isSetRows()) { - List> __this__rows = new ArrayList>(other.rows.size()); - for (List other_element : other.rows) { - List __this__rows_copy = new ArrayList(other_element); + java.util.List> __this__rows = new java.util.ArrayList>(other.rows.size()); + for (java.util.List other_element : other.rows) { + java.util.List __this__rows_copy = new java.util.ArrayList(other_element); __this__rows.add(__this__rows_copy); } this.rows = __this__rows; @@ -220,22 +202,24 @@ public int getHeaderNamesSize() { return (this.headerNames == null) ? 0 : this.headerNames.size(); } - public java.util.Iterator getHeaderNamesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getHeaderNamesIterator() { return (this.headerNames == null) ? null : this.headerNames.iterator(); } - public void addToHeaderNames(String elem) { + public void addToHeaderNames(java.lang.String elem) { if (this.headerNames == null) { - this.headerNames = new ArrayList(); + this.headerNames = new java.util.ArrayList(); } this.headerNames.add(elem); } - public List getHeaderNames() { + @org.apache.thrift.annotation.Nullable + public java.util.List getHeaderNames() { return this.headerNames; } - public void setHeaderNames(List headerNames) { + public void setHeaderNames(@org.apache.thrift.annotation.Nullable java.util.List headerNames) { this.headerNames = headerNames; } @@ -258,22 +242,24 @@ public int getRowsSize() { return (this.rows == null) ? 0 : this.rows.size(); } - public java.util.Iterator> getRowsIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator> getRowsIterator() { return (this.rows == null) ? null : this.rows.iterator(); } - public void addToRows(List elem) { + public void addToRows(java.util.List elem) { if (this.rows == null) { - this.rows = new ArrayList>(); + this.rows = new java.util.ArrayList>(); } this.rows.add(elem); } - public List> getRows() { + @org.apache.thrift.annotation.Nullable + public java.util.List> getRows() { return this.rows; } - public void setRows(List> rows) { + public void setRows(@org.apache.thrift.annotation.Nullable java.util.List> rows) { this.rows = rows; } @@ -302,22 +288,23 @@ public void setProgressedPercentage(double progressedPercentage) { } public void unsetProgressedPercentage() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); } /** Returns true if field progressedPercentage is set (has been assigned a value) and false otherwise */ public boolean isSetProgressedPercentage() { - return EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); } public void setProgressedPercentageIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); } /** * * @see TJobExecutionStatus */ + @org.apache.thrift.annotation.Nullable public TJobExecutionStatus getStatus() { return this.status; } @@ -326,7 +313,7 @@ public TJobExecutionStatus getStatus() { * * @see TJobExecutionStatus */ - public void setStatus(TJobExecutionStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TJobExecutionStatus status) { this.status = status; } @@ -345,11 +332,12 @@ public void setStatusIsSet(boolean value) { } } - public String getFooterSummary() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getFooterSummary() { return this.footerSummary; } - public void setFooterSummary(String footerSummary) { + public void setFooterSummary(@org.apache.thrift.annotation.Nullable java.lang.String footerSummary) { this.footerSummary = footerSummary; } @@ -378,25 +366,25 @@ public void setStartTime(long startTime) { } public void unsetStartTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); } /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ public boolean isSetStartTime() { - return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); } public void setStartTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case HEADER_NAMES: if (value == null) { unsetHeaderNames(); } else { - setHeaderNames((List)value); + setHeaderNames((java.util.List)value); } break; @@ -404,7 +392,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetRows(); } else { - setRows((List>)value); + setRows((java.util.List>)value); } break; @@ -412,7 +400,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetProgressedPercentage(); } else { - setProgressedPercentage((Double)value); + setProgressedPercentage((java.lang.Double)value); } break; @@ -428,7 +416,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetFooterSummary(); } else { - setFooterSummary((String)value); + setFooterSummary((java.lang.String)value); } break; @@ -436,14 +424,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetStartTime(); } else { - setStartTime((Long)value); + setStartTime((java.lang.Long)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case HEADER_NAMES: return getHeaderNames(); @@ -464,13 +453,13 @@ public Object getFieldValue(_Fields field) { return getStartTime(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -487,11 +476,11 @@ public boolean isSet(_Fields field) { case START_TIME: return isSetStartTime(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TProgressUpdateResp) @@ -502,6 +491,8 @@ public boolean equals(Object that) { public boolean equals(TProgressUpdateResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_headerNames = true && this.isSetHeaderNames(); boolean that_present_headerNames = true && that.isSetHeaderNames(); @@ -562,39 +553,29 @@ public boolean equals(TProgressUpdateResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_headerNames = true && (isSetHeaderNames()); - list.add(present_headerNames); - if (present_headerNames) - list.add(headerNames); + hashCode = hashCode * 8191 + ((isSetHeaderNames()) ? 131071 : 524287); + if (isSetHeaderNames()) + hashCode = hashCode * 8191 + headerNames.hashCode(); - boolean present_rows = true && (isSetRows()); - list.add(present_rows); - if (present_rows) - list.add(rows); + hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); + if (isSetRows()) + hashCode = hashCode * 8191 + rows.hashCode(); - boolean present_progressedPercentage = true; - list.add(present_progressedPercentage); - if (present_progressedPercentage) - list.add(progressedPercentage); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(progressedPercentage); - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status.getValue()); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.getValue(); - boolean present_footerSummary = true && (isSetFooterSummary()); - list.add(present_footerSummary); - if (present_footerSummary) - list.add(footerSummary); + hashCode = hashCode * 8191 + ((isSetFooterSummary()) ? 131071 : 524287); + if (isSetFooterSummary()) + hashCode = hashCode * 8191 + footerSummary.hashCode(); - boolean present_startTime = true; - list.add(present_startTime); - if (present_startTime) - list.add(startTime); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTime); - return list.hashCode(); + return hashCode; } @Override @@ -605,7 +586,7 @@ public int compareTo(TProgressUpdateResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); + lastComparison = java.lang.Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); if (lastComparison != 0) { return lastComparison; } @@ -615,7 +596,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); if (lastComparison != 0) { return lastComparison; } @@ -625,7 +606,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); + lastComparison = java.lang.Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); if (lastComparison != 0) { return lastComparison; } @@ -635,7 +616,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -645,7 +626,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); + lastComparison = java.lang.Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); if (lastComparison != 0) { return lastComparison; } @@ -655,7 +636,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); + lastComparison = java.lang.Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); if (lastComparison != 0) { return lastComparison; } @@ -668,21 +649,22 @@ public int compareTo(TProgressUpdateResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TProgressUpdateResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TProgressUpdateResp("); boolean first = true; sb.append("headerNames:"); @@ -765,7 +747,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -775,13 +757,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TProgressUpdateRespStandardSchemeFactory implements SchemeFactory { + private static class TProgressUpdateRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TProgressUpdateRespStandardScheme getScheme() { return new TProgressUpdateRespStandardScheme(); } } - private static class TProgressUpdateRespStandardScheme extends StandardScheme { + private static class TProgressUpdateRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -797,8 +779,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(); - struct.headerNames = new ArrayList(_list190.size); - String _elem191; + struct.headerNames = new java.util.ArrayList(_list190.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem191; for (int _i192 = 0; _i192 < _list190.size; ++_i192) { _elem191 = iprot.readString(); @@ -815,14 +797,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list193 = iprot.readListBegin(); - struct.rows = new ArrayList>(_list193.size); - List _elem194; + struct.rows = new java.util.ArrayList>(_list193.size); + @org.apache.thrift.annotation.Nullable java.util.List _elem194; for (int _i195 = 0; _i195 < _list193.size; ++_i195) { { org.apache.thrift.protocol.TList _list196 = iprot.readListBegin(); - _elem194 = new ArrayList(_list196.size); - String _elem197; + _elem194 = new java.util.ArrayList(_list196.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem197; for (int _i198 = 0; _i198 < _list196.size; ++_i198) { _elem197 = iprot.readString(); @@ -849,7 +831,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp break; case 4: // STATUS if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.status = TJobExecutionStatus.findByValue(iprot.readI32()); + struct.status = org.apache.spark.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); struct.setStatusIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -888,7 +870,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateRes oprot.writeFieldBegin(HEADER_NAMES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.headerNames.size())); - for (String _iter199 : struct.headerNames) + for (java.lang.String _iter199 : struct.headerNames) { oprot.writeString(_iter199); } @@ -900,11 +882,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateRes oprot.writeFieldBegin(ROWS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.rows.size())); - for (List _iter200 : struct.rows) + for (java.util.List _iter200 : struct.rows) { { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter200.size())); - for (String _iter201 : _iter200) + for (java.lang.String _iter201 : _iter200) { oprot.writeString(_iter201); } @@ -937,31 +919,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateRes } - private static class TProgressUpdateRespTupleSchemeFactory implements SchemeFactory { + private static class TProgressUpdateRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TProgressUpdateRespTupleScheme getScheme() { return new TProgressUpdateRespTupleScheme(); } } - private static class TProgressUpdateRespTupleScheme extends TupleScheme { + private static class TProgressUpdateRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.headerNames.size()); - for (String _iter202 : struct.headerNames) + for (java.lang.String _iter202 : struct.headerNames) { oprot.writeString(_iter202); } } { oprot.writeI32(struct.rows.size()); - for (List _iter203 : struct.rows) + for (java.util.List _iter203 : struct.rows) { { oprot.writeI32(_iter203.size()); - for (String _iter204 : _iter203) + for (java.lang.String _iter204 : _iter203) { oprot.writeString(_iter204); } @@ -976,11 +958,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp @Override public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list205 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.headerNames = new ArrayList(_list205.size); - String _elem206; + struct.headerNames = new java.util.ArrayList(_list205.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem206; for (int _i207 = 0; _i207 < _list205.size; ++_i207) { _elem206 = iprot.readString(); @@ -990,14 +972,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct.setHeaderNamesIsSet(true); { org.apache.thrift.protocol.TList _list208 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); - struct.rows = new ArrayList>(_list208.size); - List _elem209; + struct.rows = new java.util.ArrayList>(_list208.size); + @org.apache.thrift.annotation.Nullable java.util.List _elem209; for (int _i210 = 0; _i210 < _list208.size; ++_i210) { { org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - _elem209 = new ArrayList(_list211.size); - String _elem212; + _elem209 = new java.util.ArrayList(_list211.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem212; for (int _i213 = 0; _i213 < _list211.size; ++_i213) { _elem212 = iprot.readString(); @@ -1010,7 +992,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct.setRowsIsSet(true); struct.progressedPercentage = iprot.readDouble(); struct.setProgressedPercentageIsSet(true); - struct.status = TJobExecutionStatus.findByValue(iprot.readI32()); + struct.status = org.apache.spark.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); struct.setStatusIsSet(true); struct.footerSummary = iprot.readString(); struct.setFooterSummaryIsSet(true); @@ -1019,5 +1001,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java index de8792888b66..9ac17f4ad40e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TProtocolVersion implements org.apache.thrift.TEnum { HIVE_CLI_SERVICE_PROTOCOL_V1(0), HIVE_CLI_SERVICE_PROTOCOL_V2(1), @@ -37,6 +38,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TProtocolVersion findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java index 9be39d344981..3897e68b5e33 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java @@ -1,53 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenReq"); 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRenewDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRenewDelegationTokenReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private String delegationToken; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), DELEGATION_TOKEN((short)2, "delegationToken"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -55,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -72,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -95,20 +78,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenReq.class, metaDataMap); } @@ -117,7 +100,7 @@ public TRenewDelegationTokenReq() { public TRenewDelegationTokenReq( TSessionHandle sessionHandle, - String delegationToken) + java.lang.String delegationToken) { this(); this.sessionHandle = sessionHandle; @@ -146,11 +129,12 @@ public void clear() { this.delegationToken = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -169,11 +153,12 @@ public void setSessionHandleIsSet(boolean value) { } } - public String getDelegationToken() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getDelegationToken() { return this.delegationToken; } - public void setDelegationToken(String delegationToken) { + public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { this.delegationToken = delegationToken; } @@ -192,7 +177,7 @@ public void setDelegationTokenIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -206,14 +191,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetDelegationToken(); } else { - setDelegationToken((String)value); + setDelegationToken((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -222,13 +208,13 @@ public Object getFieldValue(_Fields field) { return getDelegationToken(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -237,11 +223,11 @@ public boolean isSet(_Fields field) { case DELEGATION_TOKEN: return isSetDelegationToken(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TRenewDelegationTokenReq) @@ -252,6 +238,8 @@ public boolean equals(Object that) { public boolean equals(TRenewDelegationTokenReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -276,19 +264,17 @@ public boolean equals(TRenewDelegationTokenReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_delegationToken = true && (isSetDelegationToken()); - list.add(present_delegationToken); - if (present_delegationToken) - list.add(delegationToken); + hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); + if (isSetDelegationToken()) + hashCode = hashCode * 8191 + delegationToken.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -299,7 +285,7 @@ public int compareTo(TRenewDelegationTokenReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -309,7 +295,7 @@ public int compareTo(TRenewDelegationTokenReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); if (lastComparison != 0) { return lastComparison; } @@ -322,21 +308,22 @@ public int compareTo(TRenewDelegationTokenReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRenewDelegationTokenReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenReq("); boolean first = true; sb.append("sessionHandle:"); @@ -382,7 +369,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -390,13 +377,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRenewDelegationTokenReqStandardSchemeFactory implements SchemeFactory { + private static class TRenewDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenewDelegationTokenReqStandardScheme getScheme() { return new TRenewDelegationTokenReqStandardScheme(); } } - private static class TRenewDelegationTokenReqStandardScheme extends StandardScheme { + private static class TRenewDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -454,24 +441,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTo } - private static class TRenewDelegationTokenReqTupleSchemeFactory implements SchemeFactory { + private static class TRenewDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenewDelegationTokenReqTupleScheme getScheme() { return new TRenewDelegationTokenReqTupleScheme(); } } - private static class TRenewDelegationTokenReqTupleScheme extends TupleScheme { + private static class TRenewDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.delegationToken); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); @@ -480,5 +467,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationToke } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java index 35af8a6c17f0..211e75153a0b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRenewDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRenewDelegationTokenRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenRespTupleSchemeFactory(); - private TStatus status; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { STATUS((short)1, "status"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenResp.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.status = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -156,7 +140,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TRenewDelegationTokenResp) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TRenewDelegationTokenResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -218,14 +205,13 @@ public boolean equals(TRenewDelegationTokenResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TRenewDelegationTokenResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TRenewDelegationTokenResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRenewDelegationTokenResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenResp("); boolean first = true; sb.append("status:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRenewDelegationTokenRespStandardSchemeFactory implements SchemeFactory { + private static class TRenewDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenewDelegationTokenRespStandardScheme getScheme() { return new TRenewDelegationTokenRespStandardScheme(); } } - private static class TRenewDelegationTokenRespStandardScheme extends StandardScheme { + private static class TRenewDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTo } - private static class TRenewDelegationTokenRespTupleSchemeFactory implements SchemeFactory { + private static class TRenewDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRenewDelegationTokenRespTupleScheme getScheme() { return new TRenewDelegationTokenRespTupleScheme(); } } - private static class TRenewDelegationTokenRespTupleScheme extends TupleScheme { + private static class TRenewDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java index 74518ac9f615..f34069538d4b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRowStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRowTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowTupleSchemeFactory(); - private List colVals; // required + private @org.apache.thrift.annotation.Nullable java.util.List colVals; // 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 { COL_VALS((short)1, "colVals"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // COL_VALS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,19 +73,19 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); } @@ -110,7 +93,7 @@ public TRow() { } public TRow( - List colVals) + java.util.List colVals) { this(); this.colVals = colVals; @@ -121,7 +104,7 @@ public TRow( */ public TRow(TRow other) { if (other.isSetColVals()) { - List __this__colVals = new ArrayList(other.colVals.size()); + java.util.List __this__colVals = new java.util.ArrayList(other.colVals.size()); for (TColumnValue other_element : other.colVals) { __this__colVals.add(new TColumnValue(other_element)); } @@ -142,22 +125,24 @@ public int getColValsSize() { return (this.colVals == null) ? 0 : this.colVals.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator getColValsIterator() { return (this.colVals == null) ? null : this.colVals.iterator(); } public void addToColVals(TColumnValue elem) { if (this.colVals == null) { - this.colVals = new ArrayList(); + this.colVals = new java.util.ArrayList(); } this.colVals.add(elem); } - public List getColVals() { + @org.apache.thrift.annotation.Nullable + public java.util.List getColVals() { return this.colVals; } - public void setColVals(List colVals) { + public void setColVals(@org.apache.thrift.annotation.Nullable java.util.List colVals) { this.colVals = colVals; } @@ -176,43 +161,44 @@ public void setColValsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case COL_VALS: if (value == null) { unsetColVals(); } else { - setColVals((List)value); + setColVals((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case COL_VALS: return getColVals(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case COL_VALS: return isSetColVals(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TRow) @@ -223,6 +209,8 @@ public boolean equals(Object that) { public boolean equals(TRow that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_colVals = true && this.isSetColVals(); boolean that_present_colVals = true && that.isSetColVals(); @@ -238,14 +226,13 @@ public boolean equals(TRow that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_colVals = true && (isSetColVals()); - list.add(present_colVals); - if (present_colVals) - list.add(colVals); + hashCode = hashCode * 8191 + ((isSetColVals()) ? 131071 : 524287); + if (isSetColVals()) + hashCode = hashCode * 8191 + colVals.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -256,7 +243,7 @@ public int compareTo(TRow other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); + lastComparison = java.lang.Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); if (lastComparison != 0) { return lastComparison; } @@ -269,21 +256,22 @@ public int compareTo(TRow other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRow("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRow("); boolean first = true; sb.append("colVals:"); @@ -314,7 +302,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -322,13 +310,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRowStandardSchemeFactory implements SchemeFactory { + private static class TRowStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowStandardScheme getScheme() { return new TRowStandardScheme(); } } - private static class TRowStandardScheme extends StandardScheme { + private static class TRowStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRow struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -344,8 +332,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRow struct) throws if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); - struct.colVals = new ArrayList(_list46.size); - TColumnValue _elem47; + struct.colVals = new java.util.ArrayList(_list46.size); + @org.apache.thrift.annotation.Nullable TColumnValue _elem47; for (int _i48 = 0; _i48 < _list46.size; ++_i48) { _elem47 = new TColumnValue(); @@ -390,17 +378,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRow struct) throw } - private static class TRowTupleSchemeFactory implements SchemeFactory { + private static class TRowTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowTupleScheme getScheme() { return new TRowTupleScheme(); } } - private static class TRowTupleScheme extends TupleScheme { + private static class TRowTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.colVals.size()); for (TColumnValue _iter50 : struct.colVals) @@ -412,11 +400,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.colVals = new ArrayList(_list51.size); - TColumnValue _elem52; + struct.colVals = new java.util.ArrayList(_list51.size); + @org.apache.thrift.annotation.Nullable TColumnValue _elem52; for (int _i53 = 0; _i53 < _list51.size; ++_i53) { _elem52 = new TColumnValue(); @@ -428,5 +416,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java index e9fc50bebbc6..678de927cdca 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java @@ -1,34 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1); @@ -37,16 +17,13 @@ private static final org.apache.thrift.protocol.TField BINARY_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumns", org.apache.thrift.protocol.TType.STRING, (short)4); private static final org.apache.thrift.protocol.TField COLUMN_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("columnCount", org.apache.thrift.protocol.TType.I32, (short)5); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRowSetStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRowSetTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowSetStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowSetTupleSchemeFactory(); private long startRowOffset; // required - private List rows; // required - private List columns; // optional - private ByteBuffer binaryColumns; // optional + private @org.apache.thrift.annotation.Nullable java.util.List rows; // required + private @org.apache.thrift.annotation.Nullable java.util.List columns; // optional + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns; // optional private int columnCount; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -57,10 +34,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { BINARY_COLUMNS((short)4, "binaryColumns"), COLUMN_COUNT((short)5, "columnCount"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -68,6 +45,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // START_ROW_OFFSET @@ -91,21 +69,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -114,7 +93,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -124,9 +103,9 @@ public String getFieldName() { private static final int __COLUMNCOUNT_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.BINARY_COLUMNS,_Fields.COLUMN_COUNT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -139,7 +118,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.COLUMN_COUNT, new org.apache.thrift.meta_data.FieldMetaData("columnCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); } @@ -148,7 +127,7 @@ public TRowSet() { public TRowSet( long startRowOffset, - List rows) + java.util.List rows) { this(); this.startRowOffset = startRowOffset; @@ -163,14 +142,14 @@ public TRowSet(TRowSet other) { __isset_bitfield = other.__isset_bitfield; this.startRowOffset = other.startRowOffset; if (other.isSetRows()) { - List __this__rows = new ArrayList(other.rows.size()); + java.util.List __this__rows = new java.util.ArrayList(other.rows.size()); for (TRow other_element : other.rows) { __this__rows.add(new TRow(other_element)); } this.rows = __this__rows; } if (other.isSetColumns()) { - List __this__columns = new ArrayList(other.columns.size()); + java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); for (TColumn other_element : other.columns) { __this__columns.add(new TColumn(other_element)); } @@ -207,38 +186,40 @@ public void setStartRowOffset(long startRowOffset) { } public void unsetStartRowOffset() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); } /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */ public boolean isSetStartRowOffset() { - return EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); } public void setStartRowOffsetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); } public int getRowsSize() { return (this.rows == null) ? 0 : this.rows.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator getRowsIterator() { return (this.rows == null) ? null : this.rows.iterator(); } public void addToRows(TRow elem) { if (this.rows == null) { - this.rows = new ArrayList(); + this.rows = new java.util.ArrayList(); } this.rows.add(elem); } - public List getRows() { + @org.apache.thrift.annotation.Nullable + public java.util.List getRows() { return this.rows; } - public void setRows(List rows) { + public void setRows(@org.apache.thrift.annotation.Nullable java.util.List rows) { this.rows = rows; } @@ -261,22 +242,24 @@ public int getColumnsSize() { return (this.columns == null) ? 0 : this.columns.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } public void addToColumns(TColumn elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new java.util.ArrayList(); } this.columns.add(elem); } - public List getColumns() { + @org.apache.thrift.annotation.Nullable + public java.util.List getColumns() { return this.columns; } - public void setColumns(List columns) { + public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { this.columns = columns; } @@ -300,15 +283,15 @@ public byte[] getBinaryColumns() { return binaryColumns == null ? null : binaryColumns.array(); } - public ByteBuffer bufferForBinaryColumns() { + public java.nio.ByteBuffer bufferForBinaryColumns() { return org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); } public void setBinaryColumns(byte[] binaryColumns) { - this.binaryColumns = binaryColumns == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(binaryColumns, binaryColumns.length)); + this.binaryColumns = binaryColumns == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(binaryColumns.clone()); } - public void setBinaryColumns(ByteBuffer binaryColumns) { + public void setBinaryColumns(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns) { this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); } @@ -337,25 +320,25 @@ public void setColumnCount(int columnCount) { } public void unsetColumnCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); } /** Returns true if field columnCount is set (has been assigned a value) and false otherwise */ public boolean isSetColumnCount() { - return EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); } public void setColumnCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case START_ROW_OFFSET: if (value == null) { unsetStartRowOffset(); } else { - setStartRowOffset((Long)value); + setStartRowOffset((java.lang.Long)value); } break; @@ -363,7 +346,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetRows(); } else { - setRows((List)value); + setRows((java.util.List)value); } break; @@ -371,7 +354,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((java.util.List)value); } break; @@ -379,7 +362,11 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetBinaryColumns(); } else { - setBinaryColumns((ByteBuffer)value); + if (value instanceof byte[]) { + setBinaryColumns((byte[])value); + } else { + setBinaryColumns((java.nio.ByteBuffer)value); + } } break; @@ -387,14 +374,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetColumnCount(); } else { - setColumnCount((Integer)value); + setColumnCount((java.lang.Integer)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case START_ROW_OFFSET: return getStartRowOffset(); @@ -412,13 +400,13 @@ public Object getFieldValue(_Fields field) { return getColumnCount(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -433,11 +421,11 @@ public boolean isSet(_Fields field) { case COLUMN_COUNT: return isSetColumnCount(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TRowSet) @@ -448,6 +436,8 @@ public boolean equals(Object that) { public boolean equals(TRowSet that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_startRowOffset = true; boolean that_present_startRowOffset = true; @@ -499,34 +489,27 @@ public boolean equals(TRowSet that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_startRowOffset = true; - list.add(present_startRowOffset); - if (present_startRowOffset) - list.add(startRowOffset); + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startRowOffset); - boolean present_rows = true && (isSetRows()); - list.add(present_rows); - if (present_rows) - list.add(rows); + hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); + if (isSetRows()) + hashCode = hashCode * 8191 + rows.hashCode(); - boolean present_columns = true && (isSetColumns()); - list.add(present_columns); - if (present_columns) - list.add(columns); + hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); + if (isSetColumns()) + hashCode = hashCode * 8191 + columns.hashCode(); - boolean present_binaryColumns = true && (isSetBinaryColumns()); - list.add(present_binaryColumns); - if (present_binaryColumns) - list.add(binaryColumns); + hashCode = hashCode * 8191 + ((isSetBinaryColumns()) ? 131071 : 524287); + if (isSetBinaryColumns()) + hashCode = hashCode * 8191 + binaryColumns.hashCode(); - boolean present_columnCount = true && (isSetColumnCount()); - list.add(present_columnCount); - if (present_columnCount) - list.add(columnCount); + hashCode = hashCode * 8191 + ((isSetColumnCount()) ? 131071 : 524287); + if (isSetColumnCount()) + hashCode = hashCode * 8191 + columnCount; - return list.hashCode(); + return hashCode; } @Override @@ -537,7 +520,7 @@ public int compareTo(TRowSet other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); + lastComparison = java.lang.Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); if (lastComparison != 0) { return lastComparison; } @@ -547,7 +530,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); if (lastComparison != 0) { return lastComparison; } @@ -557,7 +540,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } @@ -567,7 +550,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); + lastComparison = java.lang.Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); if (lastComparison != 0) { return lastComparison; } @@ -577,7 +560,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); + lastComparison = java.lang.Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); if (lastComparison != 0) { return lastComparison; } @@ -590,21 +573,22 @@ public int compareTo(TRowSet other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRowSet("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRowSet("); boolean first = true; sb.append("startRowOffset:"); @@ -669,7 +653,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -679,13 +663,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRowSetStandardSchemeFactory implements SchemeFactory { + private static class TRowSetStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowSetStandardScheme getScheme() { return new TRowSetStandardScheme(); } } - private static class TRowSetStandardScheme extends StandardScheme { + private static class TRowSetStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -709,8 +693,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); - struct.rows = new ArrayList(_list118.size); - TRow _elem119; + struct.rows = new java.util.ArrayList(_list118.size); + @org.apache.thrift.annotation.Nullable TRow _elem119; for (int _i120 = 0; _i120 < _list118.size; ++_i120) { _elem119 = new TRow(); @@ -728,8 +712,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); - struct.columns = new ArrayList(_list121.size); - TColumn _elem122; + struct.columns = new java.util.ArrayList(_list121.size); + @org.apache.thrift.annotation.Nullable TColumn _elem122; for (int _i123 = 0; _i123 < _list121.size; ++_i123) { _elem122 = new TColumn(); @@ -819,17 +803,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) th } - private static class TRowSetTupleSchemeFactory implements SchemeFactory { + private static class TRowSetTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TRowSetTupleScheme getScheme() { return new TRowSetTupleScheme(); } } - private static class TRowSetTupleScheme extends TupleScheme { + private static class TRowSetTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI64(struct.startRowOffset); { oprot.writeI32(struct.rows.size()); @@ -838,7 +822,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thr _iter126.write(oprot); } } - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetColumns()) { optionals.set(0); } @@ -868,13 +852,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thr @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.startRowOffset = iprot.readI64(); struct.setStartRowOffsetIsSet(true); { org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.rows = new ArrayList(_list128.size); - TRow _elem129; + struct.rows = new java.util.ArrayList(_list128.size); + @org.apache.thrift.annotation.Nullable TRow _elem129; for (int _i130 = 0; _i130 < _list128.size; ++_i130) { _elem129 = new TRow(); @@ -883,12 +867,12 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thro } } struct.setRowsIsSet(true); - BitSet incoming = iprot.readBitSet(3); + java.util.BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list131.size); - TColumn _elem132; + struct.columns = new java.util.ArrayList(_list131.size); + @org.apache.thrift.annotation.Nullable TColumn _elem132; for (int _i133 = 0; _i133 < _list131.size; ++_i133) { _elem132 = new TColumn(); @@ -909,5 +893,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thro } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java index ec092b46dcfd..d89251455777 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionHandle"); private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TSessionHandleStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TSessionHandleTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSessionHandleStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSessionHandleTupleSchemeFactory(); - private THandleIdentifier sessionId; // required + private @org.apache.thrift.annotation.Nullable THandleIdentifier sessionId; // 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_ID((short)1, "sessionId"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_ID @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionHandle.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.sessionId = null; } + @org.apache.thrift.annotation.Nullable public THandleIdentifier getSessionId() { return this.sessionId; } - public void setSessionId(THandleIdentifier sessionId) { + public void setSessionId(@org.apache.thrift.annotation.Nullable THandleIdentifier sessionId) { this.sessionId = sessionId; } @@ -156,7 +140,7 @@ public void setSessionIdIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_ID: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_ID: return getSessionId(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case SESSION_ID: return isSetSessionId(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TSessionHandle) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TSessionHandle that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionId = true && this.isSetSessionId(); boolean that_present_sessionId = true && that.isSetSessionId(); @@ -218,14 +205,13 @@ public boolean equals(TSessionHandle that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionId = true && (isSetSessionId()); - list.add(present_sessionId); - if (present_sessionId) - list.add(sessionId); + hashCode = hashCode * 8191 + ((isSetSessionId()) ? 131071 : 524287); + if (isSetSessionId()) + hashCode = hashCode * 8191 + sessionId.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TSessionHandle other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TSessionHandle other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TSessionHandle("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TSessionHandle("); boolean first = true; sb.append("sessionId:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TSessionHandleStandardSchemeFactory implements SchemeFactory { + private static class TSessionHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSessionHandleStandardScheme getScheme() { return new TSessionHandleStandardScheme(); } } - private static class TSessionHandleStandardScheme extends StandardScheme { + private static class TSessionHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionHandle struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSessionHandle str } - private static class TSessionHandleTupleSchemeFactory implements SchemeFactory { + private static class TSessionHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSessionHandleTupleScheme getScheme() { return new TSessionHandleTupleScheme(); } } - private static class TSessionHandleTupleScheme extends TupleScheme { + private static class TSessionHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionId.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionId = new THandleIdentifier(); struct.sessionId.read(iprot); struct.setSessionIdIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java index 665e6dfe5ab8..7b7b3a14665e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java @@ -1,54 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TSetClientInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TSetClientInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoReq"); 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 CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TSetClientInfoReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TSetClientInfoReqTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoReqTupleSchemeFactory(); - private TSessionHandle sessionHandle; // required - private Map configuration; // optional + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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 { SESSION_HANDLE((short)1, "sessionHandle"), CONFIGURATION((short)2, "configuration"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -56,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -73,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -96,23 +78,23 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CONFIGURATION}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoReq.class, metaDataMap); } @@ -134,7 +116,7 @@ public TSetClientInfoReq(TSetClientInfoReq other) { this.sessionHandle = new TSessionHandle(other.sessionHandle); } if (other.isSetConfiguration()) { - Map __this__configuration = new HashMap(other.configuration); + java.util.Map __this__configuration = new java.util.HashMap(other.configuration); this.configuration = __this__configuration; } } @@ -149,11 +131,12 @@ public void clear() { this.configuration = null; } + @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(TSessionHandle sessionHandle) { + public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -176,18 +159,19 @@ public int getConfigurationSize() { return (this.configuration == null) ? 0 : this.configuration.size(); } - public void putToConfiguration(String key, String val) { + public void putToConfiguration(java.lang.String key, java.lang.String val) { if (this.configuration == null) { - this.configuration = new HashMap(); + this.configuration = new java.util.HashMap(); } this.configuration.put(key, val); } - public Map getConfiguration() { + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfiguration() { return this.configuration; } - public void setConfiguration(Map configuration) { + public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { this.configuration = configuration; } @@ -206,7 +190,7 @@ public void setConfigurationIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -220,14 +204,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetConfiguration(); } else { - setConfiguration((Map)value); + setConfiguration((java.util.Map)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -236,13 +221,13 @@ public Object getFieldValue(_Fields field) { return getConfiguration(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -251,11 +236,11 @@ public boolean isSet(_Fields field) { case CONFIGURATION: return isSetConfiguration(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TSetClientInfoReq) @@ -266,6 +251,8 @@ public boolean equals(Object that) { public boolean equals(TSetClientInfoReq that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -290,19 +277,17 @@ public boolean equals(TSetClientInfoReq that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); - boolean present_configuration = true && (isSetConfiguration()); - list.add(present_configuration); - if (present_configuration) - list.add(configuration); + hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); + if (isSetConfiguration()) + hashCode = hashCode * 8191 + configuration.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -313,7 +298,7 @@ public int compareTo(TSetClientInfoReq other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -323,7 +308,7 @@ public int compareTo(TSetClientInfoReq other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); if (lastComparison != 0) { return lastComparison; } @@ -336,21 +321,22 @@ public int compareTo(TSetClientInfoReq other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TSetClientInfoReq("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoReq("); boolean first = true; sb.append("sessionHandle:"); @@ -394,7 +380,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -402,13 +388,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TSetClientInfoReqStandardSchemeFactory implements SchemeFactory { + private static class TSetClientInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSetClientInfoReqStandardScheme getScheme() { return new TSetClientInfoReqStandardScheme(); } } - private static class TSetClientInfoReqStandardScheme extends StandardScheme { + private static class TSetClientInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -433,9 +419,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoReq s if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map162.size); - String _key163; - String _val164; + struct.configuration = new java.util.HashMap(2*_map162.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key163; + @org.apache.thrift.annotation.Nullable java.lang.String _val164; for (int _i165 = 0; _i165 < _map162.size; ++_i165) { _key163 = iprot.readString(); @@ -472,7 +458,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSetClientInfoReq oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter166 : struct.configuration.entrySet()) + for (java.util.Map.Entry _iter166 : struct.configuration.entrySet()) { oprot.writeString(_iter166.getKey()); oprot.writeString(_iter166.getValue()); @@ -488,19 +474,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSetClientInfoReq } - private static class TSetClientInfoReqTupleSchemeFactory implements SchemeFactory { + private static class TSetClientInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSetClientInfoReqTupleScheme getScheme() { return new TSetClientInfoReqTupleScheme(); } } - private static class TSetClientInfoReqTupleScheme extends TupleScheme { + private static class TSetClientInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetConfiguration()) { optionals.set(0); } @@ -508,7 +494,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq s if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter167 : struct.configuration.entrySet()) + for (java.util.Map.Entry _iter167 : struct.configuration.entrySet()) { oprot.writeString(_iter167.getKey()); oprot.writeString(_iter167.getValue()); @@ -519,17 +505,17 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq s @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(1); + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map168.size); - String _key169; - String _val170; + struct.configuration = new java.util.HashMap(2*_map168.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key169; + @org.apache.thrift.annotation.Nullable java.lang.String _val170; for (int _i171 = 0; _i171 < _map168.size; ++_i171) { _key169 = iprot.readString(); @@ -542,5 +528,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq st } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java index 633a4be94a30..fc1546c69153 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TSetClientInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TSetClientInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoResp"); 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TSetClientInfoRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TSetClientInfoRespTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoRespTupleSchemeFactory(); - private TStatus status; // required + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { STATUS((short)1, "status"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoResp.class, metaDataMap); } @@ -133,11 +116,12 @@ public void clear() { this.status = null; } + @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(TStatus status) { + public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { this.status = status; } @@ -156,7 +140,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS: if (value == null) { @@ -169,30 +153,31 @@ public void setFieldValue(_Fields field, Object value) { } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TSetClientInfoResp) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TSetClientInfoResp that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -218,14 +205,13 @@ public boolean equals(TSetClientInfoResp that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TSetClientInfoResp other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TSetClientInfoResp other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TSetClientInfoResp("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoResp("); boolean first = true; sb.append("status:"); @@ -297,7 +284,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -305,13 +292,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TSetClientInfoRespStandardSchemeFactory implements SchemeFactory { + private static class TSetClientInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSetClientInfoRespStandardScheme getScheme() { return new TSetClientInfoRespStandardScheme(); } } - private static class TSetClientInfoRespStandardScheme extends StandardScheme { + private static class TSetClientInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -356,28 +343,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSetClientInfoResp } - private static class TSetClientInfoRespTupleSchemeFactory implements SchemeFactory { + private static class TSetClientInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TSetClientInfoRespTupleScheme getScheme() { return new TSetClientInfoRespTupleScheme(); } } - private static class TSetClientInfoRespTupleScheme extends TupleScheme { + private static class TSetClientInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java index 70d6ab1321a4..36cfddc24861 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java @@ -1,32 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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.EncodingUtils; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus"); private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1); @@ -35,17 +17,14 @@ private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStatusStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStatusTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStatusStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStatusTupleSchemeFactory(); - private TStatusCode statusCode; // required - private List infoMessages; // optional - private String sqlState; // optional + private @org.apache.thrift.annotation.Nullable TStatusCode statusCode; // required + private @org.apache.thrift.annotation.Nullable java.util.List infoMessages; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional private int errorCode; // optional - private String errorMessage; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // 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 { @@ -59,10 +38,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ERROR_CODE((short)4, "errorCode"), ERROR_MESSAGE((short)5, "errorMessage"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -70,6 +49,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS_CODE @@ -93,21 +73,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -116,7 +97,7 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } @@ -125,9 +106,9 @@ public String getFieldName() { private static final int __ERRORCODE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class))); tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -139,7 +120,7 @@ public String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap); } @@ -162,7 +143,7 @@ public TStatus(TStatus other) { this.statusCode = other.statusCode; } if (other.isSetInfoMessages()) { - List __this__infoMessages = new ArrayList(other.infoMessages); + java.util.List __this__infoMessages = new java.util.ArrayList(other.infoMessages); this.infoMessages = __this__infoMessages; } if (other.isSetSqlState()) { @@ -192,6 +173,7 @@ public void clear() { * * @see TStatusCode */ + @org.apache.thrift.annotation.Nullable public TStatusCode getStatusCode() { return this.statusCode; } @@ -200,7 +182,7 @@ public TStatusCode getStatusCode() { * * @see TStatusCode */ - public void setStatusCode(TStatusCode statusCode) { + public void setStatusCode(@org.apache.thrift.annotation.Nullable TStatusCode statusCode) { this.statusCode = statusCode; } @@ -223,22 +205,24 @@ public int getInfoMessagesSize() { return (this.infoMessages == null) ? 0 : this.infoMessages.size(); } - public java.util.Iterator getInfoMessagesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getInfoMessagesIterator() { return (this.infoMessages == null) ? null : this.infoMessages.iterator(); } - public void addToInfoMessages(String elem) { + public void addToInfoMessages(java.lang.String elem) { if (this.infoMessages == null) { - this.infoMessages = new ArrayList(); + this.infoMessages = new java.util.ArrayList(); } this.infoMessages.add(elem); } - public List getInfoMessages() { + @org.apache.thrift.annotation.Nullable + public java.util.List getInfoMessages() { return this.infoMessages; } - public void setInfoMessages(List infoMessages) { + public void setInfoMessages(@org.apache.thrift.annotation.Nullable java.util.List infoMessages) { this.infoMessages = infoMessages; } @@ -257,11 +241,12 @@ public void setInfoMessagesIsSet(boolean value) { } } - public String getSqlState() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getSqlState() { return this.sqlState; } - public void setSqlState(String sqlState) { + public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { this.sqlState = sqlState; } @@ -290,23 +275,24 @@ public void setErrorCode(int errorCode) { } public void unsetErrorCode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ public boolean isSetErrorCode() { - return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); } - public String getErrorMessage() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getErrorMessage() { return this.errorMessage; } - public void setErrorMessage(String errorMessage) { + public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { this.errorMessage = errorMessage; } @@ -325,7 +311,7 @@ public void setErrorMessageIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case STATUS_CODE: if (value == null) { @@ -339,7 +325,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetInfoMessages(); } else { - setInfoMessages((List)value); + setInfoMessages((java.util.List)value); } break; @@ -347,7 +333,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetSqlState(); } else { - setSqlState((String)value); + setSqlState((java.lang.String)value); } break; @@ -355,7 +341,7 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetErrorCode(); } else { - setErrorCode((Integer)value); + setErrorCode((java.lang.Integer)value); } break; @@ -363,14 +349,15 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetErrorMessage(); } else { - setErrorMessage((String)value); + setErrorMessage((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case STATUS_CODE: return getStatusCode(); @@ -388,13 +375,13 @@ public Object getFieldValue(_Fields field) { return getErrorMessage(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -409,11 +396,11 @@ public boolean isSet(_Fields field) { case ERROR_MESSAGE: return isSetErrorMessage(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TStatus) @@ -424,6 +411,8 @@ public boolean equals(Object that) { public boolean equals(TStatus that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_statusCode = true && this.isSetStatusCode(); boolean that_present_statusCode = true && that.isSetStatusCode(); @@ -475,34 +464,29 @@ public boolean equals(TStatus that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_statusCode = true && (isSetStatusCode()); - list.add(present_statusCode); - if (present_statusCode) - list.add(statusCode.getValue()); + hashCode = hashCode * 8191 + ((isSetStatusCode()) ? 131071 : 524287); + if (isSetStatusCode()) + hashCode = hashCode * 8191 + statusCode.getValue(); - boolean present_infoMessages = true && (isSetInfoMessages()); - list.add(present_infoMessages); - if (present_infoMessages) - list.add(infoMessages); + hashCode = hashCode * 8191 + ((isSetInfoMessages()) ? 131071 : 524287); + if (isSetInfoMessages()) + hashCode = hashCode * 8191 + infoMessages.hashCode(); - boolean present_sqlState = true && (isSetSqlState()); - list.add(present_sqlState); - if (present_sqlState) - list.add(sqlState); + hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); + if (isSetSqlState()) + hashCode = hashCode * 8191 + sqlState.hashCode(); - boolean present_errorCode = true && (isSetErrorCode()); - list.add(present_errorCode); - if (present_errorCode) - list.add(errorCode); + hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); + if (isSetErrorCode()) + hashCode = hashCode * 8191 + errorCode; - boolean present_errorMessage = true && (isSetErrorMessage()); - list.add(present_errorMessage); - if (present_errorMessage) - list.add(errorMessage); + hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); + if (isSetErrorMessage()) + hashCode = hashCode * 8191 + errorMessage.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -513,7 +497,7 @@ public int compareTo(TStatus other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); + lastComparison = java.lang.Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); if (lastComparison != 0) { return lastComparison; } @@ -523,7 +507,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); + lastComparison = java.lang.Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); if (lastComparison != 0) { return lastComparison; } @@ -533,7 +517,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); if (lastComparison != 0) { return lastComparison; } @@ -543,7 +527,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); if (lastComparison != 0) { return lastComparison; } @@ -553,7 +537,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); if (lastComparison != 0) { return lastComparison; } @@ -566,21 +550,22 @@ public int compareTo(TStatus other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStatus("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStatus("); boolean first = true; sb.append("statusCode:"); @@ -647,7 +632,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -657,13 +642,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStatusStandardSchemeFactory implements SchemeFactory { + private static class TStatusStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStatusStandardScheme getScheme() { return new TStatusStandardScheme(); } } - private static class TStatusStandardScheme extends StandardScheme { + private static class TStatusStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -677,7 +662,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) thr switch (schemeField.id) { case 1: // STATUS_CODE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.statusCode = TStatusCode.findByValue(iprot.readI32()); + struct.statusCode = org.apache.spark.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32()); struct.setStatusCodeIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); @@ -687,8 +672,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); - struct.infoMessages = new ArrayList(_list134.size); - String _elem135; + struct.infoMessages = new java.util.ArrayList(_list134.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem135; for (int _i136 = 0; _i136 < _list134.size; ++_i136) { _elem135 = iprot.readString(); @@ -748,7 +733,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) th oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); - for (String _iter137 : struct.infoMessages) + for (java.lang.String _iter137 : struct.infoMessages) { oprot.writeString(_iter137); } @@ -782,19 +767,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) th } - private static class TStatusTupleSchemeFactory implements SchemeFactory { + private static class TStatusTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStatusTupleScheme getScheme() { return new TStatusTupleScheme(); } } - private static class TStatusTupleScheme extends TupleScheme { + private static class TStatusTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeI32(struct.statusCode.getValue()); - BitSet optionals = new BitSet(); + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetInfoMessages()) { optionals.set(0); } @@ -811,7 +796,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thr if (struct.isSetInfoMessages()) { { oprot.writeI32(struct.infoMessages.size()); - for (String _iter138 : struct.infoMessages) + for (java.lang.String _iter138 : struct.infoMessages) { oprot.writeString(_iter138); } @@ -830,15 +815,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thr @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.statusCode = TStatusCode.findByValue(iprot.readI32()); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.statusCode = org.apache.spark.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32()); struct.setStatusCodeIsSet(true); - BitSet incoming = iprot.readBitSet(4); + java.util.BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.infoMessages = new ArrayList(_list139.size); - String _elem140; + struct.infoMessages = new java.util.ArrayList(_list139.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem140; for (int _i141 = 0; _i141 < _list139.size; ++_i141) { _elem140 = iprot.readString(); @@ -862,5 +847,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thro } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java index 02f1fa19a55b..ea075d05cb37 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TStatusCode implements org.apache.thrift.TEnum { SUCCESS_STATUS(0), SUCCESS_WITH_INFO_STATUS(1), @@ -31,6 +32,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TStatusCode findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java index 162a94cc7698..3a37e1a9da13 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java @@ -1,55 +1,34 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStringColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStringColumnTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringColumnTupleSchemeFactory(); - private List values; // required - private ByteBuffer nulls; // required + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -57,6 +36,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -74,21 +54,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,21 +78,21 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap); } @@ -119,8 +100,8 @@ public TStringColumn() { } public TStringColumn( - List values, - ByteBuffer nulls) + java.util.List values, + java.nio.ByteBuffer nulls) { this(); this.values = values; @@ -132,7 +113,7 @@ public TStringColumn( */ public TStringColumn(TStringColumn other) { if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); + java.util.List __this__values = new java.util.ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -154,22 +135,24 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - public java.util.Iterator getValuesIterator() { + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } - public void addToValues(String elem) { + public void addToValues(java.lang.String elem) { if (this.values == null) { - this.values = new ArrayList(); + this.values = new java.util.ArrayList(); } this.values.add(elem); } - public List getValues() { + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { return this.values; } - public void setValues(List values) { + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { this.values = values; } @@ -193,15 +176,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public ByteBuffer bufferForNulls() { + public java.nio.ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); } - public void setNulls(ByteBuffer nulls) { + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -220,13 +203,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((List)value); + setValues((java.util.List)value); } break; @@ -234,14 +217,19 @@ public void setFieldValue(_Fields field, Object value) { if (value == null) { unsetNulls(); } else { - setNulls((ByteBuffer)value); + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -250,13 +238,13 @@ public Object getFieldValue(_Fields field) { return getNulls(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { @@ -265,11 +253,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TStringColumn) @@ -280,6 +268,8 @@ public boolean equals(Object that) { public boolean equals(TStringColumn that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -304,19 +294,17 @@ public boolean equals(TStringColumn that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -327,7 +315,7 @@ public int compareTo(TStringColumn other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -337,7 +325,7 @@ public int compareTo(TStringColumn other) { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -350,21 +338,22 @@ public int compareTo(TStringColumn other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStringColumn("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringColumn("); boolean first = true; sb.append("values:"); @@ -407,7 +396,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -415,13 +404,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStringColumnStandardSchemeFactory implements SchemeFactory { + private static class TStringColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringColumnStandardScheme getScheme() { return new TStringColumnStandardScheme(); } } - private static class TStringColumnStandardScheme extends StandardScheme { + private static class TStringColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -437,8 +426,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); - struct.values = new ArrayList(_list102.size); - String _elem103; + struct.values = new java.util.ArrayList(_list102.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem103; for (int _i104 = 0; _i104 < _list102.size; ++_i104) { _elem103 = iprot.readString(); @@ -476,7 +465,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringColumn stru oprot.writeFieldBegin(VALUES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (String _iter105 : struct.values) + for (java.lang.String _iter105 : struct.values) { oprot.writeString(_iter105); } @@ -495,20 +484,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringColumn stru } - private static class TStringColumnTupleSchemeFactory implements SchemeFactory { + private static class TStringColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringColumnTupleScheme getScheme() { return new TStringColumnTupleScheme(); } } - private static class TStringColumnTupleScheme extends TupleScheme { + private static class TStringColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); - for (String _iter106 : struct.values) + for (java.lang.String _iter106 : struct.values) { oprot.writeString(_iter106); } @@ -518,11 +507,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new ArrayList(_list107.size); - String _elem108; + struct.values = new java.util.ArrayList(_list107.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem108; for (int _i109 = 0; _i109 < _list107.size; ++_i109) { _elem108 = iprot.readString(); @@ -535,5 +524,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java index 69ac17f9884b..f45b06239bcb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java @@ -1,51 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStringValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStringValueTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringValueTupleSchemeFactory(); - private String value; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String value; // 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 { VALUE((short)1, "value"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -53,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -68,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -91,19 +73,19 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); } @@ -128,11 +110,12 @@ public void clear() { this.value = null; } - public String getValue() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getValue() { return this.value; } - public void setValue(String value) { + public void setValue(@org.apache.thrift.annotation.Nullable java.lang.String value) { this.value = value; } @@ -151,43 +134,44 @@ public void setValueIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((String)value); + setValue((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TStringValue) @@ -198,6 +182,8 @@ public boolean equals(Object that) { public boolean equals(TStringValue that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -213,14 +199,13 @@ public boolean equals(TStringValue that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -231,7 +216,7 @@ public int compareTo(TStringValue other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -244,21 +229,22 @@ public int compareTo(TStringValue other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStringValue("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringValue("); boolean first = true; if (isSetValue()) { @@ -287,7 +273,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -295,13 +281,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStringValueStandardSchemeFactory implements SchemeFactory { + private static class TStringValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringValueStandardScheme getScheme() { return new TStringValueStandardScheme(); } } - private static class TStringValueStandardScheme extends StandardScheme { + private static class TStringValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -347,18 +333,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringValue struc } - private static class TStringValueTupleSchemeFactory implements SchemeFactory { + private static class TStringValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStringValueTupleScheme getScheme() { return new TStringValueTupleScheme(); } } - private static class TStringValueTupleScheme extends TupleScheme { + private static class TStringValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -370,8 +356,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readString(); struct.setValueIsSet(true); @@ -379,5 +365,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java index 64fc9a1cf508..2bd39df87ed9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStructTypeEntry"); private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStructTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStructTypeEntryTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStructTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStructTypeEntryTupleSchemeFactory(); - private Map nameToTypePtr; // required + private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // 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 { NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // NAME_TO_TYPE_PTR @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,20 +73,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStructTypeEntry.class, metaDataMap); } @@ -111,7 +94,7 @@ public TStructTypeEntry() { } public TStructTypeEntry( - Map nameToTypePtr) + java.util.Map nameToTypePtr) { this(); this.nameToTypePtr = nameToTypePtr; @@ -122,15 +105,15 @@ public TStructTypeEntry( */ public TStructTypeEntry(TStructTypeEntry other) { if (other.isSetNameToTypePtr()) { - Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); - for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { + java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); + for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { - String other_element_key = other_element.getKey(); - Integer other_element_value = other_element.getValue(); + java.lang.String other_element_key = other_element.getKey(); + java.lang.Integer other_element_value = other_element.getValue(); - String __this__nameToTypePtr_copy_key = other_element_key; + java.lang.String __this__nameToTypePtr_copy_key = other_element_key; - Integer __this__nameToTypePtr_copy_value = other_element_value; + java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); } @@ -151,18 +134,19 @@ public int getNameToTypePtrSize() { return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); } - public void putToNameToTypePtr(String key, int val) { + public void putToNameToTypePtr(java.lang.String key, int val) { if (this.nameToTypePtr == null) { - this.nameToTypePtr = new HashMap(); + this.nameToTypePtr = new java.util.HashMap(); } this.nameToTypePtr.put(key, val); } - public Map getNameToTypePtr() { + @org.apache.thrift.annotation.Nullable + public java.util.Map getNameToTypePtr() { return this.nameToTypePtr; } - public void setNameToTypePtr(Map nameToTypePtr) { + public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { this.nameToTypePtr = nameToTypePtr; } @@ -181,43 +165,44 @@ public void setNameToTypePtrIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NAME_TO_TYPE_PTR: if (value == null) { unsetNameToTypePtr(); } else { - setNameToTypePtr((Map)value); + setNameToTypePtr((java.util.Map)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME_TO_TYPE_PTR: return getNameToTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case NAME_TO_TYPE_PTR: return isSetNameToTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TStructTypeEntry) @@ -228,6 +213,8 @@ public boolean equals(Object that) { public boolean equals(TStructTypeEntry that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); @@ -243,14 +230,13 @@ public boolean equals(TStructTypeEntry that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); - list.add(present_nameToTypePtr); - if (present_nameToTypePtr) - list.add(nameToTypePtr); + hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); + if (isSetNameToTypePtr()) + hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -261,7 +247,7 @@ public int compareTo(TStructTypeEntry other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -274,21 +260,22 @@ public int compareTo(TStructTypeEntry other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStructTypeEntry("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStructTypeEntry("); boolean first = true; sb.append("nameToTypePtr:"); @@ -319,7 +306,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -327,13 +314,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStructTypeEntryStandardSchemeFactory implements SchemeFactory { + private static class TStructTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStructTypeEntryStandardScheme getScheme() { return new TStructTypeEntryStandardScheme(); } } - private static class TStructTypeEntryStandardScheme extends StandardScheme { + private static class TStructTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -349,8 +336,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry st if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin(); - struct.nameToTypePtr = new HashMap(2*_map10.size); - String _key11; + struct.nameToTypePtr = new java.util.HashMap(2*_map10.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key11; int _val12; for (int _i13 = 0; _i13 < _map10.size; ++_i13) { @@ -382,7 +369,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStructTypeEntry s oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) + for (java.util.Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter14.getKey()); oprot.writeI32(_iter14.getValue()); @@ -397,20 +384,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStructTypeEntry s } - private static class TStructTypeEntryTupleSchemeFactory implements SchemeFactory { + private static class TStructTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TStructTypeEntryTupleScheme getScheme() { return new TStructTypeEntryTupleScheme(); } } - private static class TStructTypeEntryTupleScheme extends TupleScheme { + private static class TStructTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.nameToTypePtr.size()); - for (Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) + for (java.util.Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter15.getKey()); oprot.writeI32(_iter15.getValue()); @@ -420,11 +407,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new HashMap(2*_map16.size); - String _key17; + struct.nameToTypePtr = new java.util.HashMap(2*_map16.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key17; int _val18; for (int _i19 = 0; _i19 < _map16.size; ++_i19) { @@ -437,5 +424,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry str } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java index ed6c508141e7..e64d4f6119ac 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableSchema"); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTableSchemaStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTableSchemaTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableSchemaStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableSchemaTupleSchemeFactory(); - private List columns; // required + private @org.apache.thrift.annotation.Nullable java.util.List columns; // 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 { COLUMNS((short)1, "columns"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // COLUMNS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,19 +73,19 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnDesc.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableSchema.class, metaDataMap); } @@ -110,7 +93,7 @@ public TTableSchema() { } public TTableSchema( - List columns) + java.util.List columns) { this(); this.columns = columns; @@ -121,7 +104,7 @@ public TTableSchema( */ public TTableSchema(TTableSchema other) { if (other.isSetColumns()) { - List __this__columns = new ArrayList(other.columns.size()); + java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); for (TColumnDesc other_element : other.columns) { __this__columns.add(new TColumnDesc(other_element)); } @@ -142,22 +125,24 @@ public int getColumnsSize() { return (this.columns == null) ? 0 : this.columns.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } public void addToColumns(TColumnDesc elem) { if (this.columns == null) { - this.columns = new ArrayList(); + this.columns = new java.util.ArrayList(); } this.columns.add(elem); } - public List getColumns() { + @org.apache.thrift.annotation.Nullable + public java.util.List getColumns() { return this.columns; } - public void setColumns(List columns) { + public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { this.columns = columns; } @@ -176,43 +161,44 @@ public void setColumnsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case COLUMNS: if (value == null) { unsetColumns(); } else { - setColumns((List)value); + setColumns((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case COLUMNS: return getColumns(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case COLUMNS: return isSetColumns(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TTableSchema) @@ -223,6 +209,8 @@ public boolean equals(Object that) { public boolean equals(TTableSchema that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_columns = true && this.isSetColumns(); boolean that_present_columns = true && that.isSetColumns(); @@ -238,14 +226,13 @@ public boolean equals(TTableSchema that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_columns = true && (isSetColumns()); - list.add(present_columns); - if (present_columns) - list.add(columns); + hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); + if (isSetColumns()) + hashCode = hashCode * 8191 + columns.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -256,7 +243,7 @@ public int compareTo(TTableSchema other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } @@ -269,21 +256,22 @@ public int compareTo(TTableSchema other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTableSchema("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TTableSchema("); boolean first = true; sb.append("columns:"); @@ -314,7 +302,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -322,13 +310,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TTableSchemaStandardSchemeFactory implements SchemeFactory { + private static class TTableSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableSchemaStandardScheme getScheme() { return new TTableSchemaStandardScheme(); } } - private static class TTableSchemaStandardScheme extends StandardScheme { + private static class TTableSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -344,8 +332,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema struct if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); - struct.columns = new ArrayList(_list38.size); - TColumnDesc _elem39; + struct.columns = new java.util.ArrayList(_list38.size); + @org.apache.thrift.annotation.Nullable TColumnDesc _elem39; for (int _i40 = 0; _i40 < _list38.size; ++_i40) { _elem39 = new TColumnDesc(); @@ -390,17 +378,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTableSchema struc } - private static class TTableSchemaTupleSchemeFactory implements SchemeFactory { + private static class TTableSchemaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTableSchemaTupleScheme getScheme() { return new TTableSchemaTupleScheme(); } } - private static class TTableSchemaTupleScheme extends TupleScheme { + private static class TTableSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.columns.size()); for (TColumnDesc _iter42 : struct.columns) @@ -412,11 +400,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list43.size); - TColumnDesc _elem44; + struct.columns = new java.util.ArrayList(_list43.size); + @org.apache.thrift.annotation.Nullable TColumnDesc _elem44; for (int _i45 = 0; _i45 < _list43.size; ++_i45) { _elem44 = new TColumnDesc(); @@ -428,5 +416,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java index 376bca420e78..484b76e60e1e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeDesc"); private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTypeDescStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTypeDescTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeDescStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeDescTupleSchemeFactory(); - private List types; // required + private @org.apache.thrift.annotation.Nullable java.util.List types; // 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 { TYPES((short)1, "types"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TYPES @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,19 +73,19 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeEntry.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeDesc.class, metaDataMap); } @@ -110,7 +93,7 @@ public TTypeDesc() { } public TTypeDesc( - List types) + java.util.List types) { this(); this.types = types; @@ -121,7 +104,7 @@ public TTypeDesc( */ public TTypeDesc(TTypeDesc other) { if (other.isSetTypes()) { - List __this__types = new ArrayList(other.types.size()); + java.util.List __this__types = new java.util.ArrayList(other.types.size()); for (TTypeEntry other_element : other.types) { __this__types.add(new TTypeEntry(other_element)); } @@ -142,22 +125,24 @@ public int getTypesSize() { return (this.types == null) ? 0 : this.types.size(); } + @org.apache.thrift.annotation.Nullable public java.util.Iterator getTypesIterator() { return (this.types == null) ? null : this.types.iterator(); } public void addToTypes(TTypeEntry elem) { if (this.types == null) { - this.types = new ArrayList(); + this.types = new java.util.ArrayList(); } this.types.add(elem); } - public List getTypes() { + @org.apache.thrift.annotation.Nullable + public java.util.List getTypes() { return this.types; } - public void setTypes(List types) { + public void setTypes(@org.apache.thrift.annotation.Nullable java.util.List types) { this.types = types; } @@ -176,43 +161,44 @@ public void setTypesIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TYPES: if (value == null) { unsetTypes(); } else { - setTypes((List)value); + setTypes((java.util.List)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPES: return getTypes(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case TYPES: return isSetTypes(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TTypeDesc) @@ -223,6 +209,8 @@ public boolean equals(Object that) { public boolean equals(TTypeDesc that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_types = true && this.isSetTypes(); boolean that_present_types = true && that.isSetTypes(); @@ -238,14 +226,13 @@ public boolean equals(TTypeDesc that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_types = true && (isSetTypes()); - list.add(present_types); - if (present_types) - list.add(types); + hashCode = hashCode * 8191 + ((isSetTypes()) ? 131071 : 524287); + if (isSetTypes()) + hashCode = hashCode * 8191 + types.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -256,7 +243,7 @@ public int compareTo(TTypeDesc other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); + lastComparison = java.lang.Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); if (lastComparison != 0) { return lastComparison; } @@ -269,21 +256,22 @@ public int compareTo(TTypeDesc other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTypeDesc("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeDesc("); boolean first = true; sb.append("types:"); @@ -314,7 +302,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -322,13 +310,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TTypeDescStandardSchemeFactory implements SchemeFactory { + private static class TTypeDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTypeDescStandardScheme getScheme() { return new TTypeDescStandardScheme(); } } - private static class TTypeDescStandardScheme extends StandardScheme { + private static class TTypeDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -344,8 +332,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc struct) t if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); - struct.types = new ArrayList(_list30.size); - TTypeEntry _elem31; + struct.types = new java.util.ArrayList(_list30.size); + @org.apache.thrift.annotation.Nullable TTypeEntry _elem31; for (int _i32 = 0; _i32 < _list30.size; ++_i32) { _elem31 = new TTypeEntry(); @@ -390,17 +378,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeDesc struct) } - private static class TTypeDescTupleSchemeFactory implements SchemeFactory { + private static class TTypeDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTypeDescTupleScheme getScheme() { return new TTypeDescTupleScheme(); } } - private static class TTypeDescTupleScheme extends TupleScheme { + private static class TTypeDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.types.size()); for (TTypeEntry _iter34 : struct.types) @@ -412,11 +400,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.types = new ArrayList(_list35.size); - TTypeEntry _elem36; + struct.types = new java.util.ArrayList(_list35.size); + @org.apache.thrift.annotation.Nullable TTypeEntry _elem36; for (int _i37 = 0; _i37 < _list35.size; ++_i37) { _elem36 = new TTypeEntry(); @@ -428,5 +416,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) th } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java index d856f68c6a50..9d57e8a3396b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java @@ -1,23 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -import org.apache.thrift.protocol.TProtocolException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeEntry extends org.apache.thrift.TUnion { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TTypeEntry extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry"); private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField ARRAY_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("arrayEntry", org.apache.thrift.protocol.TType.STRUCT, (short)2); @@ -35,10 +26,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { UNION_ENTRY((short)5, "unionEntry"), USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -46,6 +37,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PRIMITIVE_ENTRY @@ -71,21 +63,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -94,27 +87,27 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class))); - tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class))); - tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class))); - tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class))); - tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class))); - tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap); } @@ -122,7 +115,7 @@ public TTypeEntry() { super(); } - public TTypeEntry(_Fields setField, Object value) { + public TTypeEntry(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -171,45 +164,45 @@ public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) { @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case PRIMITIVE_ENTRY: if (value instanceof TPrimitiveTypeEntry) { break; } - throw new ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); case ARRAY_ENTRY: if (value instanceof TArrayTypeEntry) { break; } - throw new ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); case MAP_ENTRY: if (value instanceof TMapTypeEntry) { break; } - throw new ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); case STRUCT_ENTRY: if (value instanceof TStructTypeEntry) { break; } - throw new ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); case UNION_ENTRY: if (value instanceof TUnionTypeEntry) { break; } - throw new ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); case USER_DEFINED_TYPE_ENTRY: if (value instanceof TUserDefinedTypeEntry) { break; } - throw new ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { @@ -274,7 +267,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip return null; } default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -310,12 +303,12 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr userDefinedTypeEntry.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { @@ -350,10 +343,10 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot userDefinedTypeEntry.read(iprot); return userDefinedTypeEntry; default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -385,7 +378,7 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) userDefinedTypeEntry.write(oprot); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -405,7 +398,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case USER_DEFINED_TYPE_ENTRY: return USER_DEFINED_TYPE_ENTRY_FIELD_DESC; default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @@ -419,6 +412,7 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -428,12 +422,12 @@ public TPrimitiveTypeEntry getPrimitiveEntry() { if (getSetField() == _Fields.PRIMITIVE_ENTRY) { return (TPrimitiveTypeEntry)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setPrimitiveEntry(TPrimitiveTypeEntry value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.PRIMITIVE_ENTRY; value_ = value; } @@ -442,12 +436,12 @@ public TArrayTypeEntry getArrayEntry() { if (getSetField() == _Fields.ARRAY_ENTRY) { return (TArrayTypeEntry)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setArrayEntry(TArrayTypeEntry value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.ARRAY_ENTRY; value_ = value; } @@ -456,12 +450,12 @@ public TMapTypeEntry getMapEntry() { if (getSetField() == _Fields.MAP_ENTRY) { return (TMapTypeEntry)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setMapEntry(TMapTypeEntry value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.MAP_ENTRY; value_ = value; } @@ -470,12 +464,12 @@ public TStructTypeEntry getStructEntry() { if (getSetField() == _Fields.STRUCT_ENTRY) { return (TStructTypeEntry)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setStructEntry(TStructTypeEntry value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.STRUCT_ENTRY; value_ = value; } @@ -484,12 +478,12 @@ public TUnionTypeEntry getUnionEntry() { if (getSetField() == _Fields.UNION_ENTRY) { return (TUnionTypeEntry)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setUnionEntry(TUnionTypeEntry value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.UNION_ENTRY; value_ = value; } @@ -498,12 +492,12 @@ public TUserDefinedTypeEntry getUserDefinedTypeEntry() { if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) { return (TUserDefinedTypeEntry)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) { - if (value == null) throw new NullPointerException(); + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.USER_DEFINED_TYPE_ENTRY; value_ = value; } @@ -538,7 +532,7 @@ public boolean isSetUserDefinedTypeEntry() { } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof TTypeEntry) { return equals((TTypeEntry)other); } else { @@ -562,12 +556,12 @@ public int compareTo(TTypeEntry other) { @Override public int hashCode() { - List list = new ArrayList(); + java.util.List list = new java.util.ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); + java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -585,7 +579,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java index e06761b93c25..4780d4bb1173 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,6 +7,7 @@ package org.apache.spark.service.rpc.thrift; +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") public enum TTypeId implements org.apache.thrift.TEnum { BOOLEAN_TYPE(0), TINYINT_TYPE(1), @@ -49,6 +50,7 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ + @org.apache.thrift.annotation.Nullable public static TTypeId findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java index 182163cec675..f88f97770c1a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java @@ -1,23 +1,14 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -import org.apache.thrift.protocol.TProtocolException; - -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeQualifierValue extends org.apache.thrift.TUnion { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TTypeQualifierValue extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifierValue"); private static final org.apache.thrift.protocol.TField I32_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Value", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)2); @@ -27,10 +18,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { I32_VALUE((short)1, "i32Value"), STRING_VALUE((short)2, "stringValue"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -38,6 +29,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // I32_VALUE @@ -55,21 +47,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,19 +71,19 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.I32_VALUE, new org.apache.thrift.meta_data.FieldMetaData("i32Value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifierValue.class, metaDataMap); } @@ -98,7 +91,7 @@ public TTypeQualifierValue() { super(); } - public TTypeQualifierValue(_Fields setField, Object value) { + public TTypeQualifierValue(_Fields setField, java.lang.Object value) { super(setField, value); } @@ -115,7 +108,7 @@ public static TTypeQualifierValue i32Value(int value) { return x; } - public static TTypeQualifierValue stringValue(String value) { + public static TTypeQualifierValue stringValue(java.lang.String value) { TTypeQualifierValue x = new TTypeQualifierValue(); x.setStringValue(value); return x; @@ -123,31 +116,31 @@ public static TTypeQualifierValue stringValue(String value) { @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { switch (setField) { case I32_VALUE: - if (value instanceof Integer) { + if (value instanceof java.lang.Integer) { break; } - throw new ClassCastException("Was expecting value of type Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); case STRING_VALUE: - if (value instanceof String) { + if (value instanceof java.lang.String) { break; } - throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); + throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { case I32_VALUE: if (field.type == I32_VALUE_FIELD_DESC.type) { - Integer i32Value; + java.lang.Integer i32Value; i32Value = iprot.readI32(); return i32Value; } else { @@ -156,7 +149,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip } case STRING_VALUE: if (field.type == STRING_VALUE_FIELD_DESC.type) { - String stringValue; + java.lang.String stringValue; stringValue = iprot.readString(); return stringValue; } else { @@ -164,7 +157,7 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip return null; } default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -176,36 +169,36 @@ protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol ip protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case I32_VALUE: - Integer i32Value = (Integer)value_; + java.lang.Integer i32Value = (java.lang.Integer)value_; oprot.writeI32(i32Value); return; case STRING_VALUE: - String stringValue = (String)value_; + java.lang.String stringValue = (java.lang.String)value_; oprot.writeString(stringValue); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case I32_VALUE: - Integer i32Value; + java.lang.Integer i32Value; i32Value = iprot.readI32(); return i32Value; case STRING_VALUE: - String stringValue; + java.lang.String stringValue; stringValue = iprot.readString(); return stringValue; default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -213,15 +206,15 @@ protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case I32_VALUE: - Integer i32Value = (Integer)value_; + java.lang.Integer i32Value = (java.lang.Integer)value_; oprot.writeI32(i32Value); return; case STRING_VALUE: - String stringValue = (String)value_; + java.lang.String stringValue = (java.lang.String)value_; oprot.writeString(stringValue); return; default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -233,7 +226,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case STRING_VALUE: return STRING_VALUE_FIELD_DESC; default: - throw new IllegalArgumentException("Unknown field id " + setField); + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); } } @@ -247,6 +240,7 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } + @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -254,9 +248,9 @@ public _Fields fieldForId(int fieldId) { public int getI32Value() { if (getSetField() == _Fields.I32_VALUE) { - return (Integer)getFieldValue(); + return (java.lang.Integer)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -265,16 +259,16 @@ public void setI32Value(int value) { value_ = value; } - public String getStringValue() { + public java.lang.String getStringValue() { if (getSetField() == _Fields.STRING_VALUE) { - return (String)getFieldValue(); + return (java.lang.String)getFieldValue(); } else { - throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } - public void setStringValue(String value) { - if (value == null) throw new NullPointerException(); + public void setStringValue(java.lang.String value) { + if (value == null) throw new java.lang.NullPointerException(); setField_ = _Fields.STRING_VALUE; value_ = value; } @@ -289,7 +283,7 @@ public boolean isSetStringValue() { } - public boolean equals(Object other) { + public boolean equals(java.lang.Object other) { if (other instanceof TTypeQualifierValue) { return equals((TTypeQualifierValue)other); } else { @@ -313,12 +307,12 @@ public int compareTo(TTypeQualifierValue other) { @Override public int hashCode() { - List list = new ArrayList(); + java.util.List list = new java.util.ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); + java.lang.Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -336,7 +330,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java index 3f46e5577c20..350d0dc72cfb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifiers"); private static final org.apache.thrift.protocol.TField QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifiers", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTypeQualifiersStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTypeQualifiersTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeQualifiersStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeQualifiersTupleSchemeFactory(); - private Map qualifiers; // required + private @org.apache.thrift.annotation.Nullable java.util.Map qualifiers; // 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 { QUALIFIERS((short)1, "qualifiers"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // QUALIFIERS @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,20 +73,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("qualifiers", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifierValue.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifiers.class, metaDataMap); } @@ -111,7 +94,7 @@ public TTypeQualifiers() { } public TTypeQualifiers( - Map qualifiers) + java.util.Map qualifiers) { this(); this.qualifiers = qualifiers; @@ -122,13 +105,13 @@ public TTypeQualifiers( */ public TTypeQualifiers(TTypeQualifiers other) { if (other.isSetQualifiers()) { - Map __this__qualifiers = new HashMap(other.qualifiers.size()); - for (Map.Entry other_element : other.qualifiers.entrySet()) { + java.util.Map __this__qualifiers = new java.util.HashMap(other.qualifiers.size()); + for (java.util.Map.Entry other_element : other.qualifiers.entrySet()) { - String other_element_key = other_element.getKey(); + java.lang.String other_element_key = other_element.getKey(); TTypeQualifierValue other_element_value = other_element.getValue(); - String __this__qualifiers_copy_key = other_element_key; + java.lang.String __this__qualifiers_copy_key = other_element_key; TTypeQualifierValue __this__qualifiers_copy_value = new TTypeQualifierValue(other_element_value); @@ -151,18 +134,19 @@ public int getQualifiersSize() { return (this.qualifiers == null) ? 0 : this.qualifiers.size(); } - public void putToQualifiers(String key, TTypeQualifierValue val) { + public void putToQualifiers(java.lang.String key, TTypeQualifierValue val) { if (this.qualifiers == null) { - this.qualifiers = new HashMap(); + this.qualifiers = new java.util.HashMap(); } this.qualifiers.put(key, val); } - public Map getQualifiers() { + @org.apache.thrift.annotation.Nullable + public java.util.Map getQualifiers() { return this.qualifiers; } - public void setQualifiers(Map qualifiers) { + public void setQualifiers(@org.apache.thrift.annotation.Nullable java.util.Map qualifiers) { this.qualifiers = qualifiers; } @@ -181,43 +165,44 @@ public void setQualifiersIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case QUALIFIERS: if (value == null) { unsetQualifiers(); } else { - setQualifiers((Map)value); + setQualifiers((java.util.Map)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case QUALIFIERS: return getQualifiers(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case QUALIFIERS: return isSetQualifiers(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TTypeQualifiers) @@ -228,6 +213,8 @@ public boolean equals(Object that) { public boolean equals(TTypeQualifiers that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_qualifiers = true && this.isSetQualifiers(); boolean that_present_qualifiers = true && that.isSetQualifiers(); @@ -243,14 +230,13 @@ public boolean equals(TTypeQualifiers that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_qualifiers = true && (isSetQualifiers()); - list.add(present_qualifiers); - if (present_qualifiers) - list.add(qualifiers); + hashCode = hashCode * 8191 + ((isSetQualifiers()) ? 131071 : 524287); + if (isSetQualifiers()) + hashCode = hashCode * 8191 + qualifiers.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -261,7 +247,7 @@ public int compareTo(TTypeQualifiers other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); + lastComparison = java.lang.Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); if (lastComparison != 0) { return lastComparison; } @@ -274,21 +260,22 @@ public int compareTo(TTypeQualifiers other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTypeQualifiers("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeQualifiers("); boolean first = true; sb.append("qualifiers:"); @@ -319,7 +306,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -327,13 +314,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TTypeQualifiersStandardSchemeFactory implements SchemeFactory { + private static class TTypeQualifiersStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTypeQualifiersStandardScheme getScheme() { return new TTypeQualifiersStandardScheme(); } } - private static class TTypeQualifiersStandardScheme extends StandardScheme { + private static class TTypeQualifiersStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -349,9 +336,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers str if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.qualifiers = new HashMap(2*_map0.size); - String _key1; - TTypeQualifierValue _val2; + struct.qualifiers = new java.util.HashMap(2*_map0.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key1; + @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val2; for (int _i3 = 0; _i3 < _map0.size; ++_i3) { _key1 = iprot.readString(); @@ -383,7 +370,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeQualifiers st oprot.writeFieldBegin(QUALIFIERS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.qualifiers.size())); - for (Map.Entry _iter4 : struct.qualifiers.entrySet()) + for (java.util.Map.Entry _iter4 : struct.qualifiers.entrySet()) { oprot.writeString(_iter4.getKey()); _iter4.getValue().write(oprot); @@ -398,20 +385,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeQualifiers st } - private static class TTypeQualifiersTupleSchemeFactory implements SchemeFactory { + private static class TTypeQualifiersTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TTypeQualifiersTupleScheme getScheme() { return new TTypeQualifiersTupleScheme(); } } - private static class TTypeQualifiersTupleScheme extends TupleScheme { + private static class TTypeQualifiersTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.qualifiers.size()); - for (Map.Entry _iter5 : struct.qualifiers.entrySet()) + for (java.util.Map.Entry _iter5 : struct.qualifiers.entrySet()) { oprot.writeString(_iter5.getKey()); _iter5.getValue().write(oprot); @@ -421,12 +408,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.qualifiers = new HashMap(2*_map6.size); - String _key7; - TTypeQualifierValue _val8; + struct.qualifiers = new java.util.HashMap(2*_map6.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7; + @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val8; for (int _i9 = 0; _i9 < _map6.size; ++_i9) { _key7 = iprot.readString(); @@ -439,5 +426,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java index 3eee9c15e594..7899575ffcc9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTypeEntry"); private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TUnionTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TUnionTypeEntryTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUnionTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUnionTypeEntryTupleSchemeFactory(); - private Map nameToTypePtr; // required + private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // 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 { NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // NAME_TO_TYPE_PTR @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,20 +73,20 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTypeEntry.class, metaDataMap); } @@ -111,7 +94,7 @@ public TUnionTypeEntry() { } public TUnionTypeEntry( - Map nameToTypePtr) + java.util.Map nameToTypePtr) { this(); this.nameToTypePtr = nameToTypePtr; @@ -122,15 +105,15 @@ public TUnionTypeEntry( */ public TUnionTypeEntry(TUnionTypeEntry other) { if (other.isSetNameToTypePtr()) { - Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); - for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { + java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); + for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { - String other_element_key = other_element.getKey(); - Integer other_element_value = other_element.getValue(); + java.lang.String other_element_key = other_element.getKey(); + java.lang.Integer other_element_value = other_element.getValue(); - String __this__nameToTypePtr_copy_key = other_element_key; + java.lang.String __this__nameToTypePtr_copy_key = other_element_key; - Integer __this__nameToTypePtr_copy_value = other_element_value; + java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); } @@ -151,18 +134,19 @@ public int getNameToTypePtrSize() { return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); } - public void putToNameToTypePtr(String key, int val) { + public void putToNameToTypePtr(java.lang.String key, int val) { if (this.nameToTypePtr == null) { - this.nameToTypePtr = new HashMap(); + this.nameToTypePtr = new java.util.HashMap(); } this.nameToTypePtr.put(key, val); } - public Map getNameToTypePtr() { + @org.apache.thrift.annotation.Nullable + public java.util.Map getNameToTypePtr() { return this.nameToTypePtr; } - public void setNameToTypePtr(Map nameToTypePtr) { + public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { this.nameToTypePtr = nameToTypePtr; } @@ -181,43 +165,44 @@ public void setNameToTypePtrIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case NAME_TO_TYPE_PTR: if (value == null) { unsetNameToTypePtr(); } else { - setNameToTypePtr((Map)value); + setNameToTypePtr((java.util.Map)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case NAME_TO_TYPE_PTR: return getNameToTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case NAME_TO_TYPE_PTR: return isSetNameToTypePtr(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TUnionTypeEntry) @@ -228,6 +213,8 @@ public boolean equals(Object that) { public boolean equals(TUnionTypeEntry that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); @@ -243,14 +230,13 @@ public boolean equals(TUnionTypeEntry that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); - list.add(present_nameToTypePtr); - if (present_nameToTypePtr) - list.add(nameToTypePtr); + hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); + if (isSetNameToTypePtr()) + hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -261,7 +247,7 @@ public int compareTo(TUnionTypeEntry other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -274,21 +260,22 @@ public int compareTo(TUnionTypeEntry other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TUnionTypeEntry("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TUnionTypeEntry("); boolean first = true; sb.append("nameToTypePtr:"); @@ -319,7 +306,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -327,13 +314,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TUnionTypeEntryStandardSchemeFactory implements SchemeFactory { + private static class TUnionTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TUnionTypeEntryStandardScheme getScheme() { return new TUnionTypeEntryStandardScheme(); } } - private static class TUnionTypeEntryStandardScheme extends StandardScheme { + private static class TUnionTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -349,8 +336,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry str if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin(); - struct.nameToTypePtr = new HashMap(2*_map20.size); - String _key21; + struct.nameToTypePtr = new java.util.HashMap(2*_map20.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key21; int _val22; for (int _i23 = 0; _i23 < _map20.size; ++_i23) { @@ -382,7 +369,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TUnionTypeEntry st oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) + for (java.util.Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter24.getKey()); oprot.writeI32(_iter24.getValue()); @@ -397,20 +384,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TUnionTypeEntry st } - private static class TUnionTypeEntryTupleSchemeFactory implements SchemeFactory { + private static class TUnionTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TUnionTypeEntryTupleScheme getScheme() { return new TUnionTypeEntryTupleScheme(); } } - private static class TUnionTypeEntryTupleScheme extends TupleScheme { + private static class TUnionTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { oprot.writeI32(struct.nameToTypePtr.size()); - for (Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) + for (java.util.Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter25.getKey()); oprot.writeI32(_iter25.getValue()); @@ -420,11 +407,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new HashMap(2*_map26.size); - String _key27; + struct.nameToTypePtr = new java.util.HashMap(2*_map26.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key27; int _val28; for (int _i29 = 0; _i29 < _map26.size; ++_i29) { @@ -437,5 +424,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry stru } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java index 21b35185f5fa..9ad9d584b3ce 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java @@ -1,50 +1,31 @@ /** - * Autogenerated by Thrift Compiler (0.9.3) + * Autogenerated by Thrift Compiler (0.12.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.service.rpc.thrift; -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 java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.EnumSet; -import java.util.Collections; -import javax.annotation.Generated; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -@org.apache.hadoop.hive.common.classification.InterfaceAudience.Public @org.apache.hadoop.hive.common.classification.InterfaceStability.Stable public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") +public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry"); private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TUserDefinedTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TUserDefinedTypeEntryTupleSchemeFactory()); - } + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUserDefinedTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUserDefinedTypeEntryTupleSchemeFactory(); - private String typeClassName; // required + private @org.apache.thrift.annotation.Nullable java.lang.String typeClassName; // 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 { TYPE_CLASS_NAME((short)1, "typeClassName"); - private static final Map byName = new HashMap(); + private static final java.util.Map byName = new java.util.HashMap(); static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,6 +33,7 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ + @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TYPE_CLASS_NAME @@ -67,21 +49,22 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + if (fields == null) throw new java.lang.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) { + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { return byName.get(name); } private final short _thriftId; - private final String _fieldName; + private final java.lang.String _fieldName; - _Fields(short thriftId, String fieldName) { + _Fields(short thriftId, java.lang.String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -90,18 +73,18 @@ public short getThriftFieldId() { return _thriftId; } - public String getFieldName() { + public java.lang.String getFieldName() { return _fieldName; } } // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final java.util.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); + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap); } @@ -109,7 +92,7 @@ public TUserDefinedTypeEntry() { } public TUserDefinedTypeEntry( - String typeClassName) + java.lang.String typeClassName) { this(); this.typeClassName = typeClassName; @@ -133,11 +116,12 @@ public void clear() { this.typeClassName = null; } - public String getTypeClassName() { + @org.apache.thrift.annotation.Nullable + public java.lang.String getTypeClassName() { return this.typeClassName; } - public void setTypeClassName(String typeClassName) { + public void setTypeClassName(@org.apache.thrift.annotation.Nullable java.lang.String typeClassName) { this.typeClassName = typeClassName; } @@ -156,43 +140,44 @@ public void setTypeClassNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, Object value) { + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case TYPE_CLASS_NAME: if (value == null) { unsetTypeClassName(); } else { - setTypeClassName((String)value); + setTypeClassName((java.lang.String)value); } break; } } - public Object getFieldValue(_Fields field) { + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { switch (field) { case TYPE_CLASS_NAME: return getTypeClassName(); } - throw new IllegalStateException(); + throw new java.lang.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(); + throw new java.lang.IllegalArgumentException(); } switch (field) { case TYPE_CLASS_NAME: return isSetTypeClassName(); } - throw new IllegalStateException(); + throw new java.lang.IllegalStateException(); } @Override - public boolean equals(Object that) { + public boolean equals(java.lang.Object that) { if (that == null) return false; if (that instanceof TUserDefinedTypeEntry) @@ -203,6 +188,8 @@ public boolean equals(Object that) { public boolean equals(TUserDefinedTypeEntry that) { if (that == null) return false; + if (this == that) + return true; boolean this_present_typeClassName = true && this.isSetTypeClassName(); boolean that_present_typeClassName = true && that.isSetTypeClassName(); @@ -218,14 +205,13 @@ public boolean equals(TUserDefinedTypeEntry that) { @Override public int hashCode() { - List list = new ArrayList(); + int hashCode = 1; - boolean present_typeClassName = true && (isSetTypeClassName()); - list.add(present_typeClassName); - if (present_typeClassName) - list.add(typeClassName); + hashCode = hashCode * 8191 + ((isSetTypeClassName()) ? 131071 : 524287); + if (isSetTypeClassName()) + hashCode = hashCode * 8191 + typeClassName.hashCode(); - return list.hashCode(); + return hashCode; } @Override @@ -236,7 +222,7 @@ public int compareTo(TUserDefinedTypeEntry other) { int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); + lastComparison = java.lang.Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); if (lastComparison != 0) { return lastComparison; } @@ -249,21 +235,22 @@ public int compareTo(TUserDefinedTypeEntry other) { return 0; } + @org.apache.thrift.annotation.Nullable 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); + scheme(iprot).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); + scheme(oprot).write(oprot, this); } @Override - public String toString() { - StringBuilder sb = new StringBuilder("TUserDefinedTypeEntry("); + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TUserDefinedTypeEntry("); boolean first = true; sb.append("typeClassName:"); @@ -294,7 +281,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { @@ -302,13 +289,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TUserDefinedTypeEntryStandardSchemeFactory implements SchemeFactory { + private static class TUserDefinedTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TUserDefinedTypeEntryStandardScheme getScheme() { return new TUserDefinedTypeEntryStandardScheme(); } } - private static class TUserDefinedTypeEntryStandardScheme extends StandardScheme { + private static class TUserDefinedTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -352,27 +339,30 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TUserDefinedTypeEn } - private static class TUserDefinedTypeEntryTupleSchemeFactory implements SchemeFactory { + private static class TUserDefinedTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { public TUserDefinedTypeEntryTupleScheme getScheme() { return new TUserDefinedTypeEntryTupleScheme(); } } - private static class TUserDefinedTypeEntryTupleScheme extends TupleScheme { + private static class TUserDefinedTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; oprot.writeString(struct.typeClassName); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; struct.typeClassName = iprot.readString(); struct.setTypeClassNameIsSet(true); } } + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } } diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote new file mode 100755 index 000000000000..d882caecd52c --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote @@ -0,0 +1,271 @@ +#!/usr/bin/env python +# +# Autogenerated by Thrift Compiler (0.12.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +import sys +import pprint +if sys.version_info[0] > 2: + from urllib.parse import urlparse +else: + from urlparse import urlparse +from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient +from thrift.protocol.TBinaryProtocol import TBinaryProtocol + +from TCLIService import TCLIService +from TCLIService.ttypes import * + +if len(sys.argv) <= 1 or sys.argv[1] == '--help': + print('') + print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]') + print('') + print('Functions:') + print(' TOpenSessionResp OpenSession(TOpenSessionReq req)') + print(' TCloseSessionResp CloseSession(TCloseSessionReq req)') + print(' TGetInfoResp GetInfo(TGetInfoReq req)') + print(' TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req)') + print(' TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req)') + print(' TGetCatalogsResp GetCatalogs(TGetCatalogsReq req)') + print(' TGetSchemasResp GetSchemas(TGetSchemasReq req)') + print(' TGetTablesResp GetTables(TGetTablesReq req)') + print(' TGetTableTypesResp GetTableTypes(TGetTableTypesReq req)') + print(' TGetColumnsResp GetColumns(TGetColumnsReq req)') + print(' TGetFunctionsResp GetFunctions(TGetFunctionsReq req)') + print(' TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req)') + print(' TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req)') + print(' TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req)') + print(' TCancelOperationResp CancelOperation(TCancelOperationReq req)') + print(' TCloseOperationResp CloseOperation(TCloseOperationReq req)') + print(' TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req)') + print(' TFetchResultsResp FetchResults(TFetchResultsReq req)') + print(' TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req)') + print(' TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req)') + print(' TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req)') + print(' TGetQueryIdResp GetQueryId(TGetQueryIdReq req)') + print(' TSetClientInfoResp SetClientInfo(TSetClientInfoReq req)') + print('') + sys.exit(0) + +pp = pprint.PrettyPrinter(indent=2) +host = 'localhost' +port = 9090 +uri = '' +framed = False +ssl = False +validate = True +ca_certs = None +keyfile = None +certfile = None +http = False +argi = 1 + +if sys.argv[argi] == '-h': + parts = sys.argv[argi + 1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + argi += 2 + +if sys.argv[argi] == '-u': + url = urlparse(sys.argv[argi + 1]) + parts = url[1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + else: + port = 80 + uri = url[2] + if url[4]: + uri += '?%s' % url[4] + http = True + argi += 2 + +if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': + framed = True + argi += 1 + +if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl': + ssl = True + argi += 1 + +if sys.argv[argi] == '-novalidate': + validate = False + argi += 1 + +if sys.argv[argi] == '-ca_certs': + ca_certs = sys.argv[argi+1] + argi += 2 + +if sys.argv[argi] == '-keyfile': + keyfile = sys.argv[argi+1] + argi += 2 + +if sys.argv[argi] == '-certfile': + certfile = sys.argv[argi+1] + argi += 2 + +cmd = sys.argv[argi] +args = sys.argv[argi + 1:] + +if http: + transport = THttpClient.THttpClient(host, port, uri) +else: + if ssl: + socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile) + else: + socket = TSocket.TSocket(host, port) + if framed: + transport = TTransport.TFramedTransport(socket) + else: + transport = TTransport.TBufferedTransport(socket) +protocol = TBinaryProtocol(transport) +client = TCLIService.Client(protocol) +transport.open() + +if cmd == 'OpenSession': + if len(args) != 1: + print('OpenSession requires 1 args') + sys.exit(1) + pp.pprint(client.OpenSession(eval(args[0]),)) + +elif cmd == 'CloseSession': + if len(args) != 1: + print('CloseSession requires 1 args') + sys.exit(1) + pp.pprint(client.CloseSession(eval(args[0]),)) + +elif cmd == 'GetInfo': + if len(args) != 1: + print('GetInfo requires 1 args') + sys.exit(1) + pp.pprint(client.GetInfo(eval(args[0]),)) + +elif cmd == 'ExecuteStatement': + if len(args) != 1: + print('ExecuteStatement requires 1 args') + sys.exit(1) + pp.pprint(client.ExecuteStatement(eval(args[0]),)) + +elif cmd == 'GetTypeInfo': + if len(args) != 1: + print('GetTypeInfo requires 1 args') + sys.exit(1) + pp.pprint(client.GetTypeInfo(eval(args[0]),)) + +elif cmd == 'GetCatalogs': + if len(args) != 1: + print('GetCatalogs requires 1 args') + sys.exit(1) + pp.pprint(client.GetCatalogs(eval(args[0]),)) + +elif cmd == 'GetSchemas': + if len(args) != 1: + print('GetSchemas requires 1 args') + sys.exit(1) + pp.pprint(client.GetSchemas(eval(args[0]),)) + +elif cmd == 'GetTables': + if len(args) != 1: + print('GetTables requires 1 args') + sys.exit(1) + pp.pprint(client.GetTables(eval(args[0]),)) + +elif cmd == 'GetTableTypes': + if len(args) != 1: + print('GetTableTypes requires 1 args') + sys.exit(1) + pp.pprint(client.GetTableTypes(eval(args[0]),)) + +elif cmd == 'GetColumns': + if len(args) != 1: + print('GetColumns requires 1 args') + sys.exit(1) + pp.pprint(client.GetColumns(eval(args[0]),)) + +elif cmd == 'GetFunctions': + if len(args) != 1: + print('GetFunctions requires 1 args') + sys.exit(1) + pp.pprint(client.GetFunctions(eval(args[0]),)) + +elif cmd == 'GetPrimaryKeys': + if len(args) != 1: + print('GetPrimaryKeys requires 1 args') + sys.exit(1) + pp.pprint(client.GetPrimaryKeys(eval(args[0]),)) + +elif cmd == 'GetCrossReference': + if len(args) != 1: + print('GetCrossReference requires 1 args') + sys.exit(1) + pp.pprint(client.GetCrossReference(eval(args[0]),)) + +elif cmd == 'GetOperationStatus': + if len(args) != 1: + print('GetOperationStatus requires 1 args') + sys.exit(1) + pp.pprint(client.GetOperationStatus(eval(args[0]),)) + +elif cmd == 'CancelOperation': + if len(args) != 1: + print('CancelOperation requires 1 args') + sys.exit(1) + pp.pprint(client.CancelOperation(eval(args[0]),)) + +elif cmd == 'CloseOperation': + if len(args) != 1: + print('CloseOperation requires 1 args') + sys.exit(1) + pp.pprint(client.CloseOperation(eval(args[0]),)) + +elif cmd == 'GetResultSetMetadata': + if len(args) != 1: + print('GetResultSetMetadata requires 1 args') + sys.exit(1) + pp.pprint(client.GetResultSetMetadata(eval(args[0]),)) + +elif cmd == 'FetchResults': + if len(args) != 1: + print('FetchResults requires 1 args') + sys.exit(1) + pp.pprint(client.FetchResults(eval(args[0]),)) + +elif cmd == 'GetDelegationToken': + if len(args) != 1: + print('GetDelegationToken requires 1 args') + sys.exit(1) + pp.pprint(client.GetDelegationToken(eval(args[0]),)) + +elif cmd == 'CancelDelegationToken': + if len(args) != 1: + print('CancelDelegationToken requires 1 args') + sys.exit(1) + pp.pprint(client.CancelDelegationToken(eval(args[0]),)) + +elif cmd == 'RenewDelegationToken': + if len(args) != 1: + print('RenewDelegationToken requires 1 args') + sys.exit(1) + pp.pprint(client.RenewDelegationToken(eval(args[0]),)) + +elif cmd == 'GetQueryId': + if len(args) != 1: + print('GetQueryId requires 1 args') + sys.exit(1) + pp.pprint(client.GetQueryId(eval(args[0]),)) + +elif cmd == 'SetClientInfo': + if len(args) != 1: + print('SetClientInfo requires 1 args') + sys.exit(1) + pp.pprint(client.SetClientInfo(eval(args[0]),)) + +else: + print('Unrecognized method %s' % cmd) + sys.exit(1) + +transport.close() diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py new file mode 100644 index 000000000000..cd7a5c4872f0 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py @@ -0,0 +1,4401 @@ +# +# Autogenerated by Thrift Compiler (0.12.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +import logging +from .ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +all_structs = [] + + +class Iface(object): + def OpenSession(self, req): + """ + Parameters: + - req + + """ + pass + + def CloseSession(self, req): + """ + Parameters: + - req + + """ + pass + + def GetInfo(self, req): + """ + Parameters: + - req + + """ + pass + + def ExecuteStatement(self, req): + """ + Parameters: + - req + + """ + pass + + def GetTypeInfo(self, req): + """ + Parameters: + - req + + """ + pass + + def GetCatalogs(self, req): + """ + Parameters: + - req + + """ + pass + + def GetSchemas(self, req): + """ + Parameters: + - req + + """ + pass + + def GetTables(self, req): + """ + Parameters: + - req + + """ + pass + + def GetTableTypes(self, req): + """ + Parameters: + - req + + """ + pass + + def GetColumns(self, req): + """ + Parameters: + - req + + """ + pass + + def GetFunctions(self, req): + """ + Parameters: + - req + + """ + pass + + def GetPrimaryKeys(self, req): + """ + Parameters: + - req + + """ + pass + + def GetCrossReference(self, req): + """ + Parameters: + - req + + """ + pass + + def GetOperationStatus(self, req): + """ + Parameters: + - req + + """ + pass + + def CancelOperation(self, req): + """ + Parameters: + - req + + """ + pass + + def CloseOperation(self, req): + """ + Parameters: + - req + + """ + pass + + def GetResultSetMetadata(self, req): + """ + Parameters: + - req + + """ + pass + + def FetchResults(self, req): + """ + Parameters: + - req + + """ + pass + + def GetDelegationToken(self, req): + """ + Parameters: + - req + + """ + pass + + def CancelDelegationToken(self, req): + """ + Parameters: + - req + + """ + pass + + def RenewDelegationToken(self, req): + """ + Parameters: + - req + + """ + pass + + def GetQueryId(self, req): + """ + Parameters: + - req + + """ + pass + + def SetClientInfo(self, req): + """ + Parameters: + - req + + """ + pass + + +class Client(Iface): + def __init__(self, iprot, oprot=None): + self._iprot = self._oprot = iprot + if oprot is not None: + self._oprot = oprot + self._seqid = 0 + + def OpenSession(self, req): + """ + Parameters: + - req + + """ + self.send_OpenSession(req) + return self.recv_OpenSession() + + def send_OpenSession(self, req): + self._oprot.writeMessageBegin('OpenSession', TMessageType.CALL, self._seqid) + args = OpenSession_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_OpenSession(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = OpenSession_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result") + + def CloseSession(self, req): + """ + Parameters: + - req + + """ + self.send_CloseSession(req) + return self.recv_CloseSession() + + def send_CloseSession(self, req): + self._oprot.writeMessageBegin('CloseSession', TMessageType.CALL, self._seqid) + args = CloseSession_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_CloseSession(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = CloseSession_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "CloseSession failed: unknown result") + + def GetInfo(self, req): + """ + Parameters: + - req + + """ + self.send_GetInfo(req) + return self.recv_GetInfo() + + def send_GetInfo(self, req): + self._oprot.writeMessageBegin('GetInfo', TMessageType.CALL, self._seqid) + args = GetInfo_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetInfo(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetInfo_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetInfo failed: unknown result") + + def ExecuteStatement(self, req): + """ + Parameters: + - req + + """ + self.send_ExecuteStatement(req) + return self.recv_ExecuteStatement() + + def send_ExecuteStatement(self, req): + self._oprot.writeMessageBegin('ExecuteStatement', TMessageType.CALL, self._seqid) + args = ExecuteStatement_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_ExecuteStatement(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = ExecuteStatement_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result") + + def GetTypeInfo(self, req): + """ + Parameters: + - req + + """ + self.send_GetTypeInfo(req) + return self.recv_GetTypeInfo() + + def send_GetTypeInfo(self, req): + self._oprot.writeMessageBegin('GetTypeInfo', TMessageType.CALL, self._seqid) + args = GetTypeInfo_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetTypeInfo(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetTypeInfo_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetTypeInfo failed: unknown result") + + def GetCatalogs(self, req): + """ + Parameters: + - req + + """ + self.send_GetCatalogs(req) + return self.recv_GetCatalogs() + + def send_GetCatalogs(self, req): + self._oprot.writeMessageBegin('GetCatalogs', TMessageType.CALL, self._seqid) + args = GetCatalogs_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetCatalogs(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetCatalogs_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetCatalogs failed: unknown result") + + def GetSchemas(self, req): + """ + Parameters: + - req + + """ + self.send_GetSchemas(req) + return self.recv_GetSchemas() + + def send_GetSchemas(self, req): + self._oprot.writeMessageBegin('GetSchemas', TMessageType.CALL, self._seqid) + args = GetSchemas_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetSchemas(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetSchemas_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetSchemas failed: unknown result") + + def GetTables(self, req): + """ + Parameters: + - req + + """ + self.send_GetTables(req) + return self.recv_GetTables() + + def send_GetTables(self, req): + self._oprot.writeMessageBegin('GetTables', TMessageType.CALL, self._seqid) + args = GetTables_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetTables(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetTables_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetTables failed: unknown result") + + def GetTableTypes(self, req): + """ + Parameters: + - req + + """ + self.send_GetTableTypes(req) + return self.recv_GetTableTypes() + + def send_GetTableTypes(self, req): + self._oprot.writeMessageBegin('GetTableTypes', TMessageType.CALL, self._seqid) + args = GetTableTypes_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetTableTypes(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetTableTypes_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetTableTypes failed: unknown result") + + def GetColumns(self, req): + """ + Parameters: + - req + + """ + self.send_GetColumns(req) + return self.recv_GetColumns() + + def send_GetColumns(self, req): + self._oprot.writeMessageBegin('GetColumns', TMessageType.CALL, self._seqid) + args = GetColumns_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetColumns(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetColumns_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetColumns failed: unknown result") + + def GetFunctions(self, req): + """ + Parameters: + - req + + """ + self.send_GetFunctions(req) + return self.recv_GetFunctions() + + def send_GetFunctions(self, req): + self._oprot.writeMessageBegin('GetFunctions', TMessageType.CALL, self._seqid) + args = GetFunctions_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetFunctions(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetFunctions_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetFunctions failed: unknown result") + + def GetPrimaryKeys(self, req): + """ + Parameters: + - req + + """ + self.send_GetPrimaryKeys(req) + return self.recv_GetPrimaryKeys() + + def send_GetPrimaryKeys(self, req): + self._oprot.writeMessageBegin('GetPrimaryKeys', TMessageType.CALL, self._seqid) + args = GetPrimaryKeys_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetPrimaryKeys(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetPrimaryKeys_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetPrimaryKeys failed: unknown result") + + def GetCrossReference(self, req): + """ + Parameters: + - req + + """ + self.send_GetCrossReference(req) + return self.recv_GetCrossReference() + + def send_GetCrossReference(self, req): + self._oprot.writeMessageBegin('GetCrossReference', TMessageType.CALL, self._seqid) + args = GetCrossReference_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetCrossReference(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetCrossReference_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetCrossReference failed: unknown result") + + def GetOperationStatus(self, req): + """ + Parameters: + - req + + """ + self.send_GetOperationStatus(req) + return self.recv_GetOperationStatus() + + def send_GetOperationStatus(self, req): + self._oprot.writeMessageBegin('GetOperationStatus', TMessageType.CALL, self._seqid) + args = GetOperationStatus_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetOperationStatus(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetOperationStatus_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetOperationStatus failed: unknown result") + + def CancelOperation(self, req): + """ + Parameters: + - req + + """ + self.send_CancelOperation(req) + return self.recv_CancelOperation() + + def send_CancelOperation(self, req): + self._oprot.writeMessageBegin('CancelOperation', TMessageType.CALL, self._seqid) + args = CancelOperation_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_CancelOperation(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = CancelOperation_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "CancelOperation failed: unknown result") + + def CloseOperation(self, req): + """ + Parameters: + - req + + """ + self.send_CloseOperation(req) + return self.recv_CloseOperation() + + def send_CloseOperation(self, req): + self._oprot.writeMessageBegin('CloseOperation', TMessageType.CALL, self._seqid) + args = CloseOperation_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_CloseOperation(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = CloseOperation_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "CloseOperation failed: unknown result") + + def GetResultSetMetadata(self, req): + """ + Parameters: + - req + + """ + self.send_GetResultSetMetadata(req) + return self.recv_GetResultSetMetadata() + + def send_GetResultSetMetadata(self, req): + self._oprot.writeMessageBegin('GetResultSetMetadata', TMessageType.CALL, self._seqid) + args = GetResultSetMetadata_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetResultSetMetadata(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetResultSetMetadata_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetResultSetMetadata failed: unknown result") + + def FetchResults(self, req): + """ + Parameters: + - req + + """ + self.send_FetchResults(req) + return self.recv_FetchResults() + + def send_FetchResults(self, req): + self._oprot.writeMessageBegin('FetchResults', TMessageType.CALL, self._seqid) + args = FetchResults_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_FetchResults(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = FetchResults_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result") + + def GetDelegationToken(self, req): + """ + Parameters: + - req + + """ + self.send_GetDelegationToken(req) + return self.recv_GetDelegationToken() + + def send_GetDelegationToken(self, req): + self._oprot.writeMessageBegin('GetDelegationToken', TMessageType.CALL, self._seqid) + args = GetDelegationToken_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetDelegationToken(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetDelegationToken_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result") + + def CancelDelegationToken(self, req): + """ + Parameters: + - req + + """ + self.send_CancelDelegationToken(req) + return self.recv_CancelDelegationToken() + + def send_CancelDelegationToken(self, req): + self._oprot.writeMessageBegin('CancelDelegationToken', TMessageType.CALL, self._seqid) + args = CancelDelegationToken_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_CancelDelegationToken(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = CancelDelegationToken_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result") + + def RenewDelegationToken(self, req): + """ + Parameters: + - req + + """ + self.send_RenewDelegationToken(req) + return self.recv_RenewDelegationToken() + + def send_RenewDelegationToken(self, req): + self._oprot.writeMessageBegin('RenewDelegationToken', TMessageType.CALL, self._seqid) + args = RenewDelegationToken_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_RenewDelegationToken(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = RenewDelegationToken_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result") + + def GetQueryId(self, req): + """ + Parameters: + - req + + """ + self.send_GetQueryId(req) + return self.recv_GetQueryId() + + def send_GetQueryId(self, req): + self._oprot.writeMessageBegin('GetQueryId', TMessageType.CALL, self._seqid) + args = GetQueryId_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_GetQueryId(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = GetQueryId_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "GetQueryId failed: unknown result") + + def SetClientInfo(self, req): + """ + Parameters: + - req + + """ + self.send_SetClientInfo(req) + return self.recv_SetClientInfo() + + def send_SetClientInfo(self, req): + self._oprot.writeMessageBegin('SetClientInfo', TMessageType.CALL, self._seqid) + args = SetClientInfo_args() + args.req = req + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_SetClientInfo(self): + iprot = self._iprot + (fname, mtype, rseqid) = iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + raise x + result = SetClientInfo_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success is not None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "SetClientInfo failed: unknown result") + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["OpenSession"] = Processor.process_OpenSession + self._processMap["CloseSession"] = Processor.process_CloseSession + self._processMap["GetInfo"] = Processor.process_GetInfo + self._processMap["ExecuteStatement"] = Processor.process_ExecuteStatement + self._processMap["GetTypeInfo"] = Processor.process_GetTypeInfo + self._processMap["GetCatalogs"] = Processor.process_GetCatalogs + self._processMap["GetSchemas"] = Processor.process_GetSchemas + self._processMap["GetTables"] = Processor.process_GetTables + self._processMap["GetTableTypes"] = Processor.process_GetTableTypes + self._processMap["GetColumns"] = Processor.process_GetColumns + self._processMap["GetFunctions"] = Processor.process_GetFunctions + self._processMap["GetPrimaryKeys"] = Processor.process_GetPrimaryKeys + self._processMap["GetCrossReference"] = Processor.process_GetCrossReference + self._processMap["GetOperationStatus"] = Processor.process_GetOperationStatus + self._processMap["CancelOperation"] = Processor.process_CancelOperation + self._processMap["CloseOperation"] = Processor.process_CloseOperation + self._processMap["GetResultSetMetadata"] = Processor.process_GetResultSetMetadata + self._processMap["FetchResults"] = Processor.process_FetchResults + self._processMap["GetDelegationToken"] = Processor.process_GetDelegationToken + self._processMap["CancelDelegationToken"] = Processor.process_CancelDelegationToken + self._processMap["RenewDelegationToken"] = Processor.process_RenewDelegationToken + self._processMap["GetQueryId"] = Processor.process_GetQueryId + self._processMap["SetClientInfo"] = Processor.process_SetClientInfo + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_OpenSession(self, seqid, iprot, oprot): + args = OpenSession_args() + args.read(iprot) + iprot.readMessageEnd() + result = OpenSession_result() + try: + result.success = self._handler.OpenSession(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("OpenSession", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_CloseSession(self, seqid, iprot, oprot): + args = CloseSession_args() + args.read(iprot) + iprot.readMessageEnd() + result = CloseSession_result() + try: + result.success = self._handler.CloseSession(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("CloseSession", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetInfo(self, seqid, iprot, oprot): + args = GetInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetInfo_result() + try: + result.success = self._handler.GetInfo(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetInfo", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_ExecuteStatement(self, seqid, iprot, oprot): + args = ExecuteStatement_args() + args.read(iprot) + iprot.readMessageEnd() + result = ExecuteStatement_result() + try: + result.success = self._handler.ExecuteStatement(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("ExecuteStatement", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetTypeInfo(self, seqid, iprot, oprot): + args = GetTypeInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetTypeInfo_result() + try: + result.success = self._handler.GetTypeInfo(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetTypeInfo", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetCatalogs(self, seqid, iprot, oprot): + args = GetCatalogs_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetCatalogs_result() + try: + result.success = self._handler.GetCatalogs(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetCatalogs", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetSchemas(self, seqid, iprot, oprot): + args = GetSchemas_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetSchemas_result() + try: + result.success = self._handler.GetSchemas(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetSchemas", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetTables(self, seqid, iprot, oprot): + args = GetTables_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetTables_result() + try: + result.success = self._handler.GetTables(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetTables", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetTableTypes(self, seqid, iprot, oprot): + args = GetTableTypes_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetTableTypes_result() + try: + result.success = self._handler.GetTableTypes(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetTableTypes", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetColumns(self, seqid, iprot, oprot): + args = GetColumns_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetColumns_result() + try: + result.success = self._handler.GetColumns(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetColumns", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetFunctions(self, seqid, iprot, oprot): + args = GetFunctions_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetFunctions_result() + try: + result.success = self._handler.GetFunctions(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetFunctions", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetPrimaryKeys(self, seqid, iprot, oprot): + args = GetPrimaryKeys_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetPrimaryKeys_result() + try: + result.success = self._handler.GetPrimaryKeys(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetPrimaryKeys", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetCrossReference(self, seqid, iprot, oprot): + args = GetCrossReference_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetCrossReference_result() + try: + result.success = self._handler.GetCrossReference(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetCrossReference", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetOperationStatus(self, seqid, iprot, oprot): + args = GetOperationStatus_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetOperationStatus_result() + try: + result.success = self._handler.GetOperationStatus(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetOperationStatus", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_CancelOperation(self, seqid, iprot, oprot): + args = CancelOperation_args() + args.read(iprot) + iprot.readMessageEnd() + result = CancelOperation_result() + try: + result.success = self._handler.CancelOperation(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("CancelOperation", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_CloseOperation(self, seqid, iprot, oprot): + args = CloseOperation_args() + args.read(iprot) + iprot.readMessageEnd() + result = CloseOperation_result() + try: + result.success = self._handler.CloseOperation(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("CloseOperation", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetResultSetMetadata(self, seqid, iprot, oprot): + args = GetResultSetMetadata_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetResultSetMetadata_result() + try: + result.success = self._handler.GetResultSetMetadata(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetResultSetMetadata", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_FetchResults(self, seqid, iprot, oprot): + args = FetchResults_args() + args.read(iprot) + iprot.readMessageEnd() + result = FetchResults_result() + try: + result.success = self._handler.FetchResults(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("FetchResults", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetDelegationToken(self, seqid, iprot, oprot): + args = GetDelegationToken_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetDelegationToken_result() + try: + result.success = self._handler.GetDelegationToken(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetDelegationToken", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_CancelDelegationToken(self, seqid, iprot, oprot): + args = CancelDelegationToken_args() + args.read(iprot) + iprot.readMessageEnd() + result = CancelDelegationToken_result() + try: + result.success = self._handler.CancelDelegationToken(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("CancelDelegationToken", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_RenewDelegationToken(self, seqid, iprot, oprot): + args = RenewDelegationToken_args() + args.read(iprot) + iprot.readMessageEnd() + result = RenewDelegationToken_result() + try: + result.success = self._handler.RenewDelegationToken(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("RenewDelegationToken", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_GetQueryId(self, seqid, iprot, oprot): + args = GetQueryId_args() + args.read(iprot) + iprot.readMessageEnd() + result = GetQueryId_result() + try: + result.success = self._handler.GetQueryId(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("GetQueryId", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_SetClientInfo(self, seqid, iprot, oprot): + args = SetClientInfo_args() + args.read(iprot) + iprot.readMessageEnd() + result = SetClientInfo_result() + try: + result.success = self._handler.SetClientInfo(args.req) + msg_type = TMessageType.REPLY + except TTransport.TTransportException: + raise + except TApplicationException as ex: + logging.exception('TApplication exception in handler') + msg_type = TMessageType.EXCEPTION + result = ex + except Exception: + logging.exception('Unexpected exception in handler') + msg_type = TMessageType.EXCEPTION + result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') + oprot.writeMessageBegin("SetClientInfo", msg_type, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + +# HELPER FUNCTIONS AND STRUCTURES + + +class OpenSession_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TOpenSessionReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('OpenSession_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__.items()] + 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) +all_structs.append(OpenSession_args) +OpenSession_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TOpenSessionReq, None], None, ), # 1 +) + + +class OpenSession_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TOpenSessionResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('OpenSession_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__.items()] + 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) +all_structs.append(OpenSession_result) +OpenSession_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TOpenSessionResp, None], None, ), # 0 +) + + +class CloseSession_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCloseSessionReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CloseSession_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__.items()] + 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) +all_structs.append(CloseSession_args) +CloseSession_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TCloseSessionReq, None], None, ), # 1 +) + + +class CloseSession_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCloseSessionResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CloseSession_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__.items()] + 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) +all_structs.append(CloseSession_result) +CloseSession_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TCloseSessionResp, None], None, ), # 0 +) + + +class GetInfo_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetInfoReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetInfo_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__.items()] + 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) +all_structs.append(GetInfo_args) +GetInfo_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetInfoReq, None], None, ), # 1 +) + + +class GetInfo_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetInfoResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetInfo_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__.items()] + 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) +all_structs.append(GetInfo_result) +GetInfo_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetInfoResp, None], None, ), # 0 +) + + +class ExecuteStatement_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('ExecuteStatement_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__.items()] + 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) +all_structs.append(ExecuteStatement_args) +ExecuteStatement_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TExecuteStatementReq, None], None, ), # 1 +) + + +class ExecuteStatement_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TExecuteStatementResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('ExecuteStatement_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__.items()] + 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) +all_structs.append(ExecuteStatement_result) +ExecuteStatement_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TExecuteStatementResp, None], None, ), # 0 +) + + +class GetTypeInfo_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetTypeInfoReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetTypeInfo_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__.items()] + 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) +all_structs.append(GetTypeInfo_args) +GetTypeInfo_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetTypeInfoReq, None], None, ), # 1 +) + + +class GetTypeInfo_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetTypeInfoResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetTypeInfo_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__.items()] + 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) +all_structs.append(GetTypeInfo_result) +GetTypeInfo_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetTypeInfoResp, None], None, ), # 0 +) + + +class GetCatalogs_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetCatalogsReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetCatalogs_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__.items()] + 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) +all_structs.append(GetCatalogs_args) +GetCatalogs_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetCatalogsReq, None], None, ), # 1 +) + + +class GetCatalogs_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetCatalogsResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetCatalogs_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__.items()] + 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) +all_structs.append(GetCatalogs_result) +GetCatalogs_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetCatalogsResp, None], None, ), # 0 +) + + +class GetSchemas_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetSchemasReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetSchemas_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__.items()] + 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) +all_structs.append(GetSchemas_args) +GetSchemas_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetSchemasReq, None], None, ), # 1 +) + + +class GetSchemas_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetSchemasResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetSchemas_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__.items()] + 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) +all_structs.append(GetSchemas_result) +GetSchemas_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetSchemasResp, None], None, ), # 0 +) + + +class GetTables_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetTablesReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetTables_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__.items()] + 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) +all_structs.append(GetTables_args) +GetTables_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetTablesReq, None], None, ), # 1 +) + + +class GetTables_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetTablesResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetTables_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__.items()] + 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) +all_structs.append(GetTables_result) +GetTables_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetTablesResp, None], None, ), # 0 +) + + +class GetTableTypes_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetTableTypesReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetTableTypes_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__.items()] + 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) +all_structs.append(GetTableTypes_args) +GetTableTypes_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetTableTypesReq, None], None, ), # 1 +) + + +class GetTableTypes_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetTableTypesResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetTableTypes_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__.items()] + 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) +all_structs.append(GetTableTypes_result) +GetTableTypes_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetTableTypesResp, None], None, ), # 0 +) + + +class GetColumns_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetColumnsReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetColumns_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__.items()] + 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) +all_structs.append(GetColumns_args) +GetColumns_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetColumnsReq, None], None, ), # 1 +) + + +class GetColumns_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetColumnsResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetColumns_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__.items()] + 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) +all_structs.append(GetColumns_result) +GetColumns_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetColumnsResp, None], None, ), # 0 +) + + +class GetFunctions_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetFunctionsReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetFunctions_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__.items()] + 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) +all_structs.append(GetFunctions_args) +GetFunctions_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetFunctionsReq, None], None, ), # 1 +) + + +class GetFunctions_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetFunctionsResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetFunctions_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__.items()] + 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) +all_structs.append(GetFunctions_result) +GetFunctions_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetFunctionsResp, None], None, ), # 0 +) + + +class GetPrimaryKeys_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetPrimaryKeysReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetPrimaryKeys_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__.items()] + 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) +all_structs.append(GetPrimaryKeys_args) +GetPrimaryKeys_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetPrimaryKeysReq, None], None, ), # 1 +) + + +class GetPrimaryKeys_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetPrimaryKeysResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetPrimaryKeys_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__.items()] + 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) +all_structs.append(GetPrimaryKeys_result) +GetPrimaryKeys_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetPrimaryKeysResp, None], None, ), # 0 +) + + +class GetCrossReference_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetCrossReferenceReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetCrossReference_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__.items()] + 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) +all_structs.append(GetCrossReference_args) +GetCrossReference_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetCrossReferenceReq, None], None, ), # 1 +) + + +class GetCrossReference_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetCrossReferenceResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetCrossReference_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__.items()] + 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) +all_structs.append(GetCrossReference_result) +GetCrossReference_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetCrossReferenceResp, None], None, ), # 0 +) + + +class GetOperationStatus_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetOperationStatusReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetOperationStatus_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__.items()] + 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) +all_structs.append(GetOperationStatus_args) +GetOperationStatus_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetOperationStatusReq, None], None, ), # 1 +) + + +class GetOperationStatus_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetOperationStatusResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetOperationStatus_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__.items()] + 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) +all_structs.append(GetOperationStatus_result) +GetOperationStatus_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetOperationStatusResp, None], None, ), # 0 +) + + +class CancelOperation_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCancelOperationReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CancelOperation_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__.items()] + 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) +all_structs.append(CancelOperation_args) +CancelOperation_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TCancelOperationReq, None], None, ), # 1 +) + + +class CancelOperation_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCancelOperationResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CancelOperation_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__.items()] + 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) +all_structs.append(CancelOperation_result) +CancelOperation_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TCancelOperationResp, None], None, ), # 0 +) + + +class CloseOperation_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCloseOperationReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CloseOperation_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__.items()] + 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) +all_structs.append(CloseOperation_args) +CloseOperation_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TCloseOperationReq, None], None, ), # 1 +) + + +class CloseOperation_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCloseOperationResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CloseOperation_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__.items()] + 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) +all_structs.append(CloseOperation_result) +CloseOperation_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TCloseOperationResp, None], None, ), # 0 +) + + +class GetResultSetMetadata_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetResultSetMetadataReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetResultSetMetadata_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__.items()] + 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) +all_structs.append(GetResultSetMetadata_args) +GetResultSetMetadata_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetResultSetMetadataReq, None], None, ), # 1 +) + + +class GetResultSetMetadata_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetResultSetMetadataResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetResultSetMetadata_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__.items()] + 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) +all_structs.append(GetResultSetMetadata_result) +GetResultSetMetadata_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetResultSetMetadataResp, None], None, ), # 0 +) + + +class FetchResults_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TFetchResultsReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('FetchResults_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__.items()] + 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) +all_structs.append(FetchResults_args) +FetchResults_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TFetchResultsReq, None], None, ), # 1 +) + + +class FetchResults_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TFetchResultsResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('FetchResults_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__.items()] + 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) +all_structs.append(FetchResults_result) +FetchResults_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TFetchResultsResp, None], None, ), # 0 +) + + +class GetDelegationToken_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetDelegationTokenReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetDelegationToken_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__.items()] + 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) +all_structs.append(GetDelegationToken_args) +GetDelegationToken_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetDelegationTokenReq, None], None, ), # 1 +) + + +class GetDelegationToken_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetDelegationTokenResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetDelegationToken_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__.items()] + 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) +all_structs.append(GetDelegationToken_result) +GetDelegationToken_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetDelegationTokenResp, None], None, ), # 0 +) + + +class CancelDelegationToken_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCancelDelegationTokenReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CancelDelegationToken_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__.items()] + 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) +all_structs.append(CancelDelegationToken_args) +CancelDelegationToken_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TCancelDelegationTokenReq, None], None, ), # 1 +) + + +class CancelDelegationToken_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TCancelDelegationTokenResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('CancelDelegationToken_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__.items()] + 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) +all_structs.append(CancelDelegationToken_result) +CancelDelegationToken_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TCancelDelegationTokenResp, None], None, ), # 0 +) + + +class RenewDelegationToken_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TRenewDelegationTokenReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('RenewDelegationToken_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__.items()] + 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) +all_structs.append(RenewDelegationToken_args) +RenewDelegationToken_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TRenewDelegationTokenReq, None], None, ), # 1 +) + + +class RenewDelegationToken_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TRenewDelegationTokenResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('RenewDelegationToken_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__.items()] + 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) +all_structs.append(RenewDelegationToken_result) +RenewDelegationToken_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TRenewDelegationTokenResp, None], None, ), # 0 +) + + +class GetQueryId_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetQueryIdReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetQueryId_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__.items()] + 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) +all_structs.append(GetQueryId_args) +GetQueryId_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TGetQueryIdReq, None], None, ), # 1 +) + + +class GetQueryId_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TGetQueryIdResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('GetQueryId_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__.items()] + 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) +all_structs.append(GetQueryId_result) +GetQueryId_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TGetQueryIdResp, None], None, ), # 0 +) + + +class SetClientInfo_args(object): + """ + Attributes: + - req + + """ + + + def __init__(self, req=None,): + self.req = req + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TSetClientInfoReq() + self.req.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('SetClientInfo_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__.items()] + 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) +all_structs.append(SetClientInfo_args) +SetClientInfo_args.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'req', [TSetClientInfoReq, None], None, ), # 1 +) + + +class SetClientInfo_result(object): + """ + Attributes: + - success + + """ + + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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 = TSetClientInfoResp() + self.success.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('SetClientInfo_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__.items()] + 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) +all_structs.append(SetClientInfo_result) +SetClientInfo_result.thrift_spec = ( + (0, TType.STRUCT, 'success', [TSetClientInfoResp, None], None, ), # 0 +) +fix_spec(all_structs) +del all_structs + diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py new file mode 100644 index 000000000000..fe5e7c20b62d --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants', 'TCLIService'] diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py new file mode 100644 index 000000000000..ff858cde608f --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py @@ -0,0 +1,72 @@ +# +# Autogenerated by Thrift Compiler (0.12.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys +from .ttypes import * +PRIMITIVE_TYPES = set(( + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, +)) +COMPLEX_TYPES = set(( + 10, + 11, + 12, + 13, + 14, +)) +COLLECTION_TYPES = set(( + 10, + 11, +)) +TYPE_NAMES = { + 10: "ARRAY", + 4: "BIGINT", + 9: "BINARY", + 0: "BOOLEAN", + 19: "CHAR", + 17: "DATE", + 15: "DECIMAL", + 6: "DOUBLE", + 5: "FLOAT", + 21: "INTERVAL_DAY_TIME", + 20: "INTERVAL_YEAR_MONTH", + 3: "INT", + 11: "MAP", + 16: "NULL", + 2: "SMALLINT", + 7: "STRING", + 12: "STRUCT", + 22: "TIMESTAMP WITH LOCAL TIME ZONE", + 8: "TIMESTAMP", + 1: "TINYINT", + 13: "UNIONTYPE", + 18: "VARCHAR", +} +CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" +PRECISION = "precision" +SCALE = "scale" diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py new file mode 100644 index 000000000000..3a4f151f06dd --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py @@ -0,0 +1,7526 @@ +# +# Autogenerated by Thrift Compiler (0.12.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# +# options string: py +# + +from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException +from thrift.protocol.TProtocol import TProtocolException +from thrift.TRecursive import fix_spec + +import sys + +from thrift.transport import TTransport +all_structs = [] + + +class TProtocolVersion(object): + HIVE_CLI_SERVICE_PROTOCOL_V1 = 0 + HIVE_CLI_SERVICE_PROTOCOL_V2 = 1 + HIVE_CLI_SERVICE_PROTOCOL_V3 = 2 + HIVE_CLI_SERVICE_PROTOCOL_V4 = 3 + HIVE_CLI_SERVICE_PROTOCOL_V5 = 4 + HIVE_CLI_SERVICE_PROTOCOL_V6 = 5 + HIVE_CLI_SERVICE_PROTOCOL_V7 = 6 + HIVE_CLI_SERVICE_PROTOCOL_V8 = 7 + HIVE_CLI_SERVICE_PROTOCOL_V9 = 8 + HIVE_CLI_SERVICE_PROTOCOL_V10 = 9 + HIVE_CLI_SERVICE_PROTOCOL_V11 = 10 + + _VALUES_TO_NAMES = { + 0: "HIVE_CLI_SERVICE_PROTOCOL_V1", + 1: "HIVE_CLI_SERVICE_PROTOCOL_V2", + 2: "HIVE_CLI_SERVICE_PROTOCOL_V3", + 3: "HIVE_CLI_SERVICE_PROTOCOL_V4", + 4: "HIVE_CLI_SERVICE_PROTOCOL_V5", + 5: "HIVE_CLI_SERVICE_PROTOCOL_V6", + 6: "HIVE_CLI_SERVICE_PROTOCOL_V7", + 7: "HIVE_CLI_SERVICE_PROTOCOL_V8", + 8: "HIVE_CLI_SERVICE_PROTOCOL_V9", + 9: "HIVE_CLI_SERVICE_PROTOCOL_V10", + 10: "HIVE_CLI_SERVICE_PROTOCOL_V11", + } + + _NAMES_TO_VALUES = { + "HIVE_CLI_SERVICE_PROTOCOL_V1": 0, + "HIVE_CLI_SERVICE_PROTOCOL_V2": 1, + "HIVE_CLI_SERVICE_PROTOCOL_V3": 2, + "HIVE_CLI_SERVICE_PROTOCOL_V4": 3, + "HIVE_CLI_SERVICE_PROTOCOL_V5": 4, + "HIVE_CLI_SERVICE_PROTOCOL_V6": 5, + "HIVE_CLI_SERVICE_PROTOCOL_V7": 6, + "HIVE_CLI_SERVICE_PROTOCOL_V8": 7, + "HIVE_CLI_SERVICE_PROTOCOL_V9": 8, + "HIVE_CLI_SERVICE_PROTOCOL_V10": 9, + "HIVE_CLI_SERVICE_PROTOCOL_V11": 10, + } + + +class TTypeId(object): + BOOLEAN_TYPE = 0 + TINYINT_TYPE = 1 + SMALLINT_TYPE = 2 + INT_TYPE = 3 + BIGINT_TYPE = 4 + FLOAT_TYPE = 5 + DOUBLE_TYPE = 6 + STRING_TYPE = 7 + TIMESTAMP_TYPE = 8 + BINARY_TYPE = 9 + ARRAY_TYPE = 10 + MAP_TYPE = 11 + STRUCT_TYPE = 12 + UNION_TYPE = 13 + USER_DEFINED_TYPE = 14 + DECIMAL_TYPE = 15 + NULL_TYPE = 16 + DATE_TYPE = 17 + VARCHAR_TYPE = 18 + CHAR_TYPE = 19 + INTERVAL_YEAR_MONTH_TYPE = 20 + INTERVAL_DAY_TIME_TYPE = 21 + TIMESTAMPLOCALTZ_TYPE = 22 + + _VALUES_TO_NAMES = { + 0: "BOOLEAN_TYPE", + 1: "TINYINT_TYPE", + 2: "SMALLINT_TYPE", + 3: "INT_TYPE", + 4: "BIGINT_TYPE", + 5: "FLOAT_TYPE", + 6: "DOUBLE_TYPE", + 7: "STRING_TYPE", + 8: "TIMESTAMP_TYPE", + 9: "BINARY_TYPE", + 10: "ARRAY_TYPE", + 11: "MAP_TYPE", + 12: "STRUCT_TYPE", + 13: "UNION_TYPE", + 14: "USER_DEFINED_TYPE", + 15: "DECIMAL_TYPE", + 16: "NULL_TYPE", + 17: "DATE_TYPE", + 18: "VARCHAR_TYPE", + 19: "CHAR_TYPE", + 20: "INTERVAL_YEAR_MONTH_TYPE", + 21: "INTERVAL_DAY_TIME_TYPE", + 22: "TIMESTAMPLOCALTZ_TYPE", + } + + _NAMES_TO_VALUES = { + "BOOLEAN_TYPE": 0, + "TINYINT_TYPE": 1, + "SMALLINT_TYPE": 2, + "INT_TYPE": 3, + "BIGINT_TYPE": 4, + "FLOAT_TYPE": 5, + "DOUBLE_TYPE": 6, + "STRING_TYPE": 7, + "TIMESTAMP_TYPE": 8, + "BINARY_TYPE": 9, + "ARRAY_TYPE": 10, + "MAP_TYPE": 11, + "STRUCT_TYPE": 12, + "UNION_TYPE": 13, + "USER_DEFINED_TYPE": 14, + "DECIMAL_TYPE": 15, + "NULL_TYPE": 16, + "DATE_TYPE": 17, + "VARCHAR_TYPE": 18, + "CHAR_TYPE": 19, + "INTERVAL_YEAR_MONTH_TYPE": 20, + "INTERVAL_DAY_TIME_TYPE": 21, + "TIMESTAMPLOCALTZ_TYPE": 22, + } + + +class TStatusCode(object): + SUCCESS_STATUS = 0 + SUCCESS_WITH_INFO_STATUS = 1 + STILL_EXECUTING_STATUS = 2 + ERROR_STATUS = 3 + INVALID_HANDLE_STATUS = 4 + + _VALUES_TO_NAMES = { + 0: "SUCCESS_STATUS", + 1: "SUCCESS_WITH_INFO_STATUS", + 2: "STILL_EXECUTING_STATUS", + 3: "ERROR_STATUS", + 4: "INVALID_HANDLE_STATUS", + } + + _NAMES_TO_VALUES = { + "SUCCESS_STATUS": 0, + "SUCCESS_WITH_INFO_STATUS": 1, + "STILL_EXECUTING_STATUS": 2, + "ERROR_STATUS": 3, + "INVALID_HANDLE_STATUS": 4, + } + + +class TOperationState(object): + INITIALIZED_STATE = 0 + RUNNING_STATE = 1 + FINISHED_STATE = 2 + CANCELED_STATE = 3 + CLOSED_STATE = 4 + ERROR_STATE = 5 + UKNOWN_STATE = 6 + PENDING_STATE = 7 + TIMEDOUT_STATE = 8 + + _VALUES_TO_NAMES = { + 0: "INITIALIZED_STATE", + 1: "RUNNING_STATE", + 2: "FINISHED_STATE", + 3: "CANCELED_STATE", + 4: "CLOSED_STATE", + 5: "ERROR_STATE", + 6: "UKNOWN_STATE", + 7: "PENDING_STATE", + 8: "TIMEDOUT_STATE", + } + + _NAMES_TO_VALUES = { + "INITIALIZED_STATE": 0, + "RUNNING_STATE": 1, + "FINISHED_STATE": 2, + "CANCELED_STATE": 3, + "CLOSED_STATE": 4, + "ERROR_STATE": 5, + "UKNOWN_STATE": 6, + "PENDING_STATE": 7, + "TIMEDOUT_STATE": 8, + } + + +class TOperationType(object): + EXECUTE_STATEMENT = 0 + GET_TYPE_INFO = 1 + GET_CATALOGS = 2 + GET_SCHEMAS = 3 + GET_TABLES = 4 + GET_TABLE_TYPES = 5 + GET_COLUMNS = 6 + GET_FUNCTIONS = 7 + UNKNOWN = 8 + + _VALUES_TO_NAMES = { + 0: "EXECUTE_STATEMENT", + 1: "GET_TYPE_INFO", + 2: "GET_CATALOGS", + 3: "GET_SCHEMAS", + 4: "GET_TABLES", + 5: "GET_TABLE_TYPES", + 6: "GET_COLUMNS", + 7: "GET_FUNCTIONS", + 8: "UNKNOWN", + } + + _NAMES_TO_VALUES = { + "EXECUTE_STATEMENT": 0, + "GET_TYPE_INFO": 1, + "GET_CATALOGS": 2, + "GET_SCHEMAS": 3, + "GET_TABLES": 4, + "GET_TABLE_TYPES": 5, + "GET_COLUMNS": 6, + "GET_FUNCTIONS": 7, + "UNKNOWN": 8, + } + + +class TGetInfoType(object): + CLI_MAX_DRIVER_CONNECTIONS = 0 + CLI_MAX_CONCURRENT_ACTIVITIES = 1 + CLI_DATA_SOURCE_NAME = 2 + CLI_FETCH_DIRECTION = 8 + CLI_SERVER_NAME = 13 + CLI_SEARCH_PATTERN_ESCAPE = 14 + CLI_DBMS_NAME = 17 + CLI_DBMS_VER = 18 + CLI_ACCESSIBLE_TABLES = 19 + CLI_ACCESSIBLE_PROCEDURES = 20 + CLI_CURSOR_COMMIT_BEHAVIOR = 23 + CLI_DATA_SOURCE_READ_ONLY = 25 + CLI_DEFAULT_TXN_ISOLATION = 26 + CLI_IDENTIFIER_CASE = 28 + CLI_IDENTIFIER_QUOTE_CHAR = 29 + CLI_MAX_COLUMN_NAME_LEN = 30 + CLI_MAX_CURSOR_NAME_LEN = 31 + CLI_MAX_SCHEMA_NAME_LEN = 32 + CLI_MAX_CATALOG_NAME_LEN = 34 + CLI_MAX_TABLE_NAME_LEN = 35 + CLI_SCROLL_CONCURRENCY = 43 + CLI_TXN_CAPABLE = 46 + CLI_USER_NAME = 47 + CLI_TXN_ISOLATION_OPTION = 72 + CLI_INTEGRITY = 73 + CLI_GETDATA_EXTENSIONS = 81 + CLI_NULL_COLLATION = 85 + CLI_ALTER_TABLE = 86 + CLI_ORDER_BY_COLUMNS_IN_SELECT = 90 + CLI_SPECIAL_CHARACTERS = 94 + CLI_MAX_COLUMNS_IN_GROUP_BY = 97 + CLI_MAX_COLUMNS_IN_INDEX = 98 + CLI_MAX_COLUMNS_IN_ORDER_BY = 99 + CLI_MAX_COLUMNS_IN_SELECT = 100 + CLI_MAX_COLUMNS_IN_TABLE = 101 + CLI_MAX_INDEX_SIZE = 102 + CLI_MAX_ROW_SIZE = 104 + CLI_MAX_STATEMENT_LEN = 105 + CLI_MAX_TABLES_IN_SELECT = 106 + CLI_MAX_USER_NAME_LEN = 107 + CLI_OJ_CAPABILITIES = 115 + CLI_XOPEN_CLI_YEAR = 10000 + CLI_CURSOR_SENSITIVITY = 10001 + CLI_DESCRIBE_PARAMETER = 10002 + CLI_CATALOG_NAME = 10003 + CLI_COLLATION_SEQ = 10004 + CLI_MAX_IDENTIFIER_LEN = 10005 + CLI_ODBC_KEYWORDS = 10006 + + _VALUES_TO_NAMES = { + 0: "CLI_MAX_DRIVER_CONNECTIONS", + 1: "CLI_MAX_CONCURRENT_ACTIVITIES", + 2: "CLI_DATA_SOURCE_NAME", + 8: "CLI_FETCH_DIRECTION", + 13: "CLI_SERVER_NAME", + 14: "CLI_SEARCH_PATTERN_ESCAPE", + 17: "CLI_DBMS_NAME", + 18: "CLI_DBMS_VER", + 19: "CLI_ACCESSIBLE_TABLES", + 20: "CLI_ACCESSIBLE_PROCEDURES", + 23: "CLI_CURSOR_COMMIT_BEHAVIOR", + 25: "CLI_DATA_SOURCE_READ_ONLY", + 26: "CLI_DEFAULT_TXN_ISOLATION", + 28: "CLI_IDENTIFIER_CASE", + 29: "CLI_IDENTIFIER_QUOTE_CHAR", + 30: "CLI_MAX_COLUMN_NAME_LEN", + 31: "CLI_MAX_CURSOR_NAME_LEN", + 32: "CLI_MAX_SCHEMA_NAME_LEN", + 34: "CLI_MAX_CATALOG_NAME_LEN", + 35: "CLI_MAX_TABLE_NAME_LEN", + 43: "CLI_SCROLL_CONCURRENCY", + 46: "CLI_TXN_CAPABLE", + 47: "CLI_USER_NAME", + 72: "CLI_TXN_ISOLATION_OPTION", + 73: "CLI_INTEGRITY", + 81: "CLI_GETDATA_EXTENSIONS", + 85: "CLI_NULL_COLLATION", + 86: "CLI_ALTER_TABLE", + 90: "CLI_ORDER_BY_COLUMNS_IN_SELECT", + 94: "CLI_SPECIAL_CHARACTERS", + 97: "CLI_MAX_COLUMNS_IN_GROUP_BY", + 98: "CLI_MAX_COLUMNS_IN_INDEX", + 99: "CLI_MAX_COLUMNS_IN_ORDER_BY", + 100: "CLI_MAX_COLUMNS_IN_SELECT", + 101: "CLI_MAX_COLUMNS_IN_TABLE", + 102: "CLI_MAX_INDEX_SIZE", + 104: "CLI_MAX_ROW_SIZE", + 105: "CLI_MAX_STATEMENT_LEN", + 106: "CLI_MAX_TABLES_IN_SELECT", + 107: "CLI_MAX_USER_NAME_LEN", + 115: "CLI_OJ_CAPABILITIES", + 10000: "CLI_XOPEN_CLI_YEAR", + 10001: "CLI_CURSOR_SENSITIVITY", + 10002: "CLI_DESCRIBE_PARAMETER", + 10003: "CLI_CATALOG_NAME", + 10004: "CLI_COLLATION_SEQ", + 10005: "CLI_MAX_IDENTIFIER_LEN", + 10006: "CLI_ODBC_KEYWORDS", + } + + _NAMES_TO_VALUES = { + "CLI_MAX_DRIVER_CONNECTIONS": 0, + "CLI_MAX_CONCURRENT_ACTIVITIES": 1, + "CLI_DATA_SOURCE_NAME": 2, + "CLI_FETCH_DIRECTION": 8, + "CLI_SERVER_NAME": 13, + "CLI_SEARCH_PATTERN_ESCAPE": 14, + "CLI_DBMS_NAME": 17, + "CLI_DBMS_VER": 18, + "CLI_ACCESSIBLE_TABLES": 19, + "CLI_ACCESSIBLE_PROCEDURES": 20, + "CLI_CURSOR_COMMIT_BEHAVIOR": 23, + "CLI_DATA_SOURCE_READ_ONLY": 25, + "CLI_DEFAULT_TXN_ISOLATION": 26, + "CLI_IDENTIFIER_CASE": 28, + "CLI_IDENTIFIER_QUOTE_CHAR": 29, + "CLI_MAX_COLUMN_NAME_LEN": 30, + "CLI_MAX_CURSOR_NAME_LEN": 31, + "CLI_MAX_SCHEMA_NAME_LEN": 32, + "CLI_MAX_CATALOG_NAME_LEN": 34, + "CLI_MAX_TABLE_NAME_LEN": 35, + "CLI_SCROLL_CONCURRENCY": 43, + "CLI_TXN_CAPABLE": 46, + "CLI_USER_NAME": 47, + "CLI_TXN_ISOLATION_OPTION": 72, + "CLI_INTEGRITY": 73, + "CLI_GETDATA_EXTENSIONS": 81, + "CLI_NULL_COLLATION": 85, + "CLI_ALTER_TABLE": 86, + "CLI_ORDER_BY_COLUMNS_IN_SELECT": 90, + "CLI_SPECIAL_CHARACTERS": 94, + "CLI_MAX_COLUMNS_IN_GROUP_BY": 97, + "CLI_MAX_COLUMNS_IN_INDEX": 98, + "CLI_MAX_COLUMNS_IN_ORDER_BY": 99, + "CLI_MAX_COLUMNS_IN_SELECT": 100, + "CLI_MAX_COLUMNS_IN_TABLE": 101, + "CLI_MAX_INDEX_SIZE": 102, + "CLI_MAX_ROW_SIZE": 104, + "CLI_MAX_STATEMENT_LEN": 105, + "CLI_MAX_TABLES_IN_SELECT": 106, + "CLI_MAX_USER_NAME_LEN": 107, + "CLI_OJ_CAPABILITIES": 115, + "CLI_XOPEN_CLI_YEAR": 10000, + "CLI_CURSOR_SENSITIVITY": 10001, + "CLI_DESCRIBE_PARAMETER": 10002, + "CLI_CATALOG_NAME": 10003, + "CLI_COLLATION_SEQ": 10004, + "CLI_MAX_IDENTIFIER_LEN": 10005, + "CLI_ODBC_KEYWORDS": 10006, + } + + +class TFetchOrientation(object): + FETCH_NEXT = 0 + FETCH_PRIOR = 1 + FETCH_RELATIVE = 2 + FETCH_ABSOLUTE = 3 + FETCH_FIRST = 4 + FETCH_LAST = 5 + + _VALUES_TO_NAMES = { + 0: "FETCH_NEXT", + 1: "FETCH_PRIOR", + 2: "FETCH_RELATIVE", + 3: "FETCH_ABSOLUTE", + 4: "FETCH_FIRST", + 5: "FETCH_LAST", + } + + _NAMES_TO_VALUES = { + "FETCH_NEXT": 0, + "FETCH_PRIOR": 1, + "FETCH_RELATIVE": 2, + "FETCH_ABSOLUTE": 3, + "FETCH_FIRST": 4, + "FETCH_LAST": 5, + } + + +class TJobExecutionStatus(object): + IN_PROGRESS = 0 + COMPLETE = 1 + NOT_AVAILABLE = 2 + + _VALUES_TO_NAMES = { + 0: "IN_PROGRESS", + 1: "COMPLETE", + 2: "NOT_AVAILABLE", + } + + _NAMES_TO_VALUES = { + "IN_PROGRESS": 0, + "COMPLETE": 1, + "NOT_AVAILABLE": 2, + } + + +class TTypeQualifierValue(object): + """ + Attributes: + - i32Value + - stringValue + + """ + + + def __init__(self, i32Value=None, stringValue=None,): + self.i32Value = i32Value + self.stringValue = stringValue + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.i32Value = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TTypeQualifierValue') + if self.i32Value is not None: + oprot.writeFieldBegin('i32Value', TType.I32, 1) + oprot.writeI32(self.i32Value) + oprot.writeFieldEnd() + if self.stringValue is not None: + oprot.writeFieldBegin('stringValue', TType.STRING, 2) + oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TTypeQualifiers(object): + """ + Attributes: + - qualifiers + + """ + + + def __init__(self, qualifiers=None,): + self.qualifiers = qualifiers + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.MAP: + self.qualifiers = {} + (_ktype1, _vtype2, _size0) = iprot.readMapBegin() + for _i4 in range(_size0): + _key5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val6 = TTypeQualifierValue() + _val6.read(iprot) + self.qualifiers[_key5] = _val6 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TTypeQualifiers') + if self.qualifiers is not None: + oprot.writeFieldBegin('qualifiers', TType.MAP, 1) + oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.qualifiers)) + for kiter7, viter8 in self.qualifiers.items(): + oprot.writeString(kiter7.encode('utf-8') if sys.version_info[0] == 2 else kiter7) + viter8.write(oprot) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.qualifiers is None: + raise TProtocolException(message='Required field qualifiers is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TPrimitiveTypeEntry(object): + """ + Attributes: + - type + - typeQualifiers + + """ + + + def __init__(self, type=None, typeQualifiers=None,): + self.type = type + self.typeQualifiers = typeQualifiers + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.type = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.typeQualifiers = TTypeQualifiers() + self.typeQualifiers.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TPrimitiveTypeEntry') + if self.type is not None: + oprot.writeFieldBegin('type', TType.I32, 1) + oprot.writeI32(self.type) + oprot.writeFieldEnd() + if self.typeQualifiers is not None: + oprot.writeFieldBegin('typeQualifiers', TType.STRUCT, 2) + self.typeQualifiers.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.type is None: + raise TProtocolException(message='Required field type is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TArrayTypeEntry(object): + """ + Attributes: + - objectTypePtr + + """ + + + def __init__(self, objectTypePtr=None,): + self.objectTypePtr = objectTypePtr + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.objectTypePtr = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TArrayTypeEntry') + if self.objectTypePtr is not None: + oprot.writeFieldBegin('objectTypePtr', TType.I32, 1) + oprot.writeI32(self.objectTypePtr) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.objectTypePtr is None: + raise TProtocolException(message='Required field objectTypePtr is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TMapTypeEntry(object): + """ + Attributes: + - keyTypePtr + - valueTypePtr + + """ + + + def __init__(self, keyTypePtr=None, valueTypePtr=None,): + self.keyTypePtr = keyTypePtr + self.valueTypePtr = valueTypePtr + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.keyTypePtr = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.valueTypePtr = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TMapTypeEntry') + if self.keyTypePtr is not None: + oprot.writeFieldBegin('keyTypePtr', TType.I32, 1) + oprot.writeI32(self.keyTypePtr) + oprot.writeFieldEnd() + if self.valueTypePtr is not None: + oprot.writeFieldBegin('valueTypePtr', TType.I32, 2) + oprot.writeI32(self.valueTypePtr) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.keyTypePtr is None: + raise TProtocolException(message='Required field keyTypePtr is unset!') + if self.valueTypePtr is None: + raise TProtocolException(message='Required field valueTypePtr is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TStructTypeEntry(object): + """ + Attributes: + - nameToTypePtr + + """ + + + def __init__(self, nameToTypePtr=None,): + self.nameToTypePtr = nameToTypePtr + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.MAP: + self.nameToTypePtr = {} + (_ktype10, _vtype11, _size9) = iprot.readMapBegin() + for _i13 in range(_size9): + _key14 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val15 = iprot.readI32() + self.nameToTypePtr[_key14] = _val15 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TStructTypeEntry') + if self.nameToTypePtr is not None: + oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1) + oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr)) + for kiter16, viter17 in self.nameToTypePtr.items(): + oprot.writeString(kiter16.encode('utf-8') if sys.version_info[0] == 2 else kiter16) + oprot.writeI32(viter17) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.nameToTypePtr is None: + raise TProtocolException(message='Required field nameToTypePtr is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TUnionTypeEntry(object): + """ + Attributes: + - nameToTypePtr + + """ + + + def __init__(self, nameToTypePtr=None,): + self.nameToTypePtr = nameToTypePtr + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.MAP: + self.nameToTypePtr = {} + (_ktype19, _vtype20, _size18) = iprot.readMapBegin() + for _i22 in range(_size18): + _key23 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val24 = iprot.readI32() + self.nameToTypePtr[_key23] = _val24 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TUnionTypeEntry') + if self.nameToTypePtr is not None: + oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1) + oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr)) + for kiter25, viter26 in self.nameToTypePtr.items(): + oprot.writeString(kiter25.encode('utf-8') if sys.version_info[0] == 2 else kiter25) + oprot.writeI32(viter26) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.nameToTypePtr is None: + raise TProtocolException(message='Required field nameToTypePtr is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TUserDefinedTypeEntry(object): + """ + Attributes: + - typeClassName + + """ + + + def __init__(self, typeClassName=None,): + self.typeClassName = typeClassName + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.typeClassName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TUserDefinedTypeEntry') + if self.typeClassName is not None: + oprot.writeFieldBegin('typeClassName', TType.STRING, 1) + oprot.writeString(self.typeClassName.encode('utf-8') if sys.version_info[0] == 2 else self.typeClassName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.typeClassName is None: + raise TProtocolException(message='Required field typeClassName is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TTypeEntry(object): + """ + Attributes: + - primitiveEntry + - arrayEntry + - mapEntry + - structEntry + - unionEntry + - userDefinedTypeEntry + + """ + + + def __init__(self, primitiveEntry=None, arrayEntry=None, mapEntry=None, structEntry=None, unionEntry=None, userDefinedTypeEntry=None,): + self.primitiveEntry = primitiveEntry + self.arrayEntry = arrayEntry + self.mapEntry = mapEntry + self.structEntry = structEntry + self.unionEntry = unionEntry + self.userDefinedTypeEntry = userDefinedTypeEntry + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.primitiveEntry = TPrimitiveTypeEntry() + self.primitiveEntry.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.arrayEntry = TArrayTypeEntry() + self.arrayEntry.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.mapEntry = TMapTypeEntry() + self.mapEntry.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.structEntry = TStructTypeEntry() + self.structEntry.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.unionEntry = TUnionTypeEntry() + self.unionEntry.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.userDefinedTypeEntry = TUserDefinedTypeEntry() + self.userDefinedTypeEntry.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TTypeEntry') + if self.primitiveEntry is not None: + oprot.writeFieldBegin('primitiveEntry', TType.STRUCT, 1) + self.primitiveEntry.write(oprot) + oprot.writeFieldEnd() + if self.arrayEntry is not None: + oprot.writeFieldBegin('arrayEntry', TType.STRUCT, 2) + self.arrayEntry.write(oprot) + oprot.writeFieldEnd() + if self.mapEntry is not None: + oprot.writeFieldBegin('mapEntry', TType.STRUCT, 3) + self.mapEntry.write(oprot) + oprot.writeFieldEnd() + if self.structEntry is not None: + oprot.writeFieldBegin('structEntry', TType.STRUCT, 4) + self.structEntry.write(oprot) + oprot.writeFieldEnd() + if self.unionEntry is not None: + oprot.writeFieldBegin('unionEntry', TType.STRUCT, 5) + self.unionEntry.write(oprot) + oprot.writeFieldEnd() + if self.userDefinedTypeEntry is not None: + oprot.writeFieldBegin('userDefinedTypeEntry', TType.STRUCT, 6) + self.userDefinedTypeEntry.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__.items()] + 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 TTypeDesc(object): + """ + Attributes: + - types + + """ + + + def __init__(self, types=None,): + self.types = types + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.types = [] + (_etype30, _size27) = iprot.readListBegin() + for _i31 in range(_size27): + _elem32 = TTypeEntry() + _elem32.read(iprot) + self.types.append(_elem32) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TTypeDesc') + if self.types is not None: + oprot.writeFieldBegin('types', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.types)) + for iter33 in self.types: + iter33.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.types is None: + raise TProtocolException(message='Required field types is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TColumnDesc(object): + """ + Attributes: + - columnName + - typeDesc + - position + - comment + + """ + + + def __init__(self, columnName=None, typeDesc=None, position=None, comment=None,): + self.columnName = columnName + self.typeDesc = typeDesc + self.position = position + self.comment = comment + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.columnName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.typeDesc = TTypeDesc() + self.typeDesc.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.position = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.comment = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TColumnDesc') + if self.columnName is not None: + oprot.writeFieldBegin('columnName', TType.STRING, 1) + oprot.writeString(self.columnName.encode('utf-8') if sys.version_info[0] == 2 else self.columnName) + oprot.writeFieldEnd() + if self.typeDesc is not None: + oprot.writeFieldBegin('typeDesc', TType.STRUCT, 2) + self.typeDesc.write(oprot) + oprot.writeFieldEnd() + if self.position is not None: + oprot.writeFieldBegin('position', TType.I32, 3) + oprot.writeI32(self.position) + oprot.writeFieldEnd() + if self.comment is not None: + oprot.writeFieldBegin('comment', TType.STRING, 4) + oprot.writeString(self.comment.encode('utf-8') if sys.version_info[0] == 2 else self.comment) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.columnName is None: + raise TProtocolException(message='Required field columnName is unset!') + if self.typeDesc is None: + raise TProtocolException(message='Required field typeDesc is unset!') + if self.position is None: + raise TProtocolException(message='Required field position is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TTableSchema(object): + """ + Attributes: + - columns + + """ + + + def __init__(self, columns=None,): + self.columns = columns + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.columns = [] + (_etype37, _size34) = iprot.readListBegin() + for _i38 in range(_size34): + _elem39 = TColumnDesc() + _elem39.read(iprot) + self.columns.append(_elem39) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TTableSchema') + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.columns)) + for iter40 in self.columns: + iter40.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.columns is None: + raise TProtocolException(message='Required field columns is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TBoolValue(object): + """ + Attributes: + - value + + """ + + + def __init__(self, value=None,): + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.BOOL: + self.value = iprot.readBool() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TBoolValue') + if self.value is not None: + oprot.writeFieldBegin('value', TType.BOOL, 1) + oprot.writeBool(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TByteValue(object): + """ + Attributes: + - value + + """ + + + def __init__(self, value=None,): + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.BYTE: + self.value = iprot.readByte() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TByteValue') + if self.value is not None: + oprot.writeFieldBegin('value', TType.BYTE, 1) + oprot.writeByte(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TI16Value(object): + """ + Attributes: + - value + + """ + + + def __init__(self, value=None,): + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I16: + self.value = iprot.readI16() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TI16Value') + if self.value is not None: + oprot.writeFieldBegin('value', TType.I16, 1) + oprot.writeI16(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TI32Value(object): + """ + Attributes: + - value + + """ + + + def __init__(self, value=None,): + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.value = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TI32Value') + if self.value is not None: + oprot.writeFieldBegin('value', TType.I32, 1) + oprot.writeI32(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TI64Value(object): + """ + Attributes: + - value + + """ + + + def __init__(self, value=None,): + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I64: + self.value = iprot.readI64() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TI64Value') + if self.value is not None: + oprot.writeFieldBegin('value', TType.I64, 1) + oprot.writeI64(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TDoubleValue(object): + """ + Attributes: + - value + + """ + + + def __init__(self, value=None,): + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.DOUBLE: + self.value = iprot.readDouble() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TDoubleValue') + if self.value is not None: + oprot.writeFieldBegin('value', TType.DOUBLE, 1) + oprot.writeDouble(self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TStringValue(object): + """ + Attributes: + - value + + """ + + + def __init__(self, value=None,): + self.value = value + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.value = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TStringValue') + if self.value is not None: + oprot.writeFieldBegin('value', TType.STRING, 1) + oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TColumnValue(object): + """ + Attributes: + - boolVal + - byteVal + - i16Val + - i32Val + - i64Val + - doubleVal + - stringVal + + """ + + + def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None,): + self.boolVal = boolVal + self.byteVal = byteVal + self.i16Val = i16Val + self.i32Val = i32Val + self.i64Val = i64Val + self.doubleVal = doubleVal + self.stringVal = stringVal + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.boolVal = TBoolValue() + self.boolVal.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.byteVal = TByteValue() + self.byteVal.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.i16Val = TI16Value() + self.i16Val.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.i32Val = TI32Value() + self.i32Val.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.i64Val = TI64Value() + self.i64Val.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.doubleVal = TDoubleValue() + self.doubleVal.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.stringVal = TStringValue() + self.stringVal.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TColumnValue') + if self.boolVal is not None: + oprot.writeFieldBegin('boolVal', TType.STRUCT, 1) + self.boolVal.write(oprot) + oprot.writeFieldEnd() + if self.byteVal is not None: + oprot.writeFieldBegin('byteVal', TType.STRUCT, 2) + self.byteVal.write(oprot) + oprot.writeFieldEnd() + if self.i16Val is not None: + oprot.writeFieldBegin('i16Val', TType.STRUCT, 3) + self.i16Val.write(oprot) + oprot.writeFieldEnd() + if self.i32Val is not None: + oprot.writeFieldBegin('i32Val', TType.STRUCT, 4) + self.i32Val.write(oprot) + oprot.writeFieldEnd() + if self.i64Val is not None: + oprot.writeFieldBegin('i64Val', TType.STRUCT, 5) + self.i64Val.write(oprot) + oprot.writeFieldEnd() + if self.doubleVal is not None: + oprot.writeFieldBegin('doubleVal', TType.STRUCT, 6) + self.doubleVal.write(oprot) + oprot.writeFieldEnd() + if self.stringVal is not None: + oprot.writeFieldBegin('stringVal', TType.STRUCT, 7) + self.stringVal.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__.items()] + 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 TRow(object): + """ + Attributes: + - colVals + + """ + + + def __init__(self, colVals=None,): + self.colVals = colVals + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.colVals = [] + (_etype44, _size41) = iprot.readListBegin() + for _i45 in range(_size41): + _elem46 = TColumnValue() + _elem46.read(iprot) + self.colVals.append(_elem46) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TRow') + if self.colVals is not None: + oprot.writeFieldBegin('colVals', TType.LIST, 1) + oprot.writeListBegin(TType.STRUCT, len(self.colVals)) + for iter47 in self.colVals: + iter47.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.colVals is None: + raise TProtocolException(message='Required field colVals is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TBoolColumn(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype51, _size48) = iprot.readListBegin() + for _i52 in range(_size48): + _elem53 = iprot.readBool() + self.values.append(_elem53) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TBoolColumn') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.BOOL, len(self.values)) + for iter54 in self.values: + oprot.writeBool(iter54) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TByteColumn(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype58, _size55) = iprot.readListBegin() + for _i59 in range(_size55): + _elem60 = iprot.readByte() + self.values.append(_elem60) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TByteColumn') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.BYTE, len(self.values)) + for iter61 in self.values: + oprot.writeByte(iter61) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TI16Column(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype65, _size62) = iprot.readListBegin() + for _i66 in range(_size62): + _elem67 = iprot.readI16() + self.values.append(_elem67) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TI16Column') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.I16, len(self.values)) + for iter68 in self.values: + oprot.writeI16(iter68) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TI32Column(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype72, _size69) = iprot.readListBegin() + for _i73 in range(_size69): + _elem74 = iprot.readI32() + self.values.append(_elem74) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TI32Column') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.I32, len(self.values)) + for iter75 in self.values: + oprot.writeI32(iter75) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TI64Column(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype79, _size76) = iprot.readListBegin() + for _i80 in range(_size76): + _elem81 = iprot.readI64() + self.values.append(_elem81) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TI64Column') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.I64, len(self.values)) + for iter82 in self.values: + oprot.writeI64(iter82) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TDoubleColumn(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype86, _size83) = iprot.readListBegin() + for _i87 in range(_size83): + _elem88 = iprot.readDouble() + self.values.append(_elem88) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TDoubleColumn') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.DOUBLE, len(self.values)) + for iter89 in self.values: + oprot.writeDouble(iter89) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TStringColumn(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype93, _size90) = iprot.readListBegin() + for _i94 in range(_size90): + _elem95 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.values.append(_elem95) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TStringColumn') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.values)) + for iter96 in self.values: + oprot.writeString(iter96.encode('utf-8') if sys.version_info[0] == 2 else iter96) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TBinaryColumn(object): + """ + Attributes: + - values + - nulls + + """ + + + def __init__(self, values=None, nulls=None,): + self.values = values + self.nulls = nulls + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.values = [] + (_etype100, _size97) = iprot.readListBegin() + for _i101 in range(_size97): + _elem102 = iprot.readBinary() + self.values.append(_elem102) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.nulls = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TBinaryColumn') + if self.values is not None: + oprot.writeFieldBegin('values', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.values)) + for iter103 in self.values: + oprot.writeBinary(iter103) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.nulls is not None: + oprot.writeFieldBegin('nulls', TType.STRING, 2) + oprot.writeBinary(self.nulls) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.values is None: + raise TProtocolException(message='Required field values is unset!') + if self.nulls is None: + raise TProtocolException(message='Required field nulls is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TColumn(object): + """ + Attributes: + - boolVal + - byteVal + - i16Val + - i32Val + - i64Val + - doubleVal + - stringVal + - binaryVal + + """ + + + def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None, binaryVal=None,): + self.boolVal = boolVal + self.byteVal = byteVal + self.i16Val = i16Val + self.i32Val = i32Val + self.i64Val = i64Val + self.doubleVal = doubleVal + self.stringVal = stringVal + self.binaryVal = binaryVal + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.boolVal = TBoolColumn() + self.boolVal.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRUCT: + self.byteVal = TByteColumn() + self.byteVal.read(iprot) + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.i16Val = TI16Column() + self.i16Val.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRUCT: + self.i32Val = TI32Column() + self.i32Val.read(iprot) + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRUCT: + self.i64Val = TI64Column() + self.i64Val.read(iprot) + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRUCT: + self.doubleVal = TDoubleColumn() + self.doubleVal.read(iprot) + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRUCT: + self.stringVal = TStringColumn() + self.stringVal.read(iprot) + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.STRUCT: + self.binaryVal = TBinaryColumn() + self.binaryVal.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TColumn') + if self.boolVal is not None: + oprot.writeFieldBegin('boolVal', TType.STRUCT, 1) + self.boolVal.write(oprot) + oprot.writeFieldEnd() + if self.byteVal is not None: + oprot.writeFieldBegin('byteVal', TType.STRUCT, 2) + self.byteVal.write(oprot) + oprot.writeFieldEnd() + if self.i16Val is not None: + oprot.writeFieldBegin('i16Val', TType.STRUCT, 3) + self.i16Val.write(oprot) + oprot.writeFieldEnd() + if self.i32Val is not None: + oprot.writeFieldBegin('i32Val', TType.STRUCT, 4) + self.i32Val.write(oprot) + oprot.writeFieldEnd() + if self.i64Val is not None: + oprot.writeFieldBegin('i64Val', TType.STRUCT, 5) + self.i64Val.write(oprot) + oprot.writeFieldEnd() + if self.doubleVal is not None: + oprot.writeFieldBegin('doubleVal', TType.STRUCT, 6) + self.doubleVal.write(oprot) + oprot.writeFieldEnd() + if self.stringVal is not None: + oprot.writeFieldBegin('stringVal', TType.STRUCT, 7) + self.stringVal.write(oprot) + oprot.writeFieldEnd() + if self.binaryVal is not None: + oprot.writeFieldBegin('binaryVal', TType.STRUCT, 8) + self.binaryVal.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__.items()] + 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 TRowSet(object): + """ + Attributes: + - startRowOffset + - rows + - columns + - binaryColumns + - columnCount + + """ + + + def __init__(self, startRowOffset=None, rows=None, columns=None, binaryColumns=None, columnCount=None,): + self.startRowOffset = startRowOffset + self.rows = rows + self.columns = columns + self.binaryColumns = binaryColumns + self.columnCount = columnCount + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I64: + self.startRowOffset = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rows = [] + (_etype107, _size104) = iprot.readListBegin() + for _i108 in range(_size104): + _elem109 = TRow() + _elem109.read(iprot) + self.rows.append(_elem109) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.LIST: + self.columns = [] + (_etype113, _size110) = iprot.readListBegin() + for _i114 in range(_size110): + _elem115 = TColumn() + _elem115.read(iprot) + self.columns.append(_elem115) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.binaryColumns = iprot.readBinary() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.columnCount = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TRowSet') + if self.startRowOffset is not None: + oprot.writeFieldBegin('startRowOffset', TType.I64, 1) + oprot.writeI64(self.startRowOffset) + oprot.writeFieldEnd() + if self.rows is not None: + oprot.writeFieldBegin('rows', TType.LIST, 2) + oprot.writeListBegin(TType.STRUCT, len(self.rows)) + for iter116 in self.rows: + iter116.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.columns is not None: + oprot.writeFieldBegin('columns', TType.LIST, 3) + oprot.writeListBegin(TType.STRUCT, len(self.columns)) + for iter117 in self.columns: + iter117.write(oprot) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.binaryColumns is not None: + oprot.writeFieldBegin('binaryColumns', TType.STRING, 4) + oprot.writeBinary(self.binaryColumns) + oprot.writeFieldEnd() + if self.columnCount is not None: + oprot.writeFieldBegin('columnCount', TType.I32, 5) + oprot.writeI32(self.columnCount) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.startRowOffset is None: + raise TProtocolException(message='Required field startRowOffset is unset!') + if self.rows is None: + raise TProtocolException(message='Required field rows is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TStatus(object): + """ + Attributes: + - statusCode + - infoMessages + - sqlState + - errorCode + - errorMessage + + """ + + + def __init__(self, statusCode=None, infoMessages=None, sqlState=None, errorCode=None, errorMessage=None,): + self.statusCode = statusCode + self.infoMessages = infoMessages + self.sqlState = sqlState + self.errorCode = errorCode + self.errorMessage = errorMessage + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.statusCode = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.infoMessages = [] + (_etype121, _size118) = iprot.readListBegin() + for _i122 in range(_size118): + _elem123 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.infoMessages.append(_elem123) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.sqlState = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.errorCode = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.errorMessage = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TStatus') + if self.statusCode is not None: + oprot.writeFieldBegin('statusCode', TType.I32, 1) + oprot.writeI32(self.statusCode) + oprot.writeFieldEnd() + if self.infoMessages is not None: + oprot.writeFieldBegin('infoMessages', TType.LIST, 2) + oprot.writeListBegin(TType.STRING, len(self.infoMessages)) + for iter124 in self.infoMessages: + oprot.writeString(iter124.encode('utf-8') if sys.version_info[0] == 2 else iter124) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.sqlState is not None: + oprot.writeFieldBegin('sqlState', TType.STRING, 3) + oprot.writeString(self.sqlState.encode('utf-8') if sys.version_info[0] == 2 else self.sqlState) + oprot.writeFieldEnd() + if self.errorCode is not None: + oprot.writeFieldBegin('errorCode', TType.I32, 4) + oprot.writeI32(self.errorCode) + oprot.writeFieldEnd() + if self.errorMessage is not None: + oprot.writeFieldBegin('errorMessage', TType.STRING, 5) + oprot.writeString(self.errorMessage.encode('utf-8') if sys.version_info[0] == 2 else self.errorMessage) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.statusCode is None: + raise TProtocolException(message='Required field statusCode is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 THandleIdentifier(object): + """ + Attributes: + - guid + - secret + + """ + + + def __init__(self, guid=None, secret=None,): + self.guid = guid + self.secret = secret + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.guid = iprot.readBinary() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.secret = iprot.readBinary() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('THandleIdentifier') + if self.guid is not None: + oprot.writeFieldBegin('guid', TType.STRING, 1) + oprot.writeBinary(self.guid) + oprot.writeFieldEnd() + if self.secret is not None: + oprot.writeFieldBegin('secret', TType.STRING, 2) + oprot.writeBinary(self.secret) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.guid is None: + raise TProtocolException(message='Required field guid is unset!') + if self.secret is None: + raise TProtocolException(message='Required field secret is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TSessionHandle(object): + """ + Attributes: + - sessionId + + """ + + + def __init__(self, sessionId=None,): + self.sessionId = sessionId + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.sessionId = THandleIdentifier() + self.sessionId.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TSessionHandle') + if self.sessionId is not None: + oprot.writeFieldBegin('sessionId', TType.STRUCT, 1) + self.sessionId.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionId is None: + raise TProtocolException(message='Required field sessionId is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TOperationHandle(object): + """ + Attributes: + - operationId + - operationType + - hasResultSet + - modifiedRowCount + + """ + + + def __init__(self, operationId=None, operationType=None, hasResultSet=None, modifiedRowCount=None,): + self.operationId = operationId + self.operationType = operationType + self.hasResultSet = hasResultSet + self.modifiedRowCount = modifiedRowCount + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.operationId = THandleIdentifier() + self.operationId.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.operationType = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.BOOL: + self.hasResultSet = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.DOUBLE: + self.modifiedRowCount = iprot.readDouble() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TOperationHandle') + if self.operationId is not None: + oprot.writeFieldBegin('operationId', TType.STRUCT, 1) + self.operationId.write(oprot) + oprot.writeFieldEnd() + if self.operationType is not None: + oprot.writeFieldBegin('operationType', TType.I32, 2) + oprot.writeI32(self.operationType) + oprot.writeFieldEnd() + if self.hasResultSet is not None: + oprot.writeFieldBegin('hasResultSet', TType.BOOL, 3) + oprot.writeBool(self.hasResultSet) + oprot.writeFieldEnd() + if self.modifiedRowCount is not None: + oprot.writeFieldBegin('modifiedRowCount', TType.DOUBLE, 4) + oprot.writeDouble(self.modifiedRowCount) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.operationId is None: + raise TProtocolException(message='Required field operationId is unset!') + if self.operationType is None: + raise TProtocolException(message='Required field operationType is unset!') + if self.hasResultSet is None: + raise TProtocolException(message='Required field hasResultSet is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TOpenSessionReq(object): + """ + Attributes: + - client_protocol + - username + - password + - configuration + + """ + + + def __init__(self, client_protocol=9, username=None, password=None, configuration=None,): + self.client_protocol = client_protocol + self.username = username + self.password = password + self.configuration = configuration + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.client_protocol = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.STRING: + self.username = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.password = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.MAP: + self.configuration = {} + (_ktype126, _vtype127, _size125) = iprot.readMapBegin() + for _i129 in range(_size125): + _key130 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val131 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.configuration[_key130] = _val131 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TOpenSessionReq') + if self.client_protocol is not None: + oprot.writeFieldBegin('client_protocol', TType.I32, 1) + oprot.writeI32(self.client_protocol) + oprot.writeFieldEnd() + if self.username is not None: + oprot.writeFieldBegin('username', TType.STRING, 2) + oprot.writeString(self.username.encode('utf-8') if sys.version_info[0] == 2 else self.username) + oprot.writeFieldEnd() + if self.password is not None: + oprot.writeFieldBegin('password', TType.STRING, 3) + oprot.writeString(self.password.encode('utf-8') if sys.version_info[0] == 2 else self.password) + oprot.writeFieldEnd() + if self.configuration is not None: + oprot.writeFieldBegin('configuration', TType.MAP, 4) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) + for kiter132, viter133 in self.configuration.items(): + oprot.writeString(kiter132.encode('utf-8') if sys.version_info[0] == 2 else kiter132) + oprot.writeString(viter133.encode('utf-8') if sys.version_info[0] == 2 else viter133) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.client_protocol is None: + raise TProtocolException(message='Required field client_protocol is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TOpenSessionResp(object): + """ + Attributes: + - status + - serverProtocolVersion + - sessionHandle + - configuration + + """ + + + def __init__(self, status=None, serverProtocolVersion=9, sessionHandle=None, configuration=None,): + self.status = status + self.serverProtocolVersion = serverProtocolVersion + self.sessionHandle = sessionHandle + self.configuration = configuration + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.serverProtocolVersion = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.sessionHandle = TSessionHandle() + self.sessionHandle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.MAP: + self.configuration = {} + (_ktype135, _vtype136, _size134) = iprot.readMapBegin() + for _i138 in range(_size134): + _key139 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val140 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.configuration[_key139] = _val140 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TOpenSessionResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.serverProtocolVersion is not None: + oprot.writeFieldBegin('serverProtocolVersion', TType.I32, 2) + oprot.writeI32(self.serverProtocolVersion) + oprot.writeFieldEnd() + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 3) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.configuration is not None: + oprot.writeFieldBegin('configuration', TType.MAP, 4) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) + for kiter141, viter142 in self.configuration.items(): + oprot.writeString(kiter141.encode('utf-8') if sys.version_info[0] == 2 else kiter141) + oprot.writeString(viter142.encode('utf-8') if sys.version_info[0] == 2 else viter142) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + if self.serverProtocolVersion is None: + raise TProtocolException(message='Required field serverProtocolVersion is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TSetClientInfoReq(object): + """ + Attributes: + - sessionHandle + - configuration + + """ + + + def __init__(self, sessionHandle=None, configuration=None,): + self.sessionHandle = sessionHandle + self.configuration = configuration + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.MAP: + self.configuration = {} + (_ktype144, _vtype145, _size143) = iprot.readMapBegin() + for _i147 in range(_size143): + _key148 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val149 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.configuration[_key148] = _val149 + iprot.readMapEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TSetClientInfoReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.configuration is not None: + oprot.writeFieldBegin('configuration', TType.MAP, 2) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) + for kiter150, viter151 in self.configuration.items(): + oprot.writeString(kiter150.encode('utf-8') if sys.version_info[0] == 2 else kiter150) + oprot.writeString(viter151.encode('utf-8') if sys.version_info[0] == 2 else viter151) + oprot.writeMapEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TSetClientInfoResp(object): + """ + Attributes: + - status + + """ + + + def __init__(self, status=None,): + self.status = status + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TSetClientInfoResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCloseSessionReq(object): + """ + Attributes: + - sessionHandle + + """ + + + def __init__(self, sessionHandle=None,): + self.sessionHandle = sessionHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCloseSessionReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCloseSessionResp(object): + """ + Attributes: + - status + + """ + + + def __init__(self, status=None,): + self.status = status + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCloseSessionResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetInfoValue(object): + """ + Attributes: + - stringValue + - smallIntValue + - integerBitmask + - integerFlag + - binaryValue + - lenValue + + """ + + + def __init__(self, stringValue=None, smallIntValue=None, integerBitmask=None, integerFlag=None, binaryValue=None, lenValue=None,): + self.stringValue = stringValue + self.smallIntValue = smallIntValue + self.integerBitmask = integerBitmask + self.integerFlag = integerFlag + self.binaryValue = binaryValue + self.lenValue = lenValue + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I16: + self.smallIntValue = iprot.readI16() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I32: + self.integerBitmask = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.integerFlag = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I32: + self.binaryValue = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I64: + self.lenValue = iprot.readI64() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetInfoValue') + if self.stringValue is not None: + oprot.writeFieldBegin('stringValue', TType.STRING, 1) + oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue) + oprot.writeFieldEnd() + if self.smallIntValue is not None: + oprot.writeFieldBegin('smallIntValue', TType.I16, 2) + oprot.writeI16(self.smallIntValue) + oprot.writeFieldEnd() + if self.integerBitmask is not None: + oprot.writeFieldBegin('integerBitmask', TType.I32, 3) + oprot.writeI32(self.integerBitmask) + oprot.writeFieldEnd() + if self.integerFlag is not None: + oprot.writeFieldBegin('integerFlag', TType.I32, 4) + oprot.writeI32(self.integerFlag) + oprot.writeFieldEnd() + if self.binaryValue is not None: + oprot.writeFieldBegin('binaryValue', TType.I32, 5) + oprot.writeI32(self.binaryValue) + oprot.writeFieldEnd() + if self.lenValue is not None: + oprot.writeFieldBegin('lenValue', TType.I64, 6) + oprot.writeI64(self.lenValue) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetInfoReq(object): + """ + Attributes: + - sessionHandle + - infoType + + """ + + + def __init__(self, sessionHandle=None, infoType=None,): + self.sessionHandle = sessionHandle + self.infoType = infoType + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.infoType = iprot.readI32() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetInfoReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.infoType is not None: + oprot.writeFieldBegin('infoType', TType.I32, 2) + oprot.writeI32(self.infoType) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + if self.infoType is None: + raise TProtocolException(message='Required field infoType is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetInfoResp(object): + """ + Attributes: + - status + - infoValue + + """ + + + def __init__(self, status=None, infoValue=None,): + self.status = status + self.infoValue = infoValue + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.infoValue = TGetInfoValue() + self.infoValue.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetInfoResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.infoValue is not None: + oprot.writeFieldBegin('infoValue', TType.STRUCT, 2) + self.infoValue.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + if self.infoValue is None: + raise TProtocolException(message='Required field infoValue is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TExecuteStatementReq(object): + """ + Attributes: + - sessionHandle + - statement + - confOverlay + - runAsync + - queryTimeout + + """ + + + def __init__(self, sessionHandle=None, statement=None, confOverlay=None, runAsync=False, queryTimeout=0,): + self.sessionHandle = sessionHandle + self.statement = statement + self.confOverlay = confOverlay + self.runAsync = runAsync + self.queryTimeout = queryTimeout + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.statement = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.MAP: + self.confOverlay = {} + (_ktype153, _vtype154, _size152) = iprot.readMapBegin() + for _i156 in range(_size152): + _key157 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _val158 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.confOverlay[_key157] = _val158 + iprot.readMapEnd() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.BOOL: + self.runAsync = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.I64: + self.queryTimeout = iprot.readI64() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TExecuteStatementReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.statement is not None: + oprot.writeFieldBegin('statement', TType.STRING, 2) + oprot.writeString(self.statement.encode('utf-8') if sys.version_info[0] == 2 else self.statement) + oprot.writeFieldEnd() + if self.confOverlay is not None: + oprot.writeFieldBegin('confOverlay', TType.MAP, 3) + oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.confOverlay)) + for kiter159, viter160 in self.confOverlay.items(): + oprot.writeString(kiter159.encode('utf-8') if sys.version_info[0] == 2 else kiter159) + oprot.writeString(viter160.encode('utf-8') if sys.version_info[0] == 2 else viter160) + oprot.writeMapEnd() + oprot.writeFieldEnd() + if self.runAsync is not None: + oprot.writeFieldBegin('runAsync', TType.BOOL, 4) + oprot.writeBool(self.runAsync) + oprot.writeFieldEnd() + if self.queryTimeout is not None: + oprot.writeFieldBegin('queryTimeout', TType.I64, 5) + oprot.writeI64(self.queryTimeout) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + if self.statement is None: + raise TProtocolException(message='Required field statement is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TExecuteStatementResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TExecuteStatementResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetTypeInfoReq(object): + """ + Attributes: + - sessionHandle + + """ + + + def __init__(self, sessionHandle=None,): + self.sessionHandle = sessionHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetTypeInfoReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetTypeInfoResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetTypeInfoResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetCatalogsReq(object): + """ + Attributes: + - sessionHandle + + """ + + + def __init__(self, sessionHandle=None,): + self.sessionHandle = sessionHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetCatalogsReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetCatalogsResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetCatalogsResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetSchemasReq(object): + """ + Attributes: + - sessionHandle + - catalogName + - schemaName + + """ + + + def __init__(self, sessionHandle=None, catalogName=None, schemaName=None,): + self.sessionHandle = sessionHandle + self.catalogName = catalogName + self.schemaName = schemaName + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetSchemasReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.schemaName is not None: + oprot.writeFieldBegin('schemaName', TType.STRING, 3) + oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetSchemasResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetSchemasResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetTablesReq(object): + """ + Attributes: + - sessionHandle + - catalogName + - schemaName + - tableName + - tableTypes + + """ + + + def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None, tableTypes=None,): + self.sessionHandle = sessionHandle + self.catalogName = catalogName + self.schemaName = schemaName + self.tableName = tableName + self.tableTypes = tableTypes + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.tableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.LIST: + self.tableTypes = [] + (_etype164, _size161) = iprot.readListBegin() + for _i165 in range(_size161): + _elem166 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.tableTypes.append(_elem166) + iprot.readListEnd() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetTablesReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.schemaName is not None: + oprot.writeFieldBegin('schemaName', TType.STRING, 3) + oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) + oprot.writeFieldEnd() + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 4) + oprot.writeString(self.tableName.encode('utf-8') if sys.version_info[0] == 2 else self.tableName) + oprot.writeFieldEnd() + if self.tableTypes is not None: + oprot.writeFieldBegin('tableTypes', TType.LIST, 5) + oprot.writeListBegin(TType.STRING, len(self.tableTypes)) + for iter167 in self.tableTypes: + oprot.writeString(iter167.encode('utf-8') if sys.version_info[0] == 2 else iter167) + oprot.writeListEnd() + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetTablesResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetTablesResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetTableTypesReq(object): + """ + Attributes: + - sessionHandle + + """ + + + def __init__(self, sessionHandle=None,): + self.sessionHandle = sessionHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetTableTypesReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetTableTypesResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetTableTypesResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetColumnsReq(object): + """ + Attributes: + - sessionHandle + - catalogName + - schemaName + - tableName + - columnName + + """ + + + def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None, columnName=None,): + self.sessionHandle = sessionHandle + self.catalogName = catalogName + self.schemaName = schemaName + self.tableName = tableName + self.columnName = columnName + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.tableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.columnName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetColumnsReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.schemaName is not None: + oprot.writeFieldBegin('schemaName', TType.STRING, 3) + oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) + oprot.writeFieldEnd() + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 4) + oprot.writeString(self.tableName.encode('utf-8') if sys.version_info[0] == 2 else self.tableName) + oprot.writeFieldEnd() + if self.columnName is not None: + oprot.writeFieldBegin('columnName', TType.STRING, 5) + oprot.writeString(self.columnName.encode('utf-8') if sys.version_info[0] == 2 else self.columnName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetColumnsResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetColumnsResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetFunctionsReq(object): + """ + Attributes: + - sessionHandle + - catalogName + - schemaName + - functionName + + """ + + + def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, functionName=None,): + self.sessionHandle = sessionHandle + self.catalogName = catalogName + self.schemaName = schemaName + self.functionName = functionName + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.functionName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetFunctionsReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.schemaName is not None: + oprot.writeFieldBegin('schemaName', TType.STRING, 3) + oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) + oprot.writeFieldEnd() + if self.functionName is not None: + oprot.writeFieldBegin('functionName', TType.STRING, 4) + oprot.writeString(self.functionName.encode('utf-8') if sys.version_info[0] == 2 else self.functionName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + if self.functionName is None: + raise TProtocolException(message='Required field functionName is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetFunctionsResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetFunctionsResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetPrimaryKeysReq(object): + """ + Attributes: + - sessionHandle + - catalogName + - schemaName + - tableName + + """ + + + def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None,): + self.sessionHandle = sessionHandle + self.catalogName = catalogName + self.schemaName = schemaName + self.tableName = tableName + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.tableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetPrimaryKeysReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.catalogName is not None: + oprot.writeFieldBegin('catalogName', TType.STRING, 2) + oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) + oprot.writeFieldEnd() + if self.schemaName is not None: + oprot.writeFieldBegin('schemaName', TType.STRING, 3) + oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) + oprot.writeFieldEnd() + if self.tableName is not None: + oprot.writeFieldBegin('tableName', TType.STRING, 4) + oprot.writeString(self.tableName.encode('utf-8') if sys.version_info[0] == 2 else self.tableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetPrimaryKeysResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetPrimaryKeysResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetCrossReferenceReq(object): + """ + Attributes: + - sessionHandle + - parentCatalogName + - parentSchemaName + - parentTableName + - foreignCatalogName + - foreignSchemaName + - foreignTableName + + """ + + + def __init__(self, sessionHandle=None, parentCatalogName=None, parentSchemaName=None, parentTableName=None, foreignCatalogName=None, foreignSchemaName=None, foreignTableName=None,): + self.sessionHandle = sessionHandle + self.parentCatalogName = parentCatalogName + self.parentSchemaName = parentSchemaName + self.parentTableName = parentTableName + self.foreignCatalogName = foreignCatalogName + self.foreignSchemaName = foreignSchemaName + self.foreignTableName = foreignTableName + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.parentCatalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.parentSchemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.STRING: + self.parentTableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.foreignCatalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.foreignSchemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.STRING: + self.foreignTableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetCrossReferenceReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.parentCatalogName is not None: + oprot.writeFieldBegin('parentCatalogName', TType.STRING, 2) + oprot.writeString(self.parentCatalogName.encode('utf-8') if sys.version_info[0] == 2 else self.parentCatalogName) + oprot.writeFieldEnd() + if self.parentSchemaName is not None: + oprot.writeFieldBegin('parentSchemaName', TType.STRING, 3) + oprot.writeString(self.parentSchemaName.encode('utf-8') if sys.version_info[0] == 2 else self.parentSchemaName) + oprot.writeFieldEnd() + if self.parentTableName is not None: + oprot.writeFieldBegin('parentTableName', TType.STRING, 4) + oprot.writeString(self.parentTableName.encode('utf-8') if sys.version_info[0] == 2 else self.parentTableName) + oprot.writeFieldEnd() + if self.foreignCatalogName is not None: + oprot.writeFieldBegin('foreignCatalogName', TType.STRING, 5) + oprot.writeString(self.foreignCatalogName.encode('utf-8') if sys.version_info[0] == 2 else self.foreignCatalogName) + oprot.writeFieldEnd() + if self.foreignSchemaName is not None: + oprot.writeFieldBegin('foreignSchemaName', TType.STRING, 6) + oprot.writeString(self.foreignSchemaName.encode('utf-8') if sys.version_info[0] == 2 else self.foreignSchemaName) + oprot.writeFieldEnd() + if self.foreignTableName is not None: + oprot.writeFieldBegin('foreignTableName', TType.STRING, 7) + oprot.writeString(self.foreignTableName.encode('utf-8') if sys.version_info[0] == 2 else self.foreignTableName) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetCrossReferenceResp(object): + """ + Attributes: + - status + - operationHandle + + """ + + + def __init__(self, status=None, operationHandle=None,): + self.status = status + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetCrossReferenceResp') + 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() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetOperationStatusReq(object): + """ + Attributes: + - operationHandle + - getProgressUpdate + + """ + + + def __init__(self, operationHandle=None, getProgressUpdate=None,): + self.operationHandle = operationHandle + self.getProgressUpdate = getProgressUpdate + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() + self.operationHandle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.BOOL: + self.getProgressUpdate = iprot.readBool() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetOperationStatusReq') + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + if self.getProgressUpdate is not None: + oprot.writeFieldBegin('getProgressUpdate', TType.BOOL, 2) + oprot.writeBool(self.getProgressUpdate) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.operationHandle is None: + raise TProtocolException(message='Required field operationHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetOperationStatusResp(object): + """ + Attributes: + - status + - operationState + - sqlState + - errorCode + - errorMessage + - taskStatus + - operationStarted + - operationCompleted + - hasResultSet + - progressUpdateResponse + + """ + + + def __init__(self, status=None, operationState=None, sqlState=None, errorCode=None, errorMessage=None, taskStatus=None, operationStarted=None, operationCompleted=None, hasResultSet=None, progressUpdateResponse=None,): + self.status = status + self.operationState = operationState + self.sqlState = sqlState + self.errorCode = errorCode + self.errorMessage = errorMessage + self.taskStatus = taskStatus + self.operationStarted = operationStarted + self.operationCompleted = operationCompleted + self.hasResultSet = hasResultSet + self.progressUpdateResponse = progressUpdateResponse + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.I32: + self.operationState = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.sqlState = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.errorCode = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.errorMessage = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.STRING: + self.taskStatus = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 7: + if ftype == TType.I64: + self.operationStarted = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 8: + if ftype == TType.I64: + self.operationCompleted = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 9: + if ftype == TType.BOOL: + self.hasResultSet = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 10: + if ftype == TType.STRUCT: + self.progressUpdateResponse = TProgressUpdateResp() + self.progressUpdateResponse.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetOperationStatusResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.operationState is not None: + oprot.writeFieldBegin('operationState', TType.I32, 2) + oprot.writeI32(self.operationState) + oprot.writeFieldEnd() + if self.sqlState is not None: + oprot.writeFieldBegin('sqlState', TType.STRING, 3) + oprot.writeString(self.sqlState.encode('utf-8') if sys.version_info[0] == 2 else self.sqlState) + oprot.writeFieldEnd() + if self.errorCode is not None: + oprot.writeFieldBegin('errorCode', TType.I32, 4) + oprot.writeI32(self.errorCode) + oprot.writeFieldEnd() + if self.errorMessage is not None: + oprot.writeFieldBegin('errorMessage', TType.STRING, 5) + oprot.writeString(self.errorMessage.encode('utf-8') if sys.version_info[0] == 2 else self.errorMessage) + oprot.writeFieldEnd() + if self.taskStatus is not None: + oprot.writeFieldBegin('taskStatus', TType.STRING, 6) + oprot.writeString(self.taskStatus.encode('utf-8') if sys.version_info[0] == 2 else self.taskStatus) + oprot.writeFieldEnd() + if self.operationStarted is not None: + oprot.writeFieldBegin('operationStarted', TType.I64, 7) + oprot.writeI64(self.operationStarted) + oprot.writeFieldEnd() + if self.operationCompleted is not None: + oprot.writeFieldBegin('operationCompleted', TType.I64, 8) + oprot.writeI64(self.operationCompleted) + oprot.writeFieldEnd() + if self.hasResultSet is not None: + oprot.writeFieldBegin('hasResultSet', TType.BOOL, 9) + oprot.writeBool(self.hasResultSet) + oprot.writeFieldEnd() + if self.progressUpdateResponse is not None: + oprot.writeFieldBegin('progressUpdateResponse', TType.STRUCT, 10) + self.progressUpdateResponse.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCancelOperationReq(object): + """ + Attributes: + - operationHandle + + """ + + + def __init__(self, operationHandle=None,): + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() + self.operationHandle.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCancelOperationReq') + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.operationHandle is None: + raise TProtocolException(message='Required field operationHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCancelOperationResp(object): + """ + Attributes: + - status + + """ + + + def __init__(self, status=None,): + self.status = status + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCancelOperationResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCloseOperationReq(object): + """ + Attributes: + - operationHandle + + """ + + + def __init__(self, operationHandle=None,): + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() + self.operationHandle.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCloseOperationReq') + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.operationHandle is None: + raise TProtocolException(message='Required field operationHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCloseOperationResp(object): + """ + Attributes: + - status + + """ + + + def __init__(self, status=None,): + self.status = status + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCloseOperationResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetResultSetMetadataReq(object): + """ + Attributes: + - operationHandle + + """ + + + def __init__(self, operationHandle=None,): + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() + self.operationHandle.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetResultSetMetadataReq') + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.operationHandle is None: + raise TProtocolException(message='Required field operationHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetResultSetMetadataResp(object): + """ + Attributes: + - status + - schema + + """ + + + def __init__(self, status=None, schema=None,): + self.status = status + self.schema = schema + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.schema = TTableSchema() + self.schema.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetResultSetMetadataResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.schema is not None: + oprot.writeFieldBegin('schema', TType.STRUCT, 2) + self.schema.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TFetchResultsReq(object): + """ + Attributes: + - operationHandle + - orientation + - maxRows + - fetchType + + """ + + + def __init__(self, operationHandle=None, orientation=0, maxRows=None, fetchType=0,): + self.operationHandle = operationHandle + self.orientation = orientation + self.maxRows = maxRows + self.fetchType = fetchType + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() + self.operationHandle.read(iprot) + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.I32: + self.orientation = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.I64: + self.maxRows = iprot.readI64() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I16: + self.fetchType = iprot.readI16() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TFetchResultsReq') + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + if self.orientation is not None: + oprot.writeFieldBegin('orientation', TType.I32, 2) + oprot.writeI32(self.orientation) + oprot.writeFieldEnd() + if self.maxRows is not None: + oprot.writeFieldBegin('maxRows', TType.I64, 3) + oprot.writeI64(self.maxRows) + oprot.writeFieldEnd() + if self.fetchType is not None: + oprot.writeFieldBegin('fetchType', TType.I16, 4) + oprot.writeI16(self.fetchType) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.operationHandle is None: + raise TProtocolException(message='Required field operationHandle is unset!') + if self.orientation is None: + raise TProtocolException(message='Required field orientation is unset!') + if self.maxRows is None: + raise TProtocolException(message='Required field maxRows is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TFetchResultsResp(object): + """ + Attributes: + - status + - hasMoreRows + - results + + """ + + + def __init__(self, status=None, hasMoreRows=None, results=None,): + self.status = status + self.hasMoreRows = hasMoreRows + self.results = results + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.BOOL: + self.hasMoreRows = iprot.readBool() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRUCT: + self.results = TRowSet() + self.results.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TFetchResultsResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.hasMoreRows is not None: + oprot.writeFieldBegin('hasMoreRows', TType.BOOL, 2) + oprot.writeBool(self.hasMoreRows) + oprot.writeFieldEnd() + if self.results is not None: + oprot.writeFieldBegin('results', TType.STRUCT, 3) + self.results.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetDelegationTokenReq(object): + """ + Attributes: + - sessionHandle + - owner + - renewer + + """ + + + def __init__(self, sessionHandle=None, owner=None, renewer=None,): + self.sessionHandle = sessionHandle + self.owner = owner + self.renewer = renewer + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.owner = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.STRING: + self.renewer = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetDelegationTokenReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.owner is not None: + oprot.writeFieldBegin('owner', TType.STRING, 2) + oprot.writeString(self.owner.encode('utf-8') if sys.version_info[0] == 2 else self.owner) + oprot.writeFieldEnd() + if self.renewer is not None: + oprot.writeFieldBegin('renewer', TType.STRING, 3) + oprot.writeString(self.renewer.encode('utf-8') if sys.version_info[0] == 2 else self.renewer) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + if self.owner is None: + raise TProtocolException(message='Required field owner is unset!') + if self.renewer is None: + raise TProtocolException(message='Required field renewer is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetDelegationTokenResp(object): + """ + Attributes: + - status + - delegationToken + + """ + + + def __init__(self, status=None, delegationToken=None,): + self.status = status + self.delegationToken = delegationToken + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.delegationToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetDelegationTokenResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + if self.delegationToken is not None: + oprot.writeFieldBegin('delegationToken', TType.STRING, 2) + oprot.writeString(self.delegationToken.encode('utf-8') if sys.version_info[0] == 2 else self.delegationToken) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCancelDelegationTokenReq(object): + """ + Attributes: + - sessionHandle + - delegationToken + + """ + + + def __init__(self, sessionHandle=None, delegationToken=None,): + self.sessionHandle = sessionHandle + self.delegationToken = delegationToken + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.delegationToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCancelDelegationTokenReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.delegationToken is not None: + oprot.writeFieldBegin('delegationToken', TType.STRING, 2) + oprot.writeString(self.delegationToken.encode('utf-8') if sys.version_info[0] == 2 else self.delegationToken) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + if self.delegationToken is None: + raise TProtocolException(message='Required field delegationToken is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TCancelDelegationTokenResp(object): + """ + Attributes: + - status + + """ + + + def __init__(self, status=None,): + self.status = status + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TCancelDelegationTokenResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TRenewDelegationTokenReq(object): + """ + Attributes: + - sessionHandle + - delegationToken + + """ + + + def __init__(self, sessionHandle=None, delegationToken=None,): + self.sessionHandle = sessionHandle + self.delegationToken = delegationToken + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.STRING: + self.delegationToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TRenewDelegationTokenReq') + if self.sessionHandle is not None: + oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) + self.sessionHandle.write(oprot) + oprot.writeFieldEnd() + if self.delegationToken is not None: + oprot.writeFieldBegin('delegationToken', TType.STRING, 2) + oprot.writeString(self.delegationToken.encode('utf-8') if sys.version_info[0] == 2 else self.delegationToken) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.sessionHandle is None: + raise TProtocolException(message='Required field sessionHandle is unset!') + if self.delegationToken is None: + raise TProtocolException(message='Required field delegationToken is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TRenewDelegationTokenResp(object): + """ + Attributes: + - status + + """ + + + def __init__(self, status=None,): + self.status = status + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TRenewDelegationTokenResp') + if self.status is not None: + oprot.writeFieldBegin('status', TType.STRUCT, 1) + self.status.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TProgressUpdateResp(object): + """ + Attributes: + - headerNames + - rows + - progressedPercentage + - status + - footerSummary + - startTime + + """ + + + def __init__(self, headerNames=None, rows=None, progressedPercentage=None, status=None, footerSummary=None, startTime=None,): + self.headerNames = headerNames + self.rows = rows + self.progressedPercentage = progressedPercentage + self.status = status + self.footerSummary = footerSummary + self.startTime = startTime + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.LIST: + self.headerNames = [] + (_etype171, _size168) = iprot.readListBegin() + for _i172 in range(_size168): + _elem173 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + self.headerNames.append(_elem173) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 2: + if ftype == TType.LIST: + self.rows = [] + (_etype177, _size174) = iprot.readListBegin() + for _i178 in range(_size174): + _elem179 = [] + (_etype183, _size180) = iprot.readListBegin() + for _i184 in range(_size180): + _elem185 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + _elem179.append(_elem185) + iprot.readListEnd() + self.rows.append(_elem179) + iprot.readListEnd() + else: + iprot.skip(ftype) + elif fid == 3: + if ftype == TType.DOUBLE: + self.progressedPercentage = iprot.readDouble() + else: + iprot.skip(ftype) + elif fid == 4: + if ftype == TType.I32: + self.status = iprot.readI32() + else: + iprot.skip(ftype) + elif fid == 5: + if ftype == TType.STRING: + self.footerSummary = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + elif fid == 6: + if ftype == TType.I64: + self.startTime = iprot.readI64() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TProgressUpdateResp') + if self.headerNames is not None: + oprot.writeFieldBegin('headerNames', TType.LIST, 1) + oprot.writeListBegin(TType.STRING, len(self.headerNames)) + for iter186 in self.headerNames: + oprot.writeString(iter186.encode('utf-8') if sys.version_info[0] == 2 else iter186) + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.rows is not None: + oprot.writeFieldBegin('rows', TType.LIST, 2) + oprot.writeListBegin(TType.LIST, len(self.rows)) + for iter187 in self.rows: + oprot.writeListBegin(TType.STRING, len(iter187)) + for iter188 in iter187: + oprot.writeString(iter188.encode('utf-8') if sys.version_info[0] == 2 else iter188) + oprot.writeListEnd() + oprot.writeListEnd() + oprot.writeFieldEnd() + if self.progressedPercentage is not None: + oprot.writeFieldBegin('progressedPercentage', TType.DOUBLE, 3) + oprot.writeDouble(self.progressedPercentage) + oprot.writeFieldEnd() + if self.status is not None: + oprot.writeFieldBegin('status', TType.I32, 4) + oprot.writeI32(self.status) + oprot.writeFieldEnd() + if self.footerSummary is not None: + oprot.writeFieldBegin('footerSummary', TType.STRING, 5) + oprot.writeString(self.footerSummary.encode('utf-8') if sys.version_info[0] == 2 else self.footerSummary) + oprot.writeFieldEnd() + if self.startTime is not None: + oprot.writeFieldBegin('startTime', TType.I64, 6) + oprot.writeI64(self.startTime) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.headerNames is None: + raise TProtocolException(message='Required field headerNames is unset!') + if self.rows is None: + raise TProtocolException(message='Required field rows is unset!') + if self.progressedPercentage is None: + raise TProtocolException(message='Required field progressedPercentage is unset!') + if self.status is None: + raise TProtocolException(message='Required field status is unset!') + if self.footerSummary is None: + raise TProtocolException(message='Required field footerSummary is unset!') + if self.startTime is None: + raise TProtocolException(message='Required field startTime is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetQueryIdReq(object): + """ + Attributes: + - operationHandle + + """ + + + def __init__(self, operationHandle=None,): + self.operationHandle = operationHandle + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() + self.operationHandle.read(iprot) + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetQueryIdReq') + if self.operationHandle is not None: + oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) + self.operationHandle.write(oprot) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.operationHandle is None: + raise TProtocolException(message='Required field operationHandle is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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 TGetQueryIdResp(object): + """ + Attributes: + - queryId + + """ + + + def __init__(self, queryId=None,): + self.queryId = queryId + + def read(self, iprot): + if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: + iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 1: + if ftype == TType.STRING: + self.queryId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot._fast_encode is not None and self.thrift_spec is not None: + oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) + return + oprot.writeStructBegin('TGetQueryIdResp') + if self.queryId is not None: + oprot.writeFieldBegin('queryId', TType.STRING, 1) + oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def validate(self): + if self.queryId is None: + raise TProtocolException(message='Required field queryId is unset!') + return + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.items()] + 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) +all_structs.append(TTypeQualifierValue) +TTypeQualifierValue.thrift_spec = ( + None, # 0 + (1, TType.I32, 'i32Value', None, None, ), # 1 + (2, TType.STRING, 'stringValue', 'UTF8', None, ), # 2 +) +all_structs.append(TTypeQualifiers) +TTypeQualifiers.thrift_spec = ( + None, # 0 + (1, TType.MAP, 'qualifiers', (TType.STRING, 'UTF8', TType.STRUCT, [TTypeQualifierValue, None], False), None, ), # 1 +) +all_structs.append(TPrimitiveTypeEntry) +TPrimitiveTypeEntry.thrift_spec = ( + None, # 0 + (1, TType.I32, 'type', None, None, ), # 1 + (2, TType.STRUCT, 'typeQualifiers', [TTypeQualifiers, None], None, ), # 2 +) +all_structs.append(TArrayTypeEntry) +TArrayTypeEntry.thrift_spec = ( + None, # 0 + (1, TType.I32, 'objectTypePtr', None, None, ), # 1 +) +all_structs.append(TMapTypeEntry) +TMapTypeEntry.thrift_spec = ( + None, # 0 + (1, TType.I32, 'keyTypePtr', None, None, ), # 1 + (2, TType.I32, 'valueTypePtr', None, None, ), # 2 +) +all_structs.append(TStructTypeEntry) +TStructTypeEntry.thrift_spec = ( + None, # 0 + (1, TType.MAP, 'nameToTypePtr', (TType.STRING, 'UTF8', TType.I32, None, False), None, ), # 1 +) +all_structs.append(TUnionTypeEntry) +TUnionTypeEntry.thrift_spec = ( + None, # 0 + (1, TType.MAP, 'nameToTypePtr', (TType.STRING, 'UTF8', TType.I32, None, False), None, ), # 1 +) +all_structs.append(TUserDefinedTypeEntry) +TUserDefinedTypeEntry.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'typeClassName', 'UTF8', None, ), # 1 +) +all_structs.append(TTypeEntry) +TTypeEntry.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'primitiveEntry', [TPrimitiveTypeEntry, None], None, ), # 1 + (2, TType.STRUCT, 'arrayEntry', [TArrayTypeEntry, None], None, ), # 2 + (3, TType.STRUCT, 'mapEntry', [TMapTypeEntry, None], None, ), # 3 + (4, TType.STRUCT, 'structEntry', [TStructTypeEntry, None], None, ), # 4 + (5, TType.STRUCT, 'unionEntry', [TUnionTypeEntry, None], None, ), # 5 + (6, TType.STRUCT, 'userDefinedTypeEntry', [TUserDefinedTypeEntry, None], None, ), # 6 +) +all_structs.append(TTypeDesc) +TTypeDesc.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'types', (TType.STRUCT, [TTypeEntry, None], False), None, ), # 1 +) +all_structs.append(TColumnDesc) +TColumnDesc.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'columnName', 'UTF8', None, ), # 1 + (2, TType.STRUCT, 'typeDesc', [TTypeDesc, None], None, ), # 2 + (3, TType.I32, 'position', None, None, ), # 3 + (4, TType.STRING, 'comment', 'UTF8', None, ), # 4 +) +all_structs.append(TTableSchema) +TTableSchema.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'columns', (TType.STRUCT, [TColumnDesc, None], False), None, ), # 1 +) +all_structs.append(TBoolValue) +TBoolValue.thrift_spec = ( + None, # 0 + (1, TType.BOOL, 'value', None, None, ), # 1 +) +all_structs.append(TByteValue) +TByteValue.thrift_spec = ( + None, # 0 + (1, TType.BYTE, 'value', None, None, ), # 1 +) +all_structs.append(TI16Value) +TI16Value.thrift_spec = ( + None, # 0 + (1, TType.I16, 'value', None, None, ), # 1 +) +all_structs.append(TI32Value) +TI32Value.thrift_spec = ( + None, # 0 + (1, TType.I32, 'value', None, None, ), # 1 +) +all_structs.append(TI64Value) +TI64Value.thrift_spec = ( + None, # 0 + (1, TType.I64, 'value', None, None, ), # 1 +) +all_structs.append(TDoubleValue) +TDoubleValue.thrift_spec = ( + None, # 0 + (1, TType.DOUBLE, 'value', None, None, ), # 1 +) +all_structs.append(TStringValue) +TStringValue.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'value', 'UTF8', None, ), # 1 +) +all_structs.append(TColumnValue) +TColumnValue.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'boolVal', [TBoolValue, None], None, ), # 1 + (2, TType.STRUCT, 'byteVal', [TByteValue, None], None, ), # 2 + (3, TType.STRUCT, 'i16Val', [TI16Value, None], None, ), # 3 + (4, TType.STRUCT, 'i32Val', [TI32Value, None], None, ), # 4 + (5, TType.STRUCT, 'i64Val', [TI64Value, None], None, ), # 5 + (6, TType.STRUCT, 'doubleVal', [TDoubleValue, None], None, ), # 6 + (7, TType.STRUCT, 'stringVal', [TStringValue, None], None, ), # 7 +) +all_structs.append(TRow) +TRow.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'colVals', (TType.STRUCT, [TColumnValue, None], False), None, ), # 1 +) +all_structs.append(TBoolColumn) +TBoolColumn.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.BOOL, None, False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TByteColumn) +TByteColumn.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.BYTE, None, False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TI16Column) +TI16Column.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.I16, None, False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TI32Column) +TI32Column.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.I32, None, False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TI64Column) +TI64Column.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.I64, None, False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TDoubleColumn) +TDoubleColumn.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.DOUBLE, None, False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TStringColumn) +TStringColumn.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.STRING, 'UTF8', False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TBinaryColumn) +TBinaryColumn.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'values', (TType.STRING, 'BINARY', False), None, ), # 1 + (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 +) +all_structs.append(TColumn) +TColumn.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'boolVal', [TBoolColumn, None], None, ), # 1 + (2, TType.STRUCT, 'byteVal', [TByteColumn, None], None, ), # 2 + (3, TType.STRUCT, 'i16Val', [TI16Column, None], None, ), # 3 + (4, TType.STRUCT, 'i32Val', [TI32Column, None], None, ), # 4 + (5, TType.STRUCT, 'i64Val', [TI64Column, None], None, ), # 5 + (6, TType.STRUCT, 'doubleVal', [TDoubleColumn, None], None, ), # 6 + (7, TType.STRUCT, 'stringVal', [TStringColumn, None], None, ), # 7 + (8, TType.STRUCT, 'binaryVal', [TBinaryColumn, None], None, ), # 8 +) +all_structs.append(TRowSet) +TRowSet.thrift_spec = ( + None, # 0 + (1, TType.I64, 'startRowOffset', None, None, ), # 1 + (2, TType.LIST, 'rows', (TType.STRUCT, [TRow, None], False), None, ), # 2 + (3, TType.LIST, 'columns', (TType.STRUCT, [TColumn, None], False), None, ), # 3 + (4, TType.STRING, 'binaryColumns', 'BINARY', None, ), # 4 + (5, TType.I32, 'columnCount', None, None, ), # 5 +) +all_structs.append(TStatus) +TStatus.thrift_spec = ( + None, # 0 + (1, TType.I32, 'statusCode', None, None, ), # 1 + (2, TType.LIST, 'infoMessages', (TType.STRING, 'UTF8', False), None, ), # 2 + (3, TType.STRING, 'sqlState', 'UTF8', None, ), # 3 + (4, TType.I32, 'errorCode', None, None, ), # 4 + (5, TType.STRING, 'errorMessage', 'UTF8', None, ), # 5 +) +all_structs.append(THandleIdentifier) +THandleIdentifier.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'guid', 'BINARY', None, ), # 1 + (2, TType.STRING, 'secret', 'BINARY', None, ), # 2 +) +all_structs.append(TSessionHandle) +TSessionHandle.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionId', [THandleIdentifier, None], None, ), # 1 +) +all_structs.append(TOperationHandle) +TOperationHandle.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'operationId', [THandleIdentifier, None], None, ), # 1 + (2, TType.I32, 'operationType', None, None, ), # 2 + (3, TType.BOOL, 'hasResultSet', None, None, ), # 3 + (4, TType.DOUBLE, 'modifiedRowCount', None, None, ), # 4 +) +all_structs.append(TOpenSessionReq) +TOpenSessionReq.thrift_spec = ( + None, # 0 + (1, TType.I32, 'client_protocol', None, 9, ), # 1 + (2, TType.STRING, 'username', 'UTF8', None, ), # 2 + (3, TType.STRING, 'password', 'UTF8', None, ), # 3 + (4, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 +) +all_structs.append(TOpenSessionResp) +TOpenSessionResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.I32, 'serverProtocolVersion', None, 9, ), # 2 + (3, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 3 + (4, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 +) +all_structs.append(TSetClientInfoReq) +TSetClientInfoReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 2 +) +all_structs.append(TSetClientInfoResp) +TSetClientInfoResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 +) +all_structs.append(TCloseSessionReq) +TCloseSessionReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 +) +all_structs.append(TCloseSessionResp) +TCloseSessionResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 +) +all_structs.append(TGetInfoValue) +TGetInfoValue.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'stringValue', 'UTF8', None, ), # 1 + (2, TType.I16, 'smallIntValue', None, None, ), # 2 + (3, TType.I32, 'integerBitmask', None, None, ), # 3 + (4, TType.I32, 'integerFlag', None, None, ), # 4 + (5, TType.I32, 'binaryValue', None, None, ), # 5 + (6, TType.I64, 'lenValue', None, None, ), # 6 +) +all_structs.append(TGetInfoReq) +TGetInfoReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.I32, 'infoType', None, None, ), # 2 +) +all_structs.append(TGetInfoResp) +TGetInfoResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'infoValue', [TGetInfoValue, None], None, ), # 2 +) +all_structs.append(TExecuteStatementReq) +TExecuteStatementReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'statement', 'UTF8', None, ), # 2 + (3, TType.MAP, 'confOverlay', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 3 + (4, TType.BOOL, 'runAsync', None, False, ), # 4 + (5, TType.I64, 'queryTimeout', None, 0, ), # 5 +) +all_structs.append(TExecuteStatementResp) +TExecuteStatementResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetTypeInfoReq) +TGetTypeInfoReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 +) +all_structs.append(TGetTypeInfoResp) +TGetTypeInfoResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetCatalogsReq) +TGetCatalogsReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 +) +all_structs.append(TGetCatalogsResp) +TGetCatalogsResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetSchemasReq) +TGetSchemasReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 +) +all_structs.append(TGetSchemasResp) +TGetSchemasResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetTablesReq) +TGetTablesReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 + (4, TType.STRING, 'tableName', 'UTF8', None, ), # 4 + (5, TType.LIST, 'tableTypes', (TType.STRING, 'UTF8', False), None, ), # 5 +) +all_structs.append(TGetTablesResp) +TGetTablesResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetTableTypesReq) +TGetTableTypesReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 +) +all_structs.append(TGetTableTypesResp) +TGetTableTypesResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetColumnsReq) +TGetColumnsReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 + (4, TType.STRING, 'tableName', 'UTF8', None, ), # 4 + (5, TType.STRING, 'columnName', 'UTF8', None, ), # 5 +) +all_structs.append(TGetColumnsResp) +TGetColumnsResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetFunctionsReq) +TGetFunctionsReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 + (4, TType.STRING, 'functionName', 'UTF8', None, ), # 4 +) +all_structs.append(TGetFunctionsResp) +TGetFunctionsResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetPrimaryKeysReq) +TGetPrimaryKeysReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 + (4, TType.STRING, 'tableName', 'UTF8', None, ), # 4 +) +all_structs.append(TGetPrimaryKeysResp) +TGetPrimaryKeysResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetCrossReferenceReq) +TGetCrossReferenceReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'parentCatalogName', 'UTF8', None, ), # 2 + (3, TType.STRING, 'parentSchemaName', 'UTF8', None, ), # 3 + (4, TType.STRING, 'parentTableName', 'UTF8', None, ), # 4 + (5, TType.STRING, 'foreignCatalogName', 'UTF8', None, ), # 5 + (6, TType.STRING, 'foreignSchemaName', 'UTF8', None, ), # 6 + (7, TType.STRING, 'foreignTableName', 'UTF8', None, ), # 7 +) +all_structs.append(TGetCrossReferenceResp) +TGetCrossReferenceResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 +) +all_structs.append(TGetOperationStatusReq) +TGetOperationStatusReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 + (2, TType.BOOL, 'getProgressUpdate', None, None, ), # 2 +) +all_structs.append(TGetOperationStatusResp) +TGetOperationStatusResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.I32, 'operationState', None, None, ), # 2 + (3, TType.STRING, 'sqlState', 'UTF8', None, ), # 3 + (4, TType.I32, 'errorCode', None, None, ), # 4 + (5, TType.STRING, 'errorMessage', 'UTF8', None, ), # 5 + (6, TType.STRING, 'taskStatus', 'UTF8', None, ), # 6 + (7, TType.I64, 'operationStarted', None, None, ), # 7 + (8, TType.I64, 'operationCompleted', None, None, ), # 8 + (9, TType.BOOL, 'hasResultSet', None, None, ), # 9 + (10, TType.STRUCT, 'progressUpdateResponse', [TProgressUpdateResp, None], None, ), # 10 +) +all_structs.append(TCancelOperationReq) +TCancelOperationReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 +) +all_structs.append(TCancelOperationResp) +TCancelOperationResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 +) +all_structs.append(TCloseOperationReq) +TCloseOperationReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 +) +all_structs.append(TCloseOperationResp) +TCloseOperationResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 +) +all_structs.append(TGetResultSetMetadataReq) +TGetResultSetMetadataReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 +) +all_structs.append(TGetResultSetMetadataResp) +TGetResultSetMetadataResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRUCT, 'schema', [TTableSchema, None], None, ), # 2 +) +all_structs.append(TFetchResultsReq) +TFetchResultsReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 + (2, TType.I32, 'orientation', None, 0, ), # 2 + (3, TType.I64, 'maxRows', None, None, ), # 3 + (4, TType.I16, 'fetchType', None, 0, ), # 4 +) +all_structs.append(TFetchResultsResp) +TFetchResultsResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.BOOL, 'hasMoreRows', None, None, ), # 2 + (3, TType.STRUCT, 'results', [TRowSet, None], None, ), # 3 +) +all_structs.append(TGetDelegationTokenReq) +TGetDelegationTokenReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'owner', 'UTF8', None, ), # 2 + (3, TType.STRING, 'renewer', 'UTF8', None, ), # 3 +) +all_structs.append(TGetDelegationTokenResp) +TGetDelegationTokenResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 + (2, TType.STRING, 'delegationToken', 'UTF8', None, ), # 2 +) +all_structs.append(TCancelDelegationTokenReq) +TCancelDelegationTokenReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'delegationToken', 'UTF8', None, ), # 2 +) +all_structs.append(TCancelDelegationTokenResp) +TCancelDelegationTokenResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 +) +all_structs.append(TRenewDelegationTokenReq) +TRenewDelegationTokenReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 + (2, TType.STRING, 'delegationToken', 'UTF8', None, ), # 2 +) +all_structs.append(TRenewDelegationTokenResp) +TRenewDelegationTokenResp.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 +) +all_structs.append(TProgressUpdateResp) +TProgressUpdateResp.thrift_spec = ( + None, # 0 + (1, TType.LIST, 'headerNames', (TType.STRING, 'UTF8', False), None, ), # 1 + (2, TType.LIST, 'rows', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ), # 2 + (3, TType.DOUBLE, 'progressedPercentage', None, None, ), # 3 + (4, TType.I32, 'status', None, None, ), # 4 + (5, TType.STRING, 'footerSummary', 'UTF8', None, ), # 5 + (6, TType.I64, 'startTime', None, None, ), # 6 +) +all_structs.append(TGetQueryIdReq) +TGetQueryIdReq.thrift_spec = ( + None, # 0 + (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 +) +all_structs.append(TGetQueryIdResp) +TGetQueryIdResp.thrift_spec = ( + None, # 0 + (1, TType.STRING, 'queryId', 'UTF8', None, ), # 1 +) +fix_spec(all_structs) +del all_structs diff --git a/sql/thriftserver/src/gen/thrift/gen-py/__init__.py b/sql/thriftserver/src/gen/thrift/gen-py/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb new file mode 100644 index 000000000000..6d6161539d7e --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb @@ -0,0 +1,1266 @@ +# +# Autogenerated by Thrift Compiler (0.12.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 't_c_l_i_service_types' + +module TCLIService + class Client + include ::Thrift::Client + + def OpenSession(req) + send_OpenSession(req) + return recv_OpenSession() + end + + def send_OpenSession(req) + send_message('OpenSession', OpenSession_args, :req => req) + end + + def recv_OpenSession() + result = receive_message(OpenSession_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'OpenSession failed: unknown result') + end + + def CloseSession(req) + send_CloseSession(req) + return recv_CloseSession() + end + + def send_CloseSession(req) + send_message('CloseSession', CloseSession_args, :req => req) + end + + def recv_CloseSession() + result = receive_message(CloseSession_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CloseSession failed: unknown result') + end + + def GetInfo(req) + send_GetInfo(req) + return recv_GetInfo() + end + + def send_GetInfo(req) + send_message('GetInfo', GetInfo_args, :req => req) + end + + def recv_GetInfo() + result = receive_message(GetInfo_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetInfo failed: unknown result') + end + + def ExecuteStatement(req) + send_ExecuteStatement(req) + return recv_ExecuteStatement() + end + + def send_ExecuteStatement(req) + send_message('ExecuteStatement', ExecuteStatement_args, :req => req) + end + + def recv_ExecuteStatement() + result = receive_message(ExecuteStatement_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'ExecuteStatement failed: unknown result') + end + + def GetTypeInfo(req) + send_GetTypeInfo(req) + return recv_GetTypeInfo() + end + + def send_GetTypeInfo(req) + send_message('GetTypeInfo', GetTypeInfo_args, :req => req) + end + + def recv_GetTypeInfo() + result = receive_message(GetTypeInfo_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetTypeInfo failed: unknown result') + end + + def GetCatalogs(req) + send_GetCatalogs(req) + return recv_GetCatalogs() + end + + def send_GetCatalogs(req) + send_message('GetCatalogs', GetCatalogs_args, :req => req) + end + + def recv_GetCatalogs() + result = receive_message(GetCatalogs_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetCatalogs failed: unknown result') + end + + def GetSchemas(req) + send_GetSchemas(req) + return recv_GetSchemas() + end + + def send_GetSchemas(req) + send_message('GetSchemas', GetSchemas_args, :req => req) + end + + def recv_GetSchemas() + result = receive_message(GetSchemas_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetSchemas failed: unknown result') + end + + def GetTables(req) + send_GetTables(req) + return recv_GetTables() + end + + def send_GetTables(req) + send_message('GetTables', GetTables_args, :req => req) + end + + def recv_GetTables() + result = receive_message(GetTables_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetTables failed: unknown result') + end + + def GetTableTypes(req) + send_GetTableTypes(req) + return recv_GetTableTypes() + end + + def send_GetTableTypes(req) + send_message('GetTableTypes', GetTableTypes_args, :req => req) + end + + def recv_GetTableTypes() + result = receive_message(GetTableTypes_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetTableTypes failed: unknown result') + end + + def GetColumns(req) + send_GetColumns(req) + return recv_GetColumns() + end + + def send_GetColumns(req) + send_message('GetColumns', GetColumns_args, :req => req) + end + + def recv_GetColumns() + result = receive_message(GetColumns_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetColumns failed: unknown result') + end + + def GetFunctions(req) + send_GetFunctions(req) + return recv_GetFunctions() + end + + def send_GetFunctions(req) + send_message('GetFunctions', GetFunctions_args, :req => req) + end + + def recv_GetFunctions() + result = receive_message(GetFunctions_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetFunctions failed: unknown result') + end + + def GetPrimaryKeys(req) + send_GetPrimaryKeys(req) + return recv_GetPrimaryKeys() + end + + def send_GetPrimaryKeys(req) + send_message('GetPrimaryKeys', GetPrimaryKeys_args, :req => req) + end + + def recv_GetPrimaryKeys() + result = receive_message(GetPrimaryKeys_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetPrimaryKeys failed: unknown result') + end + + def GetCrossReference(req) + send_GetCrossReference(req) + return recv_GetCrossReference() + end + + def send_GetCrossReference(req) + send_message('GetCrossReference', GetCrossReference_args, :req => req) + end + + def recv_GetCrossReference() + result = receive_message(GetCrossReference_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetCrossReference failed: unknown result') + end + + def GetOperationStatus(req) + send_GetOperationStatus(req) + return recv_GetOperationStatus() + end + + def send_GetOperationStatus(req) + send_message('GetOperationStatus', GetOperationStatus_args, :req => req) + end + + def recv_GetOperationStatus() + result = receive_message(GetOperationStatus_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetOperationStatus failed: unknown result') + end + + def CancelOperation(req) + send_CancelOperation(req) + return recv_CancelOperation() + end + + def send_CancelOperation(req) + send_message('CancelOperation', CancelOperation_args, :req => req) + end + + def recv_CancelOperation() + result = receive_message(CancelOperation_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CancelOperation failed: unknown result') + end + + def CloseOperation(req) + send_CloseOperation(req) + return recv_CloseOperation() + end + + def send_CloseOperation(req) + send_message('CloseOperation', CloseOperation_args, :req => req) + end + + def recv_CloseOperation() + result = receive_message(CloseOperation_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CloseOperation failed: unknown result') + end + + def GetResultSetMetadata(req) + send_GetResultSetMetadata(req) + return recv_GetResultSetMetadata() + end + + def send_GetResultSetMetadata(req) + send_message('GetResultSetMetadata', GetResultSetMetadata_args, :req => req) + end + + def recv_GetResultSetMetadata() + result = receive_message(GetResultSetMetadata_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetResultSetMetadata failed: unknown result') + end + + def FetchResults(req) + send_FetchResults(req) + return recv_FetchResults() + end + + def send_FetchResults(req) + send_message('FetchResults', FetchResults_args, :req => req) + end + + def recv_FetchResults() + result = receive_message(FetchResults_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'FetchResults failed: unknown result') + end + + def GetDelegationToken(req) + send_GetDelegationToken(req) + return recv_GetDelegationToken() + end + + def send_GetDelegationToken(req) + send_message('GetDelegationToken', GetDelegationToken_args, :req => req) + end + + def recv_GetDelegationToken() + result = receive_message(GetDelegationToken_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetDelegationToken failed: unknown result') + end + + def CancelDelegationToken(req) + send_CancelDelegationToken(req) + return recv_CancelDelegationToken() + end + + def send_CancelDelegationToken(req) + send_message('CancelDelegationToken', CancelDelegationToken_args, :req => req) + end + + def recv_CancelDelegationToken() + result = receive_message(CancelDelegationToken_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CancelDelegationToken failed: unknown result') + end + + def RenewDelegationToken(req) + send_RenewDelegationToken(req) + return recv_RenewDelegationToken() + end + + def send_RenewDelegationToken(req) + send_message('RenewDelegationToken', RenewDelegationToken_args, :req => req) + end + + def recv_RenewDelegationToken() + result = receive_message(RenewDelegationToken_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'RenewDelegationToken failed: unknown result') + end + + def GetQueryId(req) + send_GetQueryId(req) + return recv_GetQueryId() + end + + def send_GetQueryId(req) + send_message('GetQueryId', GetQueryId_args, :req => req) + end + + def recv_GetQueryId() + result = receive_message(GetQueryId_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetQueryId failed: unknown result') + end + + def SetClientInfo(req) + send_SetClientInfo(req) + return recv_SetClientInfo() + end + + def send_SetClientInfo(req) + send_message('SetClientInfo', SetClientInfo_args, :req => req) + end + + def recv_SetClientInfo() + result = receive_message(SetClientInfo_result) + return result.success unless result.success.nil? + raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'SetClientInfo failed: unknown result') + end + + end + + class Processor + include ::Thrift::Processor + + def process_OpenSession(seqid, iprot, oprot) + args = read_args(iprot, OpenSession_args) + result = OpenSession_result.new() + result.success = @handler.OpenSession(args.req) + write_result(result, oprot, 'OpenSession', seqid) + end + + def process_CloseSession(seqid, iprot, oprot) + args = read_args(iprot, CloseSession_args) + result = CloseSession_result.new() + result.success = @handler.CloseSession(args.req) + write_result(result, oprot, 'CloseSession', seqid) + end + + def process_GetInfo(seqid, iprot, oprot) + args = read_args(iprot, GetInfo_args) + result = GetInfo_result.new() + result.success = @handler.GetInfo(args.req) + write_result(result, oprot, 'GetInfo', seqid) + end + + def process_ExecuteStatement(seqid, iprot, oprot) + args = read_args(iprot, ExecuteStatement_args) + result = ExecuteStatement_result.new() + result.success = @handler.ExecuteStatement(args.req) + write_result(result, oprot, 'ExecuteStatement', seqid) + end + + def process_GetTypeInfo(seqid, iprot, oprot) + args = read_args(iprot, GetTypeInfo_args) + result = GetTypeInfo_result.new() + result.success = @handler.GetTypeInfo(args.req) + write_result(result, oprot, 'GetTypeInfo', seqid) + end + + def process_GetCatalogs(seqid, iprot, oprot) + args = read_args(iprot, GetCatalogs_args) + result = GetCatalogs_result.new() + result.success = @handler.GetCatalogs(args.req) + write_result(result, oprot, 'GetCatalogs', seqid) + end + + def process_GetSchemas(seqid, iprot, oprot) + args = read_args(iprot, GetSchemas_args) + result = GetSchemas_result.new() + result.success = @handler.GetSchemas(args.req) + write_result(result, oprot, 'GetSchemas', seqid) + end + + def process_GetTables(seqid, iprot, oprot) + args = read_args(iprot, GetTables_args) + result = GetTables_result.new() + result.success = @handler.GetTables(args.req) + write_result(result, oprot, 'GetTables', seqid) + end + + def process_GetTableTypes(seqid, iprot, oprot) + args = read_args(iprot, GetTableTypes_args) + result = GetTableTypes_result.new() + result.success = @handler.GetTableTypes(args.req) + write_result(result, oprot, 'GetTableTypes', seqid) + end + + def process_GetColumns(seqid, iprot, oprot) + args = read_args(iprot, GetColumns_args) + result = GetColumns_result.new() + result.success = @handler.GetColumns(args.req) + write_result(result, oprot, 'GetColumns', seqid) + end + + def process_GetFunctions(seqid, iprot, oprot) + args = read_args(iprot, GetFunctions_args) + result = GetFunctions_result.new() + result.success = @handler.GetFunctions(args.req) + write_result(result, oprot, 'GetFunctions', seqid) + end + + def process_GetPrimaryKeys(seqid, iprot, oprot) + args = read_args(iprot, GetPrimaryKeys_args) + result = GetPrimaryKeys_result.new() + result.success = @handler.GetPrimaryKeys(args.req) + write_result(result, oprot, 'GetPrimaryKeys', seqid) + end + + def process_GetCrossReference(seqid, iprot, oprot) + args = read_args(iprot, GetCrossReference_args) + result = GetCrossReference_result.new() + result.success = @handler.GetCrossReference(args.req) + write_result(result, oprot, 'GetCrossReference', seqid) + end + + def process_GetOperationStatus(seqid, iprot, oprot) + args = read_args(iprot, GetOperationStatus_args) + result = GetOperationStatus_result.new() + result.success = @handler.GetOperationStatus(args.req) + write_result(result, oprot, 'GetOperationStatus', seqid) + end + + def process_CancelOperation(seqid, iprot, oprot) + args = read_args(iprot, CancelOperation_args) + result = CancelOperation_result.new() + result.success = @handler.CancelOperation(args.req) + write_result(result, oprot, 'CancelOperation', seqid) + end + + def process_CloseOperation(seqid, iprot, oprot) + args = read_args(iprot, CloseOperation_args) + result = CloseOperation_result.new() + result.success = @handler.CloseOperation(args.req) + write_result(result, oprot, 'CloseOperation', seqid) + end + + def process_GetResultSetMetadata(seqid, iprot, oprot) + args = read_args(iprot, GetResultSetMetadata_args) + result = GetResultSetMetadata_result.new() + result.success = @handler.GetResultSetMetadata(args.req) + write_result(result, oprot, 'GetResultSetMetadata', seqid) + end + + def process_FetchResults(seqid, iprot, oprot) + args = read_args(iprot, FetchResults_args) + result = FetchResults_result.new() + result.success = @handler.FetchResults(args.req) + write_result(result, oprot, 'FetchResults', seqid) + end + + def process_GetDelegationToken(seqid, iprot, oprot) + args = read_args(iprot, GetDelegationToken_args) + result = GetDelegationToken_result.new() + result.success = @handler.GetDelegationToken(args.req) + write_result(result, oprot, 'GetDelegationToken', seqid) + end + + def process_CancelDelegationToken(seqid, iprot, oprot) + args = read_args(iprot, CancelDelegationToken_args) + result = CancelDelegationToken_result.new() + result.success = @handler.CancelDelegationToken(args.req) + write_result(result, oprot, 'CancelDelegationToken', seqid) + end + + def process_RenewDelegationToken(seqid, iprot, oprot) + args = read_args(iprot, RenewDelegationToken_args) + result = RenewDelegationToken_result.new() + result.success = @handler.RenewDelegationToken(args.req) + write_result(result, oprot, 'RenewDelegationToken', seqid) + end + + def process_GetQueryId(seqid, iprot, oprot) + args = read_args(iprot, GetQueryId_args) + result = GetQueryId_result.new() + result.success = @handler.GetQueryId(args.req) + write_result(result, oprot, 'GetQueryId', seqid) + end + + def process_SetClientInfo(seqid, iprot, oprot) + args = read_args(iprot, SetClientInfo_args) + result = SetClientInfo_result.new() + result.success = @handler.SetClientInfo(args.req) + write_result(result, oprot, 'SetClientInfo', seqid) + end + + end + + # HELPER FUNCTIONS AND STRUCTURES + + class OpenSession_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TOpenSessionReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class OpenSession_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TOpenSessionResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CloseSession_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCloseSessionReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CloseSession_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCloseSessionResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetInfo_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetInfoReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetInfo_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetInfoResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class ExecuteStatement_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 ExecuteStatement_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TExecuteStatementResp} + } + + 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 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetTypeInfoReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetTypeInfo_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetTypeInfoResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetCatalogs_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetCatalogsReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetCatalogs_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetCatalogsResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetSchemas_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetSchemasReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetSchemas_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetSchemasResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetTables_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetTablesReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetTables_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetTablesResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetTableTypes_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetTableTypesReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetTableTypes_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetTableTypesResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetColumns_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetColumnsReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetColumns_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetColumnsResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetFunctions_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetFunctionsReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetFunctions_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetFunctionsResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetPrimaryKeys_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetPrimaryKeysReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetPrimaryKeys_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetPrimaryKeysResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetCrossReference_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetCrossReferenceReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetCrossReference_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetCrossReferenceResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetOperationStatus_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetOperationStatusReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetOperationStatus_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetOperationStatusResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CancelOperation_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCancelOperationReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CancelOperation_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCancelOperationResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CloseOperation_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCloseOperationReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CloseOperation_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCloseOperationResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetResultSetMetadata_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetResultSetMetadataReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetResultSetMetadata_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetResultSetMetadataResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchResults_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TFetchResultsReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class FetchResults_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TFetchResultsResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetDelegationToken_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetDelegationTokenReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetDelegationToken_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetDelegationTokenResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CancelDelegationToken_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCancelDelegationTokenReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class CancelDelegationToken_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCancelDelegationTokenResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class RenewDelegationToken_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TRenewDelegationTokenReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class RenewDelegationToken_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TRenewDelegationTokenResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetQueryId_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetQueryIdReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class GetQueryId_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetQueryIdResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class SetClientInfo_args + include ::Thrift::Struct, ::Thrift::Struct_Union + REQ = 1 + + FIELDS = { + REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TSetClientInfoReq} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + + class SetClientInfo_result + include ::Thrift::Struct, ::Thrift::Struct_Union + SUCCESS = 0 + + FIELDS = { + SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TSetClientInfoResp} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self + end + +end + diff --git a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb new file mode 100644 index 000000000000..2dc7371004f8 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb @@ -0,0 +1,74 @@ +# +# Autogenerated by Thrift Compiler (0.12.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' +require 't_c_l_i_service_types' + +PRIMITIVE_TYPES = Set.new([ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, +]) + +COMPLEX_TYPES = Set.new([ + 10, + 11, + 12, + 13, + 14, +]) + +COLLECTION_TYPES = Set.new([ + 10, + 11, +]) + +TYPE_NAMES = { + 10 => %q"ARRAY", + 4 => %q"BIGINT", + 9 => %q"BINARY", + 0 => %q"BOOLEAN", + 19 => %q"CHAR", + 17 => %q"DATE", + 15 => %q"DECIMAL", + 6 => %q"DOUBLE", + 5 => %q"FLOAT", + 21 => %q"INTERVAL_DAY_TIME", + 20 => %q"INTERVAL_YEAR_MONTH", + 3 => %q"INT", + 11 => %q"MAP", + 16 => %q"NULL", + 2 => %q"SMALLINT", + 7 => %q"STRING", + 12 => %q"STRUCT", + 22 => %q"TIMESTAMP WITH LOCAL TIME ZONE", + 8 => %q"TIMESTAMP", + 1 => %q"TINYINT", + 13 => %q"UNIONTYPE", + 18 => %q"VARCHAR", +} + +CHARACTER_MAXIMUM_LENGTH = %q"characterMaximumLength" + +PRECISION = %q"precision" + +SCALE = %q"scale" + diff --git a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb new file mode 100644 index 000000000000..434d6e775eae --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb @@ -0,0 +1,2156 @@ +# +# Autogenerated by Thrift Compiler (0.12.0) +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +require 'thrift' + +module TProtocolVersion + HIVE_CLI_SERVICE_PROTOCOL_V1 = 0 + HIVE_CLI_SERVICE_PROTOCOL_V2 = 1 + HIVE_CLI_SERVICE_PROTOCOL_V3 = 2 + HIVE_CLI_SERVICE_PROTOCOL_V4 = 3 + HIVE_CLI_SERVICE_PROTOCOL_V5 = 4 + HIVE_CLI_SERVICE_PROTOCOL_V6 = 5 + HIVE_CLI_SERVICE_PROTOCOL_V7 = 6 + HIVE_CLI_SERVICE_PROTOCOL_V8 = 7 + HIVE_CLI_SERVICE_PROTOCOL_V9 = 8 + HIVE_CLI_SERVICE_PROTOCOL_V10 = 9 + HIVE_CLI_SERVICE_PROTOCOL_V11 = 10 + VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4", 4 => "HIVE_CLI_SERVICE_PROTOCOL_V5", 5 => "HIVE_CLI_SERVICE_PROTOCOL_V6", 6 => "HIVE_CLI_SERVICE_PROTOCOL_V7", 7 => "HIVE_CLI_SERVICE_PROTOCOL_V8", 8 => "HIVE_CLI_SERVICE_PROTOCOL_V9", 9 => "HIVE_CLI_SERVICE_PROTOCOL_V10", 10 => "HIVE_CLI_SERVICE_PROTOCOL_V11"} + VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4, HIVE_CLI_SERVICE_PROTOCOL_V5, HIVE_CLI_SERVICE_PROTOCOL_V6, HIVE_CLI_SERVICE_PROTOCOL_V7, HIVE_CLI_SERVICE_PROTOCOL_V8, HIVE_CLI_SERVICE_PROTOCOL_V9, HIVE_CLI_SERVICE_PROTOCOL_V10, HIVE_CLI_SERVICE_PROTOCOL_V11]).freeze +end + +module TTypeId + BOOLEAN_TYPE = 0 + TINYINT_TYPE = 1 + SMALLINT_TYPE = 2 + INT_TYPE = 3 + BIGINT_TYPE = 4 + FLOAT_TYPE = 5 + DOUBLE_TYPE = 6 + STRING_TYPE = 7 + TIMESTAMP_TYPE = 8 + BINARY_TYPE = 9 + ARRAY_TYPE = 10 + MAP_TYPE = 11 + STRUCT_TYPE = 12 + UNION_TYPE = 13 + USER_DEFINED_TYPE = 14 + DECIMAL_TYPE = 15 + NULL_TYPE = 16 + DATE_TYPE = 17 + VARCHAR_TYPE = 18 + CHAR_TYPE = 19 + INTERVAL_YEAR_MONTH_TYPE = 20 + INTERVAL_DAY_TIME_TYPE = 21 + TIMESTAMPLOCALTZ_TYPE = 22 + VALUE_MAP = {0 => "BOOLEAN_TYPE", 1 => "TINYINT_TYPE", 2 => "SMALLINT_TYPE", 3 => "INT_TYPE", 4 => "BIGINT_TYPE", 5 => "FLOAT_TYPE", 6 => "DOUBLE_TYPE", 7 => "STRING_TYPE", 8 => "TIMESTAMP_TYPE", 9 => "BINARY_TYPE", 10 => "ARRAY_TYPE", 11 => "MAP_TYPE", 12 => "STRUCT_TYPE", 13 => "UNION_TYPE", 14 => "USER_DEFINED_TYPE", 15 => "DECIMAL_TYPE", 16 => "NULL_TYPE", 17 => "DATE_TYPE", 18 => "VARCHAR_TYPE", 19 => "CHAR_TYPE", 20 => "INTERVAL_YEAR_MONTH_TYPE", 21 => "INTERVAL_DAY_TIME_TYPE", 22 => "TIMESTAMPLOCALTZ_TYPE"} + VALID_VALUES = Set.new([BOOLEAN_TYPE, TINYINT_TYPE, SMALLINT_TYPE, INT_TYPE, BIGINT_TYPE, FLOAT_TYPE, DOUBLE_TYPE, STRING_TYPE, TIMESTAMP_TYPE, BINARY_TYPE, ARRAY_TYPE, MAP_TYPE, STRUCT_TYPE, UNION_TYPE, USER_DEFINED_TYPE, DECIMAL_TYPE, NULL_TYPE, DATE_TYPE, VARCHAR_TYPE, CHAR_TYPE, INTERVAL_YEAR_MONTH_TYPE, INTERVAL_DAY_TIME_TYPE, TIMESTAMPLOCALTZ_TYPE]).freeze +end + +module TStatusCode + SUCCESS_STATUS = 0 + SUCCESS_WITH_INFO_STATUS = 1 + STILL_EXECUTING_STATUS = 2 + ERROR_STATUS = 3 + INVALID_HANDLE_STATUS = 4 + VALUE_MAP = {0 => "SUCCESS_STATUS", 1 => "SUCCESS_WITH_INFO_STATUS", 2 => "STILL_EXECUTING_STATUS", 3 => "ERROR_STATUS", 4 => "INVALID_HANDLE_STATUS"} + VALID_VALUES = Set.new([SUCCESS_STATUS, SUCCESS_WITH_INFO_STATUS, STILL_EXECUTING_STATUS, ERROR_STATUS, INVALID_HANDLE_STATUS]).freeze +end + +module TOperationState + INITIALIZED_STATE = 0 + RUNNING_STATE = 1 + FINISHED_STATE = 2 + CANCELED_STATE = 3 + CLOSED_STATE = 4 + ERROR_STATE = 5 + UKNOWN_STATE = 6 + PENDING_STATE = 7 + TIMEDOUT_STATE = 8 + VALUE_MAP = {0 => "INITIALIZED_STATE", 1 => "RUNNING_STATE", 2 => "FINISHED_STATE", 3 => "CANCELED_STATE", 4 => "CLOSED_STATE", 5 => "ERROR_STATE", 6 => "UKNOWN_STATE", 7 => "PENDING_STATE", 8 => "TIMEDOUT_STATE"} + VALID_VALUES = Set.new([INITIALIZED_STATE, RUNNING_STATE, FINISHED_STATE, CANCELED_STATE, CLOSED_STATE, ERROR_STATE, UKNOWN_STATE, PENDING_STATE, TIMEDOUT_STATE]).freeze +end + +module TOperationType + EXECUTE_STATEMENT = 0 + GET_TYPE_INFO = 1 + GET_CATALOGS = 2 + GET_SCHEMAS = 3 + GET_TABLES = 4 + GET_TABLE_TYPES = 5 + GET_COLUMNS = 6 + GET_FUNCTIONS = 7 + UNKNOWN = 8 + VALUE_MAP = {0 => "EXECUTE_STATEMENT", 1 => "GET_TYPE_INFO", 2 => "GET_CATALOGS", 3 => "GET_SCHEMAS", 4 => "GET_TABLES", 5 => "GET_TABLE_TYPES", 6 => "GET_COLUMNS", 7 => "GET_FUNCTIONS", 8 => "UNKNOWN"} + VALID_VALUES = Set.new([EXECUTE_STATEMENT, GET_TYPE_INFO, GET_CATALOGS, GET_SCHEMAS, GET_TABLES, GET_TABLE_TYPES, GET_COLUMNS, GET_FUNCTIONS, UNKNOWN]).freeze +end + +module TGetInfoType + CLI_MAX_DRIVER_CONNECTIONS = 0 + CLI_MAX_CONCURRENT_ACTIVITIES = 1 + CLI_DATA_SOURCE_NAME = 2 + CLI_FETCH_DIRECTION = 8 + CLI_SERVER_NAME = 13 + CLI_SEARCH_PATTERN_ESCAPE = 14 + CLI_DBMS_NAME = 17 + CLI_DBMS_VER = 18 + CLI_ACCESSIBLE_TABLES = 19 + CLI_ACCESSIBLE_PROCEDURES = 20 + CLI_CURSOR_COMMIT_BEHAVIOR = 23 + CLI_DATA_SOURCE_READ_ONLY = 25 + CLI_DEFAULT_TXN_ISOLATION = 26 + CLI_IDENTIFIER_CASE = 28 + CLI_IDENTIFIER_QUOTE_CHAR = 29 + CLI_MAX_COLUMN_NAME_LEN = 30 + CLI_MAX_CURSOR_NAME_LEN = 31 + CLI_MAX_SCHEMA_NAME_LEN = 32 + CLI_MAX_CATALOG_NAME_LEN = 34 + CLI_MAX_TABLE_NAME_LEN = 35 + CLI_SCROLL_CONCURRENCY = 43 + CLI_TXN_CAPABLE = 46 + CLI_USER_NAME = 47 + CLI_TXN_ISOLATION_OPTION = 72 + CLI_INTEGRITY = 73 + CLI_GETDATA_EXTENSIONS = 81 + CLI_NULL_COLLATION = 85 + CLI_ALTER_TABLE = 86 + CLI_ORDER_BY_COLUMNS_IN_SELECT = 90 + CLI_SPECIAL_CHARACTERS = 94 + CLI_MAX_COLUMNS_IN_GROUP_BY = 97 + CLI_MAX_COLUMNS_IN_INDEX = 98 + CLI_MAX_COLUMNS_IN_ORDER_BY = 99 + CLI_MAX_COLUMNS_IN_SELECT = 100 + CLI_MAX_COLUMNS_IN_TABLE = 101 + CLI_MAX_INDEX_SIZE = 102 + CLI_MAX_ROW_SIZE = 104 + CLI_MAX_STATEMENT_LEN = 105 + CLI_MAX_TABLES_IN_SELECT = 106 + CLI_MAX_USER_NAME_LEN = 107 + CLI_OJ_CAPABILITIES = 115 + CLI_XOPEN_CLI_YEAR = 10000 + CLI_CURSOR_SENSITIVITY = 10001 + CLI_DESCRIBE_PARAMETER = 10002 + CLI_CATALOG_NAME = 10003 + CLI_COLLATION_SEQ = 10004 + CLI_MAX_IDENTIFIER_LEN = 10005 + CLI_ODBC_KEYWORDS = 10006 + VALUE_MAP = {0 => "CLI_MAX_DRIVER_CONNECTIONS", 1 => "CLI_MAX_CONCURRENT_ACTIVITIES", 2 => "CLI_DATA_SOURCE_NAME", 8 => "CLI_FETCH_DIRECTION", 13 => "CLI_SERVER_NAME", 14 => "CLI_SEARCH_PATTERN_ESCAPE", 17 => "CLI_DBMS_NAME", 18 => "CLI_DBMS_VER", 19 => "CLI_ACCESSIBLE_TABLES", 20 => "CLI_ACCESSIBLE_PROCEDURES", 23 => "CLI_CURSOR_COMMIT_BEHAVIOR", 25 => "CLI_DATA_SOURCE_READ_ONLY", 26 => "CLI_DEFAULT_TXN_ISOLATION", 28 => "CLI_IDENTIFIER_CASE", 29 => "CLI_IDENTIFIER_QUOTE_CHAR", 30 => "CLI_MAX_COLUMN_NAME_LEN", 31 => "CLI_MAX_CURSOR_NAME_LEN", 32 => "CLI_MAX_SCHEMA_NAME_LEN", 34 => "CLI_MAX_CATALOG_NAME_LEN", 35 => "CLI_MAX_TABLE_NAME_LEN", 43 => "CLI_SCROLL_CONCURRENCY", 46 => "CLI_TXN_CAPABLE", 47 => "CLI_USER_NAME", 72 => "CLI_TXN_ISOLATION_OPTION", 73 => "CLI_INTEGRITY", 81 => "CLI_GETDATA_EXTENSIONS", 85 => "CLI_NULL_COLLATION", 86 => "CLI_ALTER_TABLE", 90 => "CLI_ORDER_BY_COLUMNS_IN_SELECT", 94 => "CLI_SPECIAL_CHARACTERS", 97 => "CLI_MAX_COLUMNS_IN_GROUP_BY", 98 => "CLI_MAX_COLUMNS_IN_INDEX", 99 => "CLI_MAX_COLUMNS_IN_ORDER_BY", 100 => "CLI_MAX_COLUMNS_IN_SELECT", 101 => "CLI_MAX_COLUMNS_IN_TABLE", 102 => "CLI_MAX_INDEX_SIZE", 104 => "CLI_MAX_ROW_SIZE", 105 => "CLI_MAX_STATEMENT_LEN", 106 => "CLI_MAX_TABLES_IN_SELECT", 107 => "CLI_MAX_USER_NAME_LEN", 115 => "CLI_OJ_CAPABILITIES", 10000 => "CLI_XOPEN_CLI_YEAR", 10001 => "CLI_CURSOR_SENSITIVITY", 10002 => "CLI_DESCRIBE_PARAMETER", 10003 => "CLI_CATALOG_NAME", 10004 => "CLI_COLLATION_SEQ", 10005 => "CLI_MAX_IDENTIFIER_LEN", 10006 => "CLI_ODBC_KEYWORDS"} + VALID_VALUES = Set.new([CLI_MAX_DRIVER_CONNECTIONS, CLI_MAX_CONCURRENT_ACTIVITIES, CLI_DATA_SOURCE_NAME, CLI_FETCH_DIRECTION, CLI_SERVER_NAME, CLI_SEARCH_PATTERN_ESCAPE, CLI_DBMS_NAME, CLI_DBMS_VER, CLI_ACCESSIBLE_TABLES, CLI_ACCESSIBLE_PROCEDURES, CLI_CURSOR_COMMIT_BEHAVIOR, CLI_DATA_SOURCE_READ_ONLY, CLI_DEFAULT_TXN_ISOLATION, CLI_IDENTIFIER_CASE, CLI_IDENTIFIER_QUOTE_CHAR, CLI_MAX_COLUMN_NAME_LEN, CLI_MAX_CURSOR_NAME_LEN, CLI_MAX_SCHEMA_NAME_LEN, CLI_MAX_CATALOG_NAME_LEN, CLI_MAX_TABLE_NAME_LEN, CLI_SCROLL_CONCURRENCY, CLI_TXN_CAPABLE, CLI_USER_NAME, CLI_TXN_ISOLATION_OPTION, CLI_INTEGRITY, CLI_GETDATA_EXTENSIONS, CLI_NULL_COLLATION, CLI_ALTER_TABLE, CLI_ORDER_BY_COLUMNS_IN_SELECT, CLI_SPECIAL_CHARACTERS, CLI_MAX_COLUMNS_IN_GROUP_BY, CLI_MAX_COLUMNS_IN_INDEX, CLI_MAX_COLUMNS_IN_ORDER_BY, CLI_MAX_COLUMNS_IN_SELECT, CLI_MAX_COLUMNS_IN_TABLE, CLI_MAX_INDEX_SIZE, CLI_MAX_ROW_SIZE, CLI_MAX_STATEMENT_LEN, CLI_MAX_TABLES_IN_SELECT, CLI_MAX_USER_NAME_LEN, CLI_OJ_CAPABILITIES, CLI_XOPEN_CLI_YEAR, CLI_CURSOR_SENSITIVITY, CLI_DESCRIBE_PARAMETER, CLI_CATALOG_NAME, CLI_COLLATION_SEQ, CLI_MAX_IDENTIFIER_LEN, CLI_ODBC_KEYWORDS]).freeze +end + +module TFetchOrientation + FETCH_NEXT = 0 + FETCH_PRIOR = 1 + FETCH_RELATIVE = 2 + FETCH_ABSOLUTE = 3 + FETCH_FIRST = 4 + FETCH_LAST = 5 + VALUE_MAP = {0 => "FETCH_NEXT", 1 => "FETCH_PRIOR", 2 => "FETCH_RELATIVE", 3 => "FETCH_ABSOLUTE", 4 => "FETCH_FIRST", 5 => "FETCH_LAST"} + VALID_VALUES = Set.new([FETCH_NEXT, FETCH_PRIOR, FETCH_RELATIVE, FETCH_ABSOLUTE, FETCH_FIRST, FETCH_LAST]).freeze +end + +module TJobExecutionStatus + IN_PROGRESS = 0 + COMPLETE = 1 + NOT_AVAILABLE = 2 + VALUE_MAP = {0 => "IN_PROGRESS", 1 => "COMPLETE", 2 => "NOT_AVAILABLE"} + VALID_VALUES = Set.new([IN_PROGRESS, COMPLETE, NOT_AVAILABLE]).freeze +end + +class TTypeQualifierValue < ::Thrift::Union; end + +class TTypeQualifiers; end + +class TPrimitiveTypeEntry; end + +class TArrayTypeEntry; end + +class TMapTypeEntry; end + +class TStructTypeEntry; end + +class TUnionTypeEntry; end + +class TUserDefinedTypeEntry; end + +class TTypeEntry < ::Thrift::Union; end + +class TTypeDesc; end + +class TColumnDesc; end + +class TTableSchema; end + +class TBoolValue; end + +class TByteValue; end + +class TI16Value; end + +class TI32Value; end + +class TI64Value; end + +class TDoubleValue; end + +class TStringValue; end + +class TColumnValue < ::Thrift::Union; end + +class TRow; end + +class TBoolColumn; end + +class TByteColumn; end + +class TI16Column; end + +class TI32Column; end + +class TI64Column; end + +class TDoubleColumn; end + +class TStringColumn; end + +class TBinaryColumn; end + +class TColumn < ::Thrift::Union; end + +class TRowSet; end + +class TStatus; end + +class THandleIdentifier; end + +class TSessionHandle; end + +class TOperationHandle; end + +class TOpenSessionReq; end + +class TOpenSessionResp; end + +class TSetClientInfoReq; end + +class TSetClientInfoResp; end + +class TCloseSessionReq; end + +class TCloseSessionResp; end + +class TGetInfoValue < ::Thrift::Union; end + +class TGetInfoReq; end + +class TGetInfoResp; end + +class TExecuteStatementReq; end + +class TExecuteStatementResp; end + +class TGetTypeInfoReq; end + +class TGetTypeInfoResp; end + +class TGetCatalogsReq; end + +class TGetCatalogsResp; end + +class TGetSchemasReq; end + +class TGetSchemasResp; end + +class TGetTablesReq; end + +class TGetTablesResp; end + +class TGetTableTypesReq; end + +class TGetTableTypesResp; end + +class TGetColumnsReq; end + +class TGetColumnsResp; end + +class TGetFunctionsReq; end + +class TGetFunctionsResp; end + +class TGetPrimaryKeysReq; end + +class TGetPrimaryKeysResp; end + +class TGetCrossReferenceReq; end + +class TGetCrossReferenceResp; end + +class TGetOperationStatusReq; end + +class TGetOperationStatusResp; end + +class TCancelOperationReq; end + +class TCancelOperationResp; end + +class TCloseOperationReq; end + +class TCloseOperationResp; end + +class TGetResultSetMetadataReq; end + +class TGetResultSetMetadataResp; end + +class TFetchResultsReq; end + +class TFetchResultsResp; end + +class TGetDelegationTokenReq; end + +class TGetDelegationTokenResp; end + +class TCancelDelegationTokenReq; end + +class TCancelDelegationTokenResp; end + +class TRenewDelegationTokenReq; end + +class TRenewDelegationTokenResp; end + +class TProgressUpdateResp; end + +class TGetQueryIdReq; end + +class TGetQueryIdResp; end + +class TTypeQualifierValue < ::Thrift::Union + include ::Thrift::Struct_Union + class << self + def i32Value(val) + TTypeQualifierValue.new(:i32Value, val) + end + + def stringValue(val) + TTypeQualifierValue.new(:stringValue, val) + end + end + + I32VALUE = 1 + STRINGVALUE = 2 + + FIELDS = { + I32VALUE => {:type => ::Thrift::Types::I32, :name => 'i32Value', :optional => true}, + STRINGVALUE => {:type => ::Thrift::Types::STRING, :name => 'stringValue', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? + end + + ::Thrift::Union.generate_accessors self +end + +class TTypeQualifiers + include ::Thrift::Struct, ::Thrift::Struct_Union + QUALIFIERS = 1 + + FIELDS = { + QUALIFIERS => {:type => ::Thrift::Types::MAP, :name => 'qualifiers', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::TTypeQualifierValue}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field qualifiers is unset!') unless @qualifiers + end + + ::Thrift::Struct.generate_accessors self +end + +class TPrimitiveTypeEntry + include ::Thrift::Struct, ::Thrift::Struct_Union + TYPE = 1 + TYPEQUALIFIERS = 2 + + FIELDS = { + TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::TTypeId}, + TYPEQUALIFIERS => {:type => ::Thrift::Types::STRUCT, :name => 'typeQualifiers', :class => ::TTypeQualifiers, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type + unless @type.nil? || ::TTypeId::VALID_VALUES.include?(@type) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TArrayTypeEntry + include ::Thrift::Struct, ::Thrift::Struct_Union + OBJECTTYPEPTR = 1 + + FIELDS = { + OBJECTTYPEPTR => {:type => ::Thrift::Types::I32, :name => 'objectTypePtr'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field objectTypePtr is unset!') unless @objectTypePtr + end + + ::Thrift::Struct.generate_accessors self +end + +class TMapTypeEntry + include ::Thrift::Struct, ::Thrift::Struct_Union + KEYTYPEPTR = 1 + VALUETYPEPTR = 2 + + FIELDS = { + KEYTYPEPTR => {:type => ::Thrift::Types::I32, :name => 'keyTypePtr'}, + VALUETYPEPTR => {:type => ::Thrift::Types::I32, :name => 'valueTypePtr'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyTypePtr is unset!') unless @keyTypePtr + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field valueTypePtr is unset!') unless @valueTypePtr + end + + ::Thrift::Struct.generate_accessors self +end + +class TStructTypeEntry + include ::Thrift::Struct, ::Thrift::Struct_Union + NAMETOTYPEPTR = 1 + + FIELDS = { + NAMETOTYPEPTR => {:type => ::Thrift::Types::MAP, :name => 'nameToTypePtr', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I32}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nameToTypePtr is unset!') unless @nameToTypePtr + end + + ::Thrift::Struct.generate_accessors self +end + +class TUnionTypeEntry + include ::Thrift::Struct, ::Thrift::Struct_Union + NAMETOTYPEPTR = 1 + + FIELDS = { + NAMETOTYPEPTR => {:type => ::Thrift::Types::MAP, :name => 'nameToTypePtr', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I32}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nameToTypePtr is unset!') unless @nameToTypePtr + end + + ::Thrift::Struct.generate_accessors self +end + +class TUserDefinedTypeEntry + include ::Thrift::Struct, ::Thrift::Struct_Union + TYPECLASSNAME = 1 + + FIELDS = { + TYPECLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'typeClassName'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field typeClassName is unset!') unless @typeClassName + end + + ::Thrift::Struct.generate_accessors self +end + +class TTypeEntry < ::Thrift::Union + include ::Thrift::Struct_Union + class << self + def primitiveEntry(val) + TTypeEntry.new(:primitiveEntry, val) + end + + def arrayEntry(val) + TTypeEntry.new(:arrayEntry, val) + end + + def mapEntry(val) + TTypeEntry.new(:mapEntry, val) + end + + def structEntry(val) + TTypeEntry.new(:structEntry, val) + end + + def unionEntry(val) + TTypeEntry.new(:unionEntry, val) + end + + def userDefinedTypeEntry(val) + TTypeEntry.new(:userDefinedTypeEntry, val) + end + end + + PRIMITIVEENTRY = 1 + ARRAYENTRY = 2 + MAPENTRY = 3 + STRUCTENTRY = 4 + UNIONENTRY = 5 + USERDEFINEDTYPEENTRY = 6 + + FIELDS = { + PRIMITIVEENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'primitiveEntry', :class => ::TPrimitiveTypeEntry, :optional => true}, + ARRAYENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'arrayEntry', :class => ::TArrayTypeEntry, :optional => true}, + MAPENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'mapEntry', :class => ::TMapTypeEntry, :optional => true}, + STRUCTENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'structEntry', :class => ::TStructTypeEntry, :optional => true}, + UNIONENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'unionEntry', :class => ::TUnionTypeEntry, :optional => true}, + USERDEFINEDTYPEENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'userDefinedTypeEntry', :class => ::TUserDefinedTypeEntry, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? + end + + ::Thrift::Union.generate_accessors self +end + +class TTypeDesc + include ::Thrift::Struct, ::Thrift::Struct_Union + TYPES = 1 + + FIELDS = { + TYPES => {:type => ::Thrift::Types::LIST, :name => 'types', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TTypeEntry}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field types is unset!') unless @types + end + + ::Thrift::Struct.generate_accessors self +end + +class TColumnDesc + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMNNAME = 1 + TYPEDESC = 2 + POSITION = 3 + COMMENT = 4 + + FIELDS = { + COLUMNNAME => {:type => ::Thrift::Types::STRING, :name => 'columnName'}, + TYPEDESC => {:type => ::Thrift::Types::STRUCT, :name => 'typeDesc', :class => ::TTypeDesc}, + POSITION => {:type => ::Thrift::Types::I32, :name => 'position'}, + COMMENT => {:type => ::Thrift::Types::STRING, :name => 'comment', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columnName is unset!') unless @columnName + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field typeDesc is unset!') unless @typeDesc + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field position is unset!') unless @position + end + + ::Thrift::Struct.generate_accessors self +end + +class TTableSchema + include ::Thrift::Struct, ::Thrift::Struct_Union + COLUMNS = 1 + + FIELDS = { + COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumnDesc}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns + end + + ::Thrift::Struct.generate_accessors self +end + +class TBoolValue + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::BOOL, :name => 'value', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class TByteValue + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::BYTE, :name => 'value', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class TI16Value + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::I16, :name => 'value', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class TI32Value + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::I32, :name => 'value', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class TI64Value + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::I64, :name => 'value', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class TDoubleValue + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::DOUBLE, :name => 'value', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class TStringValue + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUE = 1 + + FIELDS = { + VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + end + + ::Thrift::Struct.generate_accessors self +end + +class TColumnValue < ::Thrift::Union + include ::Thrift::Struct_Union + class << self + def boolVal(val) + TColumnValue.new(:boolVal, val) + end + + def byteVal(val) + TColumnValue.new(:byteVal, val) + end + + def i16Val(val) + TColumnValue.new(:i16Val, val) + end + + def i32Val(val) + TColumnValue.new(:i32Val, val) + end + + def i64Val(val) + TColumnValue.new(:i64Val, val) + end + + def doubleVal(val) + TColumnValue.new(:doubleVal, val) + end + + def stringVal(val) + TColumnValue.new(:stringVal, val) + end + end + + BOOLVAL = 1 + BYTEVAL = 2 + I16VAL = 3 + I32VAL = 4 + I64VAL = 5 + DOUBLEVAL = 6 + STRINGVAL = 7 + + FIELDS = { + BOOLVAL => {:type => ::Thrift::Types::STRUCT, :name => 'boolVal', :class => ::TBoolValue, :optional => true}, + BYTEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'byteVal', :class => ::TByteValue, :optional => true}, + I16VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i16Val', :class => ::TI16Value, :optional => true}, + I32VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i32Val', :class => ::TI32Value, :optional => true}, + I64VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i64Val', :class => ::TI64Value, :optional => true}, + DOUBLEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'doubleVal', :class => ::TDoubleValue, :optional => true}, + STRINGVAL => {:type => ::Thrift::Types::STRUCT, :name => 'stringVal', :class => ::TStringValue, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? + end + + ::Thrift::Union.generate_accessors self +end + +class TRow + include ::Thrift::Struct, ::Thrift::Struct_Union + COLVALS = 1 + + FIELDS = { + COLVALS => {:type => ::Thrift::Types::LIST, :name => 'colVals', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumnValue}} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field colVals is unset!') unless @colVals + end + + ::Thrift::Struct.generate_accessors self +end + +class TBoolColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BOOL}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TByteColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BYTE}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TI16Column + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I16}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TI32Column + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I32}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TI64Column + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I64}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TDoubleColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::DOUBLE}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TStringColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TBinaryColumn + include ::Thrift::Struct, ::Thrift::Struct_Union + VALUES = 1 + NULLS = 2 + + FIELDS = { + VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING, :binary => true}}, + NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls + end + + ::Thrift::Struct.generate_accessors self +end + +class TColumn < ::Thrift::Union + include ::Thrift::Struct_Union + class << self + def boolVal(val) + TColumn.new(:boolVal, val) + end + + def byteVal(val) + TColumn.new(:byteVal, val) + end + + def i16Val(val) + TColumn.new(:i16Val, val) + end + + def i32Val(val) + TColumn.new(:i32Val, val) + end + + def i64Val(val) + TColumn.new(:i64Val, val) + end + + def doubleVal(val) + TColumn.new(:doubleVal, val) + end + + def stringVal(val) + TColumn.new(:stringVal, val) + end + + def binaryVal(val) + TColumn.new(:binaryVal, val) + end + end + + BOOLVAL = 1 + BYTEVAL = 2 + I16VAL = 3 + I32VAL = 4 + I64VAL = 5 + DOUBLEVAL = 6 + STRINGVAL = 7 + BINARYVAL = 8 + + FIELDS = { + BOOLVAL => {:type => ::Thrift::Types::STRUCT, :name => 'boolVal', :class => ::TBoolColumn, :optional => true}, + BYTEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'byteVal', :class => ::TByteColumn, :optional => true}, + I16VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i16Val', :class => ::TI16Column, :optional => true}, + I32VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i32Val', :class => ::TI32Column, :optional => true}, + I64VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i64Val', :class => ::TI64Column, :optional => true}, + DOUBLEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'doubleVal', :class => ::TDoubleColumn, :optional => true}, + STRINGVAL => {:type => ::Thrift::Types::STRUCT, :name => 'stringVal', :class => ::TStringColumn, :optional => true}, + BINARYVAL => {:type => ::Thrift::Types::STRUCT, :name => 'binaryVal', :class => ::TBinaryColumn, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? + end + + ::Thrift::Union.generate_accessors self +end + +class TRowSet + include ::Thrift::Struct, ::Thrift::Struct_Union + STARTROWOFFSET = 1 + ROWS = 2 + COLUMNS = 3 + BINARYCOLUMNS = 4 + COLUMNCOUNT = 5 + + FIELDS = { + STARTROWOFFSET => {:type => ::Thrift::Types::I64, :name => 'startRowOffset'}, + ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TRow}}, + COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumn}, :optional => true}, + BINARYCOLUMNS => {:type => ::Thrift::Types::STRING, :name => 'binaryColumns', :binary => true, :optional => true}, + COLUMNCOUNT => {:type => ::Thrift::Types::I32, :name => 'columnCount', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startRowOffset is unset!') unless @startRowOffset + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field rows is unset!') unless @rows + end + + ::Thrift::Struct.generate_accessors self +end + +class TStatus + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUSCODE = 1 + INFOMESSAGES = 2 + SQLSTATE = 3 + ERRORCODE = 4 + ERRORMESSAGE = 5 + + FIELDS = { + STATUSCODE => {:type => ::Thrift::Types::I32, :name => 'statusCode', :enum_class => ::TStatusCode}, + INFOMESSAGES => {:type => ::Thrift::Types::LIST, :name => 'infoMessages', :element => {:type => ::Thrift::Types::STRING}, :optional => true}, + SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'sqlState', :optional => true}, + ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :optional => true}, + ERRORMESSAGE => {:type => ::Thrift::Types::STRING, :name => 'errorMessage', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field statusCode is unset!') unless @statusCode + unless @statusCode.nil? || ::TStatusCode::VALID_VALUES.include?(@statusCode) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field statusCode!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class THandleIdentifier + include ::Thrift::Struct, ::Thrift::Struct_Union + GUID = 1 + SECRET = 2 + + FIELDS = { + GUID => {:type => ::Thrift::Types::STRING, :name => 'guid', :binary => true}, + SECRET => {:type => ::Thrift::Types::STRING, :name => 'secret', :binary => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field guid is unset!') unless @guid + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field secret is unset!') unless @secret + end + + ::Thrift::Struct.generate_accessors self +end + +class TSessionHandle + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONID = 1 + + FIELDS = { + SESSIONID => {:type => ::Thrift::Types::STRUCT, :name => 'sessionId', :class => ::THandleIdentifier} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionId is unset!') unless @sessionId + end + + ::Thrift::Struct.generate_accessors self +end + +class TOperationHandle + include ::Thrift::Struct, ::Thrift::Struct_Union + OPERATIONID = 1 + OPERATIONTYPE = 2 + HASRESULTSET = 3 + MODIFIEDROWCOUNT = 4 + + FIELDS = { + OPERATIONID => {:type => ::Thrift::Types::STRUCT, :name => 'operationId', :class => ::THandleIdentifier}, + OPERATIONTYPE => {:type => ::Thrift::Types::I32, :name => 'operationType', :enum_class => ::TOperationType}, + HASRESULTSET => {:type => ::Thrift::Types::BOOL, :name => 'hasResultSet'}, + MODIFIEDROWCOUNT => {:type => ::Thrift::Types::DOUBLE, :name => 'modifiedRowCount', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationId is unset!') unless @operationId + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationType is unset!') unless @operationType + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field hasResultSet is unset!') if @hasResultSet.nil? + unless @operationType.nil? || ::TOperationType::VALID_VALUES.include?(@operationType) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field operationType!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TOpenSessionReq + include ::Thrift::Struct, ::Thrift::Struct_Union + CLIENT_PROTOCOL = 1 + USERNAME = 2 + PASSWORD = 3 + CONFIGURATION = 4 + + FIELDS = { + CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 9, :enum_class => ::TProtocolVersion}, + USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username', :optional => true}, + PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password', :optional => true}, + CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field client_protocol is unset!') unless @client_protocol + unless @client_protocol.nil? || ::TProtocolVersion::VALID_VALUES.include?(@client_protocol) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field client_protocol!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TOpenSessionResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + SERVERPROTOCOLVERSION = 2 + SESSIONHANDLE = 3 + CONFIGURATION = 4 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 9, :enum_class => ::TProtocolVersion}, + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle, :optional => true}, + CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :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 serverProtocolVersion is unset!') unless @serverProtocolVersion + unless @serverProtocolVersion.nil? || ::TProtocolVersion::VALID_VALUES.include?(@serverProtocolVersion) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field serverProtocolVersion!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TSetClientInfoReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + CONFIGURATION = 2 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TSetClientInfoResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TCloseSessionReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TCloseSessionResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetInfoValue < ::Thrift::Union + include ::Thrift::Struct_Union + class << self + def stringValue(val) + TGetInfoValue.new(:stringValue, val) + end + + def smallIntValue(val) + TGetInfoValue.new(:smallIntValue, val) + end + + def integerBitmask(val) + TGetInfoValue.new(:integerBitmask, val) + end + + def integerFlag(val) + TGetInfoValue.new(:integerFlag, val) + end + + def binaryValue(val) + TGetInfoValue.new(:binaryValue, val) + end + + def lenValue(val) + TGetInfoValue.new(:lenValue, val) + end + end + + STRINGVALUE = 1 + SMALLINTVALUE = 2 + INTEGERBITMASK = 3 + INTEGERFLAG = 4 + BINARYVALUE = 5 + LENVALUE = 6 + + FIELDS = { + STRINGVALUE => {:type => ::Thrift::Types::STRING, :name => 'stringValue', :optional => true}, + SMALLINTVALUE => {:type => ::Thrift::Types::I16, :name => 'smallIntValue', :optional => true}, + INTEGERBITMASK => {:type => ::Thrift::Types::I32, :name => 'integerBitmask', :optional => true}, + INTEGERFLAG => {:type => ::Thrift::Types::I32, :name => 'integerFlag', :optional => true}, + BINARYVALUE => {:type => ::Thrift::Types::I32, :name => 'binaryValue', :optional => true}, + LENVALUE => {:type => ::Thrift::Types::I64, :name => 'lenValue', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? + end + + ::Thrift::Union.generate_accessors self +end + +class TGetInfoReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + INFOTYPE = 2 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + INFOTYPE => {:type => ::Thrift::Types::I32, :name => 'infoType', :enum_class => ::TGetInfoType} + } + + 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 infoType is unset!') unless @infoType + unless @infoType.nil? || ::TGetInfoType::VALID_VALUES.include?(@infoType) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field infoType!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetInfoResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + INFOVALUE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + INFOVALUE => {:type => ::Thrift::Types::STRUCT, :name => 'infoValue', :class => ::TGetInfoValue} + } + + 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 infoValue is unset!') unless @infoValue + end + + ::Thrift::Struct.generate_accessors self +end + +class TExecuteStatementReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + STATEMENT = 2 + CONFOVERLAY = 3 + RUNASYNC = 4 + QUERYTIMEOUT = 5 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + STATEMENT => {:type => ::Thrift::Types::STRING, :name => 'statement'}, + CONFOVERLAY => {:type => ::Thrift::Types::MAP, :name => 'confOverlay', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}, + RUNASYNC => {:type => ::Thrift::Types::BOOL, :name => 'runAsync', :default => false, :optional => true}, + QUERYTIMEOUT => {:type => ::Thrift::Types::I64, :name => 'queryTimeout', :default => 0, :optional => true} + } + + 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 statement is unset!') unless @statement + end + + ::Thrift::Struct.generate_accessors self +end + +class TExecuteStatementResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetTypeInfoReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetTypeInfoResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetCatalogsReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetCatalogsResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetSchemasReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + CATALOGNAME = 2 + SCHEMANAME = 3 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, + SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetSchemasResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetTablesReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + CATALOGNAME = 2 + SCHEMANAME = 3 + TABLENAME = 4 + TABLETYPES = 5 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, + SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, + TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName', :optional => true}, + TABLETYPES => {:type => ::Thrift::Types::LIST, :name => 'tableTypes', :element => {:type => ::Thrift::Types::STRING}, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetTablesResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetTableTypesReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetTableTypesResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetColumnsReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + CATALOGNAME = 2 + SCHEMANAME = 3 + TABLENAME = 4 + COLUMNNAME = 5 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, + SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, + TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName', :optional => true}, + COLUMNNAME => {:type => ::Thrift::Types::STRING, :name => 'columnName', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetColumnsResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetFunctionsReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + CATALOGNAME = 2 + SCHEMANAME = 3 + FUNCTIONNAME = 4 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, + SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, + FUNCTIONNAME => {:type => ::Thrift::Types::STRING, :name => 'functionName'} + } + + 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 functionName is unset!') unless @functionName + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetFunctionsResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetPrimaryKeysReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + CATALOGNAME = 2 + SCHEMANAME = 3 + TABLENAME = 4 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, + SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, + TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetPrimaryKeysResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetCrossReferenceReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + PARENTCATALOGNAME = 2 + PARENTSCHEMANAME = 3 + PARENTTABLENAME = 4 + FOREIGNCATALOGNAME = 5 + FOREIGNSCHEMANAME = 6 + FOREIGNTABLENAME = 7 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + PARENTCATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'parentCatalogName', :optional => true}, + PARENTSCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'parentSchemaName', :optional => true}, + PARENTTABLENAME => {:type => ::Thrift::Types::STRING, :name => 'parentTableName', :optional => true}, + FOREIGNCATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'foreignCatalogName', :optional => true}, + FOREIGNSCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'foreignSchemaName', :optional => true}, + FOREIGNTABLENAME => {:type => ::Thrift::Types::STRING, :name => 'foreignTableName', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetCrossReferenceResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONHANDLE = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetOperationStatusReq + include ::Thrift::Struct, ::Thrift::Struct_Union + OPERATIONHANDLE = 1 + GETPROGRESSUPDATE = 2 + + FIELDS = { + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle}, + GETPROGRESSUPDATE => {:type => ::Thrift::Types::BOOL, :name => 'getProgressUpdate', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationHandle is unset!') unless @operationHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetOperationStatusResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + OPERATIONSTATE = 2 + SQLSTATE = 3 + ERRORCODE = 4 + ERRORMESSAGE = 5 + TASKSTATUS = 6 + OPERATIONSTARTED = 7 + OPERATIONCOMPLETED = 8 + HASRESULTSET = 9 + PROGRESSUPDATERESPONSE = 10 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + OPERATIONSTATE => {:type => ::Thrift::Types::I32, :name => 'operationState', :optional => true, :enum_class => ::TOperationState}, + SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'sqlState', :optional => true}, + ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :optional => true}, + ERRORMESSAGE => {:type => ::Thrift::Types::STRING, :name => 'errorMessage', :optional => true}, + TASKSTATUS => {:type => ::Thrift::Types::STRING, :name => 'taskStatus', :optional => true}, + OPERATIONSTARTED => {:type => ::Thrift::Types::I64, :name => 'operationStarted', :optional => true}, + OPERATIONCOMPLETED => {:type => ::Thrift::Types::I64, :name => 'operationCompleted', :optional => true}, + HASRESULTSET => {:type => ::Thrift::Types::BOOL, :name => 'hasResultSet', :optional => true}, + PROGRESSUPDATERESPONSE => {:type => ::Thrift::Types::STRUCT, :name => 'progressUpdateResponse', :class => ::TProgressUpdateResp, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + unless @operationState.nil? || ::TOperationState::VALID_VALUES.include?(@operationState) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field operationState!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TCancelOperationReq + include ::Thrift::Struct, ::Thrift::Struct_Union + OPERATIONHANDLE = 1 + + FIELDS = { + 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 operationHandle is unset!') unless @operationHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TCancelOperationResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TCloseOperationReq + include ::Thrift::Struct, ::Thrift::Struct_Union + OPERATIONHANDLE = 1 + + FIELDS = { + 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 operationHandle is unset!') unless @operationHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TCloseOperationResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetResultSetMetadataReq + include ::Thrift::Struct, ::Thrift::Struct_Union + OPERATIONHANDLE = 1 + + FIELDS = { + 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 operationHandle is unset!') unless @operationHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetResultSetMetadataResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + SCHEMA = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + SCHEMA => {:type => ::Thrift::Types::STRUCT, :name => 'schema', :class => ::TTableSchema, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TFetchResultsReq + include ::Thrift::Struct, ::Thrift::Struct_Union + OPERATIONHANDLE = 1 + ORIENTATION = 2 + MAXROWS = 3 + FETCHTYPE = 4 + + FIELDS = { + OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle}, + ORIENTATION => {:type => ::Thrift::Types::I32, :name => 'orientation', :default => 0, :enum_class => ::TFetchOrientation}, + MAXROWS => {:type => ::Thrift::Types::I64, :name => 'maxRows'}, + FETCHTYPE => {:type => ::Thrift::Types::I16, :name => 'fetchType', :default => 0, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationHandle is unset!') unless @operationHandle + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field orientation is unset!') unless @orientation + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field maxRows is unset!') unless @maxRows + unless @orientation.nil? || ::TFetchOrientation::VALID_VALUES.include?(@orientation) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field orientation!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TFetchResultsResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + HASMOREROWS = 2 + RESULTS = 3 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + HASMOREROWS => {:type => ::Thrift::Types::BOOL, :name => 'hasMoreRows', :optional => true}, + RESULTS => {:type => ::Thrift::Types::STRUCT, :name => 'results', :class => ::TRowSet, :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetDelegationTokenReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + OWNER = 2 + RENEWER = 3 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + OWNER => {:type => ::Thrift::Types::STRING, :name => 'owner'}, + RENEWER => {:type => ::Thrift::Types::STRING, :name => 'renewer'} + } + + 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 owner is unset!') unless @owner + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field renewer is unset!') unless @renewer + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetDelegationTokenResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + DELEGATIONTOKEN = 2 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, + DELEGATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'delegationToken', :optional => true} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TCancelDelegationTokenReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + DELEGATIONTOKEN = 2 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + DELEGATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'delegationToken'} + } + + 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 delegationToken is unset!') unless @delegationToken + end + + ::Thrift::Struct.generate_accessors self +end + +class TCancelDelegationTokenResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TRenewDelegationTokenReq + include ::Thrift::Struct, ::Thrift::Struct_Union + SESSIONHANDLE = 1 + DELEGATIONTOKEN = 2 + + FIELDS = { + SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, + DELEGATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'delegationToken'} + } + + 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 delegationToken is unset!') unless @delegationToken + end + + ::Thrift::Struct.generate_accessors self +end + +class TRenewDelegationTokenResp + include ::Thrift::Struct, ::Thrift::Struct_Union + STATUS = 1 + + FIELDS = { + STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + end + + ::Thrift::Struct.generate_accessors self +end + +class TProgressUpdateResp + include ::Thrift::Struct, ::Thrift::Struct_Union + HEADERNAMES = 1 + ROWS = 2 + PROGRESSEDPERCENTAGE = 3 + STATUS = 4 + FOOTERSUMMARY = 5 + STARTTIME = 6 + + FIELDS = { + HEADERNAMES => {:type => ::Thrift::Types::LIST, :name => 'headerNames', :element => {:type => ::Thrift::Types::STRING}}, + ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}}, + PROGRESSEDPERCENTAGE => {:type => ::Thrift::Types::DOUBLE, :name => 'progressedPercentage'}, + STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :enum_class => ::TJobExecutionStatus}, + FOOTERSUMMARY => {:type => ::Thrift::Types::STRING, :name => 'footerSummary'}, + STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field headerNames is unset!') unless @headerNames + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field rows is unset!') unless @rows + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field progressedPercentage is unset!') unless @progressedPercentage + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field footerSummary is unset!') unless @footerSummary + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startTime is unset!') unless @startTime + unless @status.nil? || ::TJobExecutionStatus::VALID_VALUES.include?(@status) + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field status!') + end + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetQueryIdReq + include ::Thrift::Struct, ::Thrift::Struct_Union + OPERATIONHANDLE = 1 + + FIELDS = { + 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 operationHandle is unset!') unless @operationHandle + end + + ::Thrift::Struct.generate_accessors self +end + +class TGetQueryIdResp + include ::Thrift::Struct, ::Thrift::Struct_Union + QUERYID = 1 + + FIELDS = { + QUERYID => {:type => ::Thrift::Types::STRING, :name => 'queryId'} + } + + def struct_fields; FIELDS; end + + def validate + raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field queryId is unset!') unless @queryId + end + + ::Thrift::Struct.generate_accessors self +end + From b74d5e08f9f22f41bc57031a19b691e61d8a91de Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 23 Oct 2019 20:44:15 +0800 Subject: [PATCH 05/55] remove py/cpp/r/php --- pom.xml | 7 +- sql/thriftserver/README.md | 3 - sql/thriftserver/pom.xml | 4 - .../src/gen/thrift/gen-cpp/TCLIService.cpp | 8847 ------------ .../src/gen/thrift/gen-cpp/TCLIService.h | 3068 ----- .../thrift/gen-cpp/TCLIService_constants.cpp | 74 - .../thrift/gen-cpp/TCLIService_constants.h | 31 - .../gen-cpp/TCLIService_server.skeleton.cpp | 152 - .../gen/thrift/gen-cpp/TCLIService_types.cpp | 11342 ---------------- .../gen/thrift/gen-cpp/TCLIService_types.h | 4497 ------ .../gen-py/TCLIService/TCLIService-remote | 271 - .../thrift/gen-py/TCLIService/TCLIService.py | 4401 ------ .../gen/thrift/gen-py/TCLIService/__init__.py | 1 - .../thrift/gen-py/TCLIService/constants.py | 72 - .../gen/thrift/gen-py/TCLIService/ttypes.py | 7526 ---------- .../src/gen/thrift/gen-py/__init__.py | 0 .../src/gen/thrift/gen-rb/t_c_l_i_service.rb | 1266 -- .../gen-rb/t_c_l_i_service_constants.rb | 74 - .../thrift/gen-rb/t_c_l_i_service_types.rb | 2156 --- 19 files changed, 6 insertions(+), 43786 deletions(-) delete mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp delete mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h delete mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp delete mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h delete mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp delete mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp delete mode 100644 sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h delete mode 100755 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote delete mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py delete mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py delete mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py delete mode 100644 sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py delete mode 100644 sql/thriftserver/src/gen/thrift/gen-py/__init__.py delete mode 100644 sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb delete mode 100644 sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb delete mode 100644 sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb diff --git a/pom.xml b/pom.xml index abce71678a31..7d38a7feaed9 100644 --- a/pom.xml +++ b/pom.xml @@ -240,6 +240,11 @@ ${session.executionRootDirectory} 1g + + + you-must-set-this-to-run-thrift + ${basedir}/src/gen/thrift + -I ${thrift.home} --gen java:beans,hashcode,generated_annotations=undated @@ -3100,7 +3105,7 @@ - + diff --git a/sql/thriftserver/README.md b/sql/thriftserver/README.md index 93b12f86f53e..aac10166b4aa 100644 --- a/sql/thriftserver/README.md +++ b/sql/thriftserver/README.md @@ -1,6 +1,3 @@ Thrift commands to generate files from TCLIService.thrift: -------------------- thrift --gen java:beans,hashcode -o src/gen/thrift if/TCLIService.thrift -thrift --gen cpp -o src/gen/thrift if/TCLIService.thrift -thrift --gen py -o src/gen/thrift if/TCLIService.thrift -thrift --gen rb -o src/gen/thrift if/TCLIService.thrift diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index e6bd641fe582..d26c7b9651ae 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -32,10 +32,6 @@ http://spark.apache.org/ thriftserver - - you-must-set-this-to-run-thrift - ${basedir}/src/gen/thrift - -I ${thrift.home} --gen java:beans,hashcode,generated_annotations=undated --gen cpp --gen php --gen py --gen rb diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp deleted file mode 100644 index 1c0d0dcdf1e8..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.cpp +++ /dev/null @@ -1,8847 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#include "TCLIService.h" - -namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { - - -TCLIService_OpenSession_args::~TCLIService_OpenSession_args() throw() { -} - - -uint32_t TCLIService_OpenSession_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_OpenSession_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_OpenSession_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; -} - - -TCLIService_OpenSession_pargs::~TCLIService_OpenSession_pargs() throw() { -} - - -uint32_t TCLIService_OpenSession_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_OpenSession_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; -} - - -TCLIService_OpenSession_result::~TCLIService_OpenSession_result() throw() { -} - - -uint32_t TCLIService_OpenSession_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_OpenSession_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_OpenSession_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; -} - - -TCLIService_OpenSession_presult::~TCLIService_OpenSession_presult() throw() { -} - - -uint32_t TCLIService_OpenSession_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_CloseSession_args::~TCLIService_CloseSession_args() throw() { -} - - -uint32_t TCLIService_CloseSession_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseSession_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_CloseSession_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; -} - - -TCLIService_CloseSession_pargs::~TCLIService_CloseSession_pargs() throw() { -} - - -uint32_t TCLIService_CloseSession_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_CloseSession_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; -} - - -TCLIService_CloseSession_result::~TCLIService_CloseSession_result() throw() { -} - - -uint32_t TCLIService_CloseSession_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseSession_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_CloseSession_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; -} - - -TCLIService_CloseSession_presult::~TCLIService_CloseSession_presult() throw() { -} - - -uint32_t TCLIService_CloseSession_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetInfo_args::~TCLIService_GetInfo_args() throw() { -} - - -uint32_t TCLIService_GetInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetInfo_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; -} - - -TCLIService_GetInfo_pargs::~TCLIService_GetInfo_pargs() throw() { -} - - -uint32_t TCLIService_GetInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetInfo_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; -} - - -TCLIService_GetInfo_result::~TCLIService_GetInfo_result() throw() { -} - - -uint32_t TCLIService_GetInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetInfo_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; -} - - -TCLIService_GetInfo_presult::~TCLIService_GetInfo_presult() throw() { -} - - -uint32_t TCLIService_GetInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_ExecuteStatement_args::~TCLIService_ExecuteStatement_args() throw() { -} - - -uint32_t TCLIService_ExecuteStatement_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_ExecuteStatement_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_ExecuteStatement_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; -} - - -TCLIService_ExecuteStatement_pargs::~TCLIService_ExecuteStatement_pargs() throw() { -} - - -uint32_t TCLIService_ExecuteStatement_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_ExecuteStatement_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; -} - - -TCLIService_ExecuteStatement_result::~TCLIService_ExecuteStatement_result() throw() { -} - - -uint32_t TCLIService_ExecuteStatement_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_ExecuteStatement_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_ExecuteStatement_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; -} - - -TCLIService_ExecuteStatement_presult::~TCLIService_ExecuteStatement_presult() throw() { -} - - -uint32_t TCLIService_ExecuteStatement_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetTypeInfo_args::~TCLIService_GetTypeInfo_args() throw() { -} - - -uint32_t TCLIService_GetTypeInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTypeInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_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; -} - - -TCLIService_GetTypeInfo_pargs::~TCLIService_GetTypeInfo_pargs() throw() { -} - - -uint32_t TCLIService_GetTypeInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_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; -} - - -TCLIService_GetTypeInfo_result::~TCLIService_GetTypeInfo_result() throw() { -} - - -uint32_t TCLIService_GetTypeInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTypeInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetTypeInfo_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; -} - - -TCLIService_GetTypeInfo_presult::~TCLIService_GetTypeInfo_presult() throw() { -} - - -uint32_t TCLIService_GetTypeInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetCatalogs_args::~TCLIService_GetCatalogs_args() throw() { -} - - -uint32_t TCLIService_GetCatalogs_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCatalogs_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_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; -} - - -TCLIService_GetCatalogs_pargs::~TCLIService_GetCatalogs_pargs() throw() { -} - - -uint32_t TCLIService_GetCatalogs_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_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; -} - - -TCLIService_GetCatalogs_result::~TCLIService_GetCatalogs_result() throw() { -} - - -uint32_t TCLIService_GetCatalogs_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCatalogs_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetCatalogs_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; -} - - -TCLIService_GetCatalogs_presult::~TCLIService_GetCatalogs_presult() throw() { -} - - -uint32_t TCLIService_GetCatalogs_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetSchemas_args::~TCLIService_GetSchemas_args() throw() { -} - - -uint32_t TCLIService_GetSchemas_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetSchemas_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetSchemas_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; -} - - -TCLIService_GetSchemas_pargs::~TCLIService_GetSchemas_pargs() throw() { -} - - -uint32_t TCLIService_GetSchemas_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetSchemas_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; -} - - -TCLIService_GetSchemas_result::~TCLIService_GetSchemas_result() throw() { -} - - -uint32_t TCLIService_GetSchemas_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetSchemas_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetSchemas_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; -} - - -TCLIService_GetSchemas_presult::~TCLIService_GetSchemas_presult() throw() { -} - - -uint32_t TCLIService_GetSchemas_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetTables_args::~TCLIService_GetTables_args() throw() { -} - - -uint32_t TCLIService_GetTables_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTables_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetTables_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; -} - - -TCLIService_GetTables_pargs::~TCLIService_GetTables_pargs() throw() { -} - - -uint32_t TCLIService_GetTables_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetTables_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; -} - - -TCLIService_GetTables_result::~TCLIService_GetTables_result() throw() { -} - - -uint32_t TCLIService_GetTables_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTables_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetTables_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; -} - - -TCLIService_GetTables_presult::~TCLIService_GetTables_presult() throw() { -} - - -uint32_t TCLIService_GetTables_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetTableTypes_args::~TCLIService_GetTableTypes_args() throw() { -} - - -uint32_t TCLIService_GetTableTypes_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTableTypes_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_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; -} - - -TCLIService_GetTableTypes_pargs::~TCLIService_GetTableTypes_pargs() throw() { -} - - -uint32_t TCLIService_GetTableTypes_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_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; -} - - -TCLIService_GetTableTypes_result::~TCLIService_GetTableTypes_result() throw() { -} - - -uint32_t TCLIService_GetTableTypes_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetTableTypes_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetTableTypes_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; -} - - -TCLIService_GetTableTypes_presult::~TCLIService_GetTableTypes_presult() throw() { -} - - -uint32_t TCLIService_GetTableTypes_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetColumns_args::~TCLIService_GetColumns_args() throw() { -} - - -uint32_t TCLIService_GetColumns_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetColumns_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetColumns_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; -} - - -TCLIService_GetColumns_pargs::~TCLIService_GetColumns_pargs() throw() { -} - - -uint32_t TCLIService_GetColumns_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetColumns_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; -} - - -TCLIService_GetColumns_result::~TCLIService_GetColumns_result() throw() { -} - - -uint32_t TCLIService_GetColumns_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetColumns_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetColumns_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; -} - - -TCLIService_GetColumns_presult::~TCLIService_GetColumns_presult() throw() { -} - - -uint32_t TCLIService_GetColumns_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetFunctions_args::~TCLIService_GetFunctions_args() throw() { -} - - -uint32_t TCLIService_GetFunctions_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetFunctions_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetFunctions_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; -} - - -TCLIService_GetFunctions_pargs::~TCLIService_GetFunctions_pargs() throw() { -} - - -uint32_t TCLIService_GetFunctions_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetFunctions_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; -} - - -TCLIService_GetFunctions_result::~TCLIService_GetFunctions_result() throw() { -} - - -uint32_t TCLIService_GetFunctions_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetFunctions_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetFunctions_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; -} - - -TCLIService_GetFunctions_presult::~TCLIService_GetFunctions_presult() throw() { -} - - -uint32_t TCLIService_GetFunctions_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetPrimaryKeys_args::~TCLIService_GetPrimaryKeys_args() throw() { -} - - -uint32_t TCLIService_GetPrimaryKeys_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetPrimaryKeys_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetPrimaryKeys_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; -} - - -TCLIService_GetPrimaryKeys_pargs::~TCLIService_GetPrimaryKeys_pargs() throw() { -} - - -uint32_t TCLIService_GetPrimaryKeys_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetPrimaryKeys_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; -} - - -TCLIService_GetPrimaryKeys_result::~TCLIService_GetPrimaryKeys_result() throw() { -} - - -uint32_t TCLIService_GetPrimaryKeys_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetPrimaryKeys_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetPrimaryKeys_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; -} - - -TCLIService_GetPrimaryKeys_presult::~TCLIService_GetPrimaryKeys_presult() throw() { -} - - -uint32_t TCLIService_GetPrimaryKeys_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetCrossReference_args::~TCLIService_GetCrossReference_args() throw() { -} - - -uint32_t TCLIService_GetCrossReference_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCrossReference_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetCrossReference_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; -} - - -TCLIService_GetCrossReference_pargs::~TCLIService_GetCrossReference_pargs() throw() { -} - - -uint32_t TCLIService_GetCrossReference_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetCrossReference_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; -} - - -TCLIService_GetCrossReference_result::~TCLIService_GetCrossReference_result() throw() { -} - - -uint32_t TCLIService_GetCrossReference_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetCrossReference_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetCrossReference_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; -} - - -TCLIService_GetCrossReference_presult::~TCLIService_GetCrossReference_presult() throw() { -} - - -uint32_t TCLIService_GetCrossReference_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetOperationStatus_args::~TCLIService_GetOperationStatus_args() throw() { -} - - -uint32_t TCLIService_GetOperationStatus_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetOperationStatus_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_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; -} - - -TCLIService_GetOperationStatus_pargs::~TCLIService_GetOperationStatus_pargs() throw() { -} - - -uint32_t TCLIService_GetOperationStatus_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_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; -} - - -TCLIService_GetOperationStatus_result::~TCLIService_GetOperationStatus_result() throw() { -} - - -uint32_t TCLIService_GetOperationStatus_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetOperationStatus_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetOperationStatus_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; -} - - -TCLIService_GetOperationStatus_presult::~TCLIService_GetOperationStatus_presult() throw() { -} - - -uint32_t TCLIService_GetOperationStatus_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_CancelOperation_args::~TCLIService_CancelOperation_args() throw() { -} - - -uint32_t TCLIService_CancelOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CancelOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_CancelOperation_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; -} - - -TCLIService_CancelOperation_pargs::~TCLIService_CancelOperation_pargs() throw() { -} - - -uint32_t TCLIService_CancelOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_CancelOperation_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; -} - - -TCLIService_CancelOperation_result::~TCLIService_CancelOperation_result() throw() { -} - - -uint32_t TCLIService_CancelOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CancelOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_CancelOperation_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; -} - - -TCLIService_CancelOperation_presult::~TCLIService_CancelOperation_presult() throw() { -} - - -uint32_t TCLIService_CancelOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_CloseOperation_args::~TCLIService_CloseOperation_args() throw() { -} - - -uint32_t TCLIService_CloseOperation_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseOperation_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_CloseOperation_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; -} - - -TCLIService_CloseOperation_pargs::~TCLIService_CloseOperation_pargs() throw() { -} - - -uint32_t TCLIService_CloseOperation_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_CloseOperation_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; -} - - -TCLIService_CloseOperation_result::~TCLIService_CloseOperation_result() throw() { -} - - -uint32_t TCLIService_CloseOperation_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_CloseOperation_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_CloseOperation_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; -} - - -TCLIService_CloseOperation_presult::~TCLIService_CloseOperation_presult() throw() { -} - - -uint32_t TCLIService_CloseOperation_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetResultSetMetadata_args::~TCLIService_GetResultSetMetadata_args() throw() { -} - - -uint32_t TCLIService_GetResultSetMetadata_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetResultSetMetadata_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_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; -} - - -TCLIService_GetResultSetMetadata_pargs::~TCLIService_GetResultSetMetadata_pargs() throw() { -} - - -uint32_t TCLIService_GetResultSetMetadata_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_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; -} - - -TCLIService_GetResultSetMetadata_result::~TCLIService_GetResultSetMetadata_result() throw() { -} - - -uint32_t TCLIService_GetResultSetMetadata_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetResultSetMetadata_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetResultSetMetadata_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; -} - - -TCLIService_GetResultSetMetadata_presult::~TCLIService_GetResultSetMetadata_presult() throw() { -} - - -uint32_t TCLIService_GetResultSetMetadata_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_FetchResults_args::~TCLIService_FetchResults_args() throw() { -} - - -uint32_t TCLIService_FetchResults_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_FetchResults_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_FetchResults_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; -} - - -TCLIService_FetchResults_pargs::~TCLIService_FetchResults_pargs() throw() { -} - - -uint32_t TCLIService_FetchResults_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_FetchResults_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; -} - - -TCLIService_FetchResults_result::~TCLIService_FetchResults_result() throw() { -} - - -uint32_t TCLIService_FetchResults_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_FetchResults_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_FetchResults_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; -} - - -TCLIService_FetchResults_presult::~TCLIService_FetchResults_presult() throw() { -} - - -uint32_t TCLIService_FetchResults_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetDelegationToken_args::~TCLIService_GetDelegationToken_args() throw() { -} - - -uint32_t TCLIService_GetDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetDelegationToken_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - 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; -} - - -TCLIService_GetDelegationToken_pargs::~TCLIService_GetDelegationToken_pargs() throw() { -} - - -uint32_t TCLIService_GetDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - 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; -} - - -TCLIService_GetDelegationToken_result::~TCLIService_GetDelegationToken_result() throw() { -} - - -uint32_t TCLIService_GetDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetDelegationToken_presult::~TCLIService_GetDelegationToken_presult() throw() { -} - - -uint32_t TCLIService_GetDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_CancelDelegationToken_args::~TCLIService_CancelDelegationToken_args() throw() { -} - - -uint32_t TCLIService_CancelDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - 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; -} - - -TCLIService_CancelDelegationToken_pargs::~TCLIService_CancelDelegationToken_pargs() throw() { -} - - -uint32_t TCLIService_CancelDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - 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; -} - - -TCLIService_CancelDelegationToken_result::~TCLIService_CancelDelegationToken_result() throw() { -} - - -uint32_t TCLIService_CancelDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_CancelDelegationToken_presult::~TCLIService_CancelDelegationToken_presult() throw() { -} - - -uint32_t TCLIService_CancelDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_RenewDelegationToken_args::~TCLIService_RenewDelegationToken_args() throw() { -} - - -uint32_t TCLIService_RenewDelegationToken_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - 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; -} - - -TCLIService_RenewDelegationToken_pargs::~TCLIService_RenewDelegationToken_pargs() throw() { -} - - -uint32_t TCLIService_RenewDelegationToken_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - 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; -} - - -TCLIService_RenewDelegationToken_result::~TCLIService_RenewDelegationToken_result() throw() { -} - - -uint32_t TCLIService_RenewDelegationToken_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_RenewDelegationToken_presult::~TCLIService_RenewDelegationToken_presult() throw() { -} - - -uint32_t TCLIService_RenewDelegationToken_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_GetQueryId_args::~TCLIService_GetQueryId_args() throw() { -} - - -uint32_t TCLIService_GetQueryId_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetQueryId_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetQueryId_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; -} - - -TCLIService_GetQueryId_pargs::~TCLIService_GetQueryId_pargs() throw() { -} - - -uint32_t TCLIService_GetQueryId_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_GetQueryId_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; -} - - -TCLIService_GetQueryId_result::~TCLIService_GetQueryId_result() throw() { -} - - -uint32_t TCLIService_GetQueryId_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_GetQueryId_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_GetQueryId_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; -} - - -TCLIService_GetQueryId_presult::~TCLIService_GetQueryId_presult() throw() { -} - - -uint32_t TCLIService_GetQueryId_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; -} - - -TCLIService_SetClientInfo_args::~TCLIService_SetClientInfo_args() throw() { -} - - -uint32_t TCLIService_SetClientInfo_args::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_SetClientInfo_args::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_SetClientInfo_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; -} - - -TCLIService_SetClientInfo_pargs::~TCLIService_SetClientInfo_pargs() throw() { -} - - -uint32_t TCLIService_SetClientInfo_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCLIService_SetClientInfo_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; -} - - -TCLIService_SetClientInfo_result::~TCLIService_SetClientInfo_result() throw() { -} - - -uint32_t TCLIService_SetClientInfo_result::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_SetClientInfo_result::write(::apache::thrift::protocol::TProtocol* oprot) const { - - uint32_t xfer = 0; - - xfer += oprot->writeStructBegin("TCLIService_SetClientInfo_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; -} - - -TCLIService_SetClientInfo_presult::~TCLIService_SetClientInfo_presult() throw() { -} - - -uint32_t TCLIService_SetClientInfo_presult::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetInfo(TGetInfoResp& _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("GetInfo") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetInfo_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, "GetInfo failed: unknown result"); -} - -void TCLIServiceClient::ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) -{ - send_ExecuteStatement(req); - recv_ExecuteStatement(_return); -} - -void TCLIServiceClient::send_ExecuteStatement(const TExecuteStatementReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("ExecuteStatement", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_ExecuteStatement_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_ExecuteStatement(TExecuteStatementResp& _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("ExecuteStatement") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_ExecuteStatement_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, "ExecuteStatement failed: unknown result"); -} - -void TCLIServiceClient::GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) -{ - send_GetTypeInfo(req); - recv_GetTypeInfo(_return); -} - -void TCLIServiceClient::send_GetTypeInfo(const TGetTypeInfoReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetTypeInfo", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetTypeInfo_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetTypeInfo(TGetTypeInfoResp& _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("GetTypeInfo") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetTypeInfo_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, "GetTypeInfo failed: unknown result"); -} - -void TCLIServiceClient::GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) -{ - send_GetCatalogs(req); - recv_GetCatalogs(_return); -} - -void TCLIServiceClient::send_GetCatalogs(const TGetCatalogsReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetCatalogs", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetCatalogs_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetCatalogs(TGetCatalogsResp& _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("GetCatalogs") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetCatalogs_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, "GetCatalogs failed: unknown result"); -} - -void TCLIServiceClient::GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) -{ - send_GetSchemas(req); - recv_GetSchemas(_return); -} - -void TCLIServiceClient::send_GetSchemas(const TGetSchemasReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetSchemas", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetSchemas_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetSchemas(TGetSchemasResp& _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("GetSchemas") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetSchemas_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, "GetSchemas failed: unknown result"); -} - -void TCLIServiceClient::GetTables(TGetTablesResp& _return, const TGetTablesReq& req) -{ - send_GetTables(req); - recv_GetTables(_return); -} - -void TCLIServiceClient::send_GetTables(const TGetTablesReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetTables", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetTables_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetTables(TGetTablesResp& _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("GetTables") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetTables_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, "GetTables failed: unknown result"); -} - -void TCLIServiceClient::GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) -{ - send_GetTableTypes(req); - recv_GetTableTypes(_return); -} - -void TCLIServiceClient::send_GetTableTypes(const TGetTableTypesReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetTableTypes", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetTableTypes_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetTableTypes(TGetTableTypesResp& _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("GetTableTypes") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetTableTypes_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, "GetTableTypes failed: unknown result"); -} - -void TCLIServiceClient::GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) -{ - send_GetColumns(req); - recv_GetColumns(_return); -} - -void TCLIServiceClient::send_GetColumns(const TGetColumnsReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetColumns", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetColumns_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetColumns(TGetColumnsResp& _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("GetColumns") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetColumns_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, "GetColumns failed: unknown result"); -} - -void TCLIServiceClient::GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) -{ - send_GetFunctions(req); - recv_GetFunctions(_return); -} - -void TCLIServiceClient::send_GetFunctions(const TGetFunctionsReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetFunctions", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetFunctions_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetFunctions(TGetFunctionsResp& _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("GetFunctions") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetFunctions_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, "GetFunctions failed: unknown result"); -} - -void TCLIServiceClient::GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) -{ - send_GetPrimaryKeys(req); - recv_GetPrimaryKeys(_return); -} - -void TCLIServiceClient::send_GetPrimaryKeys(const TGetPrimaryKeysReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetPrimaryKeys", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetPrimaryKeys_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetPrimaryKeys(TGetPrimaryKeysResp& _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("GetPrimaryKeys") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetPrimaryKeys_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, "GetPrimaryKeys failed: unknown result"); -} - -void TCLIServiceClient::GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) -{ - send_GetCrossReference(req); - recv_GetCrossReference(_return); -} - -void TCLIServiceClient::send_GetCrossReference(const TGetCrossReferenceReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetCrossReference", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetCrossReference_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetCrossReference(TGetCrossReferenceResp& _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("GetCrossReference") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetCrossReference_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, "GetCrossReference failed: unknown result"); -} - -void TCLIServiceClient::GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) -{ - send_GetOperationStatus(req); - recv_GetOperationStatus(_return); -} - -void TCLIServiceClient::send_GetOperationStatus(const TGetOperationStatusReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetOperationStatus", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetOperationStatus_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetOperationStatus(TGetOperationStatusResp& _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("GetOperationStatus") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetOperationStatus_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, "GetOperationStatus failed: unknown result"); -} - -void TCLIServiceClient::CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) -{ - send_CancelOperation(req); - recv_CancelOperation(_return); -} - -void TCLIServiceClient::send_CancelOperation(const TCancelOperationReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("CancelOperation", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_CancelOperation_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_CancelOperation(TCancelOperationResp& _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("CancelOperation") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_CancelOperation_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, "CancelOperation failed: unknown result"); -} - -void TCLIServiceClient::CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) -{ - send_CloseOperation(req); - recv_CloseOperation(_return); -} - -void TCLIServiceClient::send_CloseOperation(const TCloseOperationReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("CloseOperation", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_CloseOperation_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_CloseOperation(TCloseOperationResp& _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("CloseOperation") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_CloseOperation_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, "CloseOperation failed: unknown result"); -} - -void TCLIServiceClient::GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) -{ - send_GetResultSetMetadata(req); - recv_GetResultSetMetadata(_return); -} - -void TCLIServiceClient::send_GetResultSetMetadata(const TGetResultSetMetadataReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetResultSetMetadata", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetResultSetMetadata_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetResultSetMetadata(TGetResultSetMetadataResp& _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("GetResultSetMetadata") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetResultSetMetadata_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, "GetResultSetMetadata failed: unknown result"); -} - -void TCLIServiceClient::FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) -{ - send_FetchResults(req); - recv_FetchResults(_return); -} - -void TCLIServiceClient::send_FetchResults(const TFetchResultsReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("FetchResults", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_FetchResults_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_FetchResults(TFetchResultsResp& _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("FetchResults") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_FetchResults_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, "FetchResults failed: unknown result"); -} - -void TCLIServiceClient::GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) -{ - send_GetDelegationToken(req); - recv_GetDelegationToken(_return); -} - -void TCLIServiceClient::send_GetDelegationToken(const TGetDelegationTokenReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetDelegationToken_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetDelegationToken(TGetDelegationTokenResp& _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("GetDelegationToken") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetDelegationToken_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, "GetDelegationToken failed: unknown result"); -} - -void TCLIServiceClient::CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) -{ - send_CancelDelegationToken(req); - recv_CancelDelegationToken(_return); -} - -void TCLIServiceClient::send_CancelDelegationToken(const TCancelDelegationTokenReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("CancelDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_CancelDelegationToken_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_CancelDelegationToken(TCancelDelegationTokenResp& _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("CancelDelegationToken") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_CancelDelegationToken_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, "CancelDelegationToken failed: unknown result"); -} - -void TCLIServiceClient::RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) -{ - send_RenewDelegationToken(req); - recv_RenewDelegationToken(_return); -} - -void TCLIServiceClient::send_RenewDelegationToken(const TRenewDelegationTokenReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("RenewDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_RenewDelegationToken_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_RenewDelegationToken(TRenewDelegationTokenResp& _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("RenewDelegationToken") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_RenewDelegationToken_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, "RenewDelegationToken failed: unknown result"); -} - -void TCLIServiceClient::GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) -{ - send_GetQueryId(req); - recv_GetQueryId(_return); -} - -void TCLIServiceClient::send_GetQueryId(const TGetQueryIdReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("GetQueryId", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetQueryId_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_GetQueryId(TGetQueryIdResp& _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("GetQueryId") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_GetQueryId_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, "GetQueryId failed: unknown result"); -} - -void TCLIServiceClient::SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) -{ - send_SetClientInfo(req); - recv_SetClientInfo(_return); -} - -void TCLIServiceClient::send_SetClientInfo(const TSetClientInfoReq& req) -{ - int32_t cseqid = 0; - oprot_->writeMessageBegin("SetClientInfo", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_SetClientInfo_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); -} - -void TCLIServiceClient::recv_SetClientInfo(TSetClientInfoResp& _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("SetClientInfo") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - TCLIService_SetClientInfo_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, "SetClientInfo failed: unknown result"); -} - -bool TCLIServiceProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) { - ProcessMap::iterator pfn; - pfn = processMap_.find(fname); - if (pfn == processMap_.end()) { - iprot->skip(::apache::thrift::protocol::T_STRUCT); - iprot->readMessageEnd(); - iprot->getTransport()->readEnd(); - ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'"); - oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid); - x.write(oprot); - oprot->writeMessageEnd(); - oprot->getTransport()->writeEnd(); - oprot->getTransport()->flush(); - return true; - } - (this->*(pfn->second))(seqid, iprot, oprot, callContext); - return true; -} - -void TCLIServiceProcessor::process_OpenSession(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.OpenSession", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.OpenSession"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.OpenSession"); - } - - TCLIService_OpenSession_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.OpenSession", bytes); - } - - TCLIService_OpenSession_result result; - try { - iface_->OpenSession(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.OpenSession"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("OpenSession", ::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.OpenSession"); - } - - oprot->writeMessageBegin("OpenSession", ::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.OpenSession", bytes); - } -} - -void TCLIServiceProcessor::process_CloseSession(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.CloseSession", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CloseSession"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.CloseSession"); - } - - TCLIService_CloseSession_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.CloseSession", bytes); - } - - TCLIService_CloseSession_result result; - try { - iface_->CloseSession(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.CloseSession"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("CloseSession", ::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.CloseSession"); - } - - oprot->writeMessageBegin("CloseSession", ::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.CloseSession", bytes); - } -} - -void TCLIServiceProcessor::process_GetInfo(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.GetInfo", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetInfo"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetInfo"); - } - - TCLIService_GetInfo_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetInfo", bytes); - } - - TCLIService_GetInfo_result result; - try { - iface_->GetInfo(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetInfo"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetInfo", ::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.GetInfo"); - } - - oprot->writeMessageBegin("GetInfo", ::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.GetInfo", bytes); - } -} - -void TCLIServiceProcessor::process_ExecuteStatement(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.ExecuteStatement", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.ExecuteStatement"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.ExecuteStatement"); - } - - TCLIService_ExecuteStatement_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.ExecuteStatement", bytes); - } - - TCLIService_ExecuteStatement_result result; - try { - iface_->ExecuteStatement(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.ExecuteStatement"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("ExecuteStatement", ::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.ExecuteStatement"); - } - - oprot->writeMessageBegin("ExecuteStatement", ::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.ExecuteStatement", bytes); - } -} - -void TCLIServiceProcessor::process_GetTypeInfo(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.GetTypeInfo", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetTypeInfo"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetTypeInfo"); - } - - TCLIService_GetTypeInfo_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetTypeInfo", bytes); - } - - TCLIService_GetTypeInfo_result result; - try { - iface_->GetTypeInfo(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetTypeInfo"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetTypeInfo", ::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.GetTypeInfo"); - } - - oprot->writeMessageBegin("GetTypeInfo", ::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.GetTypeInfo", bytes); - } -} - -void TCLIServiceProcessor::process_GetCatalogs(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.GetCatalogs", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetCatalogs"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetCatalogs"); - } - - TCLIService_GetCatalogs_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetCatalogs", bytes); - } - - TCLIService_GetCatalogs_result result; - try { - iface_->GetCatalogs(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetCatalogs"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetCatalogs", ::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.GetCatalogs"); - } - - oprot->writeMessageBegin("GetCatalogs", ::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.GetCatalogs", bytes); - } -} - -void TCLIServiceProcessor::process_GetSchemas(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.GetSchemas", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetSchemas"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetSchemas"); - } - - TCLIService_GetSchemas_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetSchemas", bytes); - } - - TCLIService_GetSchemas_result result; - try { - iface_->GetSchemas(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetSchemas"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetSchemas", ::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.GetSchemas"); - } - - oprot->writeMessageBegin("GetSchemas", ::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.GetSchemas", bytes); - } -} - -void TCLIServiceProcessor::process_GetTables(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.GetTables", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetTables"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetTables"); - } - - TCLIService_GetTables_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetTables", bytes); - } - - TCLIService_GetTables_result result; - try { - iface_->GetTables(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetTables"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetTables", ::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.GetTables"); - } - - oprot->writeMessageBegin("GetTables", ::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.GetTables", bytes); - } -} - -void TCLIServiceProcessor::process_GetTableTypes(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.GetTableTypes", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetTableTypes"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetTableTypes"); - } - - TCLIService_GetTableTypes_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetTableTypes", bytes); - } - - TCLIService_GetTableTypes_result result; - try { - iface_->GetTableTypes(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetTableTypes"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetTableTypes", ::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.GetTableTypes"); - } - - oprot->writeMessageBegin("GetTableTypes", ::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.GetTableTypes", bytes); - } -} - -void TCLIServiceProcessor::process_GetColumns(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.GetColumns", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetColumns"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetColumns"); - } - - TCLIService_GetColumns_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetColumns", bytes); - } - - TCLIService_GetColumns_result result; - try { - iface_->GetColumns(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetColumns"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetColumns", ::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.GetColumns"); - } - - oprot->writeMessageBegin("GetColumns", ::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.GetColumns", bytes); - } -} - -void TCLIServiceProcessor::process_GetFunctions(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.GetFunctions", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetFunctions"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetFunctions"); - } - - TCLIService_GetFunctions_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetFunctions", bytes); - } - - TCLIService_GetFunctions_result result; - try { - iface_->GetFunctions(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetFunctions"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetFunctions", ::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.GetFunctions"); - } - - oprot->writeMessageBegin("GetFunctions", ::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.GetFunctions", bytes); - } -} - -void TCLIServiceProcessor::process_GetPrimaryKeys(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.GetPrimaryKeys", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetPrimaryKeys"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetPrimaryKeys"); - } - - TCLIService_GetPrimaryKeys_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetPrimaryKeys", bytes); - } - - TCLIService_GetPrimaryKeys_result result; - try { - iface_->GetPrimaryKeys(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetPrimaryKeys"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetPrimaryKeys", ::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.GetPrimaryKeys"); - } - - oprot->writeMessageBegin("GetPrimaryKeys", ::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.GetPrimaryKeys", bytes); - } -} - -void TCLIServiceProcessor::process_GetCrossReference(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.GetCrossReference", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetCrossReference"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetCrossReference"); - } - - TCLIService_GetCrossReference_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetCrossReference", bytes); - } - - TCLIService_GetCrossReference_result result; - try { - iface_->GetCrossReference(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetCrossReference"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetCrossReference", ::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.GetCrossReference"); - } - - oprot->writeMessageBegin("GetCrossReference", ::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.GetCrossReference", bytes); - } -} - -void TCLIServiceProcessor::process_GetOperationStatus(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.GetOperationStatus", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetOperationStatus"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetOperationStatus"); - } - - TCLIService_GetOperationStatus_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetOperationStatus", bytes); - } - - TCLIService_GetOperationStatus_result result; - try { - iface_->GetOperationStatus(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetOperationStatus"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetOperationStatus", ::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.GetOperationStatus"); - } - - oprot->writeMessageBegin("GetOperationStatus", ::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.GetOperationStatus", bytes); - } -} - -void TCLIServiceProcessor::process_CancelOperation(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.CancelOperation", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CancelOperation"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.CancelOperation"); - } - - TCLIService_CancelOperation_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.CancelOperation", bytes); - } - - TCLIService_CancelOperation_result result; - try { - iface_->CancelOperation(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.CancelOperation"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("CancelOperation", ::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.CancelOperation"); - } - - oprot->writeMessageBegin("CancelOperation", ::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.CancelOperation", bytes); - } -} - -void TCLIServiceProcessor::process_CloseOperation(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.CloseOperation", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CloseOperation"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.CloseOperation"); - } - - TCLIService_CloseOperation_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.CloseOperation", bytes); - } - - TCLIService_CloseOperation_result result; - try { - iface_->CloseOperation(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.CloseOperation"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("CloseOperation", ::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.CloseOperation"); - } - - oprot->writeMessageBegin("CloseOperation", ::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.CloseOperation", bytes); - } -} - -void TCLIServiceProcessor::process_GetResultSetMetadata(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.GetResultSetMetadata", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetResultSetMetadata"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetResultSetMetadata"); - } - - TCLIService_GetResultSetMetadata_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetResultSetMetadata", bytes); - } - - TCLIService_GetResultSetMetadata_result result; - try { - iface_->GetResultSetMetadata(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetResultSetMetadata"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetResultSetMetadata", ::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.GetResultSetMetadata"); - } - - oprot->writeMessageBegin("GetResultSetMetadata", ::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.GetResultSetMetadata", bytes); - } -} - -void TCLIServiceProcessor::process_FetchResults(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.FetchResults", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.FetchResults"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.FetchResults"); - } - - TCLIService_FetchResults_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.FetchResults", bytes); - } - - TCLIService_FetchResults_result result; - try { - iface_->FetchResults(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.FetchResults"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("FetchResults", ::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.FetchResults"); - } - - oprot->writeMessageBegin("FetchResults", ::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.FetchResults", bytes); - } -} - -void TCLIServiceProcessor::process_GetDelegationToken(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.GetDelegationToken", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetDelegationToken"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetDelegationToken"); - } - - TCLIService_GetDelegationToken_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetDelegationToken", bytes); - } - - TCLIService_GetDelegationToken_result result; - try { - iface_->GetDelegationToken(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetDelegationToken"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetDelegationToken", ::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.GetDelegationToken"); - } - - oprot->writeMessageBegin("GetDelegationToken", ::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.GetDelegationToken", bytes); - } -} - -void TCLIServiceProcessor::process_CancelDelegationToken(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.CancelDelegationToken", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.CancelDelegationToken"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.CancelDelegationToken"); - } - - TCLIService_CancelDelegationToken_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.CancelDelegationToken", bytes); - } - - TCLIService_CancelDelegationToken_result result; - try { - iface_->CancelDelegationToken(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.CancelDelegationToken"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("CancelDelegationToken", ::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.CancelDelegationToken"); - } - - oprot->writeMessageBegin("CancelDelegationToken", ::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.CancelDelegationToken", bytes); - } -} - -void TCLIServiceProcessor::process_RenewDelegationToken(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.RenewDelegationToken", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.RenewDelegationToken"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.RenewDelegationToken"); - } - - TCLIService_RenewDelegationToken_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.RenewDelegationToken", bytes); - } - - TCLIService_RenewDelegationToken_result result; - try { - iface_->RenewDelegationToken(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.RenewDelegationToken"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("RenewDelegationToken", ::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.RenewDelegationToken"); - } - - oprot->writeMessageBegin("RenewDelegationToken", ::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.RenewDelegationToken", bytes); - } -} - -void TCLIServiceProcessor::process_GetQueryId(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.GetQueryId", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.GetQueryId"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.GetQueryId"); - } - - TCLIService_GetQueryId_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.GetQueryId", bytes); - } - - TCLIService_GetQueryId_result result; - try { - iface_->GetQueryId(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.GetQueryId"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("GetQueryId", ::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.GetQueryId"); - } - - oprot->writeMessageBegin("GetQueryId", ::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.GetQueryId", bytes); - } -} - -void TCLIServiceProcessor::process_SetClientInfo(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.SetClientInfo", callContext); - } - ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "TCLIService.SetClientInfo"); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->preRead(ctx, "TCLIService.SetClientInfo"); - } - - TCLIService_SetClientInfo_args args; - args.read(iprot); - iprot->readMessageEnd(); - uint32_t bytes = iprot->getTransport()->readEnd(); - - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->postRead(ctx, "TCLIService.SetClientInfo", bytes); - } - - TCLIService_SetClientInfo_result result; - try { - iface_->SetClientInfo(result.success, args.req); - result.__isset.success = true; - } catch (const std::exception& e) { - if (this->eventHandler_.get() != NULL) { - this->eventHandler_->handlerError(ctx, "TCLIService.SetClientInfo"); - } - - ::apache::thrift::TApplicationException x(e.what()); - oprot->writeMessageBegin("SetClientInfo", ::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.SetClientInfo"); - } - - oprot->writeMessageBegin("SetClientInfo", ::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.SetClientInfo", bytes); - } -} - -::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > TCLIServiceProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) { - ::apache::thrift::ReleaseHandler< TCLIServiceIfFactory > cleanup(handlerFactory_); - ::apache::thrift::stdcxx::shared_ptr< TCLIServiceIf > handler(handlerFactory_->getHandler(connInfo), cleanup); - ::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > processor(new TCLIServiceProcessor(handler)); - return processor; -} - -void TCLIServiceConcurrentClient::OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) -{ - int32_t seqid = send_OpenSession(req); - recv_OpenSession(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_OpenSession(const TOpenSessionReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - 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(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_OpenSession(TOpenSessionResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - 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(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - 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 - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "OpenSession failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) -{ - int32_t seqid = send_CloseSession(req); - recv_CloseSession(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_CloseSession(const TCloseSessionReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - 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(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_CloseSession(TCloseSessionResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - 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(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - 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 - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CloseSession failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) -{ - int32_t seqid = send_GetInfo(req); - recv_GetInfo(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetInfo(const TGetInfoReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetInfo", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetInfo_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetInfo(TGetInfoResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetInfo") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetInfo_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetInfo failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) -{ - int32_t seqid = send_ExecuteStatement(req); - recv_ExecuteStatement(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_ExecuteStatement(const TExecuteStatementReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("ExecuteStatement", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_ExecuteStatement_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_ExecuteStatement(TExecuteStatementResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("ExecuteStatement") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_ExecuteStatement_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "ExecuteStatement failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) -{ - int32_t seqid = send_GetTypeInfo(req); - recv_GetTypeInfo(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetTypeInfo(const TGetTypeInfoReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetTypeInfo", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetTypeInfo_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetTypeInfo(TGetTypeInfoResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetTypeInfo") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetTypeInfo_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetTypeInfo failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) -{ - int32_t seqid = send_GetCatalogs(req); - recv_GetCatalogs(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetCatalogs(const TGetCatalogsReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetCatalogs", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetCatalogs_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetCatalogs(TGetCatalogsResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetCatalogs") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetCatalogs_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetCatalogs failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) -{ - int32_t seqid = send_GetSchemas(req); - recv_GetSchemas(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetSchemas(const TGetSchemasReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetSchemas", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetSchemas_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetSchemas(TGetSchemasResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetSchemas") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetSchemas_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetSchemas failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetTables(TGetTablesResp& _return, const TGetTablesReq& req) -{ - int32_t seqid = send_GetTables(req); - recv_GetTables(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetTables(const TGetTablesReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetTables", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetTables_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetTables(TGetTablesResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetTables") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetTables_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetTables failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) -{ - int32_t seqid = send_GetTableTypes(req); - recv_GetTableTypes(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetTableTypes(const TGetTableTypesReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetTableTypes", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetTableTypes_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetTableTypes(TGetTableTypesResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetTableTypes") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetTableTypes_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetTableTypes failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) -{ - int32_t seqid = send_GetColumns(req); - recv_GetColumns(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetColumns(const TGetColumnsReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetColumns", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetColumns_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetColumns(TGetColumnsResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetColumns") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetColumns_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetColumns failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) -{ - int32_t seqid = send_GetFunctions(req); - recv_GetFunctions(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetFunctions(const TGetFunctionsReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetFunctions", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetFunctions_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetFunctions(TGetFunctionsResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetFunctions") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetFunctions_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetFunctions failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) -{ - int32_t seqid = send_GetPrimaryKeys(req); - recv_GetPrimaryKeys(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetPrimaryKeys(const TGetPrimaryKeysReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetPrimaryKeys", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetPrimaryKeys_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetPrimaryKeys(TGetPrimaryKeysResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetPrimaryKeys") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetPrimaryKeys_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetPrimaryKeys failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) -{ - int32_t seqid = send_GetCrossReference(req); - recv_GetCrossReference(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetCrossReference(const TGetCrossReferenceReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetCrossReference", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetCrossReference_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetCrossReference(TGetCrossReferenceResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetCrossReference") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetCrossReference_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetCrossReference failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) -{ - int32_t seqid = send_GetOperationStatus(req); - recv_GetOperationStatus(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetOperationStatus(const TGetOperationStatusReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetOperationStatus", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetOperationStatus_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetOperationStatus(TGetOperationStatusResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetOperationStatus") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetOperationStatus_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetOperationStatus failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) -{ - int32_t seqid = send_CancelOperation(req); - recv_CancelOperation(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_CancelOperation(const TCancelOperationReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("CancelOperation", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_CancelOperation_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_CancelOperation(TCancelOperationResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("CancelOperation") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_CancelOperation_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CancelOperation failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) -{ - int32_t seqid = send_CloseOperation(req); - recv_CloseOperation(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_CloseOperation(const TCloseOperationReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("CloseOperation", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_CloseOperation_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_CloseOperation(TCloseOperationResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("CloseOperation") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_CloseOperation_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CloseOperation failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) -{ - int32_t seqid = send_GetResultSetMetadata(req); - recv_GetResultSetMetadata(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetResultSetMetadata(const TGetResultSetMetadataReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetResultSetMetadata", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetResultSetMetadata_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetResultSetMetadata(TGetResultSetMetadataResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetResultSetMetadata") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetResultSetMetadata_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetResultSetMetadata failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) -{ - int32_t seqid = send_FetchResults(req); - recv_FetchResults(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_FetchResults(const TFetchResultsReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("FetchResults", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_FetchResults_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_FetchResults(TFetchResultsResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("FetchResults") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_FetchResults_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "FetchResults failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) -{ - int32_t seqid = send_GetDelegationToken(req); - recv_GetDelegationToken(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetDelegationToken(const TGetDelegationTokenReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetDelegationToken_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetDelegationToken(TGetDelegationTokenResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetDelegationToken") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetDelegationToken_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetDelegationToken failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) -{ - int32_t seqid = send_CancelDelegationToken(req); - recv_CancelDelegationToken(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_CancelDelegationToken(const TCancelDelegationTokenReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("CancelDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_CancelDelegationToken_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_CancelDelegationToken(TCancelDelegationTokenResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("CancelDelegationToken") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_CancelDelegationToken_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "CancelDelegationToken failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) -{ - int32_t seqid = send_RenewDelegationToken(req); - recv_RenewDelegationToken(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_RenewDelegationToken(const TRenewDelegationTokenReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("RenewDelegationToken", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_RenewDelegationToken_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_RenewDelegationToken(TRenewDelegationTokenResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("RenewDelegationToken") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_RenewDelegationToken_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "RenewDelegationToken failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) -{ - int32_t seqid = send_GetQueryId(req); - recv_GetQueryId(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_GetQueryId(const TGetQueryIdReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("GetQueryId", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_GetQueryId_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_GetQueryId(TGetQueryIdResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("GetQueryId") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_GetQueryId_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "GetQueryId failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -void TCLIServiceConcurrentClient::SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) -{ - int32_t seqid = send_SetClientInfo(req); - recv_SetClientInfo(_return, seqid); -} - -int32_t TCLIServiceConcurrentClient::send_SetClientInfo(const TSetClientInfoReq& req) -{ - int32_t cseqid = this->sync_.generateSeqId(); - ::apache::thrift::async::TConcurrentSendSentry sentry(&this->sync_); - oprot_->writeMessageBegin("SetClientInfo", ::apache::thrift::protocol::T_CALL, cseqid); - - TCLIService_SetClientInfo_pargs args; - args.req = &req; - args.write(oprot_); - - oprot_->writeMessageEnd(); - oprot_->getTransport()->writeEnd(); - oprot_->getTransport()->flush(); - - sentry.commit(); - return cseqid; -} - -void TCLIServiceConcurrentClient::recv_SetClientInfo(TSetClientInfoResp& _return, const int32_t seqid) -{ - - int32_t rseqid = 0; - std::string fname; - ::apache::thrift::protocol::TMessageType mtype; - - // the read mutex gets dropped and reacquired as part of waitForWork() - // The destructor of this sentry wakes up other clients - ::apache::thrift::async::TConcurrentRecvSentry sentry(&this->sync_, seqid); - - while(true) { - if(!this->sync_.getPending(fname, mtype, rseqid)) { - iprot_->readMessageBegin(fname, mtype, rseqid); - } - if(seqid == rseqid) { - if (mtype == ::apache::thrift::protocol::T_EXCEPTION) { - ::apache::thrift::TApplicationException x; - x.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - sentry.commit(); - throw x; - } - if (mtype != ::apache::thrift::protocol::T_REPLY) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - } - if (fname.compare("SetClientInfo") != 0) { - iprot_->skip(::apache::thrift::protocol::T_STRUCT); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - // in a bad state, don't commit - using ::apache::thrift::protocol::TProtocolException; - throw TProtocolException(TProtocolException::INVALID_DATA); - } - TCLIService_SetClientInfo_presult result; - result.success = &_return; - result.read(iprot_); - iprot_->readMessageEnd(); - iprot_->getTransport()->readEnd(); - - if (result.__isset.success) { - // _return pointer has now been filled - sentry.commit(); - return; - } - // in a bad state, don't commit - throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "SetClientInfo failed: unknown result"); - } - // seqid != rseqid - this->sync_.updatePending(fname, mtype, rseqid); - - // this will temporarily unlock the readMutex, and let other clients get work done - this->sync_.waitForWork(seqid); - } // end while(true) -} - -}}}}} // namespace - diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h deleted file mode 100644 index 23614ee3dcf6..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService.h +++ /dev/null @@ -1,3068 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#ifndef TCLIService_H -#define TCLIService_H - -#include -#include -#include "TCLIService_types.h" - -namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { - -#ifdef _MSC_VER - #pragma warning( push ) - #pragma warning (disable : 4250 ) //inheriting methods via dominance -#endif - -class TCLIServiceIf { - public: - virtual ~TCLIServiceIf() {} - virtual void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) = 0; - 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 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; - virtual void GetTables(TGetTablesResp& _return, const TGetTablesReq& req) = 0; - virtual void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) = 0; - virtual void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) = 0; - virtual void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) = 0; - virtual void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) = 0; - virtual void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) = 0; - virtual void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) = 0; - virtual void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) = 0; - virtual void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) = 0; - virtual void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) = 0; - virtual void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) = 0; - virtual void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) = 0; - virtual void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) = 0; - virtual void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) = 0; - virtual void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) = 0; - virtual void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) = 0; -}; - -class TCLIServiceIfFactory { - public: - typedef TCLIServiceIf Handler; - - virtual ~TCLIServiceIfFactory() {} - - virtual TCLIServiceIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0; - virtual void releaseHandler(TCLIServiceIf* /* handler */) = 0; -}; - -class TCLIServiceIfSingletonFactory : virtual public TCLIServiceIfFactory { - public: - TCLIServiceIfSingletonFactory(const ::apache::thrift::stdcxx::shared_ptr& iface) : iface_(iface) {} - virtual ~TCLIServiceIfSingletonFactory() {} - - virtual TCLIServiceIf* getHandler(const ::apache::thrift::TConnectionInfo&) { - return iface_.get(); - } - virtual void releaseHandler(TCLIServiceIf* /* handler */) {} - - protected: - ::apache::thrift::stdcxx::shared_ptr iface_; -}; - -class TCLIServiceNull : virtual public TCLIServiceIf { - public: - virtual ~TCLIServiceNull() {} - void OpenSession(TOpenSessionResp& /* _return */, const TOpenSessionReq& /* req */) { - return; - } - void CloseSession(TCloseSessionResp& /* _return */, const TCloseSessionReq& /* req */) { - return; - } - void GetInfo(TGetInfoResp& /* _return */, const TGetInfoReq& /* req */) { - return; - } - void ExecuteStatement(TExecuteStatementResp& /* _return */, const TExecuteStatementReq& /* req */) { - return; - } - void GetTypeInfo(TGetTypeInfoResp& /* _return */, const TGetTypeInfoReq& /* req */) { - return; - } - void GetCatalogs(TGetCatalogsResp& /* _return */, const TGetCatalogsReq& /* req */) { - return; - } - void GetSchemas(TGetSchemasResp& /* _return */, const TGetSchemasReq& /* req */) { - return; - } - void GetTables(TGetTablesResp& /* _return */, const TGetTablesReq& /* req */) { - return; - } - void GetTableTypes(TGetTableTypesResp& /* _return */, const TGetTableTypesReq& /* req */) { - return; - } - void GetColumns(TGetColumnsResp& /* _return */, const TGetColumnsReq& /* req */) { - return; - } - void GetFunctions(TGetFunctionsResp& /* _return */, const TGetFunctionsReq& /* req */) { - return; - } - void GetPrimaryKeys(TGetPrimaryKeysResp& /* _return */, const TGetPrimaryKeysReq& /* req */) { - return; - } - void GetCrossReference(TGetCrossReferenceResp& /* _return */, const TGetCrossReferenceReq& /* req */) { - return; - } - void GetOperationStatus(TGetOperationStatusResp& /* _return */, const TGetOperationStatusReq& /* req */) { - return; - } - void CancelOperation(TCancelOperationResp& /* _return */, const TCancelOperationReq& /* req */) { - return; - } - void CloseOperation(TCloseOperationResp& /* _return */, const TCloseOperationReq& /* req */) { - return; - } - void GetResultSetMetadata(TGetResultSetMetadataResp& /* _return */, const TGetResultSetMetadataReq& /* req */) { - return; - } - void FetchResults(TFetchResultsResp& /* _return */, const TFetchResultsReq& /* req */) { - return; - } - void GetDelegationToken(TGetDelegationTokenResp& /* _return */, const TGetDelegationTokenReq& /* req */) { - return; - } - void CancelDelegationToken(TCancelDelegationTokenResp& /* _return */, const TCancelDelegationTokenReq& /* req */) { - return; - } - void RenewDelegationToken(TRenewDelegationTokenResp& /* _return */, const TRenewDelegationTokenReq& /* req */) { - return; - } - void GetQueryId(TGetQueryIdResp& /* _return */, const TGetQueryIdReq& /* req */) { - return; - } - void SetClientInfo(TSetClientInfoResp& /* _return */, const TSetClientInfoReq& /* req */) { - return; - } -}; - -typedef struct _TCLIService_OpenSession_args__isset { - _TCLIService_OpenSession_args__isset() : req(false) {} - bool req :1; -} _TCLIService_OpenSession_args__isset; - -class TCLIService_OpenSession_args { - public: - - TCLIService_OpenSession_args(const TCLIService_OpenSession_args&); - TCLIService_OpenSession_args& operator=(const TCLIService_OpenSession_args&); - TCLIService_OpenSession_args() { - } - - virtual ~TCLIService_OpenSession_args() throw(); - TOpenSessionReq req; - - _TCLIService_OpenSession_args__isset __isset; - - void __set_req(const TOpenSessionReq& val); - - bool operator == (const TCLIService_OpenSession_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_OpenSession_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_OpenSession_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_OpenSession_pargs { - public: - - - virtual ~TCLIService_OpenSession_pargs() throw(); - const TOpenSessionReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_OpenSession_result__isset { - _TCLIService_OpenSession_result__isset() : success(false) {} - bool success :1; -} _TCLIService_OpenSession_result__isset; - -class TCLIService_OpenSession_result { - public: - - TCLIService_OpenSession_result(const TCLIService_OpenSession_result&); - TCLIService_OpenSession_result& operator=(const TCLIService_OpenSession_result&); - TCLIService_OpenSession_result() { - } - - virtual ~TCLIService_OpenSession_result() throw(); - TOpenSessionResp success; - - _TCLIService_OpenSession_result__isset __isset; - - void __set_success(const TOpenSessionResp& val); - - bool operator == (const TCLIService_OpenSession_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_OpenSession_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_OpenSession_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_OpenSession_presult__isset { - _TCLIService_OpenSession_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_OpenSession_presult__isset; - -class TCLIService_OpenSession_presult { - public: - - - virtual ~TCLIService_OpenSession_presult() throw(); - TOpenSessionResp* success; - - _TCLIService_OpenSession_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_CloseSession_args__isset { - _TCLIService_CloseSession_args__isset() : req(false) {} - bool req :1; -} _TCLIService_CloseSession_args__isset; - -class TCLIService_CloseSession_args { - public: - - TCLIService_CloseSession_args(const TCLIService_CloseSession_args&); - TCLIService_CloseSession_args& operator=(const TCLIService_CloseSession_args&); - TCLIService_CloseSession_args() { - } - - virtual ~TCLIService_CloseSession_args() throw(); - TCloseSessionReq req; - - _TCLIService_CloseSession_args__isset __isset; - - void __set_req(const TCloseSessionReq& val); - - bool operator == (const TCLIService_CloseSession_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_CloseSession_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CloseSession_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_CloseSession_pargs { - public: - - - virtual ~TCLIService_CloseSession_pargs() throw(); - const TCloseSessionReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CloseSession_result__isset { - _TCLIService_CloseSession_result__isset() : success(false) {} - bool success :1; -} _TCLIService_CloseSession_result__isset; - -class TCLIService_CloseSession_result { - public: - - TCLIService_CloseSession_result(const TCLIService_CloseSession_result&); - TCLIService_CloseSession_result& operator=(const TCLIService_CloseSession_result&); - TCLIService_CloseSession_result() { - } - - virtual ~TCLIService_CloseSession_result() throw(); - TCloseSessionResp success; - - _TCLIService_CloseSession_result__isset __isset; - - void __set_success(const TCloseSessionResp& val); - - bool operator == (const TCLIService_CloseSession_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_CloseSession_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CloseSession_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CloseSession_presult__isset { - _TCLIService_CloseSession_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_CloseSession_presult__isset; - -class TCLIService_CloseSession_presult { - public: - - - virtual ~TCLIService_CloseSession_presult() throw(); - TCloseSessionResp* success; - - _TCLIService_CloseSession_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetInfo_args__isset { - _TCLIService_GetInfo_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetInfo_args__isset; - -class TCLIService_GetInfo_args { - public: - - TCLIService_GetInfo_args(const TCLIService_GetInfo_args&); - TCLIService_GetInfo_args& operator=(const TCLIService_GetInfo_args&); - TCLIService_GetInfo_args() { - } - - virtual ~TCLIService_GetInfo_args() throw(); - TGetInfoReq req; - - _TCLIService_GetInfo_args__isset __isset; - - void __set_req(const TGetInfoReq& val); - - bool operator == (const TCLIService_GetInfo_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetInfo_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetInfo_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetInfo_pargs { - public: - - - virtual ~TCLIService_GetInfo_pargs() throw(); - const TGetInfoReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetInfo_result__isset { - _TCLIService_GetInfo_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetInfo_result__isset; - -class TCLIService_GetInfo_result { - public: - - TCLIService_GetInfo_result(const TCLIService_GetInfo_result&); - TCLIService_GetInfo_result& operator=(const TCLIService_GetInfo_result&); - TCLIService_GetInfo_result() { - } - - virtual ~TCLIService_GetInfo_result() throw(); - TGetInfoResp success; - - _TCLIService_GetInfo_result__isset __isset; - - void __set_success(const TGetInfoResp& val); - - bool operator == (const TCLIService_GetInfo_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetInfo_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetInfo_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetInfo_presult__isset { - _TCLIService_GetInfo_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetInfo_presult__isset; - -class TCLIService_GetInfo_presult { - public: - - - virtual ~TCLIService_GetInfo_presult() throw(); - TGetInfoResp* success; - - _TCLIService_GetInfo_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_ExecuteStatement_args__isset { - _TCLIService_ExecuteStatement_args__isset() : req(false) {} - bool req :1; -} _TCLIService_ExecuteStatement_args__isset; - -class TCLIService_ExecuteStatement_args { - public: - - TCLIService_ExecuteStatement_args(const TCLIService_ExecuteStatement_args&); - TCLIService_ExecuteStatement_args& operator=(const TCLIService_ExecuteStatement_args&); - TCLIService_ExecuteStatement_args() { - } - - virtual ~TCLIService_ExecuteStatement_args() throw(); - TExecuteStatementReq req; - - _TCLIService_ExecuteStatement_args__isset __isset; - - void __set_req(const TExecuteStatementReq& val); - - bool operator == (const TCLIService_ExecuteStatement_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_ExecuteStatement_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_ExecuteStatement_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_ExecuteStatement_pargs { - public: - - - virtual ~TCLIService_ExecuteStatement_pargs() throw(); - const TExecuteStatementReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_ExecuteStatement_result__isset { - _TCLIService_ExecuteStatement_result__isset() : success(false) {} - bool success :1; -} _TCLIService_ExecuteStatement_result__isset; - -class TCLIService_ExecuteStatement_result { - public: - - TCLIService_ExecuteStatement_result(const TCLIService_ExecuteStatement_result&); - TCLIService_ExecuteStatement_result& operator=(const TCLIService_ExecuteStatement_result&); - TCLIService_ExecuteStatement_result() { - } - - virtual ~TCLIService_ExecuteStatement_result() throw(); - TExecuteStatementResp success; - - _TCLIService_ExecuteStatement_result__isset __isset; - - void __set_success(const TExecuteStatementResp& val); - - bool operator == (const TCLIService_ExecuteStatement_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_ExecuteStatement_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_ExecuteStatement_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_ExecuteStatement_presult__isset { - _TCLIService_ExecuteStatement_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_ExecuteStatement_presult__isset; - -class TCLIService_ExecuteStatement_presult { - public: - - - virtual ~TCLIService_ExecuteStatement_presult() throw(); - TExecuteStatementResp* success; - - _TCLIService_ExecuteStatement_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 :1; -} _TCLIService_GetTypeInfo_args__isset; - -class TCLIService_GetTypeInfo_args { - public: - - TCLIService_GetTypeInfo_args(const TCLIService_GetTypeInfo_args&); - TCLIService_GetTypeInfo_args& operator=(const TCLIService_GetTypeInfo_args&); - TCLIService_GetTypeInfo_args() { - } - - virtual ~TCLIService_GetTypeInfo_args() throw(); - TGetTypeInfoReq req; - - _TCLIService_GetTypeInfo_args__isset __isset; - - void __set_req(const TGetTypeInfoReq& val); - - bool operator == (const TCLIService_GetTypeInfo_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetTypeInfo_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetTypeInfo_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetTypeInfo_pargs { - public: - - - virtual ~TCLIService_GetTypeInfo_pargs() throw(); - const TGetTypeInfoReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetTypeInfo_result__isset { - _TCLIService_GetTypeInfo_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetTypeInfo_result__isset; - -class TCLIService_GetTypeInfo_result { - public: - - TCLIService_GetTypeInfo_result(const TCLIService_GetTypeInfo_result&); - TCLIService_GetTypeInfo_result& operator=(const TCLIService_GetTypeInfo_result&); - TCLIService_GetTypeInfo_result() { - } - - virtual ~TCLIService_GetTypeInfo_result() throw(); - TGetTypeInfoResp success; - - _TCLIService_GetTypeInfo_result__isset __isset; - - void __set_success(const TGetTypeInfoResp& val); - - bool operator == (const TCLIService_GetTypeInfo_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetTypeInfo_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetTypeInfo_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetTypeInfo_presult__isset { - _TCLIService_GetTypeInfo_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetTypeInfo_presult__isset; - -class TCLIService_GetTypeInfo_presult { - public: - - - virtual ~TCLIService_GetTypeInfo_presult() throw(); - TGetTypeInfoResp* success; - - _TCLIService_GetTypeInfo_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetCatalogs_args__isset { - _TCLIService_GetCatalogs_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetCatalogs_args__isset; - -class TCLIService_GetCatalogs_args { - public: - - TCLIService_GetCatalogs_args(const TCLIService_GetCatalogs_args&); - TCLIService_GetCatalogs_args& operator=(const TCLIService_GetCatalogs_args&); - TCLIService_GetCatalogs_args() { - } - - virtual ~TCLIService_GetCatalogs_args() throw(); - TGetCatalogsReq req; - - _TCLIService_GetCatalogs_args__isset __isset; - - void __set_req(const TGetCatalogsReq& val); - - bool operator == (const TCLIService_GetCatalogs_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetCatalogs_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetCatalogs_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetCatalogs_pargs { - public: - - - virtual ~TCLIService_GetCatalogs_pargs() throw(); - const TGetCatalogsReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetCatalogs_result__isset { - _TCLIService_GetCatalogs_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetCatalogs_result__isset; - -class TCLIService_GetCatalogs_result { - public: - - TCLIService_GetCatalogs_result(const TCLIService_GetCatalogs_result&); - TCLIService_GetCatalogs_result& operator=(const TCLIService_GetCatalogs_result&); - TCLIService_GetCatalogs_result() { - } - - virtual ~TCLIService_GetCatalogs_result() throw(); - TGetCatalogsResp success; - - _TCLIService_GetCatalogs_result__isset __isset; - - void __set_success(const TGetCatalogsResp& val); - - bool operator == (const TCLIService_GetCatalogs_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetCatalogs_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetCatalogs_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetCatalogs_presult__isset { - _TCLIService_GetCatalogs_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetCatalogs_presult__isset; - -class TCLIService_GetCatalogs_presult { - public: - - - virtual ~TCLIService_GetCatalogs_presult() throw(); - TGetCatalogsResp* success; - - _TCLIService_GetCatalogs_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetSchemas_args__isset { - _TCLIService_GetSchemas_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetSchemas_args__isset; - -class TCLIService_GetSchemas_args { - public: - - TCLIService_GetSchemas_args(const TCLIService_GetSchemas_args&); - TCLIService_GetSchemas_args& operator=(const TCLIService_GetSchemas_args&); - TCLIService_GetSchemas_args() { - } - - virtual ~TCLIService_GetSchemas_args() throw(); - TGetSchemasReq req; - - _TCLIService_GetSchemas_args__isset __isset; - - void __set_req(const TGetSchemasReq& val); - - bool operator == (const TCLIService_GetSchemas_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetSchemas_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetSchemas_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetSchemas_pargs { - public: - - - virtual ~TCLIService_GetSchemas_pargs() throw(); - const TGetSchemasReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetSchemas_result__isset { - _TCLIService_GetSchemas_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetSchemas_result__isset; - -class TCLIService_GetSchemas_result { - public: - - TCLIService_GetSchemas_result(const TCLIService_GetSchemas_result&); - TCLIService_GetSchemas_result& operator=(const TCLIService_GetSchemas_result&); - TCLIService_GetSchemas_result() { - } - - virtual ~TCLIService_GetSchemas_result() throw(); - TGetSchemasResp success; - - _TCLIService_GetSchemas_result__isset __isset; - - void __set_success(const TGetSchemasResp& val); - - bool operator == (const TCLIService_GetSchemas_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetSchemas_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetSchemas_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetSchemas_presult__isset { - _TCLIService_GetSchemas_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetSchemas_presult__isset; - -class TCLIService_GetSchemas_presult { - public: - - - virtual ~TCLIService_GetSchemas_presult() throw(); - TGetSchemasResp* success; - - _TCLIService_GetSchemas_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetTables_args__isset { - _TCLIService_GetTables_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetTables_args__isset; - -class TCLIService_GetTables_args { - public: - - TCLIService_GetTables_args(const TCLIService_GetTables_args&); - TCLIService_GetTables_args& operator=(const TCLIService_GetTables_args&); - TCLIService_GetTables_args() { - } - - virtual ~TCLIService_GetTables_args() throw(); - TGetTablesReq req; - - _TCLIService_GetTables_args__isset __isset; - - void __set_req(const TGetTablesReq& val); - - bool operator == (const TCLIService_GetTables_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetTables_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetTables_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetTables_pargs { - public: - - - virtual ~TCLIService_GetTables_pargs() throw(); - const TGetTablesReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetTables_result__isset { - _TCLIService_GetTables_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetTables_result__isset; - -class TCLIService_GetTables_result { - public: - - TCLIService_GetTables_result(const TCLIService_GetTables_result&); - TCLIService_GetTables_result& operator=(const TCLIService_GetTables_result&); - TCLIService_GetTables_result() { - } - - virtual ~TCLIService_GetTables_result() throw(); - TGetTablesResp success; - - _TCLIService_GetTables_result__isset __isset; - - void __set_success(const TGetTablesResp& val); - - bool operator == (const TCLIService_GetTables_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetTables_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetTables_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetTables_presult__isset { - _TCLIService_GetTables_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetTables_presult__isset; - -class TCLIService_GetTables_presult { - public: - - - virtual ~TCLIService_GetTables_presult() throw(); - TGetTablesResp* success; - - _TCLIService_GetTables_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetTableTypes_args__isset { - _TCLIService_GetTableTypes_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetTableTypes_args__isset; - -class TCLIService_GetTableTypes_args { - public: - - TCLIService_GetTableTypes_args(const TCLIService_GetTableTypes_args&); - TCLIService_GetTableTypes_args& operator=(const TCLIService_GetTableTypes_args&); - TCLIService_GetTableTypes_args() { - } - - virtual ~TCLIService_GetTableTypes_args() throw(); - TGetTableTypesReq req; - - _TCLIService_GetTableTypes_args__isset __isset; - - void __set_req(const TGetTableTypesReq& val); - - bool operator == (const TCLIService_GetTableTypes_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetTableTypes_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetTableTypes_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetTableTypes_pargs { - public: - - - virtual ~TCLIService_GetTableTypes_pargs() throw(); - const TGetTableTypesReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetTableTypes_result__isset { - _TCLIService_GetTableTypes_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetTableTypes_result__isset; - -class TCLIService_GetTableTypes_result { - public: - - TCLIService_GetTableTypes_result(const TCLIService_GetTableTypes_result&); - TCLIService_GetTableTypes_result& operator=(const TCLIService_GetTableTypes_result&); - TCLIService_GetTableTypes_result() { - } - - virtual ~TCLIService_GetTableTypes_result() throw(); - TGetTableTypesResp success; - - _TCLIService_GetTableTypes_result__isset __isset; - - void __set_success(const TGetTableTypesResp& val); - - bool operator == (const TCLIService_GetTableTypes_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetTableTypes_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetTableTypes_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetTableTypes_presult__isset { - _TCLIService_GetTableTypes_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetTableTypes_presult__isset; - -class TCLIService_GetTableTypes_presult { - public: - - - virtual ~TCLIService_GetTableTypes_presult() throw(); - TGetTableTypesResp* success; - - _TCLIService_GetTableTypes_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetColumns_args__isset { - _TCLIService_GetColumns_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetColumns_args__isset; - -class TCLIService_GetColumns_args { - public: - - TCLIService_GetColumns_args(const TCLIService_GetColumns_args&); - TCLIService_GetColumns_args& operator=(const TCLIService_GetColumns_args&); - TCLIService_GetColumns_args() { - } - - virtual ~TCLIService_GetColumns_args() throw(); - TGetColumnsReq req; - - _TCLIService_GetColumns_args__isset __isset; - - void __set_req(const TGetColumnsReq& val); - - bool operator == (const TCLIService_GetColumns_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetColumns_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetColumns_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetColumns_pargs { - public: - - - virtual ~TCLIService_GetColumns_pargs() throw(); - const TGetColumnsReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetColumns_result__isset { - _TCLIService_GetColumns_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetColumns_result__isset; - -class TCLIService_GetColumns_result { - public: - - TCLIService_GetColumns_result(const TCLIService_GetColumns_result&); - TCLIService_GetColumns_result& operator=(const TCLIService_GetColumns_result&); - TCLIService_GetColumns_result() { - } - - virtual ~TCLIService_GetColumns_result() throw(); - TGetColumnsResp success; - - _TCLIService_GetColumns_result__isset __isset; - - void __set_success(const TGetColumnsResp& val); - - bool operator == (const TCLIService_GetColumns_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetColumns_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetColumns_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetColumns_presult__isset { - _TCLIService_GetColumns_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetColumns_presult__isset; - -class TCLIService_GetColumns_presult { - public: - - - virtual ~TCLIService_GetColumns_presult() throw(); - TGetColumnsResp* success; - - _TCLIService_GetColumns_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetFunctions_args__isset { - _TCLIService_GetFunctions_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetFunctions_args__isset; - -class TCLIService_GetFunctions_args { - public: - - TCLIService_GetFunctions_args(const TCLIService_GetFunctions_args&); - TCLIService_GetFunctions_args& operator=(const TCLIService_GetFunctions_args&); - TCLIService_GetFunctions_args() { - } - - virtual ~TCLIService_GetFunctions_args() throw(); - TGetFunctionsReq req; - - _TCLIService_GetFunctions_args__isset __isset; - - void __set_req(const TGetFunctionsReq& val); - - bool operator == (const TCLIService_GetFunctions_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetFunctions_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetFunctions_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetFunctions_pargs { - public: - - - virtual ~TCLIService_GetFunctions_pargs() throw(); - const TGetFunctionsReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetFunctions_result__isset { - _TCLIService_GetFunctions_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetFunctions_result__isset; - -class TCLIService_GetFunctions_result { - public: - - TCLIService_GetFunctions_result(const TCLIService_GetFunctions_result&); - TCLIService_GetFunctions_result& operator=(const TCLIService_GetFunctions_result&); - TCLIService_GetFunctions_result() { - } - - virtual ~TCLIService_GetFunctions_result() throw(); - TGetFunctionsResp success; - - _TCLIService_GetFunctions_result__isset __isset; - - void __set_success(const TGetFunctionsResp& val); - - bool operator == (const TCLIService_GetFunctions_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetFunctions_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetFunctions_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetFunctions_presult__isset { - _TCLIService_GetFunctions_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetFunctions_presult__isset; - -class TCLIService_GetFunctions_presult { - public: - - - virtual ~TCLIService_GetFunctions_presult() throw(); - TGetFunctionsResp* success; - - _TCLIService_GetFunctions_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetPrimaryKeys_args__isset { - _TCLIService_GetPrimaryKeys_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetPrimaryKeys_args__isset; - -class TCLIService_GetPrimaryKeys_args { - public: - - TCLIService_GetPrimaryKeys_args(const TCLIService_GetPrimaryKeys_args&); - TCLIService_GetPrimaryKeys_args& operator=(const TCLIService_GetPrimaryKeys_args&); - TCLIService_GetPrimaryKeys_args() { - } - - virtual ~TCLIService_GetPrimaryKeys_args() throw(); - TGetPrimaryKeysReq req; - - _TCLIService_GetPrimaryKeys_args__isset __isset; - - void __set_req(const TGetPrimaryKeysReq& val); - - bool operator == (const TCLIService_GetPrimaryKeys_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetPrimaryKeys_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetPrimaryKeys_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetPrimaryKeys_pargs { - public: - - - virtual ~TCLIService_GetPrimaryKeys_pargs() throw(); - const TGetPrimaryKeysReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetPrimaryKeys_result__isset { - _TCLIService_GetPrimaryKeys_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetPrimaryKeys_result__isset; - -class TCLIService_GetPrimaryKeys_result { - public: - - TCLIService_GetPrimaryKeys_result(const TCLIService_GetPrimaryKeys_result&); - TCLIService_GetPrimaryKeys_result& operator=(const TCLIService_GetPrimaryKeys_result&); - TCLIService_GetPrimaryKeys_result() { - } - - virtual ~TCLIService_GetPrimaryKeys_result() throw(); - TGetPrimaryKeysResp success; - - _TCLIService_GetPrimaryKeys_result__isset __isset; - - void __set_success(const TGetPrimaryKeysResp& val); - - bool operator == (const TCLIService_GetPrimaryKeys_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetPrimaryKeys_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetPrimaryKeys_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetPrimaryKeys_presult__isset { - _TCLIService_GetPrimaryKeys_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetPrimaryKeys_presult__isset; - -class TCLIService_GetPrimaryKeys_presult { - public: - - - virtual ~TCLIService_GetPrimaryKeys_presult() throw(); - TGetPrimaryKeysResp* success; - - _TCLIService_GetPrimaryKeys_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetCrossReference_args__isset { - _TCLIService_GetCrossReference_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetCrossReference_args__isset; - -class TCLIService_GetCrossReference_args { - public: - - TCLIService_GetCrossReference_args(const TCLIService_GetCrossReference_args&); - TCLIService_GetCrossReference_args& operator=(const TCLIService_GetCrossReference_args&); - TCLIService_GetCrossReference_args() { - } - - virtual ~TCLIService_GetCrossReference_args() throw(); - TGetCrossReferenceReq req; - - _TCLIService_GetCrossReference_args__isset __isset; - - void __set_req(const TGetCrossReferenceReq& val); - - bool operator == (const TCLIService_GetCrossReference_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetCrossReference_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetCrossReference_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetCrossReference_pargs { - public: - - - virtual ~TCLIService_GetCrossReference_pargs() throw(); - const TGetCrossReferenceReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetCrossReference_result__isset { - _TCLIService_GetCrossReference_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetCrossReference_result__isset; - -class TCLIService_GetCrossReference_result { - public: - - TCLIService_GetCrossReference_result(const TCLIService_GetCrossReference_result&); - TCLIService_GetCrossReference_result& operator=(const TCLIService_GetCrossReference_result&); - TCLIService_GetCrossReference_result() { - } - - virtual ~TCLIService_GetCrossReference_result() throw(); - TGetCrossReferenceResp success; - - _TCLIService_GetCrossReference_result__isset __isset; - - void __set_success(const TGetCrossReferenceResp& val); - - bool operator == (const TCLIService_GetCrossReference_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetCrossReference_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetCrossReference_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetCrossReference_presult__isset { - _TCLIService_GetCrossReference_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetCrossReference_presult__isset; - -class TCLIService_GetCrossReference_presult { - public: - - - virtual ~TCLIService_GetCrossReference_presult() throw(); - TGetCrossReferenceResp* success; - - _TCLIService_GetCrossReference_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetOperationStatus_args__isset { - _TCLIService_GetOperationStatus_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetOperationStatus_args__isset; - -class TCLIService_GetOperationStatus_args { - public: - - TCLIService_GetOperationStatus_args(const TCLIService_GetOperationStatus_args&); - TCLIService_GetOperationStatus_args& operator=(const TCLIService_GetOperationStatus_args&); - TCLIService_GetOperationStatus_args() { - } - - virtual ~TCLIService_GetOperationStatus_args() throw(); - TGetOperationStatusReq req; - - _TCLIService_GetOperationStatus_args__isset __isset; - - void __set_req(const TGetOperationStatusReq& val); - - bool operator == (const TCLIService_GetOperationStatus_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetOperationStatus_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetOperationStatus_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetOperationStatus_pargs { - public: - - - virtual ~TCLIService_GetOperationStatus_pargs() throw(); - const TGetOperationStatusReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetOperationStatus_result__isset { - _TCLIService_GetOperationStatus_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetOperationStatus_result__isset; - -class TCLIService_GetOperationStatus_result { - public: - - TCLIService_GetOperationStatus_result(const TCLIService_GetOperationStatus_result&); - TCLIService_GetOperationStatus_result& operator=(const TCLIService_GetOperationStatus_result&); - TCLIService_GetOperationStatus_result() { - } - - virtual ~TCLIService_GetOperationStatus_result() throw(); - TGetOperationStatusResp success; - - _TCLIService_GetOperationStatus_result__isset __isset; - - void __set_success(const TGetOperationStatusResp& val); - - bool operator == (const TCLIService_GetOperationStatus_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetOperationStatus_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetOperationStatus_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetOperationStatus_presult__isset { - _TCLIService_GetOperationStatus_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetOperationStatus_presult__isset; - -class TCLIService_GetOperationStatus_presult { - public: - - - virtual ~TCLIService_GetOperationStatus_presult() throw(); - TGetOperationStatusResp* success; - - _TCLIService_GetOperationStatus_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_CancelOperation_args__isset { - _TCLIService_CancelOperation_args__isset() : req(false) {} - bool req :1; -} _TCLIService_CancelOperation_args__isset; - -class TCLIService_CancelOperation_args { - public: - - TCLIService_CancelOperation_args(const TCLIService_CancelOperation_args&); - TCLIService_CancelOperation_args& operator=(const TCLIService_CancelOperation_args&); - TCLIService_CancelOperation_args() { - } - - virtual ~TCLIService_CancelOperation_args() throw(); - TCancelOperationReq req; - - _TCLIService_CancelOperation_args__isset __isset; - - void __set_req(const TCancelOperationReq& val); - - bool operator == (const TCLIService_CancelOperation_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_CancelOperation_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CancelOperation_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_CancelOperation_pargs { - public: - - - virtual ~TCLIService_CancelOperation_pargs() throw(); - const TCancelOperationReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CancelOperation_result__isset { - _TCLIService_CancelOperation_result__isset() : success(false) {} - bool success :1; -} _TCLIService_CancelOperation_result__isset; - -class TCLIService_CancelOperation_result { - public: - - TCLIService_CancelOperation_result(const TCLIService_CancelOperation_result&); - TCLIService_CancelOperation_result& operator=(const TCLIService_CancelOperation_result&); - TCLIService_CancelOperation_result() { - } - - virtual ~TCLIService_CancelOperation_result() throw(); - TCancelOperationResp success; - - _TCLIService_CancelOperation_result__isset __isset; - - void __set_success(const TCancelOperationResp& val); - - bool operator == (const TCLIService_CancelOperation_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_CancelOperation_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CancelOperation_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CancelOperation_presult__isset { - _TCLIService_CancelOperation_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_CancelOperation_presult__isset; - -class TCLIService_CancelOperation_presult { - public: - - - virtual ~TCLIService_CancelOperation_presult() throw(); - TCancelOperationResp* success; - - _TCLIService_CancelOperation_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_CloseOperation_args__isset { - _TCLIService_CloseOperation_args__isset() : req(false) {} - bool req :1; -} _TCLIService_CloseOperation_args__isset; - -class TCLIService_CloseOperation_args { - public: - - TCLIService_CloseOperation_args(const TCLIService_CloseOperation_args&); - TCLIService_CloseOperation_args& operator=(const TCLIService_CloseOperation_args&); - TCLIService_CloseOperation_args() { - } - - virtual ~TCLIService_CloseOperation_args() throw(); - TCloseOperationReq req; - - _TCLIService_CloseOperation_args__isset __isset; - - void __set_req(const TCloseOperationReq& val); - - bool operator == (const TCLIService_CloseOperation_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_CloseOperation_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CloseOperation_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_CloseOperation_pargs { - public: - - - virtual ~TCLIService_CloseOperation_pargs() throw(); - const TCloseOperationReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CloseOperation_result__isset { - _TCLIService_CloseOperation_result__isset() : success(false) {} - bool success :1; -} _TCLIService_CloseOperation_result__isset; - -class TCLIService_CloseOperation_result { - public: - - TCLIService_CloseOperation_result(const TCLIService_CloseOperation_result&); - TCLIService_CloseOperation_result& operator=(const TCLIService_CloseOperation_result&); - TCLIService_CloseOperation_result() { - } - - virtual ~TCLIService_CloseOperation_result() throw(); - TCloseOperationResp success; - - _TCLIService_CloseOperation_result__isset __isset; - - void __set_success(const TCloseOperationResp& val); - - bool operator == (const TCLIService_CloseOperation_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_CloseOperation_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CloseOperation_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CloseOperation_presult__isset { - _TCLIService_CloseOperation_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_CloseOperation_presult__isset; - -class TCLIService_CloseOperation_presult { - public: - - - virtual ~TCLIService_CloseOperation_presult() throw(); - TCloseOperationResp* success; - - _TCLIService_CloseOperation_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetResultSetMetadata_args__isset { - _TCLIService_GetResultSetMetadata_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetResultSetMetadata_args__isset; - -class TCLIService_GetResultSetMetadata_args { - public: - - TCLIService_GetResultSetMetadata_args(const TCLIService_GetResultSetMetadata_args&); - TCLIService_GetResultSetMetadata_args& operator=(const TCLIService_GetResultSetMetadata_args&); - TCLIService_GetResultSetMetadata_args() { - } - - virtual ~TCLIService_GetResultSetMetadata_args() throw(); - TGetResultSetMetadataReq req; - - _TCLIService_GetResultSetMetadata_args__isset __isset; - - void __set_req(const TGetResultSetMetadataReq& val); - - bool operator == (const TCLIService_GetResultSetMetadata_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetResultSetMetadata_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetResultSetMetadata_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetResultSetMetadata_pargs { - public: - - - virtual ~TCLIService_GetResultSetMetadata_pargs() throw(); - const TGetResultSetMetadataReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetResultSetMetadata_result__isset { - _TCLIService_GetResultSetMetadata_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetResultSetMetadata_result__isset; - -class TCLIService_GetResultSetMetadata_result { - public: - - TCLIService_GetResultSetMetadata_result(const TCLIService_GetResultSetMetadata_result&); - TCLIService_GetResultSetMetadata_result& operator=(const TCLIService_GetResultSetMetadata_result&); - TCLIService_GetResultSetMetadata_result() { - } - - virtual ~TCLIService_GetResultSetMetadata_result() throw(); - TGetResultSetMetadataResp success; - - _TCLIService_GetResultSetMetadata_result__isset __isset; - - void __set_success(const TGetResultSetMetadataResp& val); - - bool operator == (const TCLIService_GetResultSetMetadata_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetResultSetMetadata_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetResultSetMetadata_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetResultSetMetadata_presult__isset { - _TCLIService_GetResultSetMetadata_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetResultSetMetadata_presult__isset; - -class TCLIService_GetResultSetMetadata_presult { - public: - - - virtual ~TCLIService_GetResultSetMetadata_presult() throw(); - TGetResultSetMetadataResp* success; - - _TCLIService_GetResultSetMetadata_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_FetchResults_args__isset { - _TCLIService_FetchResults_args__isset() : req(false) {} - bool req :1; -} _TCLIService_FetchResults_args__isset; - -class TCLIService_FetchResults_args { - public: - - TCLIService_FetchResults_args(const TCLIService_FetchResults_args&); - TCLIService_FetchResults_args& operator=(const TCLIService_FetchResults_args&); - TCLIService_FetchResults_args() { - } - - virtual ~TCLIService_FetchResults_args() throw(); - TFetchResultsReq req; - - _TCLIService_FetchResults_args__isset __isset; - - void __set_req(const TFetchResultsReq& val); - - bool operator == (const TCLIService_FetchResults_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_FetchResults_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_FetchResults_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_FetchResults_pargs { - public: - - - virtual ~TCLIService_FetchResults_pargs() throw(); - const TFetchResultsReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_FetchResults_result__isset { - _TCLIService_FetchResults_result__isset() : success(false) {} - bool success :1; -} _TCLIService_FetchResults_result__isset; - -class TCLIService_FetchResults_result { - public: - - TCLIService_FetchResults_result(const TCLIService_FetchResults_result&); - TCLIService_FetchResults_result& operator=(const TCLIService_FetchResults_result&); - TCLIService_FetchResults_result() { - } - - virtual ~TCLIService_FetchResults_result() throw(); - TFetchResultsResp success; - - _TCLIService_FetchResults_result__isset __isset; - - void __set_success(const TFetchResultsResp& val); - - bool operator == (const TCLIService_FetchResults_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_FetchResults_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_FetchResults_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_FetchResults_presult__isset { - _TCLIService_FetchResults_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_FetchResults_presult__isset; - -class TCLIService_FetchResults_presult { - public: - - - virtual ~TCLIService_FetchResults_presult() throw(); - TFetchResultsResp* success; - - _TCLIService_FetchResults_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetDelegationToken_args__isset { - _TCLIService_GetDelegationToken_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetDelegationToken_args__isset; - -class TCLIService_GetDelegationToken_args { - public: - - TCLIService_GetDelegationToken_args(const TCLIService_GetDelegationToken_args&); - TCLIService_GetDelegationToken_args& operator=(const TCLIService_GetDelegationToken_args&); - TCLIService_GetDelegationToken_args() { - } - - virtual ~TCLIService_GetDelegationToken_args() throw(); - TGetDelegationTokenReq req; - - _TCLIService_GetDelegationToken_args__isset __isset; - - void __set_req(const TGetDelegationTokenReq& val); - - bool operator == (const TCLIService_GetDelegationToken_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetDelegationToken_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetDelegationToken_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetDelegationToken_pargs { - public: - - - virtual ~TCLIService_GetDelegationToken_pargs() throw(); - const TGetDelegationTokenReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetDelegationToken_result__isset { - _TCLIService_GetDelegationToken_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetDelegationToken_result__isset; - -class TCLIService_GetDelegationToken_result { - public: - - TCLIService_GetDelegationToken_result(const TCLIService_GetDelegationToken_result&); - TCLIService_GetDelegationToken_result& operator=(const TCLIService_GetDelegationToken_result&); - TCLIService_GetDelegationToken_result() { - } - - virtual ~TCLIService_GetDelegationToken_result() throw(); - TGetDelegationTokenResp success; - - _TCLIService_GetDelegationToken_result__isset __isset; - - void __set_success(const TGetDelegationTokenResp& val); - - bool operator == (const TCLIService_GetDelegationToken_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetDelegationToken_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetDelegationToken_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetDelegationToken_presult__isset { - _TCLIService_GetDelegationToken_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetDelegationToken_presult__isset; - -class TCLIService_GetDelegationToken_presult { - public: - - - virtual ~TCLIService_GetDelegationToken_presult() throw(); - TGetDelegationTokenResp* success; - - _TCLIService_GetDelegationToken_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_CancelDelegationToken_args__isset { - _TCLIService_CancelDelegationToken_args__isset() : req(false) {} - bool req :1; -} _TCLIService_CancelDelegationToken_args__isset; - -class TCLIService_CancelDelegationToken_args { - public: - - TCLIService_CancelDelegationToken_args(const TCLIService_CancelDelegationToken_args&); - TCLIService_CancelDelegationToken_args& operator=(const TCLIService_CancelDelegationToken_args&); - TCLIService_CancelDelegationToken_args() { - } - - virtual ~TCLIService_CancelDelegationToken_args() throw(); - TCancelDelegationTokenReq req; - - _TCLIService_CancelDelegationToken_args__isset __isset; - - void __set_req(const TCancelDelegationTokenReq& val); - - bool operator == (const TCLIService_CancelDelegationToken_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_CancelDelegationToken_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CancelDelegationToken_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_CancelDelegationToken_pargs { - public: - - - virtual ~TCLIService_CancelDelegationToken_pargs() throw(); - const TCancelDelegationTokenReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CancelDelegationToken_result__isset { - _TCLIService_CancelDelegationToken_result__isset() : success(false) {} - bool success :1; -} _TCLIService_CancelDelegationToken_result__isset; - -class TCLIService_CancelDelegationToken_result { - public: - - TCLIService_CancelDelegationToken_result(const TCLIService_CancelDelegationToken_result&); - TCLIService_CancelDelegationToken_result& operator=(const TCLIService_CancelDelegationToken_result&); - TCLIService_CancelDelegationToken_result() { - } - - virtual ~TCLIService_CancelDelegationToken_result() throw(); - TCancelDelegationTokenResp success; - - _TCLIService_CancelDelegationToken_result__isset __isset; - - void __set_success(const TCancelDelegationTokenResp& val); - - bool operator == (const TCLIService_CancelDelegationToken_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_CancelDelegationToken_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_CancelDelegationToken_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_CancelDelegationToken_presult__isset { - _TCLIService_CancelDelegationToken_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_CancelDelegationToken_presult__isset; - -class TCLIService_CancelDelegationToken_presult { - public: - - - virtual ~TCLIService_CancelDelegationToken_presult() throw(); - TCancelDelegationTokenResp* success; - - _TCLIService_CancelDelegationToken_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_RenewDelegationToken_args__isset { - _TCLIService_RenewDelegationToken_args__isset() : req(false) {} - bool req :1; -} _TCLIService_RenewDelegationToken_args__isset; - -class TCLIService_RenewDelegationToken_args { - public: - - TCLIService_RenewDelegationToken_args(const TCLIService_RenewDelegationToken_args&); - TCLIService_RenewDelegationToken_args& operator=(const TCLIService_RenewDelegationToken_args&); - TCLIService_RenewDelegationToken_args() { - } - - virtual ~TCLIService_RenewDelegationToken_args() throw(); - TRenewDelegationTokenReq req; - - _TCLIService_RenewDelegationToken_args__isset __isset; - - void __set_req(const TRenewDelegationTokenReq& val); - - bool operator == (const TCLIService_RenewDelegationToken_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_RenewDelegationToken_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_RenewDelegationToken_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_RenewDelegationToken_pargs { - public: - - - virtual ~TCLIService_RenewDelegationToken_pargs() throw(); - const TRenewDelegationTokenReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_RenewDelegationToken_result__isset { - _TCLIService_RenewDelegationToken_result__isset() : success(false) {} - bool success :1; -} _TCLIService_RenewDelegationToken_result__isset; - -class TCLIService_RenewDelegationToken_result { - public: - - TCLIService_RenewDelegationToken_result(const TCLIService_RenewDelegationToken_result&); - TCLIService_RenewDelegationToken_result& operator=(const TCLIService_RenewDelegationToken_result&); - TCLIService_RenewDelegationToken_result() { - } - - virtual ~TCLIService_RenewDelegationToken_result() throw(); - TRenewDelegationTokenResp success; - - _TCLIService_RenewDelegationToken_result__isset __isset; - - void __set_success(const TRenewDelegationTokenResp& val); - - bool operator == (const TCLIService_RenewDelegationToken_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_RenewDelegationToken_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_RenewDelegationToken_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_RenewDelegationToken_presult__isset { - _TCLIService_RenewDelegationToken_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_RenewDelegationToken_presult__isset; - -class TCLIService_RenewDelegationToken_presult { - public: - - - virtual ~TCLIService_RenewDelegationToken_presult() throw(); - TRenewDelegationTokenResp* success; - - _TCLIService_RenewDelegationToken_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_GetQueryId_args__isset { - _TCLIService_GetQueryId_args__isset() : req(false) {} - bool req :1; -} _TCLIService_GetQueryId_args__isset; - -class TCLIService_GetQueryId_args { - public: - - TCLIService_GetQueryId_args(const TCLIService_GetQueryId_args&); - TCLIService_GetQueryId_args& operator=(const TCLIService_GetQueryId_args&); - TCLIService_GetQueryId_args() { - } - - virtual ~TCLIService_GetQueryId_args() throw(); - TGetQueryIdReq req; - - _TCLIService_GetQueryId_args__isset __isset; - - void __set_req(const TGetQueryIdReq& val); - - bool operator == (const TCLIService_GetQueryId_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_GetQueryId_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetQueryId_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_GetQueryId_pargs { - public: - - - virtual ~TCLIService_GetQueryId_pargs() throw(); - const TGetQueryIdReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetQueryId_result__isset { - _TCLIService_GetQueryId_result__isset() : success(false) {} - bool success :1; -} _TCLIService_GetQueryId_result__isset; - -class TCLIService_GetQueryId_result { - public: - - TCLIService_GetQueryId_result(const TCLIService_GetQueryId_result&); - TCLIService_GetQueryId_result& operator=(const TCLIService_GetQueryId_result&); - TCLIService_GetQueryId_result() { - } - - virtual ~TCLIService_GetQueryId_result() throw(); - TGetQueryIdResp success; - - _TCLIService_GetQueryId_result__isset __isset; - - void __set_success(const TGetQueryIdResp& val); - - bool operator == (const TCLIService_GetQueryId_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_GetQueryId_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_GetQueryId_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_GetQueryId_presult__isset { - _TCLIService_GetQueryId_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_GetQueryId_presult__isset; - -class TCLIService_GetQueryId_presult { - public: - - - virtual ~TCLIService_GetQueryId_presult() throw(); - TGetQueryIdResp* success; - - _TCLIService_GetQueryId_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -typedef struct _TCLIService_SetClientInfo_args__isset { - _TCLIService_SetClientInfo_args__isset() : req(false) {} - bool req :1; -} _TCLIService_SetClientInfo_args__isset; - -class TCLIService_SetClientInfo_args { - public: - - TCLIService_SetClientInfo_args(const TCLIService_SetClientInfo_args&); - TCLIService_SetClientInfo_args& operator=(const TCLIService_SetClientInfo_args&); - TCLIService_SetClientInfo_args() { - } - - virtual ~TCLIService_SetClientInfo_args() throw(); - TSetClientInfoReq req; - - _TCLIService_SetClientInfo_args__isset __isset; - - void __set_req(const TSetClientInfoReq& val); - - bool operator == (const TCLIService_SetClientInfo_args & rhs) const - { - if (!(req == rhs.req)) - return false; - return true; - } - bool operator != (const TCLIService_SetClientInfo_args &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_SetClientInfo_args & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - - -class TCLIService_SetClientInfo_pargs { - public: - - - virtual ~TCLIService_SetClientInfo_pargs() throw(); - const TSetClientInfoReq* req; - - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_SetClientInfo_result__isset { - _TCLIService_SetClientInfo_result__isset() : success(false) {} - bool success :1; -} _TCLIService_SetClientInfo_result__isset; - -class TCLIService_SetClientInfo_result { - public: - - TCLIService_SetClientInfo_result(const TCLIService_SetClientInfo_result&); - TCLIService_SetClientInfo_result& operator=(const TCLIService_SetClientInfo_result&); - TCLIService_SetClientInfo_result() { - } - - virtual ~TCLIService_SetClientInfo_result() throw(); - TSetClientInfoResp success; - - _TCLIService_SetClientInfo_result__isset __isset; - - void __set_success(const TSetClientInfoResp& val); - - bool operator == (const TCLIService_SetClientInfo_result & rhs) const - { - if (!(success == rhs.success)) - return false; - return true; - } - bool operator != (const TCLIService_SetClientInfo_result &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCLIService_SetClientInfo_result & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - -}; - -typedef struct _TCLIService_SetClientInfo_presult__isset { - _TCLIService_SetClientInfo_presult__isset() : success(false) {} - bool success :1; -} _TCLIService_SetClientInfo_presult__isset; - -class TCLIService_SetClientInfo_presult { - public: - - - virtual ~TCLIService_SetClientInfo_presult() throw(); - TSetClientInfoResp* success; - - _TCLIService_SetClientInfo_presult__isset __isset; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - -}; - -class TCLIServiceClient : virtual public TCLIServiceIf { - public: - TCLIServiceClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot); - } - TCLIServiceClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - setProtocol(iprot,oprot); - } - private: - void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot,prot); - } - void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - piprot_=iprot; - poprot_=oprot; - iprot_ = iprot.get(); - oprot_ = oprot.get(); - } - public: - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { - return piprot_; - } - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { - return poprot_; - } - void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req); - void send_OpenSession(const TOpenSessionReq& req); - void recv_OpenSession(TOpenSessionResp& _return); - void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req); - void send_CloseSession(const TCloseSessionReq& req); - void recv_CloseSession(TCloseSessionResp& _return); - void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req); - void send_GetInfo(const TGetInfoReq& req); - void recv_GetInfo(TGetInfoResp& _return); - void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req); - void send_ExecuteStatement(const TExecuteStatementReq& req); - void recv_ExecuteStatement(TExecuteStatementResp& _return); - void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req); - void send_GetTypeInfo(const TGetTypeInfoReq& req); - void recv_GetTypeInfo(TGetTypeInfoResp& _return); - void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req); - void send_GetCatalogs(const TGetCatalogsReq& req); - void recv_GetCatalogs(TGetCatalogsResp& _return); - void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req); - void send_GetSchemas(const TGetSchemasReq& req); - void recv_GetSchemas(TGetSchemasResp& _return); - void GetTables(TGetTablesResp& _return, const TGetTablesReq& req); - void send_GetTables(const TGetTablesReq& req); - void recv_GetTables(TGetTablesResp& _return); - void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req); - void send_GetTableTypes(const TGetTableTypesReq& req); - void recv_GetTableTypes(TGetTableTypesResp& _return); - void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req); - void send_GetColumns(const TGetColumnsReq& req); - void recv_GetColumns(TGetColumnsResp& _return); - void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req); - void send_GetFunctions(const TGetFunctionsReq& req); - void recv_GetFunctions(TGetFunctionsResp& _return); - void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req); - void send_GetPrimaryKeys(const TGetPrimaryKeysReq& req); - void recv_GetPrimaryKeys(TGetPrimaryKeysResp& _return); - void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req); - void send_GetCrossReference(const TGetCrossReferenceReq& req); - void recv_GetCrossReference(TGetCrossReferenceResp& _return); - void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req); - void send_GetOperationStatus(const TGetOperationStatusReq& req); - void recv_GetOperationStatus(TGetOperationStatusResp& _return); - void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req); - void send_CancelOperation(const TCancelOperationReq& req); - void recv_CancelOperation(TCancelOperationResp& _return); - void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req); - void send_CloseOperation(const TCloseOperationReq& req); - void recv_CloseOperation(TCloseOperationResp& _return); - void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req); - void send_GetResultSetMetadata(const TGetResultSetMetadataReq& req); - void recv_GetResultSetMetadata(TGetResultSetMetadataResp& _return); - void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req); - void send_FetchResults(const TFetchResultsReq& req); - void recv_FetchResults(TFetchResultsResp& _return); - void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req); - void send_GetDelegationToken(const TGetDelegationTokenReq& req); - void recv_GetDelegationToken(TGetDelegationTokenResp& _return); - void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req); - void send_CancelDelegationToken(const TCancelDelegationTokenReq& req); - void recv_CancelDelegationToken(TCancelDelegationTokenResp& _return); - void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req); - void send_RenewDelegationToken(const TRenewDelegationTokenReq& req); - void recv_RenewDelegationToken(TRenewDelegationTokenResp& _return); - void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req); - void send_GetQueryId(const TGetQueryIdReq& req); - void recv_GetQueryId(TGetQueryIdResp& _return); - void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req); - void send_SetClientInfo(const TSetClientInfoReq& req); - void recv_SetClientInfo(TSetClientInfoResp& _return); - protected: - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; - ::apache::thrift::protocol::TProtocol* iprot_; - ::apache::thrift::protocol::TProtocol* oprot_; -}; - -class TCLIServiceProcessor : public ::apache::thrift::TDispatchProcessor { - protected: - ::apache::thrift::stdcxx::shared_ptr iface_; - virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext); - private: - typedef void (TCLIServiceProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*); - typedef std::map ProcessMap; - ProcessMap processMap_; - void process_OpenSession(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - 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_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); - void process_GetTables(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetTableTypes(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetColumns(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetFunctions(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetPrimaryKeys(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetCrossReference(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetOperationStatus(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_CancelOperation(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_CloseOperation(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetResultSetMetadata(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_FetchResults(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_CancelDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_RenewDelegationToken(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_GetQueryId(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - void process_SetClientInfo(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext); - public: - TCLIServiceProcessor(::apache::thrift::stdcxx::shared_ptr iface) : - iface_(iface) { - processMap_["OpenSession"] = &TCLIServiceProcessor::process_OpenSession; - processMap_["CloseSession"] = &TCLIServiceProcessor::process_CloseSession; - processMap_["GetInfo"] = &TCLIServiceProcessor::process_GetInfo; - processMap_["ExecuteStatement"] = &TCLIServiceProcessor::process_ExecuteStatement; - processMap_["GetTypeInfo"] = &TCLIServiceProcessor::process_GetTypeInfo; - processMap_["GetCatalogs"] = &TCLIServiceProcessor::process_GetCatalogs; - processMap_["GetSchemas"] = &TCLIServiceProcessor::process_GetSchemas; - processMap_["GetTables"] = &TCLIServiceProcessor::process_GetTables; - processMap_["GetTableTypes"] = &TCLIServiceProcessor::process_GetTableTypes; - processMap_["GetColumns"] = &TCLIServiceProcessor::process_GetColumns; - processMap_["GetFunctions"] = &TCLIServiceProcessor::process_GetFunctions; - processMap_["GetPrimaryKeys"] = &TCLIServiceProcessor::process_GetPrimaryKeys; - processMap_["GetCrossReference"] = &TCLIServiceProcessor::process_GetCrossReference; - processMap_["GetOperationStatus"] = &TCLIServiceProcessor::process_GetOperationStatus; - processMap_["CancelOperation"] = &TCLIServiceProcessor::process_CancelOperation; - processMap_["CloseOperation"] = &TCLIServiceProcessor::process_CloseOperation; - processMap_["GetResultSetMetadata"] = &TCLIServiceProcessor::process_GetResultSetMetadata; - processMap_["FetchResults"] = &TCLIServiceProcessor::process_FetchResults; - processMap_["GetDelegationToken"] = &TCLIServiceProcessor::process_GetDelegationToken; - processMap_["CancelDelegationToken"] = &TCLIServiceProcessor::process_CancelDelegationToken; - processMap_["RenewDelegationToken"] = &TCLIServiceProcessor::process_RenewDelegationToken; - processMap_["GetQueryId"] = &TCLIServiceProcessor::process_GetQueryId; - processMap_["SetClientInfo"] = &TCLIServiceProcessor::process_SetClientInfo; - } - - virtual ~TCLIServiceProcessor() {} -}; - -class TCLIServiceProcessorFactory : public ::apache::thrift::TProcessorFactory { - public: - TCLIServiceProcessorFactory(const ::apache::thrift::stdcxx::shared_ptr< TCLIServiceIfFactory >& handlerFactory) : - handlerFactory_(handlerFactory) {} - - ::apache::thrift::stdcxx::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo); - - protected: - ::apache::thrift::stdcxx::shared_ptr< TCLIServiceIfFactory > handlerFactory_; -}; - -class TCLIServiceMultiface : virtual public TCLIServiceIf { - public: - TCLIServiceMultiface(std::vector >& ifaces) : ifaces_(ifaces) { - } - virtual ~TCLIServiceMultiface() {} - protected: - std::vector > ifaces_; - TCLIServiceMultiface() {} - void add(::apache::thrift::stdcxx::shared_ptr iface) { - ifaces_.push_back(iface); - } - public: - void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->OpenSession(_return, req); - } - ifaces_[i]->OpenSession(_return, req); - return; - } - - void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->CloseSession(_return, req); - } - ifaces_[i]->CloseSession(_return, req); - return; - } - - void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetInfo(_return, req); - } - ifaces_[i]->GetInfo(_return, req); - return; - } - - void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->ExecuteStatement(_return, req); - } - ifaces_[i]->ExecuteStatement(_return, req); - return; - } - - void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetTypeInfo(_return, req); - } - ifaces_[i]->GetTypeInfo(_return, req); - return; - } - - void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetCatalogs(_return, req); - } - ifaces_[i]->GetCatalogs(_return, req); - return; - } - - void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetSchemas(_return, req); - } - ifaces_[i]->GetSchemas(_return, req); - return; - } - - void GetTables(TGetTablesResp& _return, const TGetTablesReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetTables(_return, req); - } - ifaces_[i]->GetTables(_return, req); - return; - } - - void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetTableTypes(_return, req); - } - ifaces_[i]->GetTableTypes(_return, req); - return; - } - - void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetColumns(_return, req); - } - ifaces_[i]->GetColumns(_return, req); - return; - } - - void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetFunctions(_return, req); - } - ifaces_[i]->GetFunctions(_return, req); - return; - } - - void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetPrimaryKeys(_return, req); - } - ifaces_[i]->GetPrimaryKeys(_return, req); - return; - } - - void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetCrossReference(_return, req); - } - ifaces_[i]->GetCrossReference(_return, req); - return; - } - - void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetOperationStatus(_return, req); - } - ifaces_[i]->GetOperationStatus(_return, req); - return; - } - - void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->CancelOperation(_return, req); - } - ifaces_[i]->CancelOperation(_return, req); - return; - } - - void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->CloseOperation(_return, req); - } - ifaces_[i]->CloseOperation(_return, req); - return; - } - - void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetResultSetMetadata(_return, req); - } - ifaces_[i]->GetResultSetMetadata(_return, req); - return; - } - - void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->FetchResults(_return, req); - } - ifaces_[i]->FetchResults(_return, req); - return; - } - - void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetDelegationToken(_return, req); - } - ifaces_[i]->GetDelegationToken(_return, req); - return; - } - - void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->CancelDelegationToken(_return, req); - } - ifaces_[i]->CancelDelegationToken(_return, req); - return; - } - - void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->RenewDelegationToken(_return, req); - } - ifaces_[i]->RenewDelegationToken(_return, req); - return; - } - - void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->GetQueryId(_return, req); - } - ifaces_[i]->GetQueryId(_return, req); - return; - } - - void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) { - size_t sz = ifaces_.size(); - size_t i = 0; - for (; i < (sz - 1); ++i) { - ifaces_[i]->SetClientInfo(_return, req); - } - ifaces_[i]->SetClientInfo(_return, req); - return; - } - -}; - -// The 'concurrent' client is a thread safe client that correctly handles -// out of order responses. It is slower than the regular client, so should -// only be used when you need to share a connection among multiple threads -class TCLIServiceConcurrentClient : virtual public TCLIServiceIf { - public: - TCLIServiceConcurrentClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot); - } - TCLIServiceConcurrentClient(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - setProtocol(iprot,oprot); - } - private: - void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) { - setProtocol(prot,prot); - } - void setProtocol(apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) { - piprot_=iprot; - poprot_=oprot; - iprot_ = iprot.get(); - oprot_ = oprot.get(); - } - public: - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() { - return piprot_; - } - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() { - return poprot_; - } - void OpenSession(TOpenSessionResp& _return, const TOpenSessionReq& req); - int32_t send_OpenSession(const TOpenSessionReq& req); - void recv_OpenSession(TOpenSessionResp& _return, const int32_t seqid); - void CloseSession(TCloseSessionResp& _return, const TCloseSessionReq& req); - int32_t send_CloseSession(const TCloseSessionReq& req); - void recv_CloseSession(TCloseSessionResp& _return, const int32_t seqid); - void GetInfo(TGetInfoResp& _return, const TGetInfoReq& req); - int32_t send_GetInfo(const TGetInfoReq& req); - void recv_GetInfo(TGetInfoResp& _return, const int32_t seqid); - void ExecuteStatement(TExecuteStatementResp& _return, const TExecuteStatementReq& req); - int32_t send_ExecuteStatement(const TExecuteStatementReq& req); - void recv_ExecuteStatement(TExecuteStatementResp& _return, const int32_t seqid); - void GetTypeInfo(TGetTypeInfoResp& _return, const TGetTypeInfoReq& req); - int32_t send_GetTypeInfo(const TGetTypeInfoReq& req); - void recv_GetTypeInfo(TGetTypeInfoResp& _return, const int32_t seqid); - void GetCatalogs(TGetCatalogsResp& _return, const TGetCatalogsReq& req); - int32_t send_GetCatalogs(const TGetCatalogsReq& req); - void recv_GetCatalogs(TGetCatalogsResp& _return, const int32_t seqid); - void GetSchemas(TGetSchemasResp& _return, const TGetSchemasReq& req); - int32_t send_GetSchemas(const TGetSchemasReq& req); - void recv_GetSchemas(TGetSchemasResp& _return, const int32_t seqid); - void GetTables(TGetTablesResp& _return, const TGetTablesReq& req); - int32_t send_GetTables(const TGetTablesReq& req); - void recv_GetTables(TGetTablesResp& _return, const int32_t seqid); - void GetTableTypes(TGetTableTypesResp& _return, const TGetTableTypesReq& req); - int32_t send_GetTableTypes(const TGetTableTypesReq& req); - void recv_GetTableTypes(TGetTableTypesResp& _return, const int32_t seqid); - void GetColumns(TGetColumnsResp& _return, const TGetColumnsReq& req); - int32_t send_GetColumns(const TGetColumnsReq& req); - void recv_GetColumns(TGetColumnsResp& _return, const int32_t seqid); - void GetFunctions(TGetFunctionsResp& _return, const TGetFunctionsReq& req); - int32_t send_GetFunctions(const TGetFunctionsReq& req); - void recv_GetFunctions(TGetFunctionsResp& _return, const int32_t seqid); - void GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req); - int32_t send_GetPrimaryKeys(const TGetPrimaryKeysReq& req); - void recv_GetPrimaryKeys(TGetPrimaryKeysResp& _return, const int32_t seqid); - void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req); - int32_t send_GetCrossReference(const TGetCrossReferenceReq& req); - void recv_GetCrossReference(TGetCrossReferenceResp& _return, const int32_t seqid); - void GetOperationStatus(TGetOperationStatusResp& _return, const TGetOperationStatusReq& req); - int32_t send_GetOperationStatus(const TGetOperationStatusReq& req); - void recv_GetOperationStatus(TGetOperationStatusResp& _return, const int32_t seqid); - void CancelOperation(TCancelOperationResp& _return, const TCancelOperationReq& req); - int32_t send_CancelOperation(const TCancelOperationReq& req); - void recv_CancelOperation(TCancelOperationResp& _return, const int32_t seqid); - void CloseOperation(TCloseOperationResp& _return, const TCloseOperationReq& req); - int32_t send_CloseOperation(const TCloseOperationReq& req); - void recv_CloseOperation(TCloseOperationResp& _return, const int32_t seqid); - void GetResultSetMetadata(TGetResultSetMetadataResp& _return, const TGetResultSetMetadataReq& req); - int32_t send_GetResultSetMetadata(const TGetResultSetMetadataReq& req); - void recv_GetResultSetMetadata(TGetResultSetMetadataResp& _return, const int32_t seqid); - void FetchResults(TFetchResultsResp& _return, const TFetchResultsReq& req); - int32_t send_FetchResults(const TFetchResultsReq& req); - void recv_FetchResults(TFetchResultsResp& _return, const int32_t seqid); - void GetDelegationToken(TGetDelegationTokenResp& _return, const TGetDelegationTokenReq& req); - int32_t send_GetDelegationToken(const TGetDelegationTokenReq& req); - void recv_GetDelegationToken(TGetDelegationTokenResp& _return, const int32_t seqid); - void CancelDelegationToken(TCancelDelegationTokenResp& _return, const TCancelDelegationTokenReq& req); - int32_t send_CancelDelegationToken(const TCancelDelegationTokenReq& req); - void recv_CancelDelegationToken(TCancelDelegationTokenResp& _return, const int32_t seqid); - void RenewDelegationToken(TRenewDelegationTokenResp& _return, const TRenewDelegationTokenReq& req); - int32_t send_RenewDelegationToken(const TRenewDelegationTokenReq& req); - void recv_RenewDelegationToken(TRenewDelegationTokenResp& _return, const int32_t seqid); - void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req); - int32_t send_GetQueryId(const TGetQueryIdReq& req); - void recv_GetQueryId(TGetQueryIdResp& _return, const int32_t seqid); - void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req); - int32_t send_SetClientInfo(const TSetClientInfoReq& req); - void recv_SetClientInfo(TSetClientInfoResp& _return, const int32_t seqid); - protected: - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> piprot_; - apache::thrift::stdcxx::shared_ptr< ::apache::thrift::protocol::TProtocol> poprot_; - ::apache::thrift::protocol::TProtocol* iprot_; - ::apache::thrift::protocol::TProtocol* oprot_; - ::apache::thrift::async::TConcurrentClientSyncInfo sync_; -}; - -#ifdef _MSC_VER - #pragma warning( pop ) -#endif - -}}}}} // namespace - -#endif diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp deleted file mode 100644 index 60dc6442ee68..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#include "TCLIService_constants.h" - -namespace apache { namespace spark { 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); - PRIMITIVE_TYPES.insert((TTypeId::type)22); - - 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)10, "ARRAY")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)4, "BIGINT")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)9, "BINARY")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)0, "BOOLEAN")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)19, "CHAR")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)17, "DATE")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)15, "DECIMAL")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)6, "DOUBLE")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)5, "FLOAT")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)21, "INTERVAL_DAY_TIME")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)20, "INTERVAL_YEAR_MONTH")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)3, "INT")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)11, "MAP")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)16, "NULL")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)2, "SMALLINT")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)7, "STRING")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)12, "STRUCT")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)22, "TIMESTAMP WITH LOCAL TIME ZONE")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)8, "TIMESTAMP")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)1, "TINYINT")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)13, "UNIONTYPE")); - TYPE_NAMES.insert(std::make_pair((TTypeId::type)18, "VARCHAR")); - - CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; - - PRECISION = "precision"; - - SCALE = "scale"; - -} - -}}}}} // namespace - diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h deleted file mode 100644 index 82dc51bca478..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_constants.h +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * 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 spark { namespace service { namespace rpc { namespace thrift { - -class TCLIServiceConstants { - public: - TCLIServiceConstants(); - - std::set PRIMITIVE_TYPES; - std::set COMPLEX_TYPES; - std::set COLLECTION_TYPES; - std::map TYPE_NAMES; - std::string CHARACTER_MAXIMUM_LENGTH; - std::string PRECISION; - std::string SCALE; -}; - -extern const TCLIServiceConstants g_TCLIService_constants; - -}}}}} // namespace - -#endif diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp deleted file mode 100644 index d1fe9cabf7f5..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_server.skeleton.cpp +++ /dev/null @@ -1,152 +0,0 @@ -// 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 -#include -#include -#include - -using namespace ::apache::thrift; -using namespace ::apache::thrift::protocol; -using namespace ::apache::thrift::transport; -using namespace ::apache::thrift::server; - -using namespace ::apache::spark::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 GetPrimaryKeys(TGetPrimaryKeysResp& _return, const TGetPrimaryKeysReq& req) { - // Your implementation goes here - printf("GetPrimaryKeys\n"); - } - - void GetCrossReference(TGetCrossReferenceResp& _return, const TGetCrossReferenceReq& req) { - // Your implementation goes here - printf("GetCrossReference\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"); - } - - void GetQueryId(TGetQueryIdResp& _return, const TGetQueryIdReq& req) { - // Your implementation goes here - printf("GetQueryId\n"); - } - - void SetClientInfo(TSetClientInfoResp& _return, const TSetClientInfoReq& req) { - // Your implementation goes here - printf("SetClientInfo\n"); - } - -}; - -int main(int argc, char **argv) { - int port = 9090; - ::apache::thrift::stdcxx::shared_ptr handler(new TCLIServiceHandler()); - ::apache::thrift::stdcxx::shared_ptr processor(new TCLIServiceProcessor(handler)); - ::apache::thrift::stdcxx::shared_ptr serverTransport(new TServerSocket(port)); - ::apache::thrift::stdcxx::shared_ptr transportFactory(new TBufferedTransportFactory()); - ::apache::thrift::stdcxx::shared_ptr protocolFactory(new TBinaryProtocolFactory()); - - TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory); - server.serve(); - return 0; -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp deleted file mode 100644 index 2a99c29f34ec..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.cpp +++ /dev/null @@ -1,11342 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#include "TCLIService_types.h" - -#include -#include - -#include - -namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { - -int _kTProtocolVersionValues[] = { - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V1, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V2, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V3, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V4, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V5, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V6, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V7, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V8, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V9, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V10, - TProtocolVersion::HIVE_CLI_SERVICE_PROTOCOL_V11 -}; -const char* _kTProtocolVersionNames[] = { - "HIVE_CLI_SERVICE_PROTOCOL_V1", - "HIVE_CLI_SERVICE_PROTOCOL_V2", - "HIVE_CLI_SERVICE_PROTOCOL_V3", - "HIVE_CLI_SERVICE_PROTOCOL_V4", - "HIVE_CLI_SERVICE_PROTOCOL_V5", - "HIVE_CLI_SERVICE_PROTOCOL_V6", - "HIVE_CLI_SERVICE_PROTOCOL_V7", - "HIVE_CLI_SERVICE_PROTOCOL_V8", - "HIVE_CLI_SERVICE_PROTOCOL_V9", - "HIVE_CLI_SERVICE_PROTOCOL_V10", - "HIVE_CLI_SERVICE_PROTOCOL_V11" -}; -const std::map _TProtocolVersion_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(11, _kTProtocolVersionValues, _kTProtocolVersionNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TProtocolVersion::type& val) { - std::map::const_iterator it = _TProtocolVersion_VALUES_TO_NAMES.find(val); - if (it != _TProtocolVersion_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - -int _kTTypeIdValues[] = { - TTypeId::BOOLEAN_TYPE, - TTypeId::TINYINT_TYPE, - TTypeId::SMALLINT_TYPE, - TTypeId::INT_TYPE, - TTypeId::BIGINT_TYPE, - TTypeId::FLOAT_TYPE, - TTypeId::DOUBLE_TYPE, - TTypeId::STRING_TYPE, - TTypeId::TIMESTAMP_TYPE, - TTypeId::BINARY_TYPE, - TTypeId::ARRAY_TYPE, - TTypeId::MAP_TYPE, - TTypeId::STRUCT_TYPE, - TTypeId::UNION_TYPE, - TTypeId::USER_DEFINED_TYPE, - TTypeId::DECIMAL_TYPE, - TTypeId::NULL_TYPE, - TTypeId::DATE_TYPE, - TTypeId::VARCHAR_TYPE, - TTypeId::CHAR_TYPE, - TTypeId::INTERVAL_YEAR_MONTH_TYPE, - TTypeId::INTERVAL_DAY_TIME_TYPE, - TTypeId::TIMESTAMPLOCALTZ_TYPE -}; -const char* _kTTypeIdNames[] = { - "BOOLEAN_TYPE", - "TINYINT_TYPE", - "SMALLINT_TYPE", - "INT_TYPE", - "BIGINT_TYPE", - "FLOAT_TYPE", - "DOUBLE_TYPE", - "STRING_TYPE", - "TIMESTAMP_TYPE", - "BINARY_TYPE", - "ARRAY_TYPE", - "MAP_TYPE", - "STRUCT_TYPE", - "UNION_TYPE", - "USER_DEFINED_TYPE", - "DECIMAL_TYPE", - "NULL_TYPE", - "DATE_TYPE", - "VARCHAR_TYPE", - "CHAR_TYPE", - "INTERVAL_YEAR_MONTH_TYPE", - "INTERVAL_DAY_TIME_TYPE", - "TIMESTAMPLOCALTZ_TYPE" -}; -const std::map _TTypeId_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(23, _kTTypeIdValues, _kTTypeIdNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TTypeId::type& val) { - std::map::const_iterator it = _TTypeId_VALUES_TO_NAMES.find(val); - if (it != _TTypeId_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - -int _kTStatusCodeValues[] = { - TStatusCode::SUCCESS_STATUS, - TStatusCode::SUCCESS_WITH_INFO_STATUS, - TStatusCode::STILL_EXECUTING_STATUS, - TStatusCode::ERROR_STATUS, - TStatusCode::INVALID_HANDLE_STATUS -}; -const char* _kTStatusCodeNames[] = { - "SUCCESS_STATUS", - "SUCCESS_WITH_INFO_STATUS", - "STILL_EXECUTING_STATUS", - "ERROR_STATUS", - "INVALID_HANDLE_STATUS" -}; -const std::map _TStatusCode_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(5, _kTStatusCodeValues, _kTStatusCodeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TStatusCode::type& val) { - std::map::const_iterator it = _TStatusCode_VALUES_TO_NAMES.find(val); - if (it != _TStatusCode_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - -int _kTOperationStateValues[] = { - TOperationState::INITIALIZED_STATE, - TOperationState::RUNNING_STATE, - TOperationState::FINISHED_STATE, - TOperationState::CANCELED_STATE, - TOperationState::CLOSED_STATE, - TOperationState::ERROR_STATE, - TOperationState::UKNOWN_STATE, - TOperationState::PENDING_STATE, - TOperationState::TIMEDOUT_STATE -}; -const char* _kTOperationStateNames[] = { - "INITIALIZED_STATE", - "RUNNING_STATE", - "FINISHED_STATE", - "CANCELED_STATE", - "CLOSED_STATE", - "ERROR_STATE", - "UKNOWN_STATE", - "PENDING_STATE", - "TIMEDOUT_STATE" -}; -const std::map _TOperationState_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(9, _kTOperationStateValues, _kTOperationStateNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TOperationState::type& val) { - std::map::const_iterator it = _TOperationState_VALUES_TO_NAMES.find(val); - if (it != _TOperationState_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - -int _kTOperationTypeValues[] = { - TOperationType::EXECUTE_STATEMENT, - TOperationType::GET_TYPE_INFO, - TOperationType::GET_CATALOGS, - TOperationType::GET_SCHEMAS, - TOperationType::GET_TABLES, - TOperationType::GET_TABLE_TYPES, - TOperationType::GET_COLUMNS, - TOperationType::GET_FUNCTIONS, - TOperationType::UNKNOWN -}; -const char* _kTOperationTypeNames[] = { - "EXECUTE_STATEMENT", - "GET_TYPE_INFO", - "GET_CATALOGS", - "GET_SCHEMAS", - "GET_TABLES", - "GET_TABLE_TYPES", - "GET_COLUMNS", - "GET_FUNCTIONS", - "UNKNOWN" -}; -const std::map _TOperationType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(9, _kTOperationTypeValues, _kTOperationTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TOperationType::type& val) { - std::map::const_iterator it = _TOperationType_VALUES_TO_NAMES.find(val); - if (it != _TOperationType_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - -int _kTGetInfoTypeValues[] = { - TGetInfoType::CLI_MAX_DRIVER_CONNECTIONS, - TGetInfoType::CLI_MAX_CONCURRENT_ACTIVITIES, - TGetInfoType::CLI_DATA_SOURCE_NAME, - TGetInfoType::CLI_FETCH_DIRECTION, - TGetInfoType::CLI_SERVER_NAME, - TGetInfoType::CLI_SEARCH_PATTERN_ESCAPE, - TGetInfoType::CLI_DBMS_NAME, - TGetInfoType::CLI_DBMS_VER, - TGetInfoType::CLI_ACCESSIBLE_TABLES, - TGetInfoType::CLI_ACCESSIBLE_PROCEDURES, - TGetInfoType::CLI_CURSOR_COMMIT_BEHAVIOR, - TGetInfoType::CLI_DATA_SOURCE_READ_ONLY, - TGetInfoType::CLI_DEFAULT_TXN_ISOLATION, - TGetInfoType::CLI_IDENTIFIER_CASE, - TGetInfoType::CLI_IDENTIFIER_QUOTE_CHAR, - TGetInfoType::CLI_MAX_COLUMN_NAME_LEN, - TGetInfoType::CLI_MAX_CURSOR_NAME_LEN, - TGetInfoType::CLI_MAX_SCHEMA_NAME_LEN, - TGetInfoType::CLI_MAX_CATALOG_NAME_LEN, - TGetInfoType::CLI_MAX_TABLE_NAME_LEN, - TGetInfoType::CLI_SCROLL_CONCURRENCY, - TGetInfoType::CLI_TXN_CAPABLE, - TGetInfoType::CLI_USER_NAME, - TGetInfoType::CLI_TXN_ISOLATION_OPTION, - TGetInfoType::CLI_INTEGRITY, - TGetInfoType::CLI_GETDATA_EXTENSIONS, - TGetInfoType::CLI_NULL_COLLATION, - TGetInfoType::CLI_ALTER_TABLE, - TGetInfoType::CLI_ORDER_BY_COLUMNS_IN_SELECT, - TGetInfoType::CLI_SPECIAL_CHARACTERS, - TGetInfoType::CLI_MAX_COLUMNS_IN_GROUP_BY, - TGetInfoType::CLI_MAX_COLUMNS_IN_INDEX, - TGetInfoType::CLI_MAX_COLUMNS_IN_ORDER_BY, - TGetInfoType::CLI_MAX_COLUMNS_IN_SELECT, - TGetInfoType::CLI_MAX_COLUMNS_IN_TABLE, - TGetInfoType::CLI_MAX_INDEX_SIZE, - TGetInfoType::CLI_MAX_ROW_SIZE, - TGetInfoType::CLI_MAX_STATEMENT_LEN, - TGetInfoType::CLI_MAX_TABLES_IN_SELECT, - TGetInfoType::CLI_MAX_USER_NAME_LEN, - TGetInfoType::CLI_OJ_CAPABILITIES, - TGetInfoType::CLI_XOPEN_CLI_YEAR, - TGetInfoType::CLI_CURSOR_SENSITIVITY, - TGetInfoType::CLI_DESCRIBE_PARAMETER, - TGetInfoType::CLI_CATALOG_NAME, - TGetInfoType::CLI_COLLATION_SEQ, - TGetInfoType::CLI_MAX_IDENTIFIER_LEN, - TGetInfoType::CLI_ODBC_KEYWORDS -}; -const char* _kTGetInfoTypeNames[] = { - "CLI_MAX_DRIVER_CONNECTIONS", - "CLI_MAX_CONCURRENT_ACTIVITIES", - "CLI_DATA_SOURCE_NAME", - "CLI_FETCH_DIRECTION", - "CLI_SERVER_NAME", - "CLI_SEARCH_PATTERN_ESCAPE", - "CLI_DBMS_NAME", - "CLI_DBMS_VER", - "CLI_ACCESSIBLE_TABLES", - "CLI_ACCESSIBLE_PROCEDURES", - "CLI_CURSOR_COMMIT_BEHAVIOR", - "CLI_DATA_SOURCE_READ_ONLY", - "CLI_DEFAULT_TXN_ISOLATION", - "CLI_IDENTIFIER_CASE", - "CLI_IDENTIFIER_QUOTE_CHAR", - "CLI_MAX_COLUMN_NAME_LEN", - "CLI_MAX_CURSOR_NAME_LEN", - "CLI_MAX_SCHEMA_NAME_LEN", - "CLI_MAX_CATALOG_NAME_LEN", - "CLI_MAX_TABLE_NAME_LEN", - "CLI_SCROLL_CONCURRENCY", - "CLI_TXN_CAPABLE", - "CLI_USER_NAME", - "CLI_TXN_ISOLATION_OPTION", - "CLI_INTEGRITY", - "CLI_GETDATA_EXTENSIONS", - "CLI_NULL_COLLATION", - "CLI_ALTER_TABLE", - "CLI_ORDER_BY_COLUMNS_IN_SELECT", - "CLI_SPECIAL_CHARACTERS", - "CLI_MAX_COLUMNS_IN_GROUP_BY", - "CLI_MAX_COLUMNS_IN_INDEX", - "CLI_MAX_COLUMNS_IN_ORDER_BY", - "CLI_MAX_COLUMNS_IN_SELECT", - "CLI_MAX_COLUMNS_IN_TABLE", - "CLI_MAX_INDEX_SIZE", - "CLI_MAX_ROW_SIZE", - "CLI_MAX_STATEMENT_LEN", - "CLI_MAX_TABLES_IN_SELECT", - "CLI_MAX_USER_NAME_LEN", - "CLI_OJ_CAPABILITIES", - "CLI_XOPEN_CLI_YEAR", - "CLI_CURSOR_SENSITIVITY", - "CLI_DESCRIBE_PARAMETER", - "CLI_CATALOG_NAME", - "CLI_COLLATION_SEQ", - "CLI_MAX_IDENTIFIER_LEN", - "CLI_ODBC_KEYWORDS" -}; -const std::map _TGetInfoType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(48, _kTGetInfoTypeValues, _kTGetInfoTypeNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TGetInfoType::type& val) { - std::map::const_iterator it = _TGetInfoType_VALUES_TO_NAMES.find(val); - if (it != _TGetInfoType_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - -int _kTFetchOrientationValues[] = { - TFetchOrientation::FETCH_NEXT, - TFetchOrientation::FETCH_PRIOR, - TFetchOrientation::FETCH_RELATIVE, - TFetchOrientation::FETCH_ABSOLUTE, - TFetchOrientation::FETCH_FIRST, - TFetchOrientation::FETCH_LAST -}; -const char* _kTFetchOrientationNames[] = { - "FETCH_NEXT", - "FETCH_PRIOR", - "FETCH_RELATIVE", - "FETCH_ABSOLUTE", - "FETCH_FIRST", - "FETCH_LAST" -}; -const std::map _TFetchOrientation_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(6, _kTFetchOrientationValues, _kTFetchOrientationNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TFetchOrientation::type& val) { - std::map::const_iterator it = _TFetchOrientation_VALUES_TO_NAMES.find(val); - if (it != _TFetchOrientation_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - -int _kTJobExecutionStatusValues[] = { - TJobExecutionStatus::IN_PROGRESS, - TJobExecutionStatus::COMPLETE, - TJobExecutionStatus::NOT_AVAILABLE -}; -const char* _kTJobExecutionStatusNames[] = { - "IN_PROGRESS", - "COMPLETE", - "NOT_AVAILABLE" -}; -const std::map _TJobExecutionStatus_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kTJobExecutionStatusValues, _kTJobExecutionStatusNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL)); - -std::ostream& operator<<(std::ostream& out, const TJobExecutionStatus::type& val) { - std::map::const_iterator it = _TJobExecutionStatus_VALUES_TO_NAMES.find(val); - if (it != _TJobExecutionStatus_VALUES_TO_NAMES.end()) { - out << it->second; - } else { - out << static_cast(val); - } - return out; -} - - -TTypeQualifierValue::~TTypeQualifierValue() throw() { -} - - -void TTypeQualifierValue::__set_i32Value(const int32_t val) { - this->i32Value = val; -__isset.i32Value = true; -} - -void TTypeQualifierValue::__set_stringValue(const std::string& val) { - this->stringValue = val; -__isset.stringValue = true; -} -std::ostream& operator<<(std::ostream& out, const TTypeQualifierValue& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TTypeQualifierValue::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I32) { - xfer += iprot->readI32(this->i32Value); - this->__isset.i32Value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->stringValue); - this->__isset.stringValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TTypeQualifierValue::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TTypeQualifierValue"); - - if (this->__isset.i32Value) { - xfer += oprot->writeFieldBegin("i32Value", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32(this->i32Value); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.stringValue) { - xfer += oprot->writeFieldBegin("stringValue", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->stringValue); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TTypeQualifierValue &a, TTypeQualifierValue &b) { - using ::std::swap; - swap(a.i32Value, b.i32Value); - swap(a.stringValue, b.stringValue); - swap(a.__isset, b.__isset); -} - -TTypeQualifierValue::TTypeQualifierValue(const TTypeQualifierValue& other0) { - i32Value = other0.i32Value; - stringValue = other0.stringValue; - __isset = other0.__isset; -} -TTypeQualifierValue& TTypeQualifierValue::operator=(const TTypeQualifierValue& other1) { - i32Value = other1.i32Value; - stringValue = other1.stringValue; - __isset = other1.__isset; - return *this; -} -void TTypeQualifierValue::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TTypeQualifierValue("; - out << "i32Value="; (__isset.i32Value ? (out << to_string(i32Value)) : (out << "")); - out << ", " << "stringValue="; (__isset.stringValue ? (out << to_string(stringValue)) : (out << "")); - out << ")"; -} - - -TTypeQualifiers::~TTypeQualifiers() throw() { -} - - -void TTypeQualifiers::__set_qualifiers(const std::map & val) { - this->qualifiers = val; -} -std::ostream& operator<<(std::ostream& out, const TTypeQualifiers& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TTypeQualifiers::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_qualifiers = 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_MAP) { - { - this->qualifiers.clear(); - uint32_t _size2; - ::apache::thrift::protocol::TType _ktype3; - ::apache::thrift::protocol::TType _vtype4; - xfer += iprot->readMapBegin(_ktype3, _vtype4, _size2); - uint32_t _i6; - for (_i6 = 0; _i6 < _size2; ++_i6) - { - std::string _key7; - xfer += iprot->readString(_key7); - TTypeQualifierValue& _val8 = this->qualifiers[_key7]; - xfer += _val8.read(iprot); - } - xfer += iprot->readMapEnd(); - } - isset_qualifiers = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_qualifiers) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TTypeQualifiers::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TTypeQualifiers"); - - xfer += oprot->writeFieldBegin("qualifiers", ::apache::thrift::protocol::T_MAP, 1); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRUCT, static_cast(this->qualifiers.size())); - std::map ::const_iterator _iter9; - for (_iter9 = this->qualifiers.begin(); _iter9 != this->qualifiers.end(); ++_iter9) - { - xfer += oprot->writeString(_iter9->first); - xfer += _iter9->second.write(oprot); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TTypeQualifiers &a, TTypeQualifiers &b) { - using ::std::swap; - swap(a.qualifiers, b.qualifiers); -} - -TTypeQualifiers::TTypeQualifiers(const TTypeQualifiers& other10) { - qualifiers = other10.qualifiers; -} -TTypeQualifiers& TTypeQualifiers::operator=(const TTypeQualifiers& other11) { - qualifiers = other11.qualifiers; - return *this; -} -void TTypeQualifiers::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TTypeQualifiers("; - out << "qualifiers=" << to_string(qualifiers); - out << ")"; -} - - -TPrimitiveTypeEntry::~TPrimitiveTypeEntry() throw() { -} - - -void TPrimitiveTypeEntry::__set_type(const TTypeId::type val) { - this->type = val; -} - -void TPrimitiveTypeEntry::__set_typeQualifiers(const TTypeQualifiers& val) { - this->typeQualifiers = val; -__isset.typeQualifiers = true; -} -std::ostream& operator<<(std::ostream& out, const TPrimitiveTypeEntry& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TPrimitiveTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_type = 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_I32) { - int32_t ecast12; - xfer += iprot->readI32(ecast12); - this->type = (TTypeId::type)ecast12; - isset_type = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->typeQualifiers.read(iprot); - this->__isset.typeQualifiers = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_type) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TPrimitiveTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TPrimitiveTypeEntry"); - - xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32((int32_t)this->type); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.typeQualifiers) { - xfer += oprot->writeFieldBegin("typeQualifiers", ::apache::thrift::protocol::T_STRUCT, 2); - xfer += this->typeQualifiers.write(oprot); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TPrimitiveTypeEntry &a, TPrimitiveTypeEntry &b) { - using ::std::swap; - swap(a.type, b.type); - swap(a.typeQualifiers, b.typeQualifiers); - swap(a.__isset, b.__isset); -} - -TPrimitiveTypeEntry::TPrimitiveTypeEntry(const TPrimitiveTypeEntry& other13) { - type = other13.type; - typeQualifiers = other13.typeQualifiers; - __isset = other13.__isset; -} -TPrimitiveTypeEntry& TPrimitiveTypeEntry::operator=(const TPrimitiveTypeEntry& other14) { - type = other14.type; - typeQualifiers = other14.typeQualifiers; - __isset = other14.__isset; - return *this; -} -void TPrimitiveTypeEntry::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TPrimitiveTypeEntry("; - out << "type=" << to_string(type); - out << ", " << "typeQualifiers="; (__isset.typeQualifiers ? (out << to_string(typeQualifiers)) : (out << "")); - out << ")"; -} - - -TArrayTypeEntry::~TArrayTypeEntry() throw() { -} - - -void TArrayTypeEntry::__set_objectTypePtr(const TTypeEntryPtr val) { - this->objectTypePtr = val; -} -std::ostream& operator<<(std::ostream& out, const TArrayTypeEntry& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TArrayTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_objectTypePtr = 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_I32) { - xfer += iprot->readI32(this->objectTypePtr); - isset_objectTypePtr = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_objectTypePtr) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TArrayTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TArrayTypeEntry"); - - xfer += oprot->writeFieldBegin("objectTypePtr", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32(this->objectTypePtr); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TArrayTypeEntry &a, TArrayTypeEntry &b) { - using ::std::swap; - swap(a.objectTypePtr, b.objectTypePtr); -} - -TArrayTypeEntry::TArrayTypeEntry(const TArrayTypeEntry& other15) { - objectTypePtr = other15.objectTypePtr; -} -TArrayTypeEntry& TArrayTypeEntry::operator=(const TArrayTypeEntry& other16) { - objectTypePtr = other16.objectTypePtr; - return *this; -} -void TArrayTypeEntry::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TArrayTypeEntry("; - out << "objectTypePtr=" << to_string(objectTypePtr); - out << ")"; -} - - -TMapTypeEntry::~TMapTypeEntry() throw() { -} - - -void TMapTypeEntry::__set_keyTypePtr(const TTypeEntryPtr val) { - this->keyTypePtr = val; -} - -void TMapTypeEntry::__set_valueTypePtr(const TTypeEntryPtr val) { - this->valueTypePtr = val; -} -std::ostream& operator<<(std::ostream& out, const TMapTypeEntry& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TMapTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_keyTypePtr = false; - bool isset_valueTypePtr = 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_I32) { - xfer += iprot->readI32(this->keyTypePtr); - isset_keyTypePtr = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->valueTypePtr); - isset_valueTypePtr = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_keyTypePtr) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_valueTypePtr) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TMapTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TMapTypeEntry"); - - xfer += oprot->writeFieldBegin("keyTypePtr", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32(this->keyTypePtr); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("valueTypePtr", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32(this->valueTypePtr); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TMapTypeEntry &a, TMapTypeEntry &b) { - using ::std::swap; - swap(a.keyTypePtr, b.keyTypePtr); - swap(a.valueTypePtr, b.valueTypePtr); -} - -TMapTypeEntry::TMapTypeEntry(const TMapTypeEntry& other17) { - keyTypePtr = other17.keyTypePtr; - valueTypePtr = other17.valueTypePtr; -} -TMapTypeEntry& TMapTypeEntry::operator=(const TMapTypeEntry& other18) { - keyTypePtr = other18.keyTypePtr; - valueTypePtr = other18.valueTypePtr; - return *this; -} -void TMapTypeEntry::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TMapTypeEntry("; - out << "keyTypePtr=" << to_string(keyTypePtr); - out << ", " << "valueTypePtr=" << to_string(valueTypePtr); - out << ")"; -} - - -TStructTypeEntry::~TStructTypeEntry() throw() { -} - - -void TStructTypeEntry::__set_nameToTypePtr(const std::map & val) { - this->nameToTypePtr = val; -} -std::ostream& operator<<(std::ostream& out, const TStructTypeEntry& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TStructTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_nameToTypePtr = 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_MAP) { - { - this->nameToTypePtr.clear(); - uint32_t _size19; - ::apache::thrift::protocol::TType _ktype20; - ::apache::thrift::protocol::TType _vtype21; - xfer += iprot->readMapBegin(_ktype20, _vtype21, _size19); - uint32_t _i23; - for (_i23 = 0; _i23 < _size19; ++_i23) - { - std::string _key24; - xfer += iprot->readString(_key24); - TTypeEntryPtr& _val25 = this->nameToTypePtr[_key24]; - xfer += iprot->readI32(_val25); - } - xfer += iprot->readMapEnd(); - } - isset_nameToTypePtr = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_nameToTypePtr) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TStructTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TStructTypeEntry"); - - xfer += oprot->writeFieldBegin("nameToTypePtr", ::apache::thrift::protocol::T_MAP, 1); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, static_cast(this->nameToTypePtr.size())); - std::map ::const_iterator _iter26; - for (_iter26 = this->nameToTypePtr.begin(); _iter26 != this->nameToTypePtr.end(); ++_iter26) - { - xfer += oprot->writeString(_iter26->first); - xfer += oprot->writeI32(_iter26->second); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TStructTypeEntry &a, TStructTypeEntry &b) { - using ::std::swap; - swap(a.nameToTypePtr, b.nameToTypePtr); -} - -TStructTypeEntry::TStructTypeEntry(const TStructTypeEntry& other27) { - nameToTypePtr = other27.nameToTypePtr; -} -TStructTypeEntry& TStructTypeEntry::operator=(const TStructTypeEntry& other28) { - nameToTypePtr = other28.nameToTypePtr; - return *this; -} -void TStructTypeEntry::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TStructTypeEntry("; - out << "nameToTypePtr=" << to_string(nameToTypePtr); - out << ")"; -} - - -TUnionTypeEntry::~TUnionTypeEntry() throw() { -} - - -void TUnionTypeEntry::__set_nameToTypePtr(const std::map & val) { - this->nameToTypePtr = val; -} -std::ostream& operator<<(std::ostream& out, const TUnionTypeEntry& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TUnionTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_nameToTypePtr = 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_MAP) { - { - this->nameToTypePtr.clear(); - uint32_t _size29; - ::apache::thrift::protocol::TType _ktype30; - ::apache::thrift::protocol::TType _vtype31; - xfer += iprot->readMapBegin(_ktype30, _vtype31, _size29); - uint32_t _i33; - for (_i33 = 0; _i33 < _size29; ++_i33) - { - std::string _key34; - xfer += iprot->readString(_key34); - TTypeEntryPtr& _val35 = this->nameToTypePtr[_key34]; - xfer += iprot->readI32(_val35); - } - xfer += iprot->readMapEnd(); - } - isset_nameToTypePtr = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_nameToTypePtr) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TUnionTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TUnionTypeEntry"); - - xfer += oprot->writeFieldBegin("nameToTypePtr", ::apache::thrift::protocol::T_MAP, 1); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_I32, static_cast(this->nameToTypePtr.size())); - std::map ::const_iterator _iter36; - for (_iter36 = this->nameToTypePtr.begin(); _iter36 != this->nameToTypePtr.end(); ++_iter36) - { - xfer += oprot->writeString(_iter36->first); - xfer += oprot->writeI32(_iter36->second); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TUnionTypeEntry &a, TUnionTypeEntry &b) { - using ::std::swap; - swap(a.nameToTypePtr, b.nameToTypePtr); -} - -TUnionTypeEntry::TUnionTypeEntry(const TUnionTypeEntry& other37) { - nameToTypePtr = other37.nameToTypePtr; -} -TUnionTypeEntry& TUnionTypeEntry::operator=(const TUnionTypeEntry& other38) { - nameToTypePtr = other38.nameToTypePtr; - return *this; -} -void TUnionTypeEntry::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TUnionTypeEntry("; - out << "nameToTypePtr=" << to_string(nameToTypePtr); - out << ")"; -} - - -TUserDefinedTypeEntry::~TUserDefinedTypeEntry() throw() { -} - - -void TUserDefinedTypeEntry::__set_typeClassName(const std::string& val) { - this->typeClassName = val; -} -std::ostream& operator<<(std::ostream& out, const TUserDefinedTypeEntry& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TUserDefinedTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_typeClassName = 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_STRING) { - xfer += iprot->readString(this->typeClassName); - isset_typeClassName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_typeClassName) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TUserDefinedTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TUserDefinedTypeEntry"); - - xfer += oprot->writeFieldBegin("typeClassName", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->typeClassName); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TUserDefinedTypeEntry &a, TUserDefinedTypeEntry &b) { - using ::std::swap; - swap(a.typeClassName, b.typeClassName); -} - -TUserDefinedTypeEntry::TUserDefinedTypeEntry(const TUserDefinedTypeEntry& other39) { - typeClassName = other39.typeClassName; -} -TUserDefinedTypeEntry& TUserDefinedTypeEntry::operator=(const TUserDefinedTypeEntry& other40) { - typeClassName = other40.typeClassName; - return *this; -} -void TUserDefinedTypeEntry::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TUserDefinedTypeEntry("; - out << "typeClassName=" << to_string(typeClassName); - out << ")"; -} - - -TTypeEntry::~TTypeEntry() throw() { -} - - -void TTypeEntry::__set_primitiveEntry(const TPrimitiveTypeEntry& val) { - this->primitiveEntry = val; -__isset.primitiveEntry = true; -} - -void TTypeEntry::__set_arrayEntry(const TArrayTypeEntry& val) { - this->arrayEntry = val; -__isset.arrayEntry = true; -} - -void TTypeEntry::__set_mapEntry(const TMapTypeEntry& val) { - this->mapEntry = val; -__isset.mapEntry = true; -} - -void TTypeEntry::__set_structEntry(const TStructTypeEntry& val) { - this->structEntry = val; -__isset.structEntry = true; -} - -void TTypeEntry::__set_unionEntry(const TUnionTypeEntry& val) { - this->unionEntry = val; -__isset.unionEntry = true; -} - -void TTypeEntry::__set_userDefinedTypeEntry(const TUserDefinedTypeEntry& val) { - this->userDefinedTypeEntry = val; -__isset.userDefinedTypeEntry = true; -} -std::ostream& operator<<(std::ostream& out, const TTypeEntry& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TTypeEntry::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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->primitiveEntry.read(iprot); - this->__isset.primitiveEntry = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->arrayEntry.read(iprot); - this->__isset.arrayEntry = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->mapEntry.read(iprot); - this->__isset.mapEntry = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->structEntry.read(iprot); - this->__isset.structEntry = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->unionEntry.read(iprot); - this->__isset.unionEntry = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->userDefinedTypeEntry.read(iprot); - this->__isset.userDefinedTypeEntry = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TTypeEntry::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TTypeEntry"); - - if (this->__isset.primitiveEntry) { - xfer += oprot->writeFieldBegin("primitiveEntry", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->primitiveEntry.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.arrayEntry) { - xfer += oprot->writeFieldBegin("arrayEntry", ::apache::thrift::protocol::T_STRUCT, 2); - xfer += this->arrayEntry.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.mapEntry) { - xfer += oprot->writeFieldBegin("mapEntry", ::apache::thrift::protocol::T_STRUCT, 3); - xfer += this->mapEntry.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.structEntry) { - xfer += oprot->writeFieldBegin("structEntry", ::apache::thrift::protocol::T_STRUCT, 4); - xfer += this->structEntry.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.unionEntry) { - xfer += oprot->writeFieldBegin("unionEntry", ::apache::thrift::protocol::T_STRUCT, 5); - xfer += this->unionEntry.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.userDefinedTypeEntry) { - xfer += oprot->writeFieldBegin("userDefinedTypeEntry", ::apache::thrift::protocol::T_STRUCT, 6); - xfer += this->userDefinedTypeEntry.write(oprot); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TTypeEntry &a, TTypeEntry &b) { - using ::std::swap; - swap(a.primitiveEntry, b.primitiveEntry); - swap(a.arrayEntry, b.arrayEntry); - swap(a.mapEntry, b.mapEntry); - swap(a.structEntry, b.structEntry); - swap(a.unionEntry, b.unionEntry); - swap(a.userDefinedTypeEntry, b.userDefinedTypeEntry); - swap(a.__isset, b.__isset); -} - -TTypeEntry::TTypeEntry(const TTypeEntry& other41) { - primitiveEntry = other41.primitiveEntry; - arrayEntry = other41.arrayEntry; - mapEntry = other41.mapEntry; - structEntry = other41.structEntry; - unionEntry = other41.unionEntry; - userDefinedTypeEntry = other41.userDefinedTypeEntry; - __isset = other41.__isset; -} -TTypeEntry& TTypeEntry::operator=(const TTypeEntry& other42) { - primitiveEntry = other42.primitiveEntry; - arrayEntry = other42.arrayEntry; - mapEntry = other42.mapEntry; - structEntry = other42.structEntry; - unionEntry = other42.unionEntry; - userDefinedTypeEntry = other42.userDefinedTypeEntry; - __isset = other42.__isset; - return *this; -} -void TTypeEntry::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TTypeEntry("; - out << "primitiveEntry="; (__isset.primitiveEntry ? (out << to_string(primitiveEntry)) : (out << "")); - out << ", " << "arrayEntry="; (__isset.arrayEntry ? (out << to_string(arrayEntry)) : (out << "")); - out << ", " << "mapEntry="; (__isset.mapEntry ? (out << to_string(mapEntry)) : (out << "")); - out << ", " << "structEntry="; (__isset.structEntry ? (out << to_string(structEntry)) : (out << "")); - out << ", " << "unionEntry="; (__isset.unionEntry ? (out << to_string(unionEntry)) : (out << "")); - out << ", " << "userDefinedTypeEntry="; (__isset.userDefinedTypeEntry ? (out << to_string(userDefinedTypeEntry)) : (out << "")); - out << ")"; -} - - -TTypeDesc::~TTypeDesc() throw() { -} - - -void TTypeDesc::__set_types(const std::vector & val) { - this->types = val; -} -std::ostream& operator<<(std::ostream& out, const TTypeDesc& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TTypeDesc::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_types = 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_LIST) { - { - this->types.clear(); - uint32_t _size43; - ::apache::thrift::protocol::TType _etype46; - xfer += iprot->readListBegin(_etype46, _size43); - this->types.resize(_size43); - uint32_t _i47; - for (_i47 = 0; _i47 < _size43; ++_i47) - { - xfer += this->types[_i47].read(iprot); - } - xfer += iprot->readListEnd(); - } - isset_types = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_types) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TTypeDesc::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TTypeDesc"); - - xfer += oprot->writeFieldBegin("types", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->types.size())); - std::vector ::const_iterator _iter48; - for (_iter48 = this->types.begin(); _iter48 != this->types.end(); ++_iter48) - { - xfer += (*_iter48).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TTypeDesc &a, TTypeDesc &b) { - using ::std::swap; - swap(a.types, b.types); -} - -TTypeDesc::TTypeDesc(const TTypeDesc& other49) { - types = other49.types; -} -TTypeDesc& TTypeDesc::operator=(const TTypeDesc& other50) { - types = other50.types; - return *this; -} -void TTypeDesc::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TTypeDesc("; - out << "types=" << to_string(types); - out << ")"; -} - - -TColumnDesc::~TColumnDesc() throw() { -} - - -void TColumnDesc::__set_columnName(const std::string& val) { - this->columnName = val; -} - -void TColumnDesc::__set_typeDesc(const TTypeDesc& val) { - this->typeDesc = val; -} - -void TColumnDesc::__set_position(const int32_t val) { - this->position = val; -} - -void TColumnDesc::__set_comment(const std::string& val) { - this->comment = val; -__isset.comment = true; -} -std::ostream& operator<<(std::ostream& out, const TColumnDesc& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TColumnDesc::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_columnName = false; - bool isset_typeDesc = false; - bool isset_position = 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_STRING) { - xfer += iprot->readString(this->columnName); - isset_columnName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->typeDesc.read(iprot); - isset_typeDesc = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->position); - isset_position = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->comment); - this->__isset.comment = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_columnName) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_typeDesc) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_position) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TColumnDesc::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TColumnDesc"); - - xfer += oprot->writeFieldBegin("columnName", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->columnName); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("typeDesc", ::apache::thrift::protocol::T_STRUCT, 2); - xfer += this->typeDesc.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("position", ::apache::thrift::protocol::T_I32, 3); - xfer += oprot->writeI32(this->position); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.comment) { - xfer += oprot->writeFieldBegin("comment", ::apache::thrift::protocol::T_STRING, 4); - xfer += oprot->writeString(this->comment); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TColumnDesc &a, TColumnDesc &b) { - using ::std::swap; - swap(a.columnName, b.columnName); - swap(a.typeDesc, b.typeDesc); - swap(a.position, b.position); - swap(a.comment, b.comment); - swap(a.__isset, b.__isset); -} - -TColumnDesc::TColumnDesc(const TColumnDesc& other51) { - columnName = other51.columnName; - typeDesc = other51.typeDesc; - position = other51.position; - comment = other51.comment; - __isset = other51.__isset; -} -TColumnDesc& TColumnDesc::operator=(const TColumnDesc& other52) { - columnName = other52.columnName; - typeDesc = other52.typeDesc; - position = other52.position; - comment = other52.comment; - __isset = other52.__isset; - return *this; -} -void TColumnDesc::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TColumnDesc("; - out << "columnName=" << to_string(columnName); - out << ", " << "typeDesc=" << to_string(typeDesc); - out << ", " << "position=" << to_string(position); - out << ", " << "comment="; (__isset.comment ? (out << to_string(comment)) : (out << "")); - out << ")"; -} - - -TTableSchema::~TTableSchema() throw() { -} - - -void TTableSchema::__set_columns(const std::vector & val) { - this->columns = val; -} -std::ostream& operator<<(std::ostream& out, const TTableSchema& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TTableSchema::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_columns = 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_LIST) { - { - this->columns.clear(); - uint32_t _size53; - ::apache::thrift::protocol::TType _etype56; - xfer += iprot->readListBegin(_etype56, _size53); - this->columns.resize(_size53); - uint32_t _i57; - for (_i57 = 0; _i57 < _size53; ++_i57) - { - xfer += this->columns[_i57].read(iprot); - } - xfer += iprot->readListEnd(); - } - isset_columns = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_columns) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TTableSchema::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TTableSchema"); - - xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->columns.size())); - std::vector ::const_iterator _iter58; - for (_iter58 = this->columns.begin(); _iter58 != this->columns.end(); ++_iter58) - { - xfer += (*_iter58).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TTableSchema &a, TTableSchema &b) { - using ::std::swap; - swap(a.columns, b.columns); -} - -TTableSchema::TTableSchema(const TTableSchema& other59) { - columns = other59.columns; -} -TTableSchema& TTableSchema::operator=(const TTableSchema& other60) { - columns = other60.columns; - return *this; -} -void TTableSchema::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TTableSchema("; - out << "columns=" << to_string(columns); - out << ")"; -} - - -TBoolValue::~TBoolValue() throw() { -} - - -void TBoolValue::__set_value(const bool val) { - this->value = val; -__isset.value = true; -} -std::ostream& operator<<(std::ostream& out, const TBoolValue& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TBoolValue::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_BOOL) { - xfer += iprot->readBool(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TBoolValue::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TBoolValue"); - - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_BOOL, 1); - xfer += oprot->writeBool(this->value); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TBoolValue &a, TBoolValue &b) { - using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -TBoolValue::TBoolValue(const TBoolValue& other61) { - value = other61.value; - __isset = other61.__isset; -} -TBoolValue& TBoolValue::operator=(const TBoolValue& other62) { - value = other62.value; - __isset = other62.__isset; - return *this; -} -void TBoolValue::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TBoolValue("; - out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); - out << ")"; -} - - -TByteValue::~TByteValue() throw() { -} - - -void TByteValue::__set_value(const int8_t val) { - this->value = val; -__isset.value = true; -} -std::ostream& operator<<(std::ostream& out, const TByteValue& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TByteValue::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_BYTE) { - xfer += iprot->readByte(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TByteValue::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TByteValue"); - - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_BYTE, 1); - xfer += oprot->writeByte(this->value); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TByteValue &a, TByteValue &b) { - using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -TByteValue::TByteValue(const TByteValue& other63) { - value = other63.value; - __isset = other63.__isset; -} -TByteValue& TByteValue::operator=(const TByteValue& other64) { - value = other64.value; - __isset = other64.__isset; - return *this; -} -void TByteValue::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TByteValue("; - out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); - out << ")"; -} - - -TI16Value::~TI16Value() throw() { -} - - -void TI16Value::__set_value(const int16_t val) { - this->value = val; -__isset.value = true; -} -std::ostream& operator<<(std::ostream& out, const TI16Value& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TI16Value::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I16) { - xfer += iprot->readI16(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TI16Value::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TI16Value"); - - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I16, 1); - xfer += oprot->writeI16(this->value); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TI16Value &a, TI16Value &b) { - using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -TI16Value::TI16Value(const TI16Value& other65) { - value = other65.value; - __isset = other65.__isset; -} -TI16Value& TI16Value::operator=(const TI16Value& other66) { - value = other66.value; - __isset = other66.__isset; - return *this; -} -void TI16Value::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TI16Value("; - out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); - out << ")"; -} - - -TI32Value::~TI32Value() throw() { -} - - -void TI32Value::__set_value(const int32_t val) { - this->value = val; -__isset.value = true; -} -std::ostream& operator<<(std::ostream& out, const TI32Value& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TI32Value::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I32) { - xfer += iprot->readI32(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TI32Value::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TI32Value"); - - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32(this->value); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TI32Value &a, TI32Value &b) { - using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -TI32Value::TI32Value(const TI32Value& other67) { - value = other67.value; - __isset = other67.__isset; -} -TI32Value& TI32Value::operator=(const TI32Value& other68) { - value = other68.value; - __isset = other68.__isset; - return *this; -} -void TI32Value::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TI32Value("; - out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); - out << ")"; -} - - -TI64Value::~TI64Value() throw() { -} - - -void TI64Value::__set_value(const int64_t val) { - this->value = val; -__isset.value = true; -} -std::ostream& operator<<(std::ostream& out, const TI64Value& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TI64Value::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_I64) { - xfer += iprot->readI64(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TI64Value::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TI64Value"); - - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_I64, 1); - xfer += oprot->writeI64(this->value); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TI64Value &a, TI64Value &b) { - using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -TI64Value::TI64Value(const TI64Value& other69) { - value = other69.value; - __isset = other69.__isset; -} -TI64Value& TI64Value::operator=(const TI64Value& other70) { - value = other70.value; - __isset = other70.__isset; - return *this; -} -void TI64Value::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TI64Value("; - out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); - out << ")"; -} - - -TDoubleValue::~TDoubleValue() throw() { -} - - -void TDoubleValue::__set_value(const double val) { - this->value = val; -__isset.value = true; -} -std::ostream& operator<<(std::ostream& out, const TDoubleValue& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TDoubleValue::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_DOUBLE) { - xfer += iprot->readDouble(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TDoubleValue::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TDoubleValue"); - - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_DOUBLE, 1); - xfer += oprot->writeDouble(this->value); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TDoubleValue &a, TDoubleValue &b) { - using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -TDoubleValue::TDoubleValue(const TDoubleValue& other71) { - value = other71.value; - __isset = other71.__isset; -} -TDoubleValue& TDoubleValue::operator=(const TDoubleValue& other72) { - value = other72.value; - __isset = other72.__isset; - return *this; -} -void TDoubleValue::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TDoubleValue("; - out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); - out << ")"; -} - - -TStringValue::~TStringValue() throw() { -} - - -void TStringValue::__set_value(const std::string& val) { - this->value = val; -__isset.value = true; -} -std::ostream& operator<<(std::ostream& out, const TStringValue& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TStringValue::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->value); - this->__isset.value = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TStringValue::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TStringValue"); - - if (this->__isset.value) { - xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->value); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TStringValue &a, TStringValue &b) { - using ::std::swap; - swap(a.value, b.value); - swap(a.__isset, b.__isset); -} - -TStringValue::TStringValue(const TStringValue& other73) { - value = other73.value; - __isset = other73.__isset; -} -TStringValue& TStringValue::operator=(const TStringValue& other74) { - value = other74.value; - __isset = other74.__isset; - return *this; -} -void TStringValue::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TStringValue("; - out << "value="; (__isset.value ? (out << to_string(value)) : (out << "")); - out << ")"; -} - - -TColumnValue::~TColumnValue() throw() { -} - - -void TColumnValue::__set_boolVal(const TBoolValue& val) { - this->boolVal = val; -__isset.boolVal = true; -} - -void TColumnValue::__set_byteVal(const TByteValue& val) { - this->byteVal = val; -__isset.byteVal = true; -} - -void TColumnValue::__set_i16Val(const TI16Value& val) { - this->i16Val = val; -__isset.i16Val = true; -} - -void TColumnValue::__set_i32Val(const TI32Value& val) { - this->i32Val = val; -__isset.i32Val = true; -} - -void TColumnValue::__set_i64Val(const TI64Value& val) { - this->i64Val = val; -__isset.i64Val = true; -} - -void TColumnValue::__set_doubleVal(const TDoubleValue& val) { - this->doubleVal = val; -__isset.doubleVal = true; -} - -void TColumnValue::__set_stringVal(const TStringValue& val) { - this->stringVal = val; -__isset.stringVal = true; -} -std::ostream& operator<<(std::ostream& out, const TColumnValue& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TColumnValue::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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->boolVal.read(iprot); - this->__isset.boolVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->byteVal.read(iprot); - this->__isset.byteVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->i16Val.read(iprot); - this->__isset.i16Val = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->i32Val.read(iprot); - this->__isset.i32Val = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->i64Val.read(iprot); - this->__isset.i64Val = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->doubleVal.read(iprot); - this->__isset.doubleVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 7: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->stringVal.read(iprot); - this->__isset.stringVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TColumnValue::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TColumnValue"); - - if (this->__isset.boolVal) { - xfer += oprot->writeFieldBegin("boolVal", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->boolVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.byteVal) { - xfer += oprot->writeFieldBegin("byteVal", ::apache::thrift::protocol::T_STRUCT, 2); - xfer += this->byteVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.i16Val) { - xfer += oprot->writeFieldBegin("i16Val", ::apache::thrift::protocol::T_STRUCT, 3); - xfer += this->i16Val.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.i32Val) { - xfer += oprot->writeFieldBegin("i32Val", ::apache::thrift::protocol::T_STRUCT, 4); - xfer += this->i32Val.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.i64Val) { - xfer += oprot->writeFieldBegin("i64Val", ::apache::thrift::protocol::T_STRUCT, 5); - xfer += this->i64Val.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.doubleVal) { - xfer += oprot->writeFieldBegin("doubleVal", ::apache::thrift::protocol::T_STRUCT, 6); - xfer += this->doubleVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.stringVal) { - xfer += oprot->writeFieldBegin("stringVal", ::apache::thrift::protocol::T_STRUCT, 7); - xfer += this->stringVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TColumnValue &a, TColumnValue &b) { - using ::std::swap; - swap(a.boolVal, b.boolVal); - swap(a.byteVal, b.byteVal); - swap(a.i16Val, b.i16Val); - swap(a.i32Val, b.i32Val); - swap(a.i64Val, b.i64Val); - swap(a.doubleVal, b.doubleVal); - swap(a.stringVal, b.stringVal); - swap(a.__isset, b.__isset); -} - -TColumnValue::TColumnValue(const TColumnValue& other75) { - boolVal = other75.boolVal; - byteVal = other75.byteVal; - i16Val = other75.i16Val; - i32Val = other75.i32Val; - i64Val = other75.i64Val; - doubleVal = other75.doubleVal; - stringVal = other75.stringVal; - __isset = other75.__isset; -} -TColumnValue& TColumnValue::operator=(const TColumnValue& other76) { - boolVal = other76.boolVal; - byteVal = other76.byteVal; - i16Val = other76.i16Val; - i32Val = other76.i32Val; - i64Val = other76.i64Val; - doubleVal = other76.doubleVal; - stringVal = other76.stringVal; - __isset = other76.__isset; - return *this; -} -void TColumnValue::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TColumnValue("; - out << "boolVal="; (__isset.boolVal ? (out << to_string(boolVal)) : (out << "")); - out << ", " << "byteVal="; (__isset.byteVal ? (out << to_string(byteVal)) : (out << "")); - out << ", " << "i16Val="; (__isset.i16Val ? (out << to_string(i16Val)) : (out << "")); - out << ", " << "i32Val="; (__isset.i32Val ? (out << to_string(i32Val)) : (out << "")); - out << ", " << "i64Val="; (__isset.i64Val ? (out << to_string(i64Val)) : (out << "")); - out << ", " << "doubleVal="; (__isset.doubleVal ? (out << to_string(doubleVal)) : (out << "")); - out << ", " << "stringVal="; (__isset.stringVal ? (out << to_string(stringVal)) : (out << "")); - out << ")"; -} - - -TRow::~TRow() throw() { -} - - -void TRow::__set_colVals(const std::vector & val) { - this->colVals = val; -} -std::ostream& operator<<(std::ostream& out, const TRow& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TRow::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_colVals = 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_LIST) { - { - this->colVals.clear(); - uint32_t _size77; - ::apache::thrift::protocol::TType _etype80; - xfer += iprot->readListBegin(_etype80, _size77); - this->colVals.resize(_size77); - uint32_t _i81; - for (_i81 = 0; _i81 < _size77; ++_i81) - { - xfer += this->colVals[_i81].read(iprot); - } - xfer += iprot->readListEnd(); - } - isset_colVals = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_colVals) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TRow::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TRow"); - - xfer += oprot->writeFieldBegin("colVals", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->colVals.size())); - std::vector ::const_iterator _iter82; - for (_iter82 = this->colVals.begin(); _iter82 != this->colVals.end(); ++_iter82) - { - xfer += (*_iter82).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TRow &a, TRow &b) { - using ::std::swap; - swap(a.colVals, b.colVals); -} - -TRow::TRow(const TRow& other83) { - colVals = other83.colVals; -} -TRow& TRow::operator=(const TRow& other84) { - colVals = other84.colVals; - return *this; -} -void TRow::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TRow("; - out << "colVals=" << to_string(colVals); - out << ")"; -} - - -TBoolColumn::~TBoolColumn() throw() { -} - - -void TBoolColumn::__set_values(const std::vector & val) { - this->values = val; -} - -void TBoolColumn::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TBoolColumn& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TBoolColumn::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size85; - ::apache::thrift::protocol::TType _etype88; - xfer += iprot->readListBegin(_etype88, _size85); - this->values.resize(_size85); - uint32_t _i89; - for (_i89 = 0; _i89 < _size85; ++_i89) - { - xfer += iprot->readBool(this->values[_i89]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TBoolColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TBoolColumn"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_BOOL, static_cast(this->values.size())); - std::vector ::const_iterator _iter90; - for (_iter90 = this->values.begin(); _iter90 != this->values.end(); ++_iter90) - { - xfer += oprot->writeBool((*_iter90)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TBoolColumn &a, TBoolColumn &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TBoolColumn::TBoolColumn(const TBoolColumn& other91) { - values = other91.values; - nulls = other91.nulls; -} -TBoolColumn& TBoolColumn::operator=(const TBoolColumn& other92) { - values = other92.values; - nulls = other92.nulls; - return *this; -} -void TBoolColumn::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TBoolColumn("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TByteColumn::~TByteColumn() throw() { -} - - -void TByteColumn::__set_values(const std::vector & val) { - this->values = val; -} - -void TByteColumn::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TByteColumn& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TByteColumn::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size93; - ::apache::thrift::protocol::TType _etype96; - xfer += iprot->readListBegin(_etype96, _size93); - this->values.resize(_size93); - uint32_t _i97; - for (_i97 = 0; _i97 < _size93; ++_i97) - { - xfer += iprot->readByte(this->values[_i97]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TByteColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TByteColumn"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_BYTE, static_cast(this->values.size())); - std::vector ::const_iterator _iter98; - for (_iter98 = this->values.begin(); _iter98 != this->values.end(); ++_iter98) - { - xfer += oprot->writeByte((*_iter98)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TByteColumn &a, TByteColumn &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TByteColumn::TByteColumn(const TByteColumn& other99) { - values = other99.values; - nulls = other99.nulls; -} -TByteColumn& TByteColumn::operator=(const TByteColumn& other100) { - values = other100.values; - nulls = other100.nulls; - return *this; -} -void TByteColumn::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TByteColumn("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TI16Column::~TI16Column() throw() { -} - - -void TI16Column::__set_values(const std::vector & val) { - this->values = val; -} - -void TI16Column::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TI16Column& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TI16Column::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size101; - ::apache::thrift::protocol::TType _etype104; - xfer += iprot->readListBegin(_etype104, _size101); - this->values.resize(_size101); - uint32_t _i105; - for (_i105 = 0; _i105 < _size101; ++_i105) - { - xfer += iprot->readI16(this->values[_i105]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TI16Column::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TI16Column"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I16, static_cast(this->values.size())); - std::vector ::const_iterator _iter106; - for (_iter106 = this->values.begin(); _iter106 != this->values.end(); ++_iter106) - { - xfer += oprot->writeI16((*_iter106)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TI16Column &a, TI16Column &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TI16Column::TI16Column(const TI16Column& other107) { - values = other107.values; - nulls = other107.nulls; -} -TI16Column& TI16Column::operator=(const TI16Column& other108) { - values = other108.values; - nulls = other108.nulls; - return *this; -} -void TI16Column::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TI16Column("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TI32Column::~TI32Column() throw() { -} - - -void TI32Column::__set_values(const std::vector & val) { - this->values = val; -} - -void TI32Column::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TI32Column& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TI32Column::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size109; - ::apache::thrift::protocol::TType _etype112; - xfer += iprot->readListBegin(_etype112, _size109); - this->values.resize(_size109); - uint32_t _i113; - for (_i113 = 0; _i113 < _size109; ++_i113) - { - xfer += iprot->readI32(this->values[_i113]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TI32Column::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TI32Column"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast(this->values.size())); - std::vector ::const_iterator _iter114; - for (_iter114 = this->values.begin(); _iter114 != this->values.end(); ++_iter114) - { - xfer += oprot->writeI32((*_iter114)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TI32Column &a, TI32Column &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TI32Column::TI32Column(const TI32Column& other115) { - values = other115.values; - nulls = other115.nulls; -} -TI32Column& TI32Column::operator=(const TI32Column& other116) { - values = other116.values; - nulls = other116.nulls; - return *this; -} -void TI32Column::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TI32Column("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TI64Column::~TI64Column() throw() { -} - - -void TI64Column::__set_values(const std::vector & val) { - this->values = val; -} - -void TI64Column::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TI64Column& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TI64Column::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size117; - ::apache::thrift::protocol::TType _etype120; - xfer += iprot->readListBegin(_etype120, _size117); - this->values.resize(_size117); - uint32_t _i121; - for (_i121 = 0; _i121 < _size117; ++_i121) - { - xfer += iprot->readI64(this->values[_i121]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TI64Column::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TI64Column"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast(this->values.size())); - std::vector ::const_iterator _iter122; - for (_iter122 = this->values.begin(); _iter122 != this->values.end(); ++_iter122) - { - xfer += oprot->writeI64((*_iter122)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TI64Column &a, TI64Column &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TI64Column::TI64Column(const TI64Column& other123) { - values = other123.values; - nulls = other123.nulls; -} -TI64Column& TI64Column::operator=(const TI64Column& other124) { - values = other124.values; - nulls = other124.nulls; - return *this; -} -void TI64Column::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TI64Column("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TDoubleColumn::~TDoubleColumn() throw() { -} - - -void TDoubleColumn::__set_values(const std::vector & val) { - this->values = val; -} - -void TDoubleColumn::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TDoubleColumn& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TDoubleColumn::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size125; - ::apache::thrift::protocol::TType _etype128; - xfer += iprot->readListBegin(_etype128, _size125); - this->values.resize(_size125); - uint32_t _i129; - for (_i129 = 0; _i129 < _size125; ++_i129) - { - xfer += iprot->readDouble(this->values[_i129]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TDoubleColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TDoubleColumn"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_DOUBLE, static_cast(this->values.size())); - std::vector ::const_iterator _iter130; - for (_iter130 = this->values.begin(); _iter130 != this->values.end(); ++_iter130) - { - xfer += oprot->writeDouble((*_iter130)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TDoubleColumn &a, TDoubleColumn &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TDoubleColumn::TDoubleColumn(const TDoubleColumn& other131) { - values = other131.values; - nulls = other131.nulls; -} -TDoubleColumn& TDoubleColumn::operator=(const TDoubleColumn& other132) { - values = other132.values; - nulls = other132.nulls; - return *this; -} -void TDoubleColumn::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TDoubleColumn("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TStringColumn::~TStringColumn() throw() { -} - - -void TStringColumn::__set_values(const std::vector & val) { - this->values = val; -} - -void TStringColumn::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TStringColumn& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TStringColumn::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size133; - ::apache::thrift::protocol::TType _etype136; - xfer += iprot->readListBegin(_etype136, _size133); - this->values.resize(_size133); - uint32_t _i137; - for (_i137 = 0; _i137 < _size133; ++_i137) - { - xfer += iprot->readString(this->values[_i137]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TStringColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TStringColumn"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); - std::vector ::const_iterator _iter138; - for (_iter138 = this->values.begin(); _iter138 != this->values.end(); ++_iter138) - { - xfer += oprot->writeString((*_iter138)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TStringColumn &a, TStringColumn &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TStringColumn::TStringColumn(const TStringColumn& other139) { - values = other139.values; - nulls = other139.nulls; -} -TStringColumn& TStringColumn::operator=(const TStringColumn& other140) { - values = other140.values; - nulls = other140.nulls; - return *this; -} -void TStringColumn::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TStringColumn("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TBinaryColumn::~TBinaryColumn() throw() { -} - - -void TBinaryColumn::__set_values(const std::vector & val) { - this->values = val; -} - -void TBinaryColumn::__set_nulls(const std::string& val) { - this->nulls = val; -} -std::ostream& operator<<(std::ostream& out, const TBinaryColumn& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TBinaryColumn::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_values = false; - bool isset_nulls = 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_LIST) { - { - this->values.clear(); - uint32_t _size141; - ::apache::thrift::protocol::TType _etype144; - xfer += iprot->readListBegin(_etype144, _size141); - this->values.resize(_size141); - uint32_t _i145; - for (_i145 = 0; _i145 < _size141; ++_i145) - { - xfer += iprot->readBinary(this->values[_i145]); - } - xfer += iprot->readListEnd(); - } - isset_values = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->nulls); - isset_nulls = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_values) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_nulls) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TBinaryColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TBinaryColumn"); - - xfer += oprot->writeFieldBegin("values", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->values.size())); - std::vector ::const_iterator _iter146; - for (_iter146 = this->values.begin(); _iter146 != this->values.end(); ++_iter146) - { - xfer += oprot->writeBinary((*_iter146)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("nulls", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->nulls); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TBinaryColumn &a, TBinaryColumn &b) { - using ::std::swap; - swap(a.values, b.values); - swap(a.nulls, b.nulls); -} - -TBinaryColumn::TBinaryColumn(const TBinaryColumn& other147) { - values = other147.values; - nulls = other147.nulls; -} -TBinaryColumn& TBinaryColumn::operator=(const TBinaryColumn& other148) { - values = other148.values; - nulls = other148.nulls; - return *this; -} -void TBinaryColumn::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TBinaryColumn("; - out << "values=" << to_string(values); - out << ", " << "nulls=" << to_string(nulls); - out << ")"; -} - - -TColumn::~TColumn() throw() { -} - - -void TColumn::__set_boolVal(const TBoolColumn& val) { - this->boolVal = val; -__isset.boolVal = true; -} - -void TColumn::__set_byteVal(const TByteColumn& val) { - this->byteVal = val; -__isset.byteVal = true; -} - -void TColumn::__set_i16Val(const TI16Column& val) { - this->i16Val = val; -__isset.i16Val = true; -} - -void TColumn::__set_i32Val(const TI32Column& val) { - this->i32Val = val; -__isset.i32Val = true; -} - -void TColumn::__set_i64Val(const TI64Column& val) { - this->i64Val = val; -__isset.i64Val = true; -} - -void TColumn::__set_doubleVal(const TDoubleColumn& val) { - this->doubleVal = val; -__isset.doubleVal = true; -} - -void TColumn::__set_stringVal(const TStringColumn& val) { - this->stringVal = val; -__isset.stringVal = true; -} - -void TColumn::__set_binaryVal(const TBinaryColumn& val) { - this->binaryVal = val; -__isset.binaryVal = true; -} -std::ostream& operator<<(std::ostream& out, const TColumn& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TColumn::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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->boolVal.read(iprot); - this->__isset.boolVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->byteVal.read(iprot); - this->__isset.byteVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->i16Val.read(iprot); - this->__isset.i16Val = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->i32Val.read(iprot); - this->__isset.i32Val = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->i64Val.read(iprot); - this->__isset.i64Val = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->doubleVal.read(iprot); - this->__isset.doubleVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 7: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->stringVal.read(iprot); - this->__isset.stringVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 8: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->binaryVal.read(iprot); - this->__isset.binaryVal = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TColumn::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TColumn"); - - if (this->__isset.boolVal) { - xfer += oprot->writeFieldBegin("boolVal", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->boolVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.byteVal) { - xfer += oprot->writeFieldBegin("byteVal", ::apache::thrift::protocol::T_STRUCT, 2); - xfer += this->byteVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.i16Val) { - xfer += oprot->writeFieldBegin("i16Val", ::apache::thrift::protocol::T_STRUCT, 3); - xfer += this->i16Val.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.i32Val) { - xfer += oprot->writeFieldBegin("i32Val", ::apache::thrift::protocol::T_STRUCT, 4); - xfer += this->i32Val.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.i64Val) { - xfer += oprot->writeFieldBegin("i64Val", ::apache::thrift::protocol::T_STRUCT, 5); - xfer += this->i64Val.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.doubleVal) { - xfer += oprot->writeFieldBegin("doubleVal", ::apache::thrift::protocol::T_STRUCT, 6); - xfer += this->doubleVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.stringVal) { - xfer += oprot->writeFieldBegin("stringVal", ::apache::thrift::protocol::T_STRUCT, 7); - xfer += this->stringVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.binaryVal) { - xfer += oprot->writeFieldBegin("binaryVal", ::apache::thrift::protocol::T_STRUCT, 8); - xfer += this->binaryVal.write(oprot); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TColumn &a, TColumn &b) { - using ::std::swap; - swap(a.boolVal, b.boolVal); - swap(a.byteVal, b.byteVal); - swap(a.i16Val, b.i16Val); - swap(a.i32Val, b.i32Val); - swap(a.i64Val, b.i64Val); - swap(a.doubleVal, b.doubleVal); - swap(a.stringVal, b.stringVal); - swap(a.binaryVal, b.binaryVal); - swap(a.__isset, b.__isset); -} - -TColumn::TColumn(const TColumn& other149) { - boolVal = other149.boolVal; - byteVal = other149.byteVal; - i16Val = other149.i16Val; - i32Val = other149.i32Val; - i64Val = other149.i64Val; - doubleVal = other149.doubleVal; - stringVal = other149.stringVal; - binaryVal = other149.binaryVal; - __isset = other149.__isset; -} -TColumn& TColumn::operator=(const TColumn& other150) { - boolVal = other150.boolVal; - byteVal = other150.byteVal; - i16Val = other150.i16Val; - i32Val = other150.i32Val; - i64Val = other150.i64Val; - doubleVal = other150.doubleVal; - stringVal = other150.stringVal; - binaryVal = other150.binaryVal; - __isset = other150.__isset; - return *this; -} -void TColumn::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TColumn("; - out << "boolVal="; (__isset.boolVal ? (out << to_string(boolVal)) : (out << "")); - out << ", " << "byteVal="; (__isset.byteVal ? (out << to_string(byteVal)) : (out << "")); - out << ", " << "i16Val="; (__isset.i16Val ? (out << to_string(i16Val)) : (out << "")); - out << ", " << "i32Val="; (__isset.i32Val ? (out << to_string(i32Val)) : (out << "")); - out << ", " << "i64Val="; (__isset.i64Val ? (out << to_string(i64Val)) : (out << "")); - out << ", " << "doubleVal="; (__isset.doubleVal ? (out << to_string(doubleVal)) : (out << "")); - out << ", " << "stringVal="; (__isset.stringVal ? (out << to_string(stringVal)) : (out << "")); - out << ", " << "binaryVal="; (__isset.binaryVal ? (out << to_string(binaryVal)) : (out << "")); - out << ")"; -} - - -TRowSet::~TRowSet() throw() { -} - - -void TRowSet::__set_startRowOffset(const int64_t val) { - this->startRowOffset = val; -} - -void TRowSet::__set_rows(const std::vector & val) { - this->rows = val; -} - -void TRowSet::__set_columns(const std::vector & val) { - this->columns = val; -__isset.columns = true; -} - -void TRowSet::__set_binaryColumns(const std::string& val) { - this->binaryColumns = val; -__isset.binaryColumns = true; -} - -void TRowSet::__set_columnCount(const int32_t val) { - this->columnCount = val; -__isset.columnCount = true; -} -std::ostream& operator<<(std::ostream& out, const TRowSet& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TRowSet::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_startRowOffset = false; - bool isset_rows = 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_I64) { - xfer += iprot->readI64(this->startRowOffset); - isset_startRowOffset = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->rows.clear(); - uint32_t _size151; - ::apache::thrift::protocol::TType _etype154; - xfer += iprot->readListBegin(_etype154, _size151); - this->rows.resize(_size151); - uint32_t _i155; - for (_i155 = 0; _i155 < _size151; ++_i155) - { - xfer += this->rows[_i155].read(iprot); - } - xfer += iprot->readListEnd(); - } - isset_rows = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->columns.clear(); - uint32_t _size156; - ::apache::thrift::protocol::TType _etype159; - xfer += iprot->readListBegin(_etype159, _size156); - this->columns.resize(_size156); - uint32_t _i160; - for (_i160 = 0; _i160 < _size156; ++_i160) - { - xfer += this->columns[_i160].read(iprot); - } - xfer += iprot->readListEnd(); - } - this->__isset.columns = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->binaryColumns); - this->__isset.binaryColumns = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->columnCount); - this->__isset.columnCount = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_startRowOffset) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_rows) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TRowSet::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TRowSet"); - - xfer += oprot->writeFieldBegin("startRowOffset", ::apache::thrift::protocol::T_I64, 1); - xfer += oprot->writeI64(this->startRowOffset); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->rows.size())); - std::vector ::const_iterator _iter161; - for (_iter161 = this->rows.begin(); _iter161 != this->rows.end(); ++_iter161) - { - xfer += (*_iter161).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - if (this->__isset.columns) { - xfer += oprot->writeFieldBegin("columns", ::apache::thrift::protocol::T_LIST, 3); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast(this->columns.size())); - std::vector ::const_iterator _iter162; - for (_iter162 = this->columns.begin(); _iter162 != this->columns.end(); ++_iter162) - { - xfer += (*_iter162).write(oprot); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.binaryColumns) { - xfer += oprot->writeFieldBegin("binaryColumns", ::apache::thrift::protocol::T_STRING, 4); - xfer += oprot->writeBinary(this->binaryColumns); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.columnCount) { - xfer += oprot->writeFieldBegin("columnCount", ::apache::thrift::protocol::T_I32, 5); - xfer += oprot->writeI32(this->columnCount); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TRowSet &a, TRowSet &b) { - using ::std::swap; - swap(a.startRowOffset, b.startRowOffset); - swap(a.rows, b.rows); - swap(a.columns, b.columns); - swap(a.binaryColumns, b.binaryColumns); - swap(a.columnCount, b.columnCount); - swap(a.__isset, b.__isset); -} - -TRowSet::TRowSet(const TRowSet& other163) { - startRowOffset = other163.startRowOffset; - rows = other163.rows; - columns = other163.columns; - binaryColumns = other163.binaryColumns; - columnCount = other163.columnCount; - __isset = other163.__isset; -} -TRowSet& TRowSet::operator=(const TRowSet& other164) { - startRowOffset = other164.startRowOffset; - rows = other164.rows; - columns = other164.columns; - binaryColumns = other164.binaryColumns; - columnCount = other164.columnCount; - __isset = other164.__isset; - return *this; -} -void TRowSet::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TRowSet("; - out << "startRowOffset=" << to_string(startRowOffset); - out << ", " << "rows=" << to_string(rows); - out << ", " << "columns="; (__isset.columns ? (out << to_string(columns)) : (out << "")); - out << ", " << "binaryColumns="; (__isset.binaryColumns ? (out << to_string(binaryColumns)) : (out << "")); - out << ", " << "columnCount="; (__isset.columnCount ? (out << to_string(columnCount)) : (out << "")); - out << ")"; -} - - -TStatus::~TStatus() throw() { -} - - -void TStatus::__set_statusCode(const TStatusCode::type val) { - this->statusCode = val; -} - -void TStatus::__set_infoMessages(const std::vector & val) { - this->infoMessages = val; -__isset.infoMessages = true; -} - -void TStatus::__set_sqlState(const std::string& val) { - this->sqlState = val; -__isset.sqlState = true; -} - -void TStatus::__set_errorCode(const int32_t val) { - this->errorCode = val; -__isset.errorCode = true; -} - -void TStatus::__set_errorMessage(const std::string& val) { - this->errorMessage = val; -__isset.errorMessage = true; -} -std::ostream& operator<<(std::ostream& out, const TStatus& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TStatus::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_statusCode = 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_I32) { - int32_t ecast165; - xfer += iprot->readI32(ecast165); - this->statusCode = (TStatusCode::type)ecast165; - isset_statusCode = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->infoMessages.clear(); - uint32_t _size166; - ::apache::thrift::protocol::TType _etype169; - xfer += iprot->readListBegin(_etype169, _size166); - this->infoMessages.resize(_size166); - uint32_t _i170; - for (_i170 = 0; _i170 < _size166; ++_i170) - { - xfer += iprot->readString(this->infoMessages[_i170]); - } - xfer += iprot->readListEnd(); - } - this->__isset.infoMessages = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->sqlState); - this->__isset.sqlState = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->errorCode); - this->__isset.errorCode = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->errorMessage); - this->__isset.errorMessage = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_statusCode) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TStatus::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TStatus"); - - xfer += oprot->writeFieldBegin("statusCode", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32((int32_t)this->statusCode); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.infoMessages) { - xfer += oprot->writeFieldBegin("infoMessages", ::apache::thrift::protocol::T_LIST, 2); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->infoMessages.size())); - std::vector ::const_iterator _iter171; - for (_iter171 = this->infoMessages.begin(); _iter171 != this->infoMessages.end(); ++_iter171) - { - xfer += oprot->writeString((*_iter171)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.sqlState) { - xfer += oprot->writeFieldBegin("sqlState", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->sqlState); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.errorCode) { - xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I32, 4); - xfer += oprot->writeI32(this->errorCode); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.errorMessage) { - xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 5); - xfer += oprot->writeString(this->errorMessage); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TStatus &a, TStatus &b) { - using ::std::swap; - swap(a.statusCode, b.statusCode); - swap(a.infoMessages, b.infoMessages); - swap(a.sqlState, b.sqlState); - swap(a.errorCode, b.errorCode); - swap(a.errorMessage, b.errorMessage); - swap(a.__isset, b.__isset); -} - -TStatus::TStatus(const TStatus& other172) { - statusCode = other172.statusCode; - infoMessages = other172.infoMessages; - sqlState = other172.sqlState; - errorCode = other172.errorCode; - errorMessage = other172.errorMessage; - __isset = other172.__isset; -} -TStatus& TStatus::operator=(const TStatus& other173) { - statusCode = other173.statusCode; - infoMessages = other173.infoMessages; - sqlState = other173.sqlState; - errorCode = other173.errorCode; - errorMessage = other173.errorMessage; - __isset = other173.__isset; - return *this; -} -void TStatus::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TStatus("; - out << "statusCode=" << to_string(statusCode); - out << ", " << "infoMessages="; (__isset.infoMessages ? (out << to_string(infoMessages)) : (out << "")); - out << ", " << "sqlState="; (__isset.sqlState ? (out << to_string(sqlState)) : (out << "")); - out << ", " << "errorCode="; (__isset.errorCode ? (out << to_string(errorCode)) : (out << "")); - out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); - out << ")"; -} - - -THandleIdentifier::~THandleIdentifier() throw() { -} - - -void THandleIdentifier::__set_guid(const std::string& val) { - this->guid = val; -} - -void THandleIdentifier::__set_secret(const std::string& val) { - this->secret = val; -} -std::ostream& operator<<(std::ostream& out, const THandleIdentifier& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t THandleIdentifier::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_guid = false; - bool isset_secret = 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_STRING) { - xfer += iprot->readBinary(this->guid); - isset_guid = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readBinary(this->secret); - isset_secret = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_guid) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_secret) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t THandleIdentifier::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("THandleIdentifier"); - - xfer += oprot->writeFieldBegin("guid", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeBinary(this->guid); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("secret", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeBinary(this->secret); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(THandleIdentifier &a, THandleIdentifier &b) { - using ::std::swap; - swap(a.guid, b.guid); - swap(a.secret, b.secret); -} - -THandleIdentifier::THandleIdentifier(const THandleIdentifier& other174) { - guid = other174.guid; - secret = other174.secret; -} -THandleIdentifier& THandleIdentifier::operator=(const THandleIdentifier& other175) { - guid = other175.guid; - secret = other175.secret; - return *this; -} -void THandleIdentifier::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "THandleIdentifier("; - out << "guid=" << to_string(guid); - out << ", " << "secret=" << to_string(secret); - out << ")"; -} - - -TSessionHandle::~TSessionHandle() throw() { -} - - -void TSessionHandle::__set_sessionId(const THandleIdentifier& val) { - this->sessionId = val; -} -std::ostream& operator<<(std::ostream& out, const TSessionHandle& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TSessionHandle::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_sessionId = 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->sessionId.read(iprot); - isset_sessionId = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_sessionId) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TSessionHandle::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TSessionHandle"); - - xfer += oprot->writeFieldBegin("sessionId", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionId.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TSessionHandle &a, TSessionHandle &b) { - using ::std::swap; - swap(a.sessionId, b.sessionId); -} - -TSessionHandle::TSessionHandle(const TSessionHandle& other176) { - sessionId = other176.sessionId; -} -TSessionHandle& TSessionHandle::operator=(const TSessionHandle& other177) { - sessionId = other177.sessionId; - return *this; -} -void TSessionHandle::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TSessionHandle("; - out << "sessionId=" << to_string(sessionId); - out << ")"; -} - - -TOperationHandle::~TOperationHandle() throw() { -} - - -void TOperationHandle::__set_operationId(const THandleIdentifier& val) { - this->operationId = val; -} - -void TOperationHandle::__set_operationType(const TOperationType::type val) { - this->operationType = val; -} - -void TOperationHandle::__set_hasResultSet(const bool val) { - this->hasResultSet = val; -} - -void TOperationHandle::__set_modifiedRowCount(const double val) { - this->modifiedRowCount = val; -__isset.modifiedRowCount = true; -} -std::ostream& operator<<(std::ostream& out, const TOperationHandle& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TOperationHandle::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_operationId = false; - bool isset_operationType = false; - bool isset_hasResultSet = 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->operationId.read(iprot); - isset_operationId = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast178; - xfer += iprot->readI32(ecast178); - this->operationType = (TOperationType::type)ecast178; - isset_operationType = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->hasResultSet); - isset_hasResultSet = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_DOUBLE) { - xfer += iprot->readDouble(this->modifiedRowCount); - this->__isset.modifiedRowCount = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_operationId) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_operationType) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_hasResultSet) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TOperationHandle::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TOperationHandle"); - - xfer += oprot->writeFieldBegin("operationId", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->operationId.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("operationType", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32((int32_t)this->operationType); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("hasResultSet", ::apache::thrift::protocol::T_BOOL, 3); - xfer += oprot->writeBool(this->hasResultSet); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.modifiedRowCount) { - xfer += oprot->writeFieldBegin("modifiedRowCount", ::apache::thrift::protocol::T_DOUBLE, 4); - xfer += oprot->writeDouble(this->modifiedRowCount); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TOperationHandle &a, TOperationHandle &b) { - using ::std::swap; - swap(a.operationId, b.operationId); - swap(a.operationType, b.operationType); - swap(a.hasResultSet, b.hasResultSet); - swap(a.modifiedRowCount, b.modifiedRowCount); - swap(a.__isset, b.__isset); -} - -TOperationHandle::TOperationHandle(const TOperationHandle& other179) { - operationId = other179.operationId; - operationType = other179.operationType; - hasResultSet = other179.hasResultSet; - modifiedRowCount = other179.modifiedRowCount; - __isset = other179.__isset; -} -TOperationHandle& TOperationHandle::operator=(const TOperationHandle& other180) { - operationId = other180.operationId; - operationType = other180.operationType; - hasResultSet = other180.hasResultSet; - modifiedRowCount = other180.modifiedRowCount; - __isset = other180.__isset; - return *this; -} -void TOperationHandle::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TOperationHandle("; - out << "operationId=" << to_string(operationId); - out << ", " << "operationType=" << to_string(operationType); - out << ", " << "hasResultSet=" << to_string(hasResultSet); - out << ", " << "modifiedRowCount="; (__isset.modifiedRowCount ? (out << to_string(modifiedRowCount)) : (out << "")); - out << ")"; -} - - -TOpenSessionReq::~TOpenSessionReq() throw() { -} - - -void TOpenSessionReq::__set_client_protocol(const TProtocolVersion::type val) { - this->client_protocol = val; -} - -void TOpenSessionReq::__set_username(const std::string& val) { - this->username = val; -__isset.username = true; -} - -void TOpenSessionReq::__set_password(const std::string& val) { - this->password = val; -__isset.password = true; -} - -void TOpenSessionReq::__set_configuration(const std::map & val) { - this->configuration = val; -__isset.configuration = true; -} -std::ostream& operator<<(std::ostream& out, const TOpenSessionReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TOpenSessionReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_client_protocol = 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_I32) { - int32_t ecast181; - xfer += iprot->readI32(ecast181); - this->client_protocol = (TProtocolVersion::type)ecast181; - isset_client_protocol = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->username); - this->__isset.username = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->password); - this->__isset.password = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_MAP) { - { - this->configuration.clear(); - uint32_t _size182; - ::apache::thrift::protocol::TType _ktype183; - ::apache::thrift::protocol::TType _vtype184; - xfer += iprot->readMapBegin(_ktype183, _vtype184, _size182); - uint32_t _i186; - for (_i186 = 0; _i186 < _size182; ++_i186) - { - std::string _key187; - xfer += iprot->readString(_key187); - std::string& _val188 = this->configuration[_key187]; - xfer += iprot->readString(_val188); - } - xfer += iprot->readMapEnd(); - } - this->__isset.configuration = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_client_protocol) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TOpenSessionReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TOpenSessionReq"); - - xfer += oprot->writeFieldBegin("client_protocol", ::apache::thrift::protocol::T_I32, 1); - xfer += oprot->writeI32((int32_t)this->client_protocol); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.username) { - xfer += oprot->writeFieldBegin("username", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->username); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.password) { - xfer += oprot->writeFieldBegin("password", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->password); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.configuration) { - xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 4); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); - std::map ::const_iterator _iter189; - for (_iter189 = this->configuration.begin(); _iter189 != this->configuration.end(); ++_iter189) - { - xfer += oprot->writeString(_iter189->first); - xfer += oprot->writeString(_iter189->second); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TOpenSessionReq &a, TOpenSessionReq &b) { - using ::std::swap; - swap(a.client_protocol, b.client_protocol); - swap(a.username, b.username); - swap(a.password, b.password); - swap(a.configuration, b.configuration); - swap(a.__isset, b.__isset); -} - -TOpenSessionReq::TOpenSessionReq(const TOpenSessionReq& other190) { - client_protocol = other190.client_protocol; - username = other190.username; - password = other190.password; - configuration = other190.configuration; - __isset = other190.__isset; -} -TOpenSessionReq& TOpenSessionReq::operator=(const TOpenSessionReq& other191) { - client_protocol = other191.client_protocol; - username = other191.username; - password = other191.password; - configuration = other191.configuration; - __isset = other191.__isset; - return *this; -} -void TOpenSessionReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TOpenSessionReq("; - out << "client_protocol=" << to_string(client_protocol); - out << ", " << "username="; (__isset.username ? (out << to_string(username)) : (out << "")); - out << ", " << "password="; (__isset.password ? (out << to_string(password)) : (out << "")); - out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); - out << ")"; -} - - -TOpenSessionResp::~TOpenSessionResp() throw() { -} - - -void TOpenSessionResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TOpenSessionResp::__set_serverProtocolVersion(const TProtocolVersion::type val) { - this->serverProtocolVersion = val; -} - -void TOpenSessionResp::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -__isset.sessionHandle = true; -} - -void TOpenSessionResp::__set_configuration(const std::map & val) { - this->configuration = val; -__isset.configuration = true; -} -std::ostream& operator<<(std::ostream& out, const TOpenSessionResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TOpenSessionResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_serverProtocolVersion = 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_I32) { - int32_t ecast192; - xfer += iprot->readI32(ecast192); - this->serverProtocolVersion = (TProtocolVersion::type)ecast192; - isset_serverProtocolVersion = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->sessionHandle.read(iprot); - this->__isset.sessionHandle = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_MAP) { - { - this->configuration.clear(); - uint32_t _size193; - ::apache::thrift::protocol::TType _ktype194; - ::apache::thrift::protocol::TType _vtype195; - xfer += iprot->readMapBegin(_ktype194, _vtype195, _size193); - uint32_t _i197; - for (_i197 = 0; _i197 < _size193; ++_i197) - { - std::string _key198; - xfer += iprot->readString(_key198); - std::string& _val199 = this->configuration[_key198]; - xfer += iprot->readString(_val199); - } - xfer += iprot->readMapEnd(); - } - this->__isset.configuration = 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_serverProtocolVersion) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TOpenSessionResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TOpenSessionResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("serverProtocolVersion", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32((int32_t)this->serverProtocolVersion); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.sessionHandle) { - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 3); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.configuration) { - xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 4); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); - std::map ::const_iterator _iter200; - for (_iter200 = this->configuration.begin(); _iter200 != this->configuration.end(); ++_iter200) - { - xfer += oprot->writeString(_iter200->first); - xfer += oprot->writeString(_iter200->second); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TOpenSessionResp &a, TOpenSessionResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.serverProtocolVersion, b.serverProtocolVersion); - swap(a.sessionHandle, b.sessionHandle); - swap(a.configuration, b.configuration); - swap(a.__isset, b.__isset); -} - -TOpenSessionResp::TOpenSessionResp(const TOpenSessionResp& other201) { - status = other201.status; - serverProtocolVersion = other201.serverProtocolVersion; - sessionHandle = other201.sessionHandle; - configuration = other201.configuration; - __isset = other201.__isset; -} -TOpenSessionResp& TOpenSessionResp::operator=(const TOpenSessionResp& other202) { - status = other202.status; - serverProtocolVersion = other202.serverProtocolVersion; - sessionHandle = other202.sessionHandle; - configuration = other202.configuration; - __isset = other202.__isset; - return *this; -} -void TOpenSessionResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TOpenSessionResp("; - out << "status=" << to_string(status); - out << ", " << "serverProtocolVersion=" << to_string(serverProtocolVersion); - out << ", " << "sessionHandle="; (__isset.sessionHandle ? (out << to_string(sessionHandle)) : (out << "")); - out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); - out << ")"; -} - - -TSetClientInfoReq::~TSetClientInfoReq() throw() { -} - - -void TSetClientInfoReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TSetClientInfoReq::__set_configuration(const std::map & val) { - this->configuration = val; -__isset.configuration = true; -} -std::ostream& operator<<(std::ostream& out, const TSetClientInfoReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TSetClientInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_MAP) { - { - this->configuration.clear(); - uint32_t _size203; - ::apache::thrift::protocol::TType _ktype204; - ::apache::thrift::protocol::TType _vtype205; - xfer += iprot->readMapBegin(_ktype204, _vtype205, _size203); - uint32_t _i207; - for (_i207 = 0; _i207 < _size203; ++_i207) - { - std::string _key208; - xfer += iprot->readString(_key208); - std::string& _val209 = this->configuration[_key208]; - xfer += iprot->readString(_val209); - } - xfer += iprot->readMapEnd(); - } - this->__isset.configuration = 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); - return xfer; -} - -uint32_t TSetClientInfoReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TSetClientInfoReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.configuration) { - xfer += oprot->writeFieldBegin("configuration", ::apache::thrift::protocol::T_MAP, 2); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->configuration.size())); - std::map ::const_iterator _iter210; - for (_iter210 = this->configuration.begin(); _iter210 != this->configuration.end(); ++_iter210) - { - xfer += oprot->writeString(_iter210->first); - xfer += oprot->writeString(_iter210->second); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TSetClientInfoReq &a, TSetClientInfoReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.configuration, b.configuration); - swap(a.__isset, b.__isset); -} - -TSetClientInfoReq::TSetClientInfoReq(const TSetClientInfoReq& other211) { - sessionHandle = other211.sessionHandle; - configuration = other211.configuration; - __isset = other211.__isset; -} -TSetClientInfoReq& TSetClientInfoReq::operator=(const TSetClientInfoReq& other212) { - sessionHandle = other212.sessionHandle; - configuration = other212.configuration; - __isset = other212.__isset; - return *this; -} -void TSetClientInfoReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TSetClientInfoReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "configuration="; (__isset.configuration ? (out << to_string(configuration)) : (out << "")); - out << ")"; -} - - -TSetClientInfoResp::~TSetClientInfoResp() throw() { -} - - -void TSetClientInfoResp::__set_status(const TStatus& val) { - this->status = val; -} -std::ostream& operator<<(std::ostream& out, const TSetClientInfoResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TSetClientInfoResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_status) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TSetClientInfoResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TSetClientInfoResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TSetClientInfoResp &a, TSetClientInfoResp &b) { - using ::std::swap; - swap(a.status, b.status); -} - -TSetClientInfoResp::TSetClientInfoResp(const TSetClientInfoResp& other213) { - status = other213.status; -} -TSetClientInfoResp& TSetClientInfoResp::operator=(const TSetClientInfoResp& other214) { - status = other214.status; - return *this; -} -void TSetClientInfoResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TSetClientInfoResp("; - out << "status=" << to_string(status); - out << ")"; -} - - -TCloseSessionReq::~TCloseSessionReq() throw() { -} - - -void TCloseSessionReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TCloseSessionReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCloseSessionReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_sessionHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCloseSessionReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCloseSessionReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCloseSessionReq &a, TCloseSessionReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); -} - -TCloseSessionReq::TCloseSessionReq(const TCloseSessionReq& other215) { - sessionHandle = other215.sessionHandle; -} -TCloseSessionReq& TCloseSessionReq::operator=(const TCloseSessionReq& other216) { - sessionHandle = other216.sessionHandle; - return *this; -} -void TCloseSessionReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCloseSessionReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ")"; -} - - -TCloseSessionResp::~TCloseSessionResp() throw() { -} - - -void TCloseSessionResp::__set_status(const TStatus& val) { - this->status = val; -} -std::ostream& operator<<(std::ostream& out, const TCloseSessionResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCloseSessionResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_status) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCloseSessionResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCloseSessionResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCloseSessionResp &a, TCloseSessionResp &b) { - using ::std::swap; - swap(a.status, b.status); -} - -TCloseSessionResp::TCloseSessionResp(const TCloseSessionResp& other217) { - status = other217.status; -} -TCloseSessionResp& TCloseSessionResp::operator=(const TCloseSessionResp& other218) { - status = other218.status; - return *this; -} -void TCloseSessionResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCloseSessionResp("; - out << "status=" << to_string(status); - out << ")"; -} - - -TGetInfoValue::~TGetInfoValue() throw() { -} - - -void TGetInfoValue::__set_stringValue(const std::string& val) { - this->stringValue = val; -__isset.stringValue = true; -} - -void TGetInfoValue::__set_smallIntValue(const int16_t val) { - this->smallIntValue = val; -__isset.smallIntValue = true; -} - -void TGetInfoValue::__set_integerBitmask(const int32_t val) { - this->integerBitmask = val; -__isset.integerBitmask = true; -} - -void TGetInfoValue::__set_integerFlag(const int32_t val) { - this->integerFlag = val; -__isset.integerFlag = true; -} - -void TGetInfoValue::__set_binaryValue(const int32_t val) { - this->binaryValue = val; -__isset.binaryValue = true; -} - -void TGetInfoValue::__set_lenValue(const int64_t val) { - this->lenValue = val; -__isset.lenValue = true; -} -std::ostream& operator<<(std::ostream& out, const TGetInfoValue& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetInfoValue::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot); - uint32_t xfer = 0; - std::string fname; - ::apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - using ::apache::thrift::protocol::TProtocolException; - - - while (true) - { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == ::apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) - { - case 1: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->stringValue); - this->__isset.stringValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I16) { - xfer += iprot->readI16(this->smallIntValue); - this->__isset.smallIntValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->integerBitmask); - this->__isset.integerBitmask = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->integerFlag); - this->__isset.integerFlag = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->binaryValue); - this->__isset.binaryValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_I64) { - xfer += iprot->readI64(this->lenValue); - this->__isset.lenValue = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - return xfer; -} - -uint32_t TGetInfoValue::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetInfoValue"); - - if (this->__isset.stringValue) { - xfer += oprot->writeFieldBegin("stringValue", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->stringValue); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.smallIntValue) { - xfer += oprot->writeFieldBegin("smallIntValue", ::apache::thrift::protocol::T_I16, 2); - xfer += oprot->writeI16(this->smallIntValue); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.integerBitmask) { - xfer += oprot->writeFieldBegin("integerBitmask", ::apache::thrift::protocol::T_I32, 3); - xfer += oprot->writeI32(this->integerBitmask); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.integerFlag) { - xfer += oprot->writeFieldBegin("integerFlag", ::apache::thrift::protocol::T_I32, 4); - xfer += oprot->writeI32(this->integerFlag); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.binaryValue) { - xfer += oprot->writeFieldBegin("binaryValue", ::apache::thrift::protocol::T_I32, 5); - xfer += oprot->writeI32(this->binaryValue); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.lenValue) { - xfer += oprot->writeFieldBegin("lenValue", ::apache::thrift::protocol::T_I64, 6); - xfer += oprot->writeI64(this->lenValue); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetInfoValue &a, TGetInfoValue &b) { - using ::std::swap; - swap(a.stringValue, b.stringValue); - swap(a.smallIntValue, b.smallIntValue); - swap(a.integerBitmask, b.integerBitmask); - swap(a.integerFlag, b.integerFlag); - swap(a.binaryValue, b.binaryValue); - swap(a.lenValue, b.lenValue); - swap(a.__isset, b.__isset); -} - -TGetInfoValue::TGetInfoValue(const TGetInfoValue& other219) { - stringValue = other219.stringValue; - smallIntValue = other219.smallIntValue; - integerBitmask = other219.integerBitmask; - integerFlag = other219.integerFlag; - binaryValue = other219.binaryValue; - lenValue = other219.lenValue; - __isset = other219.__isset; -} -TGetInfoValue& TGetInfoValue::operator=(const TGetInfoValue& other220) { - stringValue = other220.stringValue; - smallIntValue = other220.smallIntValue; - integerBitmask = other220.integerBitmask; - integerFlag = other220.integerFlag; - binaryValue = other220.binaryValue; - lenValue = other220.lenValue; - __isset = other220.__isset; - return *this; -} -void TGetInfoValue::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetInfoValue("; - out << "stringValue="; (__isset.stringValue ? (out << to_string(stringValue)) : (out << "")); - out << ", " << "smallIntValue="; (__isset.smallIntValue ? (out << to_string(smallIntValue)) : (out << "")); - out << ", " << "integerBitmask="; (__isset.integerBitmask ? (out << to_string(integerBitmask)) : (out << "")); - out << ", " << "integerFlag="; (__isset.integerFlag ? (out << to_string(integerFlag)) : (out << "")); - out << ", " << "binaryValue="; (__isset.binaryValue ? (out << to_string(binaryValue)) : (out << "")); - out << ", " << "lenValue="; (__isset.lenValue ? (out << to_string(lenValue)) : (out << "")); - out << ")"; -} - - -TGetInfoReq::~TGetInfoReq() throw() { -} - - -void TGetInfoReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetInfoReq::__set_infoType(const TGetInfoType::type val) { - this->infoType = val; -} -std::ostream& operator<<(std::ostream& out, const TGetInfoReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_infoType = 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_I32) { - int32_t ecast221; - xfer += iprot->readI32(ecast221); - this->infoType = (TGetInfoType::type)ecast221; - isset_infoType = 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_infoType) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetInfoReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetInfoReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("infoType", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32((int32_t)this->infoType); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetInfoReq &a, TGetInfoReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.infoType, b.infoType); -} - -TGetInfoReq::TGetInfoReq(const TGetInfoReq& other222) { - sessionHandle = other222.sessionHandle; - infoType = other222.infoType; -} -TGetInfoReq& TGetInfoReq::operator=(const TGetInfoReq& other223) { - sessionHandle = other223.sessionHandle; - infoType = other223.infoType; - return *this; -} -void TGetInfoReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetInfoReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "infoType=" << to_string(infoType); - out << ")"; -} - - -TGetInfoResp::~TGetInfoResp() throw() { -} - - -void TGetInfoResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetInfoResp::__set_infoValue(const TGetInfoValue& val) { - this->infoValue = val; -} -std::ostream& operator<<(std::ostream& out, const TGetInfoResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetInfoResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_infoValue = 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->infoValue.read(iprot); - isset_infoValue = 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_infoValue) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetInfoResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetInfoResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("infoValue", ::apache::thrift::protocol::T_STRUCT, 2); - xfer += this->infoValue.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetInfoResp &a, TGetInfoResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.infoValue, b.infoValue); -} - -TGetInfoResp::TGetInfoResp(const TGetInfoResp& other224) { - status = other224.status; - infoValue = other224.infoValue; -} -TGetInfoResp& TGetInfoResp::operator=(const TGetInfoResp& other225) { - status = other225.status; - infoValue = other225.infoValue; - return *this; -} -void TGetInfoResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetInfoResp("; - out << "status=" << to_string(status); - out << ", " << "infoValue=" << to_string(infoValue); - out << ")"; -} - - -TExecuteStatementReq::~TExecuteStatementReq() throw() { -} - - -void TExecuteStatementReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TExecuteStatementReq::__set_statement(const std::string& val) { - this->statement = val; -} - -void TExecuteStatementReq::__set_confOverlay(const std::map & val) { - this->confOverlay = val; -__isset.confOverlay = true; -} - -void TExecuteStatementReq::__set_runAsync(const bool val) { - this->runAsync = val; -__isset.runAsync = true; -} - -void TExecuteStatementReq::__set_queryTimeout(const int64_t val) { - this->queryTimeout = val; -__isset.queryTimeout = true; -} -std::ostream& operator<<(std::ostream& out, const TExecuteStatementReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TExecuteStatementReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_statement = 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_STRING) { - xfer += iprot->readString(this->statement); - isset_statement = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_MAP) { - { - this->confOverlay.clear(); - uint32_t _size226; - ::apache::thrift::protocol::TType _ktype227; - ::apache::thrift::protocol::TType _vtype228; - xfer += iprot->readMapBegin(_ktype227, _vtype228, _size226); - uint32_t _i230; - for (_i230 = 0; _i230 < _size226; ++_i230) - { - std::string _key231; - xfer += iprot->readString(_key231); - std::string& _val232 = this->confOverlay[_key231]; - xfer += iprot->readString(_val232); - } - xfer += iprot->readMapEnd(); - } - this->__isset.confOverlay = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->runAsync); - this->__isset.runAsync = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_I64) { - xfer += iprot->readI64(this->queryTimeout); - this->__isset.queryTimeout = 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_statement) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TExecuteStatementReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TExecuteStatementReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("statement", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->statement); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.confOverlay) { - xfer += oprot->writeFieldBegin("confOverlay", ::apache::thrift::protocol::T_MAP, 3); - { - xfer += oprot->writeMapBegin(::apache::thrift::protocol::T_STRING, ::apache::thrift::protocol::T_STRING, static_cast(this->confOverlay.size())); - std::map ::const_iterator _iter233; - for (_iter233 = this->confOverlay.begin(); _iter233 != this->confOverlay.end(); ++_iter233) - { - xfer += oprot->writeString(_iter233->first); - xfer += oprot->writeString(_iter233->second); - } - xfer += oprot->writeMapEnd(); - } - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.runAsync) { - xfer += oprot->writeFieldBegin("runAsync", ::apache::thrift::protocol::T_BOOL, 4); - xfer += oprot->writeBool(this->runAsync); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.queryTimeout) { - xfer += oprot->writeFieldBegin("queryTimeout", ::apache::thrift::protocol::T_I64, 5); - xfer += oprot->writeI64(this->queryTimeout); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TExecuteStatementReq &a, TExecuteStatementReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.statement, b.statement); - swap(a.confOverlay, b.confOverlay); - swap(a.runAsync, b.runAsync); - swap(a.queryTimeout, b.queryTimeout); - swap(a.__isset, b.__isset); -} - -TExecuteStatementReq::TExecuteStatementReq(const TExecuteStatementReq& other234) { - sessionHandle = other234.sessionHandle; - statement = other234.statement; - confOverlay = other234.confOverlay; - runAsync = other234.runAsync; - queryTimeout = other234.queryTimeout; - __isset = other234.__isset; -} -TExecuteStatementReq& TExecuteStatementReq::operator=(const TExecuteStatementReq& other235) { - sessionHandle = other235.sessionHandle; - statement = other235.statement; - confOverlay = other235.confOverlay; - runAsync = other235.runAsync; - queryTimeout = other235.queryTimeout; - __isset = other235.__isset; - return *this; -} -void TExecuteStatementReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TExecuteStatementReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "statement=" << to_string(statement); - out << ", " << "confOverlay="; (__isset.confOverlay ? (out << to_string(confOverlay)) : (out << "")); - out << ", " << "runAsync="; (__isset.runAsync ? (out << to_string(runAsync)) : (out << "")); - out << ", " << "queryTimeout="; (__isset.queryTimeout ? (out << to_string(queryTimeout)) : (out << "")); - out << ")"; -} - - -TExecuteStatementResp::~TExecuteStatementResp() throw() { -} - - -void TExecuteStatementResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TExecuteStatementResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TExecuteStatementResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TExecuteStatementResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TExecuteStatementResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TExecuteStatementResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TExecuteStatementResp &a, TExecuteStatementResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TExecuteStatementResp::TExecuteStatementResp(const TExecuteStatementResp& other236) { - status = other236.status; - operationHandle = other236.operationHandle; - __isset = other236.__isset; -} -TExecuteStatementResp& TExecuteStatementResp::operator=(const TExecuteStatementResp& other237) { - status = other237.status; - operationHandle = other237.operationHandle; - __isset = other237.__isset; - return *this; -} -void TExecuteStatementResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TExecuteStatementResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetTypeInfoReq::~TGetTypeInfoReq() throw() { -} - - -void TGetTypeInfoReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TGetTypeInfoReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetTypeInfoReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_sessionHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetTypeInfoReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetTypeInfoReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetTypeInfoReq &a, TGetTypeInfoReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); -} - -TGetTypeInfoReq::TGetTypeInfoReq(const TGetTypeInfoReq& other238) { - sessionHandle = other238.sessionHandle; -} -TGetTypeInfoReq& TGetTypeInfoReq::operator=(const TGetTypeInfoReq& other239) { - sessionHandle = other239.sessionHandle; - return *this; -} -void TGetTypeInfoReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetTypeInfoReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ")"; -} - - -TGetTypeInfoResp::~TGetTypeInfoResp() throw() { -} - - -void TGetTypeInfoResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetTypeInfoResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetTypeInfoResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetTypeInfoResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetTypeInfoResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetTypeInfoResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetTypeInfoResp &a, TGetTypeInfoResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetTypeInfoResp::TGetTypeInfoResp(const TGetTypeInfoResp& other240) { - status = other240.status; - operationHandle = other240.operationHandle; - __isset = other240.__isset; -} -TGetTypeInfoResp& TGetTypeInfoResp::operator=(const TGetTypeInfoResp& other241) { - status = other241.status; - operationHandle = other241.operationHandle; - __isset = other241.__isset; - return *this; -} -void TGetTypeInfoResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetTypeInfoResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetCatalogsReq::~TGetCatalogsReq() throw() { -} - - -void TGetCatalogsReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TGetCatalogsReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetCatalogsReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_sessionHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetCatalogsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetCatalogsReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetCatalogsReq &a, TGetCatalogsReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); -} - -TGetCatalogsReq::TGetCatalogsReq(const TGetCatalogsReq& other242) { - sessionHandle = other242.sessionHandle; -} -TGetCatalogsReq& TGetCatalogsReq::operator=(const TGetCatalogsReq& other243) { - sessionHandle = other243.sessionHandle; - return *this; -} -void TGetCatalogsReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetCatalogsReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ")"; -} - - -TGetCatalogsResp::~TGetCatalogsResp() throw() { -} - - -void TGetCatalogsResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetCatalogsResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetCatalogsResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetCatalogsResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetCatalogsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetCatalogsResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetCatalogsResp &a, TGetCatalogsResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetCatalogsResp::TGetCatalogsResp(const TGetCatalogsResp& other244) { - status = other244.status; - operationHandle = other244.operationHandle; - __isset = other244.__isset; -} -TGetCatalogsResp& TGetCatalogsResp::operator=(const TGetCatalogsResp& other245) { - status = other245.status; - operationHandle = other245.operationHandle; - __isset = other245.__isset; - return *this; -} -void TGetCatalogsResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetCatalogsResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetSchemasReq::~TGetSchemasReq() throw() { -} - - -void TGetSchemasReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetSchemasReq::__set_catalogName(const TIdentifier& val) { - this->catalogName = val; -__isset.catalogName = true; -} - -void TGetSchemasReq::__set_schemaName(const TPatternOrIdentifier& val) { - this->schemaName = val; -__isset.schemaName = true; -} -std::ostream& operator<<(std::ostream& out, const TGetSchemasReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetSchemasReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_STRING) { - xfer += iprot->readString(this->catalogName); - this->__isset.catalogName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->schemaName); - this->__isset.schemaName = 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); - return xfer; -} - -uint32_t TGetSchemasReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetSchemasReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.catalogName) { - xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->catalogName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.schemaName) { - xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->schemaName); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetSchemasReq &a, TGetSchemasReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.catalogName, b.catalogName); - swap(a.schemaName, b.schemaName); - swap(a.__isset, b.__isset); -} - -TGetSchemasReq::TGetSchemasReq(const TGetSchemasReq& other246) { - sessionHandle = other246.sessionHandle; - catalogName = other246.catalogName; - schemaName = other246.schemaName; - __isset = other246.__isset; -} -TGetSchemasReq& TGetSchemasReq::operator=(const TGetSchemasReq& other247) { - sessionHandle = other247.sessionHandle; - catalogName = other247.catalogName; - schemaName = other247.schemaName; - __isset = other247.__isset; - return *this; -} -void TGetSchemasReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetSchemasReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); - out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); - out << ")"; -} - - -TGetSchemasResp::~TGetSchemasResp() throw() { -} - - -void TGetSchemasResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetSchemasResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetSchemasResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetSchemasResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetSchemasResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetSchemasResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetSchemasResp &a, TGetSchemasResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetSchemasResp::TGetSchemasResp(const TGetSchemasResp& other248) { - status = other248.status; - operationHandle = other248.operationHandle; - __isset = other248.__isset; -} -TGetSchemasResp& TGetSchemasResp::operator=(const TGetSchemasResp& other249) { - status = other249.status; - operationHandle = other249.operationHandle; - __isset = other249.__isset; - return *this; -} -void TGetSchemasResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetSchemasResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetTablesReq::~TGetTablesReq() throw() { -} - - -void TGetTablesReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetTablesReq::__set_catalogName(const TPatternOrIdentifier& val) { - this->catalogName = val; -__isset.catalogName = true; -} - -void TGetTablesReq::__set_schemaName(const TPatternOrIdentifier& val) { - this->schemaName = val; -__isset.schemaName = true; -} - -void TGetTablesReq::__set_tableName(const TPatternOrIdentifier& val) { - this->tableName = val; -__isset.tableName = true; -} - -void TGetTablesReq::__set_tableTypes(const std::vector & val) { - this->tableTypes = val; -__isset.tableTypes = true; -} -std::ostream& operator<<(std::ostream& out, const TGetTablesReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetTablesReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_STRING) { - xfer += iprot->readString(this->catalogName); - this->__isset.catalogName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->schemaName); - this->__isset.schemaName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->tableName); - this->__isset.tableName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->tableTypes.clear(); - uint32_t _size250; - ::apache::thrift::protocol::TType _etype253; - xfer += iprot->readListBegin(_etype253, _size250); - this->tableTypes.resize(_size250); - uint32_t _i254; - for (_i254 = 0; _i254 < _size250; ++_i254) - { - xfer += iprot->readString(this->tableTypes[_i254]); - } - xfer += iprot->readListEnd(); - } - this->__isset.tableTypes = 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); - return xfer; -} - -uint32_t TGetTablesReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetTablesReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.catalogName) { - xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->catalogName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.schemaName) { - xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->schemaName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.tableName) { - xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 4); - xfer += oprot->writeString(this->tableName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.tableTypes) { - xfer += oprot->writeFieldBegin("tableTypes", ::apache::thrift::protocol::T_LIST, 5); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->tableTypes.size())); - std::vector ::const_iterator _iter255; - for (_iter255 = this->tableTypes.begin(); _iter255 != this->tableTypes.end(); ++_iter255) - { - xfer += oprot->writeString((*_iter255)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetTablesReq &a, TGetTablesReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.catalogName, b.catalogName); - swap(a.schemaName, b.schemaName); - swap(a.tableName, b.tableName); - swap(a.tableTypes, b.tableTypes); - swap(a.__isset, b.__isset); -} - -TGetTablesReq::TGetTablesReq(const TGetTablesReq& other256) { - sessionHandle = other256.sessionHandle; - catalogName = other256.catalogName; - schemaName = other256.schemaName; - tableName = other256.tableName; - tableTypes = other256.tableTypes; - __isset = other256.__isset; -} -TGetTablesReq& TGetTablesReq::operator=(const TGetTablesReq& other257) { - sessionHandle = other257.sessionHandle; - catalogName = other257.catalogName; - schemaName = other257.schemaName; - tableName = other257.tableName; - tableTypes = other257.tableTypes; - __isset = other257.__isset; - return *this; -} -void TGetTablesReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetTablesReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); - out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); - out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); - out << ", " << "tableTypes="; (__isset.tableTypes ? (out << to_string(tableTypes)) : (out << "")); - out << ")"; -} - - -TGetTablesResp::~TGetTablesResp() throw() { -} - - -void TGetTablesResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetTablesResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetTablesResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetTablesResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetTablesResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetTablesResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetTablesResp &a, TGetTablesResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetTablesResp::TGetTablesResp(const TGetTablesResp& other258) { - status = other258.status; - operationHandle = other258.operationHandle; - __isset = other258.__isset; -} -TGetTablesResp& TGetTablesResp::operator=(const TGetTablesResp& other259) { - status = other259.status; - operationHandle = other259.operationHandle; - __isset = other259.__isset; - return *this; -} -void TGetTablesResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetTablesResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetTableTypesReq::~TGetTableTypesReq() throw() { -} - - -void TGetTableTypesReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TGetTableTypesReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetTableTypesReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_sessionHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetTableTypesReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetTableTypesReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetTableTypesReq &a, TGetTableTypesReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); -} - -TGetTableTypesReq::TGetTableTypesReq(const TGetTableTypesReq& other260) { - sessionHandle = other260.sessionHandle; -} -TGetTableTypesReq& TGetTableTypesReq::operator=(const TGetTableTypesReq& other261) { - sessionHandle = other261.sessionHandle; - return *this; -} -void TGetTableTypesReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetTableTypesReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ")"; -} - - -TGetTableTypesResp::~TGetTableTypesResp() throw() { -} - - -void TGetTableTypesResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetTableTypesResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetTableTypesResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetTableTypesResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetTableTypesResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetTableTypesResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetTableTypesResp &a, TGetTableTypesResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetTableTypesResp::TGetTableTypesResp(const TGetTableTypesResp& other262) { - status = other262.status; - operationHandle = other262.operationHandle; - __isset = other262.__isset; -} -TGetTableTypesResp& TGetTableTypesResp::operator=(const TGetTableTypesResp& other263) { - status = other263.status; - operationHandle = other263.operationHandle; - __isset = other263.__isset; - return *this; -} -void TGetTableTypesResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetTableTypesResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetColumnsReq::~TGetColumnsReq() throw() { -} - - -void TGetColumnsReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetColumnsReq::__set_catalogName(const TIdentifier& val) { - this->catalogName = val; -__isset.catalogName = true; -} - -void TGetColumnsReq::__set_schemaName(const TPatternOrIdentifier& val) { - this->schemaName = val; -__isset.schemaName = true; -} - -void TGetColumnsReq::__set_tableName(const TPatternOrIdentifier& val) { - this->tableName = val; -__isset.tableName = true; -} - -void TGetColumnsReq::__set_columnName(const TPatternOrIdentifier& val) { - this->columnName = val; -__isset.columnName = true; -} -std::ostream& operator<<(std::ostream& out, const TGetColumnsReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetColumnsReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_STRING) { - xfer += iprot->readString(this->catalogName); - this->__isset.catalogName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->schemaName); - this->__isset.schemaName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->tableName); - this->__isset.tableName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->columnName); - this->__isset.columnName = 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); - return xfer; -} - -uint32_t TGetColumnsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetColumnsReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.catalogName) { - xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->catalogName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.schemaName) { - xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->schemaName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.tableName) { - xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 4); - xfer += oprot->writeString(this->tableName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.columnName) { - xfer += oprot->writeFieldBegin("columnName", ::apache::thrift::protocol::T_STRING, 5); - xfer += oprot->writeString(this->columnName); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetColumnsReq &a, TGetColumnsReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.catalogName, b.catalogName); - swap(a.schemaName, b.schemaName); - swap(a.tableName, b.tableName); - swap(a.columnName, b.columnName); - swap(a.__isset, b.__isset); -} - -TGetColumnsReq::TGetColumnsReq(const TGetColumnsReq& other264) { - sessionHandle = other264.sessionHandle; - catalogName = other264.catalogName; - schemaName = other264.schemaName; - tableName = other264.tableName; - columnName = other264.columnName; - __isset = other264.__isset; -} -TGetColumnsReq& TGetColumnsReq::operator=(const TGetColumnsReq& other265) { - sessionHandle = other265.sessionHandle; - catalogName = other265.catalogName; - schemaName = other265.schemaName; - tableName = other265.tableName; - columnName = other265.columnName; - __isset = other265.__isset; - return *this; -} -void TGetColumnsReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetColumnsReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); - out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); - out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); - out << ", " << "columnName="; (__isset.columnName ? (out << to_string(columnName)) : (out << "")); - out << ")"; -} - - -TGetColumnsResp::~TGetColumnsResp() throw() { -} - - -void TGetColumnsResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetColumnsResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetColumnsResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetColumnsResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetColumnsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetColumnsResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetColumnsResp &a, TGetColumnsResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetColumnsResp::TGetColumnsResp(const TGetColumnsResp& other266) { - status = other266.status; - operationHandle = other266.operationHandle; - __isset = other266.__isset; -} -TGetColumnsResp& TGetColumnsResp::operator=(const TGetColumnsResp& other267) { - status = other267.status; - operationHandle = other267.operationHandle; - __isset = other267.__isset; - return *this; -} -void TGetColumnsResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetColumnsResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetFunctionsReq::~TGetFunctionsReq() throw() { -} - - -void TGetFunctionsReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetFunctionsReq::__set_catalogName(const TIdentifier& val) { - this->catalogName = val; -__isset.catalogName = true; -} - -void TGetFunctionsReq::__set_schemaName(const TPatternOrIdentifier& val) { - this->schemaName = val; -__isset.schemaName = true; -} - -void TGetFunctionsReq::__set_functionName(const TPatternOrIdentifier& val) { - this->functionName = val; -} -std::ostream& operator<<(std::ostream& out, const TGetFunctionsReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetFunctionsReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_functionName = 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_STRING) { - xfer += iprot->readString(this->catalogName); - this->__isset.catalogName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->schemaName); - this->__isset.schemaName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->functionName); - isset_functionName = 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_functionName) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetFunctionsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetFunctionsReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.catalogName) { - xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->catalogName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.schemaName) { - xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->schemaName); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldBegin("functionName", ::apache::thrift::protocol::T_STRING, 4); - xfer += oprot->writeString(this->functionName); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetFunctionsReq &a, TGetFunctionsReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.catalogName, b.catalogName); - swap(a.schemaName, b.schemaName); - swap(a.functionName, b.functionName); - swap(a.__isset, b.__isset); -} - -TGetFunctionsReq::TGetFunctionsReq(const TGetFunctionsReq& other268) { - sessionHandle = other268.sessionHandle; - catalogName = other268.catalogName; - schemaName = other268.schemaName; - functionName = other268.functionName; - __isset = other268.__isset; -} -TGetFunctionsReq& TGetFunctionsReq::operator=(const TGetFunctionsReq& other269) { - sessionHandle = other269.sessionHandle; - catalogName = other269.catalogName; - schemaName = other269.schemaName; - functionName = other269.functionName; - __isset = other269.__isset; - return *this; -} -void TGetFunctionsReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetFunctionsReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); - out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); - out << ", " << "functionName=" << to_string(functionName); - out << ")"; -} - - -TGetFunctionsResp::~TGetFunctionsResp() throw() { -} - - -void TGetFunctionsResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetFunctionsResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetFunctionsResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetFunctionsResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetFunctionsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetFunctionsResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetFunctionsResp &a, TGetFunctionsResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetFunctionsResp::TGetFunctionsResp(const TGetFunctionsResp& other270) { - status = other270.status; - operationHandle = other270.operationHandle; - __isset = other270.__isset; -} -TGetFunctionsResp& TGetFunctionsResp::operator=(const TGetFunctionsResp& other271) { - status = other271.status; - operationHandle = other271.operationHandle; - __isset = other271.__isset; - return *this; -} -void TGetFunctionsResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetFunctionsResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetPrimaryKeysReq::~TGetPrimaryKeysReq() throw() { -} - - -void TGetPrimaryKeysReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetPrimaryKeysReq::__set_catalogName(const TIdentifier& val) { - this->catalogName = val; -__isset.catalogName = true; -} - -void TGetPrimaryKeysReq::__set_schemaName(const TIdentifier& val) { - this->schemaName = val; -__isset.schemaName = true; -} - -void TGetPrimaryKeysReq::__set_tableName(const TIdentifier& val) { - this->tableName = val; -__isset.tableName = true; -} -std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetPrimaryKeysReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_STRING) { - xfer += iprot->readString(this->catalogName); - this->__isset.catalogName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->schemaName); - this->__isset.schemaName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->tableName); - this->__isset.tableName = 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); - return xfer; -} - -uint32_t TGetPrimaryKeysReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetPrimaryKeysReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.catalogName) { - xfer += oprot->writeFieldBegin("catalogName", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->catalogName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.schemaName) { - xfer += oprot->writeFieldBegin("schemaName", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->schemaName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.tableName) { - xfer += oprot->writeFieldBegin("tableName", ::apache::thrift::protocol::T_STRING, 4); - xfer += oprot->writeString(this->tableName); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetPrimaryKeysReq &a, TGetPrimaryKeysReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.catalogName, b.catalogName); - swap(a.schemaName, b.schemaName); - swap(a.tableName, b.tableName); - swap(a.__isset, b.__isset); -} - -TGetPrimaryKeysReq::TGetPrimaryKeysReq(const TGetPrimaryKeysReq& other272) { - sessionHandle = other272.sessionHandle; - catalogName = other272.catalogName; - schemaName = other272.schemaName; - tableName = other272.tableName; - __isset = other272.__isset; -} -TGetPrimaryKeysReq& TGetPrimaryKeysReq::operator=(const TGetPrimaryKeysReq& other273) { - sessionHandle = other273.sessionHandle; - catalogName = other273.catalogName; - schemaName = other273.schemaName; - tableName = other273.tableName; - __isset = other273.__isset; - return *this; -} -void TGetPrimaryKeysReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetPrimaryKeysReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "catalogName="; (__isset.catalogName ? (out << to_string(catalogName)) : (out << "")); - out << ", " << "schemaName="; (__isset.schemaName ? (out << to_string(schemaName)) : (out << "")); - out << ", " << "tableName="; (__isset.tableName ? (out << to_string(tableName)) : (out << "")); - out << ")"; -} - - -TGetPrimaryKeysResp::~TGetPrimaryKeysResp() throw() { -} - - -void TGetPrimaryKeysResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetPrimaryKeysResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetPrimaryKeysResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetPrimaryKeysResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetPrimaryKeysResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetPrimaryKeysResp &a, TGetPrimaryKeysResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetPrimaryKeysResp::TGetPrimaryKeysResp(const TGetPrimaryKeysResp& other274) { - status = other274.status; - operationHandle = other274.operationHandle; - __isset = other274.__isset; -} -TGetPrimaryKeysResp& TGetPrimaryKeysResp::operator=(const TGetPrimaryKeysResp& other275) { - status = other275.status; - operationHandle = other275.operationHandle; - __isset = other275.__isset; - return *this; -} -void TGetPrimaryKeysResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetPrimaryKeysResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetCrossReferenceReq::~TGetCrossReferenceReq() throw() { -} - - -void TGetCrossReferenceReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetCrossReferenceReq::__set_parentCatalogName(const TIdentifier& val) { - this->parentCatalogName = val; -__isset.parentCatalogName = true; -} - -void TGetCrossReferenceReq::__set_parentSchemaName(const TIdentifier& val) { - this->parentSchemaName = val; -__isset.parentSchemaName = true; -} - -void TGetCrossReferenceReq::__set_parentTableName(const TIdentifier& val) { - this->parentTableName = val; -__isset.parentTableName = true; -} - -void TGetCrossReferenceReq::__set_foreignCatalogName(const TIdentifier& val) { - this->foreignCatalogName = val; -__isset.foreignCatalogName = true; -} - -void TGetCrossReferenceReq::__set_foreignSchemaName(const TIdentifier& val) { - this->foreignSchemaName = val; -__isset.foreignSchemaName = true; -} - -void TGetCrossReferenceReq::__set_foreignTableName(const TIdentifier& val) { - this->foreignTableName = val; -__isset.foreignTableName = true; -} -std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetCrossReferenceReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_STRING) { - xfer += iprot->readString(this->parentCatalogName); - this->__isset.parentCatalogName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->parentSchemaName); - this->__isset.parentSchemaName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->parentTableName); - this->__isset.parentTableName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->foreignCatalogName); - this->__isset.foreignCatalogName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->foreignSchemaName); - this->__isset.foreignSchemaName = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 7: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->foreignTableName); - this->__isset.foreignTableName = 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); - return xfer; -} - -uint32_t TGetCrossReferenceReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetCrossReferenceReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.parentCatalogName) { - xfer += oprot->writeFieldBegin("parentCatalogName", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->parentCatalogName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.parentSchemaName) { - xfer += oprot->writeFieldBegin("parentSchemaName", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->parentSchemaName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.parentTableName) { - xfer += oprot->writeFieldBegin("parentTableName", ::apache::thrift::protocol::T_STRING, 4); - xfer += oprot->writeString(this->parentTableName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.foreignCatalogName) { - xfer += oprot->writeFieldBegin("foreignCatalogName", ::apache::thrift::protocol::T_STRING, 5); - xfer += oprot->writeString(this->foreignCatalogName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.foreignSchemaName) { - xfer += oprot->writeFieldBegin("foreignSchemaName", ::apache::thrift::protocol::T_STRING, 6); - xfer += oprot->writeString(this->foreignSchemaName); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.foreignTableName) { - xfer += oprot->writeFieldBegin("foreignTableName", ::apache::thrift::protocol::T_STRING, 7); - xfer += oprot->writeString(this->foreignTableName); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetCrossReferenceReq &a, TGetCrossReferenceReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.parentCatalogName, b.parentCatalogName); - swap(a.parentSchemaName, b.parentSchemaName); - swap(a.parentTableName, b.parentTableName); - swap(a.foreignCatalogName, b.foreignCatalogName); - swap(a.foreignSchemaName, b.foreignSchemaName); - swap(a.foreignTableName, b.foreignTableName); - swap(a.__isset, b.__isset); -} - -TGetCrossReferenceReq::TGetCrossReferenceReq(const TGetCrossReferenceReq& other276) { - sessionHandle = other276.sessionHandle; - parentCatalogName = other276.parentCatalogName; - parentSchemaName = other276.parentSchemaName; - parentTableName = other276.parentTableName; - foreignCatalogName = other276.foreignCatalogName; - foreignSchemaName = other276.foreignSchemaName; - foreignTableName = other276.foreignTableName; - __isset = other276.__isset; -} -TGetCrossReferenceReq& TGetCrossReferenceReq::operator=(const TGetCrossReferenceReq& other277) { - sessionHandle = other277.sessionHandle; - parentCatalogName = other277.parentCatalogName; - parentSchemaName = other277.parentSchemaName; - parentTableName = other277.parentTableName; - foreignCatalogName = other277.foreignCatalogName; - foreignSchemaName = other277.foreignSchemaName; - foreignTableName = other277.foreignTableName; - __isset = other277.__isset; - return *this; -} -void TGetCrossReferenceReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetCrossReferenceReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "parentCatalogName="; (__isset.parentCatalogName ? (out << to_string(parentCatalogName)) : (out << "")); - out << ", " << "parentSchemaName="; (__isset.parentSchemaName ? (out << to_string(parentSchemaName)) : (out << "")); - out << ", " << "parentTableName="; (__isset.parentTableName ? (out << to_string(parentTableName)) : (out << "")); - out << ", " << "foreignCatalogName="; (__isset.foreignCatalogName ? (out << to_string(foreignCatalogName)) : (out << "")); - out << ", " << "foreignSchemaName="; (__isset.foreignSchemaName ? (out << to_string(foreignSchemaName)) : (out << "")); - out << ", " << "foreignTableName="; (__isset.foreignTableName ? (out << to_string(foreignTableName)) : (out << "")); - out << ")"; -} - - -TGetCrossReferenceResp::~TGetCrossReferenceResp() throw() { -} - - -void TGetCrossReferenceResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetCrossReferenceResp::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -__isset.operationHandle = true; -} -std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetCrossReferenceResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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); - this->__isset.operationHandle = 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); - return xfer; -} - -uint32_t TGetCrossReferenceResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetCrossReferenceResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationHandle) { - 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(TGetCrossReferenceResp &a, TGetCrossReferenceResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationHandle, b.operationHandle); - swap(a.__isset, b.__isset); -} - -TGetCrossReferenceResp::TGetCrossReferenceResp(const TGetCrossReferenceResp& other278) { - status = other278.status; - operationHandle = other278.operationHandle; - __isset = other278.__isset; -} -TGetCrossReferenceResp& TGetCrossReferenceResp::operator=(const TGetCrossReferenceResp& other279) { - status = other279.status; - operationHandle = other279.operationHandle; - __isset = other279.__isset; - return *this; -} -void TGetCrossReferenceResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetCrossReferenceResp("; - out << "status=" << to_string(status); - out << ", " << "operationHandle="; (__isset.operationHandle ? (out << to_string(operationHandle)) : (out << "")); - out << ")"; -} - - -TGetOperationStatusReq::~TGetOperationStatusReq() throw() { -} - - -void TGetOperationStatusReq::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -} - -void TGetOperationStatusReq::__set_getProgressUpdate(const bool val) { - this->getProgressUpdate = val; -__isset.getProgressUpdate = true; -} -std::ostream& operator<<(std::ostream& out, const TGetOperationStatusReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetOperationStatusReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->operationHandle.read(iprot); - isset_operationHandle = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->getProgressUpdate); - this->__isset.getProgressUpdate = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_operationHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetOperationStatusReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetOperationStatusReq"); - - xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->operationHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.getProgressUpdate) { - xfer += oprot->writeFieldBegin("getProgressUpdate", ::apache::thrift::protocol::T_BOOL, 2); - xfer += oprot->writeBool(this->getProgressUpdate); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetOperationStatusReq &a, TGetOperationStatusReq &b) { - using ::std::swap; - swap(a.operationHandle, b.operationHandle); - swap(a.getProgressUpdate, b.getProgressUpdate); - swap(a.__isset, b.__isset); -} - -TGetOperationStatusReq::TGetOperationStatusReq(const TGetOperationStatusReq& other280) { - operationHandle = other280.operationHandle; - getProgressUpdate = other280.getProgressUpdate; - __isset = other280.__isset; -} -TGetOperationStatusReq& TGetOperationStatusReq::operator=(const TGetOperationStatusReq& other281) { - operationHandle = other281.operationHandle; - getProgressUpdate = other281.getProgressUpdate; - __isset = other281.__isset; - return *this; -} -void TGetOperationStatusReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetOperationStatusReq("; - out << "operationHandle=" << to_string(operationHandle); - out << ", " << "getProgressUpdate="; (__isset.getProgressUpdate ? (out << to_string(getProgressUpdate)) : (out << "")); - out << ")"; -} - - -TGetOperationStatusResp::~TGetOperationStatusResp() throw() { -} - - -void TGetOperationStatusResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetOperationStatusResp::__set_operationState(const TOperationState::type val) { - this->operationState = val; -__isset.operationState = true; -} - -void TGetOperationStatusResp::__set_sqlState(const std::string& val) { - this->sqlState = val; -__isset.sqlState = true; -} - -void TGetOperationStatusResp::__set_errorCode(const int32_t val) { - this->errorCode = val; -__isset.errorCode = true; -} - -void TGetOperationStatusResp::__set_errorMessage(const std::string& val) { - this->errorMessage = val; -__isset.errorMessage = true; -} - -void TGetOperationStatusResp::__set_taskStatus(const std::string& val) { - this->taskStatus = val; -__isset.taskStatus = true; -} - -void TGetOperationStatusResp::__set_operationStarted(const int64_t val) { - this->operationStarted = val; -__isset.operationStarted = true; -} - -void TGetOperationStatusResp::__set_operationCompleted(const int64_t val) { - this->operationCompleted = val; -__isset.operationCompleted = true; -} - -void TGetOperationStatusResp::__set_hasResultSet(const bool val) { - this->hasResultSet = val; -__isset.hasResultSet = true; -} - -void TGetOperationStatusResp::__set_progressUpdateResponse(const TProgressUpdateResp& val) { - this->progressUpdateResponse = val; -__isset.progressUpdateResponse = true; -} -std::ostream& operator<<(std::ostream& out, const TGetOperationStatusResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetOperationStatusResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_I32) { - int32_t ecast282; - xfer += iprot->readI32(ecast282); - this->operationState = (TOperationState::type)ecast282; - this->__isset.operationState = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->sqlState); - this->__isset.sqlState = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_I32) { - xfer += iprot->readI32(this->errorCode); - this->__isset.errorCode = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->errorMessage); - this->__isset.errorMessage = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->taskStatus); - this->__isset.taskStatus = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 7: - if (ftype == ::apache::thrift::protocol::T_I64) { - xfer += iprot->readI64(this->operationStarted); - this->__isset.operationStarted = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 8: - if (ftype == ::apache::thrift::protocol::T_I64) { - xfer += iprot->readI64(this->operationCompleted); - this->__isset.operationCompleted = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 9: - if (ftype == ::apache::thrift::protocol::T_BOOL) { - xfer += iprot->readBool(this->hasResultSet); - this->__isset.hasResultSet = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 10: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->progressUpdateResponse.read(iprot); - this->__isset.progressUpdateResponse = 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); - return xfer; -} - -uint32_t TGetOperationStatusResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetOperationStatusResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.operationState) { - xfer += oprot->writeFieldBegin("operationState", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32((int32_t)this->operationState); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.sqlState) { - xfer += oprot->writeFieldBegin("sqlState", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->sqlState); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.errorCode) { - xfer += oprot->writeFieldBegin("errorCode", ::apache::thrift::protocol::T_I32, 4); - xfer += oprot->writeI32(this->errorCode); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.errorMessage) { - xfer += oprot->writeFieldBegin("errorMessage", ::apache::thrift::protocol::T_STRING, 5); - xfer += oprot->writeString(this->errorMessage); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.taskStatus) { - xfer += oprot->writeFieldBegin("taskStatus", ::apache::thrift::protocol::T_STRING, 6); - xfer += oprot->writeString(this->taskStatus); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.operationStarted) { - xfer += oprot->writeFieldBegin("operationStarted", ::apache::thrift::protocol::T_I64, 7); - xfer += oprot->writeI64(this->operationStarted); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.operationCompleted) { - xfer += oprot->writeFieldBegin("operationCompleted", ::apache::thrift::protocol::T_I64, 8); - xfer += oprot->writeI64(this->operationCompleted); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.hasResultSet) { - xfer += oprot->writeFieldBegin("hasResultSet", ::apache::thrift::protocol::T_BOOL, 9); - xfer += oprot->writeBool(this->hasResultSet); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.progressUpdateResponse) { - xfer += oprot->writeFieldBegin("progressUpdateResponse", ::apache::thrift::protocol::T_STRUCT, 10); - xfer += this->progressUpdateResponse.write(oprot); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetOperationStatusResp &a, TGetOperationStatusResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.operationState, b.operationState); - swap(a.sqlState, b.sqlState); - swap(a.errorCode, b.errorCode); - swap(a.errorMessage, b.errorMessage); - swap(a.taskStatus, b.taskStatus); - swap(a.operationStarted, b.operationStarted); - swap(a.operationCompleted, b.operationCompleted); - swap(a.hasResultSet, b.hasResultSet); - swap(a.progressUpdateResponse, b.progressUpdateResponse); - swap(a.__isset, b.__isset); -} - -TGetOperationStatusResp::TGetOperationStatusResp(const TGetOperationStatusResp& other283) { - status = other283.status; - operationState = other283.operationState; - sqlState = other283.sqlState; - errorCode = other283.errorCode; - errorMessage = other283.errorMessage; - taskStatus = other283.taskStatus; - operationStarted = other283.operationStarted; - operationCompleted = other283.operationCompleted; - hasResultSet = other283.hasResultSet; - progressUpdateResponse = other283.progressUpdateResponse; - __isset = other283.__isset; -} -TGetOperationStatusResp& TGetOperationStatusResp::operator=(const TGetOperationStatusResp& other284) { - status = other284.status; - operationState = other284.operationState; - sqlState = other284.sqlState; - errorCode = other284.errorCode; - errorMessage = other284.errorMessage; - taskStatus = other284.taskStatus; - operationStarted = other284.operationStarted; - operationCompleted = other284.operationCompleted; - hasResultSet = other284.hasResultSet; - progressUpdateResponse = other284.progressUpdateResponse; - __isset = other284.__isset; - return *this; -} -void TGetOperationStatusResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetOperationStatusResp("; - out << "status=" << to_string(status); - out << ", " << "operationState="; (__isset.operationState ? (out << to_string(operationState)) : (out << "")); - out << ", " << "sqlState="; (__isset.sqlState ? (out << to_string(sqlState)) : (out << "")); - out << ", " << "errorCode="; (__isset.errorCode ? (out << to_string(errorCode)) : (out << "")); - out << ", " << "errorMessage="; (__isset.errorMessage ? (out << to_string(errorMessage)) : (out << "")); - out << ", " << "taskStatus="; (__isset.taskStatus ? (out << to_string(taskStatus)) : (out << "")); - out << ", " << "operationStarted="; (__isset.operationStarted ? (out << to_string(operationStarted)) : (out << "")); - out << ", " << "operationCompleted="; (__isset.operationCompleted ? (out << to_string(operationCompleted)) : (out << "")); - out << ", " << "hasResultSet="; (__isset.hasResultSet ? (out << to_string(hasResultSet)) : (out << "")); - out << ", " << "progressUpdateResponse="; (__isset.progressUpdateResponse ? (out << to_string(progressUpdateResponse)) : (out << "")); - out << ")"; -} - - -TCancelOperationReq::~TCancelOperationReq() throw() { -} - - -void TCancelOperationReq::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TCancelOperationReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCancelOperationReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCancelOperationReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCancelOperationReq"); - - xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->operationHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCancelOperationReq &a, TCancelOperationReq &b) { - using ::std::swap; - swap(a.operationHandle, b.operationHandle); -} - -TCancelOperationReq::TCancelOperationReq(const TCancelOperationReq& other285) { - operationHandle = other285.operationHandle; -} -TCancelOperationReq& TCancelOperationReq::operator=(const TCancelOperationReq& other286) { - operationHandle = other286.operationHandle; - return *this; -} -void TCancelOperationReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCancelOperationReq("; - out << "operationHandle=" << to_string(operationHandle); - out << ")"; -} - - -TCancelOperationResp::~TCancelOperationResp() throw() { -} - - -void TCancelOperationResp::__set_status(const TStatus& val) { - this->status = val; -} -std::ostream& operator<<(std::ostream& out, const TCancelOperationResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCancelOperationResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_status) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCancelOperationResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCancelOperationResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCancelOperationResp &a, TCancelOperationResp &b) { - using ::std::swap; - swap(a.status, b.status); -} - -TCancelOperationResp::TCancelOperationResp(const TCancelOperationResp& other287) { - status = other287.status; -} -TCancelOperationResp& TCancelOperationResp::operator=(const TCancelOperationResp& other288) { - status = other288.status; - return *this; -} -void TCancelOperationResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCancelOperationResp("; - out << "status=" << to_string(status); - out << ")"; -} - - -TCloseOperationReq::~TCloseOperationReq() throw() { -} - - -void TCloseOperationReq::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TCloseOperationReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCloseOperationReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCloseOperationReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCloseOperationReq"); - - xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->operationHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCloseOperationReq &a, TCloseOperationReq &b) { - using ::std::swap; - swap(a.operationHandle, b.operationHandle); -} - -TCloseOperationReq::TCloseOperationReq(const TCloseOperationReq& other289) { - operationHandle = other289.operationHandle; -} -TCloseOperationReq& TCloseOperationReq::operator=(const TCloseOperationReq& other290) { - operationHandle = other290.operationHandle; - return *this; -} -void TCloseOperationReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCloseOperationReq("; - out << "operationHandle=" << to_string(operationHandle); - out << ")"; -} - - -TCloseOperationResp::~TCloseOperationResp() throw() { -} - - -void TCloseOperationResp::__set_status(const TStatus& val) { - this->status = val; -} -std::ostream& operator<<(std::ostream& out, const TCloseOperationResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCloseOperationResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_status) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCloseOperationResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCloseOperationResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCloseOperationResp &a, TCloseOperationResp &b) { - using ::std::swap; - swap(a.status, b.status); -} - -TCloseOperationResp::TCloseOperationResp(const TCloseOperationResp& other291) { - status = other291.status; -} -TCloseOperationResp& TCloseOperationResp::operator=(const TCloseOperationResp& other292) { - status = other292.status; - return *this; -} -void TCloseOperationResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCloseOperationResp("; - out << "status=" << to_string(status); - out << ")"; -} - - -TGetResultSetMetadataReq::~TGetResultSetMetadataReq() throw() { -} - - -void TGetResultSetMetadataReq::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetResultSetMetadataReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetResultSetMetadataReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetResultSetMetadataReq"); - - xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->operationHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetResultSetMetadataReq &a, TGetResultSetMetadataReq &b) { - using ::std::swap; - swap(a.operationHandle, b.operationHandle); -} - -TGetResultSetMetadataReq::TGetResultSetMetadataReq(const TGetResultSetMetadataReq& other293) { - operationHandle = other293.operationHandle; -} -TGetResultSetMetadataReq& TGetResultSetMetadataReq::operator=(const TGetResultSetMetadataReq& other294) { - operationHandle = other294.operationHandle; - return *this; -} -void TGetResultSetMetadataReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetResultSetMetadataReq("; - out << "operationHandle=" << to_string(operationHandle); - out << ")"; -} - - -TGetResultSetMetadataResp::~TGetResultSetMetadataResp() throw() { -} - - -void TGetResultSetMetadataResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetResultSetMetadataResp::__set_schema(const TTableSchema& val) { - this->schema = val; -__isset.schema = true; -} -std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetResultSetMetadataResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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->schema.read(iprot); - this->__isset.schema = 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); - return xfer; -} - -uint32_t TGetResultSetMetadataResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetResultSetMetadataResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.schema) { - xfer += oprot->writeFieldBegin("schema", ::apache::thrift::protocol::T_STRUCT, 2); - xfer += this->schema.write(oprot); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetResultSetMetadataResp &a, TGetResultSetMetadataResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.schema, b.schema); - swap(a.__isset, b.__isset); -} - -TGetResultSetMetadataResp::TGetResultSetMetadataResp(const TGetResultSetMetadataResp& other295) { - status = other295.status; - schema = other295.schema; - __isset = other295.__isset; -} -TGetResultSetMetadataResp& TGetResultSetMetadataResp::operator=(const TGetResultSetMetadataResp& other296) { - status = other296.status; - schema = other296.schema; - __isset = other296.__isset; - return *this; -} -void TGetResultSetMetadataResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetResultSetMetadataResp("; - out << "status=" << to_string(status); - out << ", " << "schema="; (__isset.schema ? (out << to_string(schema)) : (out << "")); - out << ")"; -} - - -TFetchResultsReq::~TFetchResultsReq() throw() { -} - - -void TFetchResultsReq::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -} - -void TFetchResultsReq::__set_orientation(const TFetchOrientation::type val) { - this->orientation = val; -} - -void TFetchResultsReq::__set_maxRows(const int64_t val) { - this->maxRows = val; -} - -void TFetchResultsReq::__set_fetchType(const int16_t val) { - this->fetchType = val; -__isset.fetchType = true; -} -std::ostream& operator<<(std::ostream& out, const TFetchResultsReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TFetchResultsReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_operationHandle = false; - bool isset_orientation = false; - bool isset_maxRows = 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->operationHandle.read(iprot); - isset_operationHandle = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast297; - xfer += iprot->readI32(ecast297); - this->orientation = (TFetchOrientation::type)ecast297; - isset_orientation = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_I64) { - xfer += iprot->readI64(this->maxRows); - isset_maxRows = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_I16) { - xfer += iprot->readI16(this->fetchType); - this->__isset.fetchType = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_operationHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_orientation) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_maxRows) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TFetchResultsReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TFetchResultsReq"); - - xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->operationHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("orientation", ::apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32((int32_t)this->orientation); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("maxRows", ::apache::thrift::protocol::T_I64, 3); - xfer += oprot->writeI64(this->maxRows); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.fetchType) { - xfer += oprot->writeFieldBegin("fetchType", ::apache::thrift::protocol::T_I16, 4); - xfer += oprot->writeI16(this->fetchType); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TFetchResultsReq &a, TFetchResultsReq &b) { - using ::std::swap; - swap(a.operationHandle, b.operationHandle); - swap(a.orientation, b.orientation); - swap(a.maxRows, b.maxRows); - swap(a.fetchType, b.fetchType); - swap(a.__isset, b.__isset); -} - -TFetchResultsReq::TFetchResultsReq(const TFetchResultsReq& other298) { - operationHandle = other298.operationHandle; - orientation = other298.orientation; - maxRows = other298.maxRows; - fetchType = other298.fetchType; - __isset = other298.__isset; -} -TFetchResultsReq& TFetchResultsReq::operator=(const TFetchResultsReq& other299) { - operationHandle = other299.operationHandle; - orientation = other299.orientation; - maxRows = other299.maxRows; - fetchType = other299.fetchType; - __isset = other299.__isset; - return *this; -} -void TFetchResultsReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TFetchResultsReq("; - out << "operationHandle=" << to_string(operationHandle); - out << ", " << "orientation=" << to_string(orientation); - out << ", " << "maxRows=" << to_string(maxRows); - out << ", " << "fetchType="; (__isset.fetchType ? (out << to_string(fetchType)) : (out << "")); - out << ")"; -} - - -TFetchResultsResp::~TFetchResultsResp() throw() { -} - - -void TFetchResultsResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TFetchResultsResp::__set_hasMoreRows(const bool val) { - this->hasMoreRows = val; -__isset.hasMoreRows = true; -} - -void TFetchResultsResp::__set_results(const TRowSet& val) { - this->results = val; -__isset.results = true; -} -std::ostream& operator<<(std::ostream& out, const TFetchResultsResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TFetchResultsResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_BOOL) { - xfer += iprot->readBool(this->hasMoreRows); - this->__isset.hasMoreRows = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRUCT) { - xfer += this->results.read(iprot); - this->__isset.results = 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); - return xfer; -} - -uint32_t TFetchResultsResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TFetchResultsResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.hasMoreRows) { - xfer += oprot->writeFieldBegin("hasMoreRows", ::apache::thrift::protocol::T_BOOL, 2); - xfer += oprot->writeBool(this->hasMoreRows); - xfer += oprot->writeFieldEnd(); - } - if (this->__isset.results) { - xfer += oprot->writeFieldBegin("results", ::apache::thrift::protocol::T_STRUCT, 3); - xfer += this->results.write(oprot); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TFetchResultsResp &a, TFetchResultsResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.hasMoreRows, b.hasMoreRows); - swap(a.results, b.results); - swap(a.__isset, b.__isset); -} - -TFetchResultsResp::TFetchResultsResp(const TFetchResultsResp& other300) { - status = other300.status; - hasMoreRows = other300.hasMoreRows; - results = other300.results; - __isset = other300.__isset; -} -TFetchResultsResp& TFetchResultsResp::operator=(const TFetchResultsResp& other301) { - status = other301.status; - hasMoreRows = other301.hasMoreRows; - results = other301.results; - __isset = other301.__isset; - return *this; -} -void TFetchResultsResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TFetchResultsResp("; - out << "status=" << to_string(status); - out << ", " << "hasMoreRows="; (__isset.hasMoreRows ? (out << to_string(hasMoreRows)) : (out << "")); - out << ", " << "results="; (__isset.results ? (out << to_string(results)) : (out << "")); - out << ")"; -} - - -TGetDelegationTokenReq::~TGetDelegationTokenReq() throw() { -} - - -void TGetDelegationTokenReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TGetDelegationTokenReq::__set_owner(const std::string& val) { - this->owner = val; -} - -void TGetDelegationTokenReq::__set_renewer(const std::string& val) { - this->renewer = val; -} -std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetDelegationTokenReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_owner = false; - bool isset_renewer = 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_STRING) { - xfer += iprot->readString(this->owner); - isset_owner = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->renewer); - isset_renewer = 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_owner) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_renewer) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetDelegationTokenReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetDelegationTokenReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("owner", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->owner); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("renewer", ::apache::thrift::protocol::T_STRING, 3); - xfer += oprot->writeString(this->renewer); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetDelegationTokenReq &a, TGetDelegationTokenReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.owner, b.owner); - swap(a.renewer, b.renewer); -} - -TGetDelegationTokenReq::TGetDelegationTokenReq(const TGetDelegationTokenReq& other302) { - sessionHandle = other302.sessionHandle; - owner = other302.owner; - renewer = other302.renewer; -} -TGetDelegationTokenReq& TGetDelegationTokenReq::operator=(const TGetDelegationTokenReq& other303) { - sessionHandle = other303.sessionHandle; - owner = other303.owner; - renewer = other303.renewer; - return *this; -} -void TGetDelegationTokenReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetDelegationTokenReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "owner=" << to_string(owner); - out << ", " << "renewer=" << to_string(renewer); - out << ")"; -} - - -TGetDelegationTokenResp::~TGetDelegationTokenResp() throw() { -} - - -void TGetDelegationTokenResp::__set_status(const TStatus& val) { - this->status = val; -} - -void TGetDelegationTokenResp::__set_delegationToken(const std::string& val) { - this->delegationToken = val; -__isset.delegationToken = true; -} -std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetDelegationTokenResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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_STRING) { - xfer += iprot->readString(this->delegationToken); - this->__isset.delegationToken = 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); - return xfer; -} - -uint32_t TGetDelegationTokenResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetDelegationTokenResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - if (this->__isset.delegationToken) { - xfer += oprot->writeFieldBegin("delegationToken", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->delegationToken); - xfer += oprot->writeFieldEnd(); - } - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetDelegationTokenResp &a, TGetDelegationTokenResp &b) { - using ::std::swap; - swap(a.status, b.status); - swap(a.delegationToken, b.delegationToken); - swap(a.__isset, b.__isset); -} - -TGetDelegationTokenResp::TGetDelegationTokenResp(const TGetDelegationTokenResp& other304) { - status = other304.status; - delegationToken = other304.delegationToken; - __isset = other304.__isset; -} -TGetDelegationTokenResp& TGetDelegationTokenResp::operator=(const TGetDelegationTokenResp& other305) { - status = other305.status; - delegationToken = other305.delegationToken; - __isset = other305.__isset; - return *this; -} -void TGetDelegationTokenResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetDelegationTokenResp("; - out << "status=" << to_string(status); - out << ", " << "delegationToken="; (__isset.delegationToken ? (out << to_string(delegationToken)) : (out << "")); - out << ")"; -} - - -TCancelDelegationTokenReq::~TCancelDelegationTokenReq() throw() { -} - - -void TCancelDelegationTokenReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TCancelDelegationTokenReq::__set_delegationToken(const std::string& val) { - this->delegationToken = val; -} -std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCancelDelegationTokenReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_delegationToken = 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_STRING) { - xfer += iprot->readString(this->delegationToken); - isset_delegationToken = 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_delegationToken) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCancelDelegationTokenReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCancelDelegationTokenReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("delegationToken", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->delegationToken); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCancelDelegationTokenReq &a, TCancelDelegationTokenReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.delegationToken, b.delegationToken); -} - -TCancelDelegationTokenReq::TCancelDelegationTokenReq(const TCancelDelegationTokenReq& other306) { - sessionHandle = other306.sessionHandle; - delegationToken = other306.delegationToken; -} -TCancelDelegationTokenReq& TCancelDelegationTokenReq::operator=(const TCancelDelegationTokenReq& other307) { - sessionHandle = other307.sessionHandle; - delegationToken = other307.delegationToken; - return *this; -} -void TCancelDelegationTokenReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCancelDelegationTokenReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "delegationToken=" << to_string(delegationToken); - out << ")"; -} - - -TCancelDelegationTokenResp::~TCancelDelegationTokenResp() throw() { -} - - -void TCancelDelegationTokenResp::__set_status(const TStatus& val) { - this->status = val; -} -std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TCancelDelegationTokenResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_status) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TCancelDelegationTokenResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TCancelDelegationTokenResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TCancelDelegationTokenResp &a, TCancelDelegationTokenResp &b) { - using ::std::swap; - swap(a.status, b.status); -} - -TCancelDelegationTokenResp::TCancelDelegationTokenResp(const TCancelDelegationTokenResp& other308) { - status = other308.status; -} -TCancelDelegationTokenResp& TCancelDelegationTokenResp::operator=(const TCancelDelegationTokenResp& other309) { - status = other309.status; - return *this; -} -void TCancelDelegationTokenResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TCancelDelegationTokenResp("; - out << "status=" << to_string(status); - out << ")"; -} - - -TRenewDelegationTokenReq::~TRenewDelegationTokenReq() throw() { -} - - -void TRenewDelegationTokenReq::__set_sessionHandle(const TSessionHandle& val) { - this->sessionHandle = val; -} - -void TRenewDelegationTokenReq::__set_delegationToken(const std::string& val) { - this->delegationToken = val; -} -std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TRenewDelegationTokenReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_delegationToken = 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_STRING) { - xfer += iprot->readString(this->delegationToken); - isset_delegationToken = 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_delegationToken) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TRenewDelegationTokenReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TRenewDelegationTokenReq"); - - xfer += oprot->writeFieldBegin("sessionHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->sessionHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("delegationToken", ::apache::thrift::protocol::T_STRING, 2); - xfer += oprot->writeString(this->delegationToken); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TRenewDelegationTokenReq &a, TRenewDelegationTokenReq &b) { - using ::std::swap; - swap(a.sessionHandle, b.sessionHandle); - swap(a.delegationToken, b.delegationToken); -} - -TRenewDelegationTokenReq::TRenewDelegationTokenReq(const TRenewDelegationTokenReq& other310) { - sessionHandle = other310.sessionHandle; - delegationToken = other310.delegationToken; -} -TRenewDelegationTokenReq& TRenewDelegationTokenReq::operator=(const TRenewDelegationTokenReq& other311) { - sessionHandle = other311.sessionHandle; - delegationToken = other311.delegationToken; - return *this; -} -void TRenewDelegationTokenReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TRenewDelegationTokenReq("; - out << "sessionHandle=" << to_string(sessionHandle); - out << ", " << "delegationToken=" << to_string(delegationToken); - out << ")"; -} - - -TRenewDelegationTokenResp::~TRenewDelegationTokenResp() throw() { -} - - -void TRenewDelegationTokenResp::__set_status(const TStatus& val) { - this->status = val; -} -std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TRenewDelegationTokenResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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; - - 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; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_status) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TRenewDelegationTokenResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TRenewDelegationTokenResp"); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->status.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b) { - using ::std::swap; - swap(a.status, b.status); -} - -TRenewDelegationTokenResp::TRenewDelegationTokenResp(const TRenewDelegationTokenResp& other312) { - status = other312.status; -} -TRenewDelegationTokenResp& TRenewDelegationTokenResp::operator=(const TRenewDelegationTokenResp& other313) { - status = other313.status; - return *this; -} -void TRenewDelegationTokenResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TRenewDelegationTokenResp("; - out << "status=" << to_string(status); - out << ")"; -} - - -TProgressUpdateResp::~TProgressUpdateResp() throw() { -} - - -void TProgressUpdateResp::__set_headerNames(const std::vector & val) { - this->headerNames = val; -} - -void TProgressUpdateResp::__set_rows(const std::vector > & val) { - this->rows = val; -} - -void TProgressUpdateResp::__set_progressedPercentage(const double val) { - this->progressedPercentage = val; -} - -void TProgressUpdateResp::__set_status(const TJobExecutionStatus::type val) { - this->status = val; -} - -void TProgressUpdateResp::__set_footerSummary(const std::string& val) { - this->footerSummary = val; -} - -void TProgressUpdateResp::__set_startTime(const int64_t val) { - this->startTime = val; -} -std::ostream& operator<<(std::ostream& out, const TProgressUpdateResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TProgressUpdateResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_headerNames = false; - bool isset_rows = false; - bool isset_progressedPercentage = false; - bool isset_status = false; - bool isset_footerSummary = false; - bool isset_startTime = 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_LIST) { - { - this->headerNames.clear(); - uint32_t _size314; - ::apache::thrift::protocol::TType _etype317; - xfer += iprot->readListBegin(_etype317, _size314); - this->headerNames.resize(_size314); - uint32_t _i318; - for (_i318 = 0; _i318 < _size314; ++_i318) - { - xfer += iprot->readString(this->headerNames[_i318]); - } - xfer += iprot->readListEnd(); - } - isset_headerNames = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == ::apache::thrift::protocol::T_LIST) { - { - this->rows.clear(); - uint32_t _size319; - ::apache::thrift::protocol::TType _etype322; - xfer += iprot->readListBegin(_etype322, _size319); - this->rows.resize(_size319); - uint32_t _i323; - for (_i323 = 0; _i323 < _size319; ++_i323) - { - { - this->rows[_i323].clear(); - uint32_t _size324; - ::apache::thrift::protocol::TType _etype327; - xfer += iprot->readListBegin(_etype327, _size324); - this->rows[_i323].resize(_size324); - uint32_t _i328; - for (_i328 = 0; _i328 < _size324; ++_i328) - { - xfer += iprot->readString(this->rows[_i323][_i328]); - } - xfer += iprot->readListEnd(); - } - } - xfer += iprot->readListEnd(); - } - isset_rows = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 3: - if (ftype == ::apache::thrift::protocol::T_DOUBLE) { - xfer += iprot->readDouble(this->progressedPercentage); - isset_progressedPercentage = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 4: - if (ftype == ::apache::thrift::protocol::T_I32) { - int32_t ecast329; - xfer += iprot->readI32(ecast329); - this->status = (TJobExecutionStatus::type)ecast329; - isset_status = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 5: - if (ftype == ::apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(this->footerSummary); - isset_footerSummary = true; - } else { - xfer += iprot->skip(ftype); - } - break; - case 6: - if (ftype == ::apache::thrift::protocol::T_I64) { - xfer += iprot->readI64(this->startTime); - isset_startTime = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_headerNames) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_rows) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_progressedPercentage) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_status) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_footerSummary) - throw TProtocolException(TProtocolException::INVALID_DATA); - if (!isset_startTime) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TProgressUpdateResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TProgressUpdateResp"); - - xfer += oprot->writeFieldBegin("headerNames", ::apache::thrift::protocol::T_LIST, 1); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast(this->headerNames.size())); - std::vector ::const_iterator _iter330; - for (_iter330 = this->headerNames.begin(); _iter330 != this->headerNames.end(); ++_iter330) - { - xfer += oprot->writeString((*_iter330)); - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("rows", ::apache::thrift::protocol::T_LIST, 2); - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_LIST, static_cast(this->rows.size())); - std::vector > ::const_iterator _iter331; - for (_iter331 = this->rows.begin(); _iter331 != this->rows.end(); ++_iter331) - { - { - xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRING, static_cast((*_iter331).size())); - std::vector ::const_iterator _iter332; - for (_iter332 = (*_iter331).begin(); _iter332 != (*_iter331).end(); ++_iter332) - { - xfer += oprot->writeString((*_iter332)); - } - xfer += oprot->writeListEnd(); - } - } - xfer += oprot->writeListEnd(); - } - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("progressedPercentage", ::apache::thrift::protocol::T_DOUBLE, 3); - xfer += oprot->writeDouble(this->progressedPercentage); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("status", ::apache::thrift::protocol::T_I32, 4); - xfer += oprot->writeI32((int32_t)this->status); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("footerSummary", ::apache::thrift::protocol::T_STRING, 5); - xfer += oprot->writeString(this->footerSummary); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldBegin("startTime", ::apache::thrift::protocol::T_I64, 6); - xfer += oprot->writeI64(this->startTime); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TProgressUpdateResp &a, TProgressUpdateResp &b) { - using ::std::swap; - swap(a.headerNames, b.headerNames); - swap(a.rows, b.rows); - swap(a.progressedPercentage, b.progressedPercentage); - swap(a.status, b.status); - swap(a.footerSummary, b.footerSummary); - swap(a.startTime, b.startTime); -} - -TProgressUpdateResp::TProgressUpdateResp(const TProgressUpdateResp& other333) { - headerNames = other333.headerNames; - rows = other333.rows; - progressedPercentage = other333.progressedPercentage; - status = other333.status; - footerSummary = other333.footerSummary; - startTime = other333.startTime; -} -TProgressUpdateResp& TProgressUpdateResp::operator=(const TProgressUpdateResp& other334) { - headerNames = other334.headerNames; - rows = other334.rows; - progressedPercentage = other334.progressedPercentage; - status = other334.status; - footerSummary = other334.footerSummary; - startTime = other334.startTime; - return *this; -} -void TProgressUpdateResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TProgressUpdateResp("; - out << "headerNames=" << to_string(headerNames); - out << ", " << "rows=" << to_string(rows); - out << ", " << "progressedPercentage=" << to_string(progressedPercentage); - out << ", " << "status=" << to_string(status); - out << ", " << "footerSummary=" << to_string(footerSummary); - out << ", " << "startTime=" << to_string(startTime); - out << ")"; -} - - -TGetQueryIdReq::~TGetQueryIdReq() throw() { -} - - -void TGetQueryIdReq::__set_operationHandle(const TOperationHandle& val) { - this->operationHandle = val; -} -std::ostream& operator<<(std::ostream& out, const TGetQueryIdReq& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetQueryIdReq::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_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->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_operationHandle) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetQueryIdReq::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetQueryIdReq"); - - xfer += oprot->writeFieldBegin("operationHandle", ::apache::thrift::protocol::T_STRUCT, 1); - xfer += this->operationHandle.write(oprot); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetQueryIdReq &a, TGetQueryIdReq &b) { - using ::std::swap; - swap(a.operationHandle, b.operationHandle); -} - -TGetQueryIdReq::TGetQueryIdReq(const TGetQueryIdReq& other335) { - operationHandle = other335.operationHandle; -} -TGetQueryIdReq& TGetQueryIdReq::operator=(const TGetQueryIdReq& other336) { - operationHandle = other336.operationHandle; - return *this; -} -void TGetQueryIdReq::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetQueryIdReq("; - out << "operationHandle=" << to_string(operationHandle); - out << ")"; -} - - -TGetQueryIdResp::~TGetQueryIdResp() throw() { -} - - -void TGetQueryIdResp::__set_queryId(const std::string& val) { - this->queryId = val; -} -std::ostream& operator<<(std::ostream& out, const TGetQueryIdResp& obj) -{ - obj.printTo(out); - return out; -} - - -uint32_t TGetQueryIdResp::read(::apache::thrift::protocol::TProtocol* iprot) { - - ::apache::thrift::protocol::TInputRecursionTracker tracker(*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_queryId = 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_STRING) { - xfer += iprot->readString(this->queryId); - isset_queryId = true; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - - if (!isset_queryId) - throw TProtocolException(TProtocolException::INVALID_DATA); - return xfer; -} - -uint32_t TGetQueryIdResp::write(::apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot); - xfer += oprot->writeStructBegin("TGetQueryIdResp"); - - xfer += oprot->writeFieldBegin("queryId", ::apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(this->queryId); - xfer += oprot->writeFieldEnd(); - - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} - -void swap(TGetQueryIdResp &a, TGetQueryIdResp &b) { - using ::std::swap; - swap(a.queryId, b.queryId); -} - -TGetQueryIdResp::TGetQueryIdResp(const TGetQueryIdResp& other337) { - queryId = other337.queryId; -} -TGetQueryIdResp& TGetQueryIdResp::operator=(const TGetQueryIdResp& other338) { - queryId = other338.queryId; - return *this; -} -void TGetQueryIdResp::printTo(std::ostream& out) const { - using ::apache::thrift::to_string; - out << "TGetQueryIdResp("; - out << "queryId=" << to_string(queryId); - out << ")"; -} - -}}}}} // namespace diff --git a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h b/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h deleted file mode 100644 index 8723add2e82c..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-cpp/TCLIService_types.h +++ /dev/null @@ -1,4497 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -#ifndef TCLIService_TYPES_H -#define TCLIService_TYPES_H - -#include - -#include -#include -#include -#include -#include - -#include - - -namespace apache { namespace spark { namespace service { namespace rpc { namespace thrift { - -struct TProtocolVersion { - enum type { - HIVE_CLI_SERVICE_PROTOCOL_V1 = 0, - HIVE_CLI_SERVICE_PROTOCOL_V2 = 1, - HIVE_CLI_SERVICE_PROTOCOL_V3 = 2, - HIVE_CLI_SERVICE_PROTOCOL_V4 = 3, - HIVE_CLI_SERVICE_PROTOCOL_V5 = 4, - HIVE_CLI_SERVICE_PROTOCOL_V6 = 5, - HIVE_CLI_SERVICE_PROTOCOL_V7 = 6, - HIVE_CLI_SERVICE_PROTOCOL_V8 = 7, - HIVE_CLI_SERVICE_PROTOCOL_V9 = 8, - HIVE_CLI_SERVICE_PROTOCOL_V10 = 9, - HIVE_CLI_SERVICE_PROTOCOL_V11 = 10 - }; -}; - -extern const std::map _TProtocolVersion_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TProtocolVersion::type& val); - -struct TTypeId { - enum type { - BOOLEAN_TYPE = 0, - TINYINT_TYPE = 1, - SMALLINT_TYPE = 2, - INT_TYPE = 3, - BIGINT_TYPE = 4, - FLOAT_TYPE = 5, - DOUBLE_TYPE = 6, - STRING_TYPE = 7, - TIMESTAMP_TYPE = 8, - BINARY_TYPE = 9, - ARRAY_TYPE = 10, - MAP_TYPE = 11, - STRUCT_TYPE = 12, - UNION_TYPE = 13, - USER_DEFINED_TYPE = 14, - DECIMAL_TYPE = 15, - NULL_TYPE = 16, - DATE_TYPE = 17, - VARCHAR_TYPE = 18, - CHAR_TYPE = 19, - INTERVAL_YEAR_MONTH_TYPE = 20, - INTERVAL_DAY_TIME_TYPE = 21, - TIMESTAMPLOCALTZ_TYPE = 22 - }; -}; - -extern const std::map _TTypeId_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TTypeId::type& val); - -struct TStatusCode { - enum type { - SUCCESS_STATUS = 0, - SUCCESS_WITH_INFO_STATUS = 1, - STILL_EXECUTING_STATUS = 2, - ERROR_STATUS = 3, - INVALID_HANDLE_STATUS = 4 - }; -}; - -extern const std::map _TStatusCode_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TStatusCode::type& val); - -struct TOperationState { - enum type { - INITIALIZED_STATE = 0, - RUNNING_STATE = 1, - FINISHED_STATE = 2, - CANCELED_STATE = 3, - CLOSED_STATE = 4, - ERROR_STATE = 5, - UKNOWN_STATE = 6, - PENDING_STATE = 7, - TIMEDOUT_STATE = 8 - }; -}; - -extern const std::map _TOperationState_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TOperationState::type& val); - -struct TOperationType { - enum type { - EXECUTE_STATEMENT = 0, - GET_TYPE_INFO = 1, - GET_CATALOGS = 2, - GET_SCHEMAS = 3, - GET_TABLES = 4, - GET_TABLE_TYPES = 5, - GET_COLUMNS = 6, - GET_FUNCTIONS = 7, - UNKNOWN = 8 - }; -}; - -extern const std::map _TOperationType_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TOperationType::type& val); - -struct TGetInfoType { - enum type { - CLI_MAX_DRIVER_CONNECTIONS = 0, - CLI_MAX_CONCURRENT_ACTIVITIES = 1, - CLI_DATA_SOURCE_NAME = 2, - CLI_FETCH_DIRECTION = 8, - CLI_SERVER_NAME = 13, - CLI_SEARCH_PATTERN_ESCAPE = 14, - CLI_DBMS_NAME = 17, - CLI_DBMS_VER = 18, - CLI_ACCESSIBLE_TABLES = 19, - CLI_ACCESSIBLE_PROCEDURES = 20, - CLI_CURSOR_COMMIT_BEHAVIOR = 23, - CLI_DATA_SOURCE_READ_ONLY = 25, - CLI_DEFAULT_TXN_ISOLATION = 26, - CLI_IDENTIFIER_CASE = 28, - CLI_IDENTIFIER_QUOTE_CHAR = 29, - CLI_MAX_COLUMN_NAME_LEN = 30, - CLI_MAX_CURSOR_NAME_LEN = 31, - CLI_MAX_SCHEMA_NAME_LEN = 32, - CLI_MAX_CATALOG_NAME_LEN = 34, - CLI_MAX_TABLE_NAME_LEN = 35, - CLI_SCROLL_CONCURRENCY = 43, - CLI_TXN_CAPABLE = 46, - CLI_USER_NAME = 47, - CLI_TXN_ISOLATION_OPTION = 72, - CLI_INTEGRITY = 73, - CLI_GETDATA_EXTENSIONS = 81, - CLI_NULL_COLLATION = 85, - CLI_ALTER_TABLE = 86, - CLI_ORDER_BY_COLUMNS_IN_SELECT = 90, - CLI_SPECIAL_CHARACTERS = 94, - CLI_MAX_COLUMNS_IN_GROUP_BY = 97, - CLI_MAX_COLUMNS_IN_INDEX = 98, - CLI_MAX_COLUMNS_IN_ORDER_BY = 99, - CLI_MAX_COLUMNS_IN_SELECT = 100, - CLI_MAX_COLUMNS_IN_TABLE = 101, - CLI_MAX_INDEX_SIZE = 102, - CLI_MAX_ROW_SIZE = 104, - CLI_MAX_STATEMENT_LEN = 105, - CLI_MAX_TABLES_IN_SELECT = 106, - CLI_MAX_USER_NAME_LEN = 107, - CLI_OJ_CAPABILITIES = 115, - CLI_XOPEN_CLI_YEAR = 10000, - CLI_CURSOR_SENSITIVITY = 10001, - CLI_DESCRIBE_PARAMETER = 10002, - CLI_CATALOG_NAME = 10003, - CLI_COLLATION_SEQ = 10004, - CLI_MAX_IDENTIFIER_LEN = 10005, - CLI_ODBC_KEYWORDS = 10006 - }; -}; - -extern const std::map _TGetInfoType_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TGetInfoType::type& val); - -struct TFetchOrientation { - enum type { - FETCH_NEXT = 0, - FETCH_PRIOR = 1, - FETCH_RELATIVE = 2, - FETCH_ABSOLUTE = 3, - FETCH_FIRST = 4, - FETCH_LAST = 5 - }; -}; - -extern const std::map _TFetchOrientation_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TFetchOrientation::type& val); - -struct TJobExecutionStatus { - enum type { - IN_PROGRESS = 0, - COMPLETE = 1, - NOT_AVAILABLE = 2 - }; -}; - -extern const std::map _TJobExecutionStatus_VALUES_TO_NAMES; - -std::ostream& operator<<(std::ostream& out, const TJobExecutionStatus::type& val); - -typedef int32_t TTypeEntryPtr; - -typedef std::string TIdentifier; - -typedef std::string TPattern; - -typedef std::string TPatternOrIdentifier; - -class TTypeQualifierValue; - -class TTypeQualifiers; - -class TPrimitiveTypeEntry; - -class TArrayTypeEntry; - -class TMapTypeEntry; - -class TStructTypeEntry; - -class TUnionTypeEntry; - -class TUserDefinedTypeEntry; - -class TTypeEntry; - -class TTypeDesc; - -class TColumnDesc; - -class TTableSchema; - -class TBoolValue; - -class TByteValue; - -class TI16Value; - -class TI32Value; - -class TI64Value; - -class TDoubleValue; - -class TStringValue; - -class TColumnValue; - -class TRow; - -class TBoolColumn; - -class TByteColumn; - -class TI16Column; - -class TI32Column; - -class TI64Column; - -class TDoubleColumn; - -class TStringColumn; - -class TBinaryColumn; - -class TColumn; - -class TRowSet; - -class TStatus; - -class THandleIdentifier; - -class TSessionHandle; - -class TOperationHandle; - -class TOpenSessionReq; - -class TOpenSessionResp; - -class TSetClientInfoReq; - -class TSetClientInfoResp; - -class TCloseSessionReq; - -class TCloseSessionResp; - -class TGetInfoValue; - -class TGetInfoReq; - -class TGetInfoResp; - -class TExecuteStatementReq; - -class TExecuteStatementResp; - -class TGetTypeInfoReq; - -class TGetTypeInfoResp; - -class TGetCatalogsReq; - -class TGetCatalogsResp; - -class TGetSchemasReq; - -class TGetSchemasResp; - -class TGetTablesReq; - -class TGetTablesResp; - -class TGetTableTypesReq; - -class TGetTableTypesResp; - -class TGetColumnsReq; - -class TGetColumnsResp; - -class TGetFunctionsReq; - -class TGetFunctionsResp; - -class TGetPrimaryKeysReq; - -class TGetPrimaryKeysResp; - -class TGetCrossReferenceReq; - -class TGetCrossReferenceResp; - -class TGetOperationStatusReq; - -class TGetOperationStatusResp; - -class TCancelOperationReq; - -class TCancelOperationResp; - -class TCloseOperationReq; - -class TCloseOperationResp; - -class TGetResultSetMetadataReq; - -class TGetResultSetMetadataResp; - -class TFetchResultsReq; - -class TFetchResultsResp; - -class TGetDelegationTokenReq; - -class TGetDelegationTokenResp; - -class TCancelDelegationTokenReq; - -class TCancelDelegationTokenResp; - -class TRenewDelegationTokenReq; - -class TRenewDelegationTokenResp; - -class TProgressUpdateResp; - -class TGetQueryIdReq; - -class TGetQueryIdResp; - -typedef struct _TTypeQualifierValue__isset { - _TTypeQualifierValue__isset() : i32Value(false), stringValue(false) {} - bool i32Value :1; - bool stringValue :1; -} _TTypeQualifierValue__isset; - -class TTypeQualifierValue : public virtual ::apache::thrift::TBase { - public: - - TTypeQualifierValue(const TTypeQualifierValue&); - TTypeQualifierValue& operator=(const TTypeQualifierValue&); - TTypeQualifierValue() : i32Value(0), stringValue() { - } - - virtual ~TTypeQualifierValue() throw(); - int32_t i32Value; - std::string stringValue; - - _TTypeQualifierValue__isset __isset; - - void __set_i32Value(const int32_t val); - - void __set_stringValue(const std::string& val); - - bool operator == (const TTypeQualifierValue & rhs) const - { - if (__isset.i32Value != rhs.__isset.i32Value) - return false; - else if (__isset.i32Value && !(i32Value == rhs.i32Value)) - return false; - if (__isset.stringValue != rhs.__isset.stringValue) - return false; - else if (__isset.stringValue && !(stringValue == rhs.stringValue)) - return false; - return true; - } - bool operator != (const TTypeQualifierValue &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TTypeQualifierValue & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TTypeQualifierValue &a, TTypeQualifierValue &b); - -std::ostream& operator<<(std::ostream& out, const TTypeQualifierValue& obj); - - -class TTypeQualifiers : public virtual ::apache::thrift::TBase { - public: - - TTypeQualifiers(const TTypeQualifiers&); - TTypeQualifiers& operator=(const TTypeQualifiers&); - TTypeQualifiers() { - } - - virtual ~TTypeQualifiers() throw(); - std::map qualifiers; - - void __set_qualifiers(const std::map & val); - - bool operator == (const TTypeQualifiers & rhs) const - { - if (!(qualifiers == rhs.qualifiers)) - return false; - return true; - } - bool operator != (const TTypeQualifiers &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TTypeQualifiers & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TTypeQualifiers &a, TTypeQualifiers &b); - -std::ostream& operator<<(std::ostream& out, const TTypeQualifiers& obj); - -typedef struct _TPrimitiveTypeEntry__isset { - _TPrimitiveTypeEntry__isset() : typeQualifiers(false) {} - bool typeQualifiers :1; -} _TPrimitiveTypeEntry__isset; - -class TPrimitiveTypeEntry : public virtual ::apache::thrift::TBase { - public: - - TPrimitiveTypeEntry(const TPrimitiveTypeEntry&); - TPrimitiveTypeEntry& operator=(const TPrimitiveTypeEntry&); - TPrimitiveTypeEntry() : type((TTypeId::type)0) { - } - - virtual ~TPrimitiveTypeEntry() throw(); - TTypeId::type type; - TTypeQualifiers typeQualifiers; - - _TPrimitiveTypeEntry__isset __isset; - - void __set_type(const TTypeId::type val); - - void __set_typeQualifiers(const TTypeQualifiers& val); - - bool operator == (const TPrimitiveTypeEntry & rhs) const - { - if (!(type == rhs.type)) - return false; - if (__isset.typeQualifiers != rhs.__isset.typeQualifiers) - return false; - else if (__isset.typeQualifiers && !(typeQualifiers == rhs.typeQualifiers)) - return false; - return true; - } - bool operator != (const TPrimitiveTypeEntry &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TPrimitiveTypeEntry & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TPrimitiveTypeEntry &a, TPrimitiveTypeEntry &b); - -std::ostream& operator<<(std::ostream& out, const TPrimitiveTypeEntry& obj); - - -class TArrayTypeEntry : public virtual ::apache::thrift::TBase { - public: - - TArrayTypeEntry(const TArrayTypeEntry&); - TArrayTypeEntry& operator=(const TArrayTypeEntry&); - TArrayTypeEntry() : objectTypePtr(0) { - } - - virtual ~TArrayTypeEntry() throw(); - TTypeEntryPtr objectTypePtr; - - void __set_objectTypePtr(const TTypeEntryPtr val); - - bool operator == (const TArrayTypeEntry & rhs) const - { - if (!(objectTypePtr == rhs.objectTypePtr)) - return false; - return true; - } - bool operator != (const TArrayTypeEntry &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TArrayTypeEntry & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TArrayTypeEntry &a, TArrayTypeEntry &b); - -std::ostream& operator<<(std::ostream& out, const TArrayTypeEntry& obj); - - -class TMapTypeEntry : public virtual ::apache::thrift::TBase { - public: - - TMapTypeEntry(const TMapTypeEntry&); - TMapTypeEntry& operator=(const TMapTypeEntry&); - TMapTypeEntry() : keyTypePtr(0), valueTypePtr(0) { - } - - virtual ~TMapTypeEntry() throw(); - TTypeEntryPtr keyTypePtr; - TTypeEntryPtr valueTypePtr; - - void __set_keyTypePtr(const TTypeEntryPtr val); - - void __set_valueTypePtr(const TTypeEntryPtr val); - - bool operator == (const TMapTypeEntry & rhs) const - { - if (!(keyTypePtr == rhs.keyTypePtr)) - return false; - if (!(valueTypePtr == rhs.valueTypePtr)) - return false; - return true; - } - bool operator != (const TMapTypeEntry &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TMapTypeEntry & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TMapTypeEntry &a, TMapTypeEntry &b); - -std::ostream& operator<<(std::ostream& out, const TMapTypeEntry& obj); - - -class TStructTypeEntry : public virtual ::apache::thrift::TBase { - public: - - TStructTypeEntry(const TStructTypeEntry&); - TStructTypeEntry& operator=(const TStructTypeEntry&); - TStructTypeEntry() { - } - - virtual ~TStructTypeEntry() throw(); - std::map nameToTypePtr; - - void __set_nameToTypePtr(const std::map & val); - - bool operator == (const TStructTypeEntry & rhs) const - { - if (!(nameToTypePtr == rhs.nameToTypePtr)) - return false; - return true; - } - bool operator != (const TStructTypeEntry &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TStructTypeEntry & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TStructTypeEntry &a, TStructTypeEntry &b); - -std::ostream& operator<<(std::ostream& out, const TStructTypeEntry& obj); - - -class TUnionTypeEntry : public virtual ::apache::thrift::TBase { - public: - - TUnionTypeEntry(const TUnionTypeEntry&); - TUnionTypeEntry& operator=(const TUnionTypeEntry&); - TUnionTypeEntry() { - } - - virtual ~TUnionTypeEntry() throw(); - std::map nameToTypePtr; - - void __set_nameToTypePtr(const std::map & val); - - bool operator == (const TUnionTypeEntry & rhs) const - { - if (!(nameToTypePtr == rhs.nameToTypePtr)) - return false; - return true; - } - bool operator != (const TUnionTypeEntry &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TUnionTypeEntry & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TUnionTypeEntry &a, TUnionTypeEntry &b); - -std::ostream& operator<<(std::ostream& out, const TUnionTypeEntry& obj); - - -class TUserDefinedTypeEntry : public virtual ::apache::thrift::TBase { - public: - - TUserDefinedTypeEntry(const TUserDefinedTypeEntry&); - TUserDefinedTypeEntry& operator=(const TUserDefinedTypeEntry&); - TUserDefinedTypeEntry() : typeClassName() { - } - - virtual ~TUserDefinedTypeEntry() throw(); - std::string typeClassName; - - void __set_typeClassName(const std::string& val); - - bool operator == (const TUserDefinedTypeEntry & rhs) const - { - if (!(typeClassName == rhs.typeClassName)) - return false; - return true; - } - bool operator != (const TUserDefinedTypeEntry &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TUserDefinedTypeEntry & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TUserDefinedTypeEntry &a, TUserDefinedTypeEntry &b); - -std::ostream& operator<<(std::ostream& out, const TUserDefinedTypeEntry& obj); - -typedef struct _TTypeEntry__isset { - _TTypeEntry__isset() : primitiveEntry(false), arrayEntry(false), mapEntry(false), structEntry(false), unionEntry(false), userDefinedTypeEntry(false) {} - bool primitiveEntry :1; - bool arrayEntry :1; - bool mapEntry :1; - bool structEntry :1; - bool unionEntry :1; - bool userDefinedTypeEntry :1; -} _TTypeEntry__isset; - -class TTypeEntry : public virtual ::apache::thrift::TBase { - public: - - TTypeEntry(const TTypeEntry&); - TTypeEntry& operator=(const TTypeEntry&); - TTypeEntry() { - } - - virtual ~TTypeEntry() throw(); - TPrimitiveTypeEntry primitiveEntry; - TArrayTypeEntry arrayEntry; - TMapTypeEntry mapEntry; - TStructTypeEntry structEntry; - TUnionTypeEntry unionEntry; - TUserDefinedTypeEntry userDefinedTypeEntry; - - _TTypeEntry__isset __isset; - - void __set_primitiveEntry(const TPrimitiveTypeEntry& val); - - void __set_arrayEntry(const TArrayTypeEntry& val); - - void __set_mapEntry(const TMapTypeEntry& val); - - void __set_structEntry(const TStructTypeEntry& val); - - void __set_unionEntry(const TUnionTypeEntry& val); - - void __set_userDefinedTypeEntry(const TUserDefinedTypeEntry& val); - - bool operator == (const TTypeEntry & rhs) const - { - if (__isset.primitiveEntry != rhs.__isset.primitiveEntry) - return false; - else if (__isset.primitiveEntry && !(primitiveEntry == rhs.primitiveEntry)) - return false; - if (__isset.arrayEntry != rhs.__isset.arrayEntry) - return false; - else if (__isset.arrayEntry && !(arrayEntry == rhs.arrayEntry)) - return false; - if (__isset.mapEntry != rhs.__isset.mapEntry) - return false; - else if (__isset.mapEntry && !(mapEntry == rhs.mapEntry)) - return false; - if (__isset.structEntry != rhs.__isset.structEntry) - return false; - else if (__isset.structEntry && !(structEntry == rhs.structEntry)) - return false; - if (__isset.unionEntry != rhs.__isset.unionEntry) - return false; - else if (__isset.unionEntry && !(unionEntry == rhs.unionEntry)) - return false; - if (__isset.userDefinedTypeEntry != rhs.__isset.userDefinedTypeEntry) - return false; - else if (__isset.userDefinedTypeEntry && !(userDefinedTypeEntry == rhs.userDefinedTypeEntry)) - return false; - return true; - } - bool operator != (const TTypeEntry &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TTypeEntry & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TTypeEntry &a, TTypeEntry &b); - -std::ostream& operator<<(std::ostream& out, const TTypeEntry& obj); - - -class TTypeDesc : public virtual ::apache::thrift::TBase { - public: - - TTypeDesc(const TTypeDesc&); - TTypeDesc& operator=(const TTypeDesc&); - TTypeDesc() { - } - - virtual ~TTypeDesc() throw(); - std::vector types; - - void __set_types(const std::vector & val); - - bool operator == (const TTypeDesc & rhs) const - { - if (!(types == rhs.types)) - return false; - return true; - } - bool operator != (const TTypeDesc &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TTypeDesc & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TTypeDesc &a, TTypeDesc &b); - -std::ostream& operator<<(std::ostream& out, const TTypeDesc& obj); - -typedef struct _TColumnDesc__isset { - _TColumnDesc__isset() : comment(false) {} - bool comment :1; -} _TColumnDesc__isset; - -class TColumnDesc : public virtual ::apache::thrift::TBase { - public: - - TColumnDesc(const TColumnDesc&); - TColumnDesc& operator=(const TColumnDesc&); - TColumnDesc() : columnName(), position(0), comment() { - } - - virtual ~TColumnDesc() throw(); - std::string columnName; - TTypeDesc typeDesc; - int32_t position; - std::string comment; - - _TColumnDesc__isset __isset; - - void __set_columnName(const std::string& val); - - void __set_typeDesc(const TTypeDesc& val); - - void __set_position(const int32_t val); - - void __set_comment(const std::string& val); - - bool operator == (const TColumnDesc & rhs) const - { - if (!(columnName == rhs.columnName)) - return false; - if (!(typeDesc == rhs.typeDesc)) - return false; - if (!(position == rhs.position)) - return false; - if (__isset.comment != rhs.__isset.comment) - return false; - else if (__isset.comment && !(comment == rhs.comment)) - return false; - return true; - } - bool operator != (const TColumnDesc &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TColumnDesc & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TColumnDesc &a, TColumnDesc &b); - -std::ostream& operator<<(std::ostream& out, const TColumnDesc& obj); - - -class TTableSchema : public virtual ::apache::thrift::TBase { - public: - - TTableSchema(const TTableSchema&); - TTableSchema& operator=(const TTableSchema&); - TTableSchema() { - } - - virtual ~TTableSchema() throw(); - std::vector columns; - - void __set_columns(const std::vector & val); - - bool operator == (const TTableSchema & rhs) const - { - if (!(columns == rhs.columns)) - return false; - return true; - } - bool operator != (const TTableSchema &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TTableSchema & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TTableSchema &a, TTableSchema &b); - -std::ostream& operator<<(std::ostream& out, const TTableSchema& obj); - -typedef struct _TBoolValue__isset { - _TBoolValue__isset() : value(false) {} - bool value :1; -} _TBoolValue__isset; - -class TBoolValue : public virtual ::apache::thrift::TBase { - public: - - TBoolValue(const TBoolValue&); - TBoolValue& operator=(const TBoolValue&); - TBoolValue() : value(0) { - } - - virtual ~TBoolValue() throw(); - bool value; - - _TBoolValue__isset __isset; - - void __set_value(const bool val); - - bool operator == (const TBoolValue & rhs) const - { - if (__isset.value != rhs.__isset.value) - return false; - else if (__isset.value && !(value == rhs.value)) - return false; - return true; - } - bool operator != (const TBoolValue &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TBoolValue & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TBoolValue &a, TBoolValue &b); - -std::ostream& operator<<(std::ostream& out, const TBoolValue& obj); - -typedef struct _TByteValue__isset { - _TByteValue__isset() : value(false) {} - bool value :1; -} _TByteValue__isset; - -class TByteValue : public virtual ::apache::thrift::TBase { - public: - - TByteValue(const TByteValue&); - TByteValue& operator=(const TByteValue&); - TByteValue() : value(0) { - } - - virtual ~TByteValue() throw(); - int8_t value; - - _TByteValue__isset __isset; - - void __set_value(const int8_t val); - - bool operator == (const TByteValue & rhs) const - { - if (__isset.value != rhs.__isset.value) - return false; - else if (__isset.value && !(value == rhs.value)) - return false; - return true; - } - bool operator != (const TByteValue &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TByteValue & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TByteValue &a, TByteValue &b); - -std::ostream& operator<<(std::ostream& out, const TByteValue& obj); - -typedef struct _TI16Value__isset { - _TI16Value__isset() : value(false) {} - bool value :1; -} _TI16Value__isset; - -class TI16Value : public virtual ::apache::thrift::TBase { - public: - - TI16Value(const TI16Value&); - TI16Value& operator=(const TI16Value&); - TI16Value() : value(0) { - } - - virtual ~TI16Value() throw(); - int16_t value; - - _TI16Value__isset __isset; - - void __set_value(const int16_t val); - - bool operator == (const TI16Value & rhs) const - { - if (__isset.value != rhs.__isset.value) - return false; - else if (__isset.value && !(value == rhs.value)) - return false; - return true; - } - bool operator != (const TI16Value &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TI16Value & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TI16Value &a, TI16Value &b); - -std::ostream& operator<<(std::ostream& out, const TI16Value& obj); - -typedef struct _TI32Value__isset { - _TI32Value__isset() : value(false) {} - bool value :1; -} _TI32Value__isset; - -class TI32Value : public virtual ::apache::thrift::TBase { - public: - - TI32Value(const TI32Value&); - TI32Value& operator=(const TI32Value&); - TI32Value() : value(0) { - } - - virtual ~TI32Value() throw(); - int32_t value; - - _TI32Value__isset __isset; - - void __set_value(const int32_t val); - - bool operator == (const TI32Value & rhs) const - { - if (__isset.value != rhs.__isset.value) - return false; - else if (__isset.value && !(value == rhs.value)) - return false; - return true; - } - bool operator != (const TI32Value &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TI32Value & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TI32Value &a, TI32Value &b); - -std::ostream& operator<<(std::ostream& out, const TI32Value& obj); - -typedef struct _TI64Value__isset { - _TI64Value__isset() : value(false) {} - bool value :1; -} _TI64Value__isset; - -class TI64Value : public virtual ::apache::thrift::TBase { - public: - - TI64Value(const TI64Value&); - TI64Value& operator=(const TI64Value&); - TI64Value() : value(0) { - } - - virtual ~TI64Value() throw(); - int64_t value; - - _TI64Value__isset __isset; - - void __set_value(const int64_t val); - - bool operator == (const TI64Value & rhs) const - { - if (__isset.value != rhs.__isset.value) - return false; - else if (__isset.value && !(value == rhs.value)) - return false; - return true; - } - bool operator != (const TI64Value &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TI64Value & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TI64Value &a, TI64Value &b); - -std::ostream& operator<<(std::ostream& out, const TI64Value& obj); - -typedef struct _TDoubleValue__isset { - _TDoubleValue__isset() : value(false) {} - bool value :1; -} _TDoubleValue__isset; - -class TDoubleValue : public virtual ::apache::thrift::TBase { - public: - - TDoubleValue(const TDoubleValue&); - TDoubleValue& operator=(const TDoubleValue&); - TDoubleValue() : value(0) { - } - - virtual ~TDoubleValue() throw(); - double value; - - _TDoubleValue__isset __isset; - - void __set_value(const double val); - - bool operator == (const TDoubleValue & rhs) const - { - if (__isset.value != rhs.__isset.value) - return false; - else if (__isset.value && !(value == rhs.value)) - return false; - return true; - } - bool operator != (const TDoubleValue &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TDoubleValue & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TDoubleValue &a, TDoubleValue &b); - -std::ostream& operator<<(std::ostream& out, const TDoubleValue& obj); - -typedef struct _TStringValue__isset { - _TStringValue__isset() : value(false) {} - bool value :1; -} _TStringValue__isset; - -class TStringValue : public virtual ::apache::thrift::TBase { - public: - - TStringValue(const TStringValue&); - TStringValue& operator=(const TStringValue&); - TStringValue() : value() { - } - - virtual ~TStringValue() throw(); - std::string value; - - _TStringValue__isset __isset; - - void __set_value(const std::string& val); - - bool operator == (const TStringValue & rhs) const - { - if (__isset.value != rhs.__isset.value) - return false; - else if (__isset.value && !(value == rhs.value)) - return false; - return true; - } - bool operator != (const TStringValue &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TStringValue & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TStringValue &a, TStringValue &b); - -std::ostream& operator<<(std::ostream& out, const TStringValue& obj); - -typedef struct _TColumnValue__isset { - _TColumnValue__isset() : boolVal(false), byteVal(false), i16Val(false), i32Val(false), i64Val(false), doubleVal(false), stringVal(false) {} - bool boolVal :1; - bool byteVal :1; - bool i16Val :1; - bool i32Val :1; - bool i64Val :1; - bool doubleVal :1; - bool stringVal :1; -} _TColumnValue__isset; - -class TColumnValue : public virtual ::apache::thrift::TBase { - public: - - TColumnValue(const TColumnValue&); - TColumnValue& operator=(const TColumnValue&); - TColumnValue() { - } - - virtual ~TColumnValue() throw(); - TBoolValue boolVal; - TByteValue byteVal; - TI16Value i16Val; - TI32Value i32Val; - TI64Value i64Val; - TDoubleValue doubleVal; - TStringValue stringVal; - - _TColumnValue__isset __isset; - - void __set_boolVal(const TBoolValue& val); - - void __set_byteVal(const TByteValue& val); - - void __set_i16Val(const TI16Value& val); - - void __set_i32Val(const TI32Value& val); - - void __set_i64Val(const TI64Value& val); - - void __set_doubleVal(const TDoubleValue& val); - - void __set_stringVal(const TStringValue& val); - - bool operator == (const TColumnValue & rhs) const - { - if (__isset.boolVal != rhs.__isset.boolVal) - return false; - else if (__isset.boolVal && !(boolVal == rhs.boolVal)) - return false; - if (__isset.byteVal != rhs.__isset.byteVal) - return false; - else if (__isset.byteVal && !(byteVal == rhs.byteVal)) - return false; - if (__isset.i16Val != rhs.__isset.i16Val) - return false; - else if (__isset.i16Val && !(i16Val == rhs.i16Val)) - return false; - if (__isset.i32Val != rhs.__isset.i32Val) - return false; - else if (__isset.i32Val && !(i32Val == rhs.i32Val)) - return false; - if (__isset.i64Val != rhs.__isset.i64Val) - return false; - else if (__isset.i64Val && !(i64Val == rhs.i64Val)) - return false; - if (__isset.doubleVal != rhs.__isset.doubleVal) - return false; - else if (__isset.doubleVal && !(doubleVal == rhs.doubleVal)) - return false; - if (__isset.stringVal != rhs.__isset.stringVal) - return false; - else if (__isset.stringVal && !(stringVal == rhs.stringVal)) - return false; - return true; - } - bool operator != (const TColumnValue &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TColumnValue & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TColumnValue &a, TColumnValue &b); - -std::ostream& operator<<(std::ostream& out, const TColumnValue& obj); - - -class TRow : public virtual ::apache::thrift::TBase { - public: - - TRow(const TRow&); - TRow& operator=(const TRow&); - TRow() { - } - - virtual ~TRow() throw(); - std::vector colVals; - - void __set_colVals(const std::vector & val); - - bool operator == (const TRow & rhs) const - { - if (!(colVals == rhs.colVals)) - return false; - return true; - } - bool operator != (const TRow &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TRow & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TRow &a, TRow &b); - -std::ostream& operator<<(std::ostream& out, const TRow& obj); - - -class TBoolColumn : public virtual ::apache::thrift::TBase { - public: - - TBoolColumn(const TBoolColumn&); - TBoolColumn& operator=(const TBoolColumn&); - TBoolColumn() : nulls() { - } - - virtual ~TBoolColumn() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TBoolColumn & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TBoolColumn &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TBoolColumn & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TBoolColumn &a, TBoolColumn &b); - -std::ostream& operator<<(std::ostream& out, const TBoolColumn& obj); - - -class TByteColumn : public virtual ::apache::thrift::TBase { - public: - - TByteColumn(const TByteColumn&); - TByteColumn& operator=(const TByteColumn&); - TByteColumn() : nulls() { - } - - virtual ~TByteColumn() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TByteColumn & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TByteColumn &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TByteColumn & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TByteColumn &a, TByteColumn &b); - -std::ostream& operator<<(std::ostream& out, const TByteColumn& obj); - - -class TI16Column : public virtual ::apache::thrift::TBase { - public: - - TI16Column(const TI16Column&); - TI16Column& operator=(const TI16Column&); - TI16Column() : nulls() { - } - - virtual ~TI16Column() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TI16Column & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TI16Column &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TI16Column & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TI16Column &a, TI16Column &b); - -std::ostream& operator<<(std::ostream& out, const TI16Column& obj); - - -class TI32Column : public virtual ::apache::thrift::TBase { - public: - - TI32Column(const TI32Column&); - TI32Column& operator=(const TI32Column&); - TI32Column() : nulls() { - } - - virtual ~TI32Column() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TI32Column & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TI32Column &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TI32Column & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TI32Column &a, TI32Column &b); - -std::ostream& operator<<(std::ostream& out, const TI32Column& obj); - - -class TI64Column : public virtual ::apache::thrift::TBase { - public: - - TI64Column(const TI64Column&); - TI64Column& operator=(const TI64Column&); - TI64Column() : nulls() { - } - - virtual ~TI64Column() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TI64Column & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TI64Column &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TI64Column & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TI64Column &a, TI64Column &b); - -std::ostream& operator<<(std::ostream& out, const TI64Column& obj); - - -class TDoubleColumn : public virtual ::apache::thrift::TBase { - public: - - TDoubleColumn(const TDoubleColumn&); - TDoubleColumn& operator=(const TDoubleColumn&); - TDoubleColumn() : nulls() { - } - - virtual ~TDoubleColumn() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TDoubleColumn & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TDoubleColumn &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TDoubleColumn & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TDoubleColumn &a, TDoubleColumn &b); - -std::ostream& operator<<(std::ostream& out, const TDoubleColumn& obj); - - -class TStringColumn : public virtual ::apache::thrift::TBase { - public: - - TStringColumn(const TStringColumn&); - TStringColumn& operator=(const TStringColumn&); - TStringColumn() : nulls() { - } - - virtual ~TStringColumn() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TStringColumn & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TStringColumn &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TStringColumn & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TStringColumn &a, TStringColumn &b); - -std::ostream& operator<<(std::ostream& out, const TStringColumn& obj); - - -class TBinaryColumn : public virtual ::apache::thrift::TBase { - public: - - TBinaryColumn(const TBinaryColumn&); - TBinaryColumn& operator=(const TBinaryColumn&); - TBinaryColumn() : nulls() { - } - - virtual ~TBinaryColumn() throw(); - std::vector values; - std::string nulls; - - void __set_values(const std::vector & val); - - void __set_nulls(const std::string& val); - - bool operator == (const TBinaryColumn & rhs) const - { - if (!(values == rhs.values)) - return false; - if (!(nulls == rhs.nulls)) - return false; - return true; - } - bool operator != (const TBinaryColumn &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TBinaryColumn & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TBinaryColumn &a, TBinaryColumn &b); - -std::ostream& operator<<(std::ostream& out, const TBinaryColumn& obj); - -typedef struct _TColumn__isset { - _TColumn__isset() : boolVal(false), byteVal(false), i16Val(false), i32Val(false), i64Val(false), doubleVal(false), stringVal(false), binaryVal(false) {} - bool boolVal :1; - bool byteVal :1; - bool i16Val :1; - bool i32Val :1; - bool i64Val :1; - bool doubleVal :1; - bool stringVal :1; - bool binaryVal :1; -} _TColumn__isset; - -class TColumn : public virtual ::apache::thrift::TBase { - public: - - TColumn(const TColumn&); - TColumn& operator=(const TColumn&); - TColumn() { - } - - virtual ~TColumn() throw(); - TBoolColumn boolVal; - TByteColumn byteVal; - TI16Column i16Val; - TI32Column i32Val; - TI64Column i64Val; - TDoubleColumn doubleVal; - TStringColumn stringVal; - TBinaryColumn binaryVal; - - _TColumn__isset __isset; - - void __set_boolVal(const TBoolColumn& val); - - void __set_byteVal(const TByteColumn& val); - - void __set_i16Val(const TI16Column& val); - - void __set_i32Val(const TI32Column& val); - - void __set_i64Val(const TI64Column& val); - - void __set_doubleVal(const TDoubleColumn& val); - - void __set_stringVal(const TStringColumn& val); - - void __set_binaryVal(const TBinaryColumn& val); - - bool operator == (const TColumn & rhs) const - { - if (__isset.boolVal != rhs.__isset.boolVal) - return false; - else if (__isset.boolVal && !(boolVal == rhs.boolVal)) - return false; - if (__isset.byteVal != rhs.__isset.byteVal) - return false; - else if (__isset.byteVal && !(byteVal == rhs.byteVal)) - return false; - if (__isset.i16Val != rhs.__isset.i16Val) - return false; - else if (__isset.i16Val && !(i16Val == rhs.i16Val)) - return false; - if (__isset.i32Val != rhs.__isset.i32Val) - return false; - else if (__isset.i32Val && !(i32Val == rhs.i32Val)) - return false; - if (__isset.i64Val != rhs.__isset.i64Val) - return false; - else if (__isset.i64Val && !(i64Val == rhs.i64Val)) - return false; - if (__isset.doubleVal != rhs.__isset.doubleVal) - return false; - else if (__isset.doubleVal && !(doubleVal == rhs.doubleVal)) - return false; - if (__isset.stringVal != rhs.__isset.stringVal) - return false; - else if (__isset.stringVal && !(stringVal == rhs.stringVal)) - return false; - if (__isset.binaryVal != rhs.__isset.binaryVal) - return false; - else if (__isset.binaryVal && !(binaryVal == rhs.binaryVal)) - return false; - return true; - } - bool operator != (const TColumn &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TColumn & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TColumn &a, TColumn &b); - -std::ostream& operator<<(std::ostream& out, const TColumn& obj); - -typedef struct _TRowSet__isset { - _TRowSet__isset() : columns(false), binaryColumns(false), columnCount(false) {} - bool columns :1; - bool binaryColumns :1; - bool columnCount :1; -} _TRowSet__isset; - -class TRowSet : public virtual ::apache::thrift::TBase { - public: - - TRowSet(const TRowSet&); - TRowSet& operator=(const TRowSet&); - TRowSet() : startRowOffset(0), binaryColumns(), columnCount(0) { - } - - virtual ~TRowSet() throw(); - int64_t startRowOffset; - std::vector rows; - std::vector columns; - std::string binaryColumns; - int32_t columnCount; - - _TRowSet__isset __isset; - - void __set_startRowOffset(const int64_t val); - - void __set_rows(const std::vector & val); - - void __set_columns(const std::vector & val); - - void __set_binaryColumns(const std::string& val); - - void __set_columnCount(const int32_t val); - - bool operator == (const TRowSet & rhs) const - { - if (!(startRowOffset == rhs.startRowOffset)) - return false; - if (!(rows == rhs.rows)) - return false; - if (__isset.columns != rhs.__isset.columns) - return false; - else if (__isset.columns && !(columns == rhs.columns)) - return false; - if (__isset.binaryColumns != rhs.__isset.binaryColumns) - return false; - else if (__isset.binaryColumns && !(binaryColumns == rhs.binaryColumns)) - return false; - if (__isset.columnCount != rhs.__isset.columnCount) - return false; - else if (__isset.columnCount && !(columnCount == rhs.columnCount)) - return false; - return true; - } - bool operator != (const TRowSet &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TRowSet & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TRowSet &a, TRowSet &b); - -std::ostream& operator<<(std::ostream& out, const TRowSet& obj); - -typedef struct _TStatus__isset { - _TStatus__isset() : infoMessages(false), sqlState(false), errorCode(false), errorMessage(false) {} - bool infoMessages :1; - bool sqlState :1; - bool errorCode :1; - bool errorMessage :1; -} _TStatus__isset; - -class TStatus : public virtual ::apache::thrift::TBase { - public: - - TStatus(const TStatus&); - TStatus& operator=(const TStatus&); - TStatus() : statusCode((TStatusCode::type)0), sqlState(), errorCode(0), errorMessage() { - } - - virtual ~TStatus() throw(); - TStatusCode::type statusCode; - std::vector infoMessages; - std::string sqlState; - int32_t errorCode; - std::string errorMessage; - - _TStatus__isset __isset; - - void __set_statusCode(const TStatusCode::type val); - - void __set_infoMessages(const std::vector & val); - - void __set_sqlState(const std::string& val); - - void __set_errorCode(const int32_t val); - - void __set_errorMessage(const std::string& val); - - bool operator == (const TStatus & rhs) const - { - if (!(statusCode == rhs.statusCode)) - return false; - if (__isset.infoMessages != rhs.__isset.infoMessages) - return false; - else if (__isset.infoMessages && !(infoMessages == rhs.infoMessages)) - return false; - if (__isset.sqlState != rhs.__isset.sqlState) - return false; - else if (__isset.sqlState && !(sqlState == rhs.sqlState)) - return false; - if (__isset.errorCode != rhs.__isset.errorCode) - return false; - else if (__isset.errorCode && !(errorCode == rhs.errorCode)) - return false; - if (__isset.errorMessage != rhs.__isset.errorMessage) - return false; - else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) - return false; - return true; - } - bool operator != (const TStatus &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TStatus & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TStatus &a, TStatus &b); - -std::ostream& operator<<(std::ostream& out, const TStatus& obj); - - -class THandleIdentifier : public virtual ::apache::thrift::TBase { - public: - - THandleIdentifier(const THandleIdentifier&); - THandleIdentifier& operator=(const THandleIdentifier&); - THandleIdentifier() : guid(), secret() { - } - - virtual ~THandleIdentifier() throw(); - std::string guid; - std::string secret; - - void __set_guid(const std::string& val); - - void __set_secret(const std::string& val); - - bool operator == (const THandleIdentifier & rhs) const - { - if (!(guid == rhs.guid)) - return false; - if (!(secret == rhs.secret)) - return false; - return true; - } - bool operator != (const THandleIdentifier &rhs) const { - return !(*this == rhs); - } - - bool operator < (const THandleIdentifier & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(THandleIdentifier &a, THandleIdentifier &b); - -std::ostream& operator<<(std::ostream& out, const THandleIdentifier& obj); - - -class TSessionHandle : public virtual ::apache::thrift::TBase { - public: - - TSessionHandle(const TSessionHandle&); - TSessionHandle& operator=(const TSessionHandle&); - TSessionHandle() { - } - - virtual ~TSessionHandle() throw(); - THandleIdentifier sessionId; - - void __set_sessionId(const THandleIdentifier& val); - - bool operator == (const TSessionHandle & rhs) const - { - if (!(sessionId == rhs.sessionId)) - return false; - return true; - } - bool operator != (const TSessionHandle &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TSessionHandle & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TSessionHandle &a, TSessionHandle &b); - -std::ostream& operator<<(std::ostream& out, const TSessionHandle& obj); - -typedef struct _TOperationHandle__isset { - _TOperationHandle__isset() : modifiedRowCount(false) {} - bool modifiedRowCount :1; -} _TOperationHandle__isset; - -class TOperationHandle : public virtual ::apache::thrift::TBase { - public: - - TOperationHandle(const TOperationHandle&); - TOperationHandle& operator=(const TOperationHandle&); - TOperationHandle() : operationType((TOperationType::type)0), hasResultSet(0), modifiedRowCount(0) { - } - - virtual ~TOperationHandle() throw(); - THandleIdentifier operationId; - TOperationType::type operationType; - bool hasResultSet; - double modifiedRowCount; - - _TOperationHandle__isset __isset; - - void __set_operationId(const THandleIdentifier& val); - - void __set_operationType(const TOperationType::type val); - - void __set_hasResultSet(const bool val); - - void __set_modifiedRowCount(const double val); - - bool operator == (const TOperationHandle & rhs) const - { - if (!(operationId == rhs.operationId)) - return false; - if (!(operationType == rhs.operationType)) - return false; - if (!(hasResultSet == rhs.hasResultSet)) - return false; - if (__isset.modifiedRowCount != rhs.__isset.modifiedRowCount) - return false; - else if (__isset.modifiedRowCount && !(modifiedRowCount == rhs.modifiedRowCount)) - return false; - return true; - } - bool operator != (const TOperationHandle &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TOperationHandle & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TOperationHandle &a, TOperationHandle &b); - -std::ostream& operator<<(std::ostream& out, const TOperationHandle& obj); - -typedef struct _TOpenSessionReq__isset { - _TOpenSessionReq__isset() : username(false), password(false), configuration(false) {} - bool username :1; - bool password :1; - bool configuration :1; -} _TOpenSessionReq__isset; - -class TOpenSessionReq : public virtual ::apache::thrift::TBase { - public: - - TOpenSessionReq(const TOpenSessionReq&); - TOpenSessionReq& operator=(const TOpenSessionReq&); - TOpenSessionReq() : client_protocol((TProtocolVersion::type)9), username(), password() { - client_protocol = (TProtocolVersion::type)9; - - } - - virtual ~TOpenSessionReq() throw(); - TProtocolVersion::type client_protocol; - std::string username; - std::string password; - std::map configuration; - - _TOpenSessionReq__isset __isset; - - void __set_client_protocol(const TProtocolVersion::type val); - - void __set_username(const std::string& val); - - void __set_password(const std::string& val); - - void __set_configuration(const std::map & val); - - bool operator == (const TOpenSessionReq & rhs) const - { - if (!(client_protocol == rhs.client_protocol)) - return false; - if (__isset.username != rhs.__isset.username) - return false; - else if (__isset.username && !(username == rhs.username)) - return false; - if (__isset.password != rhs.__isset.password) - return false; - else if (__isset.password && !(password == rhs.password)) - return false; - if (__isset.configuration != rhs.__isset.configuration) - return false; - else if (__isset.configuration && !(configuration == rhs.configuration)) - return false; - return true; - } - bool operator != (const TOpenSessionReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TOpenSessionReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TOpenSessionReq &a, TOpenSessionReq &b); - -std::ostream& operator<<(std::ostream& out, const TOpenSessionReq& obj); - -typedef struct _TOpenSessionResp__isset { - _TOpenSessionResp__isset() : sessionHandle(false), configuration(false) {} - bool sessionHandle :1; - bool configuration :1; -} _TOpenSessionResp__isset; - -class TOpenSessionResp : public virtual ::apache::thrift::TBase { - public: - - TOpenSessionResp(const TOpenSessionResp&); - TOpenSessionResp& operator=(const TOpenSessionResp&); - TOpenSessionResp() : serverProtocolVersion((TProtocolVersion::type)9) { - serverProtocolVersion = (TProtocolVersion::type)9; - - } - - virtual ~TOpenSessionResp() throw(); - TStatus status; - TProtocolVersion::type serverProtocolVersion; - TSessionHandle sessionHandle; - std::map configuration; - - _TOpenSessionResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_serverProtocolVersion(const TProtocolVersion::type val); - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_configuration(const std::map & val); - - bool operator == (const TOpenSessionResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (!(serverProtocolVersion == rhs.serverProtocolVersion)) - return false; - if (__isset.sessionHandle != rhs.__isset.sessionHandle) - return false; - else if (__isset.sessionHandle && !(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.configuration != rhs.__isset.configuration) - return false; - else if (__isset.configuration && !(configuration == rhs.configuration)) - return false; - return true; - } - bool operator != (const TOpenSessionResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TOpenSessionResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TOpenSessionResp &a, TOpenSessionResp &b); - -std::ostream& operator<<(std::ostream& out, const TOpenSessionResp& obj); - -typedef struct _TSetClientInfoReq__isset { - _TSetClientInfoReq__isset() : configuration(false) {} - bool configuration :1; -} _TSetClientInfoReq__isset; - -class TSetClientInfoReq : public virtual ::apache::thrift::TBase { - public: - - TSetClientInfoReq(const TSetClientInfoReq&); - TSetClientInfoReq& operator=(const TSetClientInfoReq&); - TSetClientInfoReq() { - } - - virtual ~TSetClientInfoReq() throw(); - TSessionHandle sessionHandle; - std::map configuration; - - _TSetClientInfoReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_configuration(const std::map & val); - - bool operator == (const TSetClientInfoReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.configuration != rhs.__isset.configuration) - return false; - else if (__isset.configuration && !(configuration == rhs.configuration)) - return false; - return true; - } - bool operator != (const TSetClientInfoReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TSetClientInfoReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TSetClientInfoReq &a, TSetClientInfoReq &b); - -std::ostream& operator<<(std::ostream& out, const TSetClientInfoReq& obj); - - -class TSetClientInfoResp : public virtual ::apache::thrift::TBase { - public: - - TSetClientInfoResp(const TSetClientInfoResp&); - TSetClientInfoResp& operator=(const TSetClientInfoResp&); - TSetClientInfoResp() { - } - - virtual ~TSetClientInfoResp() throw(); - TStatus status; - - void __set_status(const TStatus& val); - - bool operator == (const TSetClientInfoResp & rhs) const - { - if (!(status == rhs.status)) - return false; - return true; - } - bool operator != (const TSetClientInfoResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TSetClientInfoResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TSetClientInfoResp &a, TSetClientInfoResp &b); - -std::ostream& operator<<(std::ostream& out, const TSetClientInfoResp& obj); - - -class TCloseSessionReq : public virtual ::apache::thrift::TBase { - public: - - TCloseSessionReq(const TCloseSessionReq&); - TCloseSessionReq& operator=(const TCloseSessionReq&); - TCloseSessionReq() { - } - - virtual ~TCloseSessionReq() throw(); - TSessionHandle sessionHandle; - - void __set_sessionHandle(const TSessionHandle& val); - - bool operator == (const TCloseSessionReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - return true; - } - bool operator != (const TCloseSessionReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCloseSessionReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCloseSessionReq &a, TCloseSessionReq &b); - -std::ostream& operator<<(std::ostream& out, const TCloseSessionReq& obj); - - -class TCloseSessionResp : public virtual ::apache::thrift::TBase { - public: - - TCloseSessionResp(const TCloseSessionResp&); - TCloseSessionResp& operator=(const TCloseSessionResp&); - TCloseSessionResp() { - } - - virtual ~TCloseSessionResp() throw(); - TStatus status; - - void __set_status(const TStatus& val); - - bool operator == (const TCloseSessionResp & rhs) const - { - if (!(status == rhs.status)) - return false; - return true; - } - bool operator != (const TCloseSessionResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCloseSessionResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCloseSessionResp &a, TCloseSessionResp &b); - -std::ostream& operator<<(std::ostream& out, const TCloseSessionResp& obj); - -typedef struct _TGetInfoValue__isset { - _TGetInfoValue__isset() : stringValue(false), smallIntValue(false), integerBitmask(false), integerFlag(false), binaryValue(false), lenValue(false) {} - bool stringValue :1; - bool smallIntValue :1; - bool integerBitmask :1; - bool integerFlag :1; - bool binaryValue :1; - bool lenValue :1; -} _TGetInfoValue__isset; - -class TGetInfoValue : public virtual ::apache::thrift::TBase { - public: - - TGetInfoValue(const TGetInfoValue&); - TGetInfoValue& operator=(const TGetInfoValue&); - TGetInfoValue() : stringValue(), smallIntValue(0), integerBitmask(0), integerFlag(0), binaryValue(0), lenValue(0) { - } - - virtual ~TGetInfoValue() throw(); - std::string stringValue; - int16_t smallIntValue; - int32_t integerBitmask; - int32_t integerFlag; - int32_t binaryValue; - int64_t lenValue; - - _TGetInfoValue__isset __isset; - - void __set_stringValue(const std::string& val); - - void __set_smallIntValue(const int16_t val); - - void __set_integerBitmask(const int32_t val); - - void __set_integerFlag(const int32_t val); - - void __set_binaryValue(const int32_t val); - - void __set_lenValue(const int64_t val); - - bool operator == (const TGetInfoValue & rhs) const - { - if (__isset.stringValue != rhs.__isset.stringValue) - return false; - else if (__isset.stringValue && !(stringValue == rhs.stringValue)) - return false; - if (__isset.smallIntValue != rhs.__isset.smallIntValue) - return false; - else if (__isset.smallIntValue && !(smallIntValue == rhs.smallIntValue)) - return false; - if (__isset.integerBitmask != rhs.__isset.integerBitmask) - return false; - else if (__isset.integerBitmask && !(integerBitmask == rhs.integerBitmask)) - return false; - if (__isset.integerFlag != rhs.__isset.integerFlag) - return false; - else if (__isset.integerFlag && !(integerFlag == rhs.integerFlag)) - return false; - if (__isset.binaryValue != rhs.__isset.binaryValue) - return false; - else if (__isset.binaryValue && !(binaryValue == rhs.binaryValue)) - return false; - if (__isset.lenValue != rhs.__isset.lenValue) - return false; - else if (__isset.lenValue && !(lenValue == rhs.lenValue)) - return false; - return true; - } - bool operator != (const TGetInfoValue &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetInfoValue & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetInfoValue &a, TGetInfoValue &b); - -std::ostream& operator<<(std::ostream& out, const TGetInfoValue& obj); - - -class TGetInfoReq : public virtual ::apache::thrift::TBase { - public: - - TGetInfoReq(const TGetInfoReq&); - TGetInfoReq& operator=(const TGetInfoReq&); - TGetInfoReq() : infoType((TGetInfoType::type)0) { - } - - virtual ~TGetInfoReq() throw(); - TSessionHandle sessionHandle; - TGetInfoType::type infoType; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_infoType(const TGetInfoType::type val); - - bool operator == (const TGetInfoReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (!(infoType == rhs.infoType)) - return false; - return true; - } - bool operator != (const TGetInfoReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetInfoReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetInfoReq &a, TGetInfoReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetInfoReq& obj); - - -class TGetInfoResp : public virtual ::apache::thrift::TBase { - public: - - TGetInfoResp(const TGetInfoResp&); - TGetInfoResp& operator=(const TGetInfoResp&); - TGetInfoResp() { - } - - virtual ~TGetInfoResp() throw(); - TStatus status; - TGetInfoValue infoValue; - - void __set_status(const TStatus& val); - - void __set_infoValue(const TGetInfoValue& val); - - bool operator == (const TGetInfoResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (!(infoValue == rhs.infoValue)) - return false; - return true; - } - bool operator != (const TGetInfoResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetInfoResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetInfoResp &a, TGetInfoResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetInfoResp& obj); - -typedef struct _TExecuteStatementReq__isset { - _TExecuteStatementReq__isset() : confOverlay(false), runAsync(true), queryTimeout(true) {} - bool confOverlay :1; - bool runAsync :1; - bool queryTimeout :1; -} _TExecuteStatementReq__isset; - -class TExecuteStatementReq : public virtual ::apache::thrift::TBase { - public: - - TExecuteStatementReq(const TExecuteStatementReq&); - TExecuteStatementReq& operator=(const TExecuteStatementReq&); - TExecuteStatementReq() : statement(), runAsync(false), queryTimeout(0LL) { - } - - virtual ~TExecuteStatementReq() throw(); - TSessionHandle sessionHandle; - std::string statement; - std::map confOverlay; - bool runAsync; - int64_t queryTimeout; - - _TExecuteStatementReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_statement(const std::string& val); - - void __set_confOverlay(const std::map & val); - - void __set_runAsync(const bool val); - - void __set_queryTimeout(const int64_t val); - - bool operator == (const TExecuteStatementReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (!(statement == rhs.statement)) - return false; - if (__isset.confOverlay != rhs.__isset.confOverlay) - return false; - else if (__isset.confOverlay && !(confOverlay == rhs.confOverlay)) - return false; - if (__isset.runAsync != rhs.__isset.runAsync) - return false; - else if (__isset.runAsync && !(runAsync == rhs.runAsync)) - return false; - if (__isset.queryTimeout != rhs.__isset.queryTimeout) - return false; - else if (__isset.queryTimeout && !(queryTimeout == rhs.queryTimeout)) - return false; - return true; - } - bool operator != (const TExecuteStatementReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TExecuteStatementReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TExecuteStatementReq &a, TExecuteStatementReq &b); - -std::ostream& operator<<(std::ostream& out, const TExecuteStatementReq& obj); - -typedef struct _TExecuteStatementResp__isset { - _TExecuteStatementResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TExecuteStatementResp__isset; - -class TExecuteStatementResp : public virtual ::apache::thrift::TBase { - public: - - TExecuteStatementResp(const TExecuteStatementResp&); - TExecuteStatementResp& operator=(const TExecuteStatementResp&); - TExecuteStatementResp() { - } - - virtual ~TExecuteStatementResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TExecuteStatementResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TExecuteStatementResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TExecuteStatementResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TExecuteStatementResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TExecuteStatementResp &a, TExecuteStatementResp &b); - -std::ostream& operator<<(std::ostream& out, const TExecuteStatementResp& obj); - - -class TGetTypeInfoReq : public virtual ::apache::thrift::TBase { - public: - - TGetTypeInfoReq(const TGetTypeInfoReq&); - TGetTypeInfoReq& operator=(const TGetTypeInfoReq&); - TGetTypeInfoReq() { - } - - virtual ~TGetTypeInfoReq() throw(); - TSessionHandle sessionHandle; - - void __set_sessionHandle(const TSessionHandle& val); - - bool operator == (const TGetTypeInfoReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - return true; - } - bool operator != (const TGetTypeInfoReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetTypeInfoReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetTypeInfoReq &a, TGetTypeInfoReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetTypeInfoReq& obj); - -typedef struct _TGetTypeInfoResp__isset { - _TGetTypeInfoResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetTypeInfoResp__isset; - -class TGetTypeInfoResp : public virtual ::apache::thrift::TBase { - public: - - TGetTypeInfoResp(const TGetTypeInfoResp&); - TGetTypeInfoResp& operator=(const TGetTypeInfoResp&); - TGetTypeInfoResp() { - } - - virtual ~TGetTypeInfoResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetTypeInfoResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetTypeInfoResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetTypeInfoResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetTypeInfoResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetTypeInfoResp &a, TGetTypeInfoResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetTypeInfoResp& obj); - - -class TGetCatalogsReq : public virtual ::apache::thrift::TBase { - public: - - TGetCatalogsReq(const TGetCatalogsReq&); - TGetCatalogsReq& operator=(const TGetCatalogsReq&); - TGetCatalogsReq() { - } - - virtual ~TGetCatalogsReq() throw(); - TSessionHandle sessionHandle; - - void __set_sessionHandle(const TSessionHandle& val); - - bool operator == (const TGetCatalogsReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - return true; - } - bool operator != (const TGetCatalogsReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetCatalogsReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetCatalogsReq &a, TGetCatalogsReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetCatalogsReq& obj); - -typedef struct _TGetCatalogsResp__isset { - _TGetCatalogsResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetCatalogsResp__isset; - -class TGetCatalogsResp : public virtual ::apache::thrift::TBase { - public: - - TGetCatalogsResp(const TGetCatalogsResp&); - TGetCatalogsResp& operator=(const TGetCatalogsResp&); - TGetCatalogsResp() { - } - - virtual ~TGetCatalogsResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetCatalogsResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetCatalogsResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetCatalogsResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetCatalogsResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetCatalogsResp &a, TGetCatalogsResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetCatalogsResp& obj); - -typedef struct _TGetSchemasReq__isset { - _TGetSchemasReq__isset() : catalogName(false), schemaName(false) {} - bool catalogName :1; - bool schemaName :1; -} _TGetSchemasReq__isset; - -class TGetSchemasReq : public virtual ::apache::thrift::TBase { - public: - - TGetSchemasReq(const TGetSchemasReq&); - TGetSchemasReq& operator=(const TGetSchemasReq&); - TGetSchemasReq() : catalogName(), schemaName() { - } - - virtual ~TGetSchemasReq() throw(); - TSessionHandle sessionHandle; - TIdentifier catalogName; - TPatternOrIdentifier schemaName; - - _TGetSchemasReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_catalogName(const TIdentifier& val); - - void __set_schemaName(const TPatternOrIdentifier& val); - - bool operator == (const TGetSchemasReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.catalogName != rhs.__isset.catalogName) - return false; - else if (__isset.catalogName && !(catalogName == rhs.catalogName)) - return false; - if (__isset.schemaName != rhs.__isset.schemaName) - return false; - else if (__isset.schemaName && !(schemaName == rhs.schemaName)) - return false; - return true; - } - bool operator != (const TGetSchemasReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetSchemasReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetSchemasReq &a, TGetSchemasReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetSchemasReq& obj); - -typedef struct _TGetSchemasResp__isset { - _TGetSchemasResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetSchemasResp__isset; - -class TGetSchemasResp : public virtual ::apache::thrift::TBase { - public: - - TGetSchemasResp(const TGetSchemasResp&); - TGetSchemasResp& operator=(const TGetSchemasResp&); - TGetSchemasResp() { - } - - virtual ~TGetSchemasResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetSchemasResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetSchemasResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetSchemasResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetSchemasResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetSchemasResp &a, TGetSchemasResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetSchemasResp& obj); - -typedef struct _TGetTablesReq__isset { - _TGetTablesReq__isset() : catalogName(false), schemaName(false), tableName(false), tableTypes(false) {} - bool catalogName :1; - bool schemaName :1; - bool tableName :1; - bool tableTypes :1; -} _TGetTablesReq__isset; - -class TGetTablesReq : public virtual ::apache::thrift::TBase { - public: - - TGetTablesReq(const TGetTablesReq&); - TGetTablesReq& operator=(const TGetTablesReq&); - TGetTablesReq() : catalogName(), schemaName(), tableName() { - } - - virtual ~TGetTablesReq() throw(); - TSessionHandle sessionHandle; - TPatternOrIdentifier catalogName; - TPatternOrIdentifier schemaName; - TPatternOrIdentifier tableName; - std::vector tableTypes; - - _TGetTablesReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_catalogName(const TPatternOrIdentifier& val); - - void __set_schemaName(const TPatternOrIdentifier& val); - - void __set_tableName(const TPatternOrIdentifier& val); - - void __set_tableTypes(const std::vector & val); - - bool operator == (const TGetTablesReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.catalogName != rhs.__isset.catalogName) - return false; - else if (__isset.catalogName && !(catalogName == rhs.catalogName)) - return false; - if (__isset.schemaName != rhs.__isset.schemaName) - return false; - else if (__isset.schemaName && !(schemaName == rhs.schemaName)) - return false; - if (__isset.tableName != rhs.__isset.tableName) - return false; - else if (__isset.tableName && !(tableName == rhs.tableName)) - return false; - if (__isset.tableTypes != rhs.__isset.tableTypes) - return false; - else if (__isset.tableTypes && !(tableTypes == rhs.tableTypes)) - return false; - return true; - } - bool operator != (const TGetTablesReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetTablesReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetTablesReq &a, TGetTablesReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetTablesReq& obj); - -typedef struct _TGetTablesResp__isset { - _TGetTablesResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetTablesResp__isset; - -class TGetTablesResp : public virtual ::apache::thrift::TBase { - public: - - TGetTablesResp(const TGetTablesResp&); - TGetTablesResp& operator=(const TGetTablesResp&); - TGetTablesResp() { - } - - virtual ~TGetTablesResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetTablesResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetTablesResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetTablesResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetTablesResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetTablesResp &a, TGetTablesResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetTablesResp& obj); - - -class TGetTableTypesReq : public virtual ::apache::thrift::TBase { - public: - - TGetTableTypesReq(const TGetTableTypesReq&); - TGetTableTypesReq& operator=(const TGetTableTypesReq&); - TGetTableTypesReq() { - } - - virtual ~TGetTableTypesReq() throw(); - TSessionHandle sessionHandle; - - void __set_sessionHandle(const TSessionHandle& val); - - bool operator == (const TGetTableTypesReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - return true; - } - bool operator != (const TGetTableTypesReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetTableTypesReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetTableTypesReq &a, TGetTableTypesReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetTableTypesReq& obj); - -typedef struct _TGetTableTypesResp__isset { - _TGetTableTypesResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetTableTypesResp__isset; - -class TGetTableTypesResp : public virtual ::apache::thrift::TBase { - public: - - TGetTableTypesResp(const TGetTableTypesResp&); - TGetTableTypesResp& operator=(const TGetTableTypesResp&); - TGetTableTypesResp() { - } - - virtual ~TGetTableTypesResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetTableTypesResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetTableTypesResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetTableTypesResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetTableTypesResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetTableTypesResp &a, TGetTableTypesResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetTableTypesResp& obj); - -typedef struct _TGetColumnsReq__isset { - _TGetColumnsReq__isset() : catalogName(false), schemaName(false), tableName(false), columnName(false) {} - bool catalogName :1; - bool schemaName :1; - bool tableName :1; - bool columnName :1; -} _TGetColumnsReq__isset; - -class TGetColumnsReq : public virtual ::apache::thrift::TBase { - public: - - TGetColumnsReq(const TGetColumnsReq&); - TGetColumnsReq& operator=(const TGetColumnsReq&); - TGetColumnsReq() : catalogName(), schemaName(), tableName(), columnName() { - } - - virtual ~TGetColumnsReq() throw(); - TSessionHandle sessionHandle; - TIdentifier catalogName; - TPatternOrIdentifier schemaName; - TPatternOrIdentifier tableName; - TPatternOrIdentifier columnName; - - _TGetColumnsReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_catalogName(const TIdentifier& val); - - void __set_schemaName(const TPatternOrIdentifier& val); - - void __set_tableName(const TPatternOrIdentifier& val); - - void __set_columnName(const TPatternOrIdentifier& val); - - bool operator == (const TGetColumnsReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.catalogName != rhs.__isset.catalogName) - return false; - else if (__isset.catalogName && !(catalogName == rhs.catalogName)) - return false; - if (__isset.schemaName != rhs.__isset.schemaName) - return false; - else if (__isset.schemaName && !(schemaName == rhs.schemaName)) - return false; - if (__isset.tableName != rhs.__isset.tableName) - return false; - else if (__isset.tableName && !(tableName == rhs.tableName)) - return false; - if (__isset.columnName != rhs.__isset.columnName) - return false; - else if (__isset.columnName && !(columnName == rhs.columnName)) - return false; - return true; - } - bool operator != (const TGetColumnsReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetColumnsReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetColumnsReq &a, TGetColumnsReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetColumnsReq& obj); - -typedef struct _TGetColumnsResp__isset { - _TGetColumnsResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetColumnsResp__isset; - -class TGetColumnsResp : public virtual ::apache::thrift::TBase { - public: - - TGetColumnsResp(const TGetColumnsResp&); - TGetColumnsResp& operator=(const TGetColumnsResp&); - TGetColumnsResp() { - } - - virtual ~TGetColumnsResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetColumnsResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetColumnsResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetColumnsResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetColumnsResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetColumnsResp &a, TGetColumnsResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetColumnsResp& obj); - -typedef struct _TGetFunctionsReq__isset { - _TGetFunctionsReq__isset() : catalogName(false), schemaName(false) {} - bool catalogName :1; - bool schemaName :1; -} _TGetFunctionsReq__isset; - -class TGetFunctionsReq : public virtual ::apache::thrift::TBase { - public: - - TGetFunctionsReq(const TGetFunctionsReq&); - TGetFunctionsReq& operator=(const TGetFunctionsReq&); - TGetFunctionsReq() : catalogName(), schemaName(), functionName() { - } - - virtual ~TGetFunctionsReq() throw(); - TSessionHandle sessionHandle; - TIdentifier catalogName; - TPatternOrIdentifier schemaName; - TPatternOrIdentifier functionName; - - _TGetFunctionsReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_catalogName(const TIdentifier& val); - - void __set_schemaName(const TPatternOrIdentifier& val); - - void __set_functionName(const TPatternOrIdentifier& val); - - bool operator == (const TGetFunctionsReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.catalogName != rhs.__isset.catalogName) - return false; - else if (__isset.catalogName && !(catalogName == rhs.catalogName)) - return false; - if (__isset.schemaName != rhs.__isset.schemaName) - return false; - else if (__isset.schemaName && !(schemaName == rhs.schemaName)) - return false; - if (!(functionName == rhs.functionName)) - return false; - return true; - } - bool operator != (const TGetFunctionsReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetFunctionsReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetFunctionsReq &a, TGetFunctionsReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetFunctionsReq& obj); - -typedef struct _TGetFunctionsResp__isset { - _TGetFunctionsResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetFunctionsResp__isset; - -class TGetFunctionsResp : public virtual ::apache::thrift::TBase { - public: - - TGetFunctionsResp(const TGetFunctionsResp&); - TGetFunctionsResp& operator=(const TGetFunctionsResp&); - TGetFunctionsResp() { - } - - virtual ~TGetFunctionsResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetFunctionsResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetFunctionsResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetFunctionsResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetFunctionsResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetFunctionsResp &a, TGetFunctionsResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetFunctionsResp& obj); - -typedef struct _TGetPrimaryKeysReq__isset { - _TGetPrimaryKeysReq__isset() : catalogName(false), schemaName(false), tableName(false) {} - bool catalogName :1; - bool schemaName :1; - bool tableName :1; -} _TGetPrimaryKeysReq__isset; - -class TGetPrimaryKeysReq : public virtual ::apache::thrift::TBase { - public: - - TGetPrimaryKeysReq(const TGetPrimaryKeysReq&); - TGetPrimaryKeysReq& operator=(const TGetPrimaryKeysReq&); - TGetPrimaryKeysReq() : catalogName(), schemaName(), tableName() { - } - - virtual ~TGetPrimaryKeysReq() throw(); - TSessionHandle sessionHandle; - TIdentifier catalogName; - TIdentifier schemaName; - TIdentifier tableName; - - _TGetPrimaryKeysReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_catalogName(const TIdentifier& val); - - void __set_schemaName(const TIdentifier& val); - - void __set_tableName(const TIdentifier& val); - - bool operator == (const TGetPrimaryKeysReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.catalogName != rhs.__isset.catalogName) - return false; - else if (__isset.catalogName && !(catalogName == rhs.catalogName)) - return false; - if (__isset.schemaName != rhs.__isset.schemaName) - return false; - else if (__isset.schemaName && !(schemaName == rhs.schemaName)) - return false; - if (__isset.tableName != rhs.__isset.tableName) - return false; - else if (__isset.tableName && !(tableName == rhs.tableName)) - return false; - return true; - } - bool operator != (const TGetPrimaryKeysReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetPrimaryKeysReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetPrimaryKeysReq &a, TGetPrimaryKeysReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysReq& obj); - -typedef struct _TGetPrimaryKeysResp__isset { - _TGetPrimaryKeysResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetPrimaryKeysResp__isset; - -class TGetPrimaryKeysResp : public virtual ::apache::thrift::TBase { - public: - - TGetPrimaryKeysResp(const TGetPrimaryKeysResp&); - TGetPrimaryKeysResp& operator=(const TGetPrimaryKeysResp&); - TGetPrimaryKeysResp() { - } - - virtual ~TGetPrimaryKeysResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetPrimaryKeysResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetPrimaryKeysResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetPrimaryKeysResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetPrimaryKeysResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetPrimaryKeysResp &a, TGetPrimaryKeysResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetPrimaryKeysResp& obj); - -typedef struct _TGetCrossReferenceReq__isset { - _TGetCrossReferenceReq__isset() : parentCatalogName(false), parentSchemaName(false), parentTableName(false), foreignCatalogName(false), foreignSchemaName(false), foreignTableName(false) {} - bool parentCatalogName :1; - bool parentSchemaName :1; - bool parentTableName :1; - bool foreignCatalogName :1; - bool foreignSchemaName :1; - bool foreignTableName :1; -} _TGetCrossReferenceReq__isset; - -class TGetCrossReferenceReq : public virtual ::apache::thrift::TBase { - public: - - TGetCrossReferenceReq(const TGetCrossReferenceReq&); - TGetCrossReferenceReq& operator=(const TGetCrossReferenceReq&); - TGetCrossReferenceReq() : parentCatalogName(), parentSchemaName(), parentTableName(), foreignCatalogName(), foreignSchemaName(), foreignTableName() { - } - - virtual ~TGetCrossReferenceReq() throw(); - TSessionHandle sessionHandle; - TIdentifier parentCatalogName; - TIdentifier parentSchemaName; - TIdentifier parentTableName; - TIdentifier foreignCatalogName; - TIdentifier foreignSchemaName; - TIdentifier foreignTableName; - - _TGetCrossReferenceReq__isset __isset; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_parentCatalogName(const TIdentifier& val); - - void __set_parentSchemaName(const TIdentifier& val); - - void __set_parentTableName(const TIdentifier& val); - - void __set_foreignCatalogName(const TIdentifier& val); - - void __set_foreignSchemaName(const TIdentifier& val); - - void __set_foreignTableName(const TIdentifier& val); - - bool operator == (const TGetCrossReferenceReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (__isset.parentCatalogName != rhs.__isset.parentCatalogName) - return false; - else if (__isset.parentCatalogName && !(parentCatalogName == rhs.parentCatalogName)) - return false; - if (__isset.parentSchemaName != rhs.__isset.parentSchemaName) - return false; - else if (__isset.parentSchemaName && !(parentSchemaName == rhs.parentSchemaName)) - return false; - if (__isset.parentTableName != rhs.__isset.parentTableName) - return false; - else if (__isset.parentTableName && !(parentTableName == rhs.parentTableName)) - return false; - if (__isset.foreignCatalogName != rhs.__isset.foreignCatalogName) - return false; - else if (__isset.foreignCatalogName && !(foreignCatalogName == rhs.foreignCatalogName)) - return false; - if (__isset.foreignSchemaName != rhs.__isset.foreignSchemaName) - return false; - else if (__isset.foreignSchemaName && !(foreignSchemaName == rhs.foreignSchemaName)) - return false; - if (__isset.foreignTableName != rhs.__isset.foreignTableName) - return false; - else if (__isset.foreignTableName && !(foreignTableName == rhs.foreignTableName)) - return false; - return true; - } - bool operator != (const TGetCrossReferenceReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetCrossReferenceReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetCrossReferenceReq &a, TGetCrossReferenceReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceReq& obj); - -typedef struct _TGetCrossReferenceResp__isset { - _TGetCrossReferenceResp__isset() : operationHandle(false) {} - bool operationHandle :1; -} _TGetCrossReferenceResp__isset; - -class TGetCrossReferenceResp : public virtual ::apache::thrift::TBase { - public: - - TGetCrossReferenceResp(const TGetCrossReferenceResp&); - TGetCrossReferenceResp& operator=(const TGetCrossReferenceResp&); - TGetCrossReferenceResp() { - } - - virtual ~TGetCrossReferenceResp() throw(); - TStatus status; - TOperationHandle operationHandle; - - _TGetCrossReferenceResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetCrossReferenceResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationHandle != rhs.__isset.operationHandle) - return false; - else if (__isset.operationHandle && !(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetCrossReferenceResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetCrossReferenceResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetCrossReferenceResp &a, TGetCrossReferenceResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetCrossReferenceResp& obj); - -typedef struct _TGetOperationStatusReq__isset { - _TGetOperationStatusReq__isset() : getProgressUpdate(false) {} - bool getProgressUpdate :1; -} _TGetOperationStatusReq__isset; - -class TGetOperationStatusReq : public virtual ::apache::thrift::TBase { - public: - - TGetOperationStatusReq(const TGetOperationStatusReq&); - TGetOperationStatusReq& operator=(const TGetOperationStatusReq&); - TGetOperationStatusReq() : getProgressUpdate(0) { - } - - virtual ~TGetOperationStatusReq() throw(); - TOperationHandle operationHandle; - bool getProgressUpdate; - - _TGetOperationStatusReq__isset __isset; - - void __set_operationHandle(const TOperationHandle& val); - - void __set_getProgressUpdate(const bool val); - - bool operator == (const TGetOperationStatusReq & rhs) const - { - if (!(operationHandle == rhs.operationHandle)) - return false; - if (__isset.getProgressUpdate != rhs.__isset.getProgressUpdate) - return false; - else if (__isset.getProgressUpdate && !(getProgressUpdate == rhs.getProgressUpdate)) - return false; - return true; - } - bool operator != (const TGetOperationStatusReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetOperationStatusReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetOperationStatusReq &a, TGetOperationStatusReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetOperationStatusReq& obj); - -typedef struct _TGetOperationStatusResp__isset { - _TGetOperationStatusResp__isset() : operationState(false), sqlState(false), errorCode(false), errorMessage(false), taskStatus(false), operationStarted(false), operationCompleted(false), hasResultSet(false), progressUpdateResponse(false) {} - bool operationState :1; - bool sqlState :1; - bool errorCode :1; - bool errorMessage :1; - bool taskStatus :1; - bool operationStarted :1; - bool operationCompleted :1; - bool hasResultSet :1; - bool progressUpdateResponse :1; -} _TGetOperationStatusResp__isset; - -class TGetOperationStatusResp : public virtual ::apache::thrift::TBase { - public: - - TGetOperationStatusResp(const TGetOperationStatusResp&); - TGetOperationStatusResp& operator=(const TGetOperationStatusResp&); - TGetOperationStatusResp() : operationState((TOperationState::type)0), sqlState(), errorCode(0), errorMessage(), taskStatus(), operationStarted(0), operationCompleted(0), hasResultSet(0) { - } - - virtual ~TGetOperationStatusResp() throw(); - TStatus status; - TOperationState::type operationState; - std::string sqlState; - int32_t errorCode; - std::string errorMessage; - std::string taskStatus; - int64_t operationStarted; - int64_t operationCompleted; - bool hasResultSet; - TProgressUpdateResp progressUpdateResponse; - - _TGetOperationStatusResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_operationState(const TOperationState::type val); - - void __set_sqlState(const std::string& val); - - void __set_errorCode(const int32_t val); - - void __set_errorMessage(const std::string& val); - - void __set_taskStatus(const std::string& val); - - void __set_operationStarted(const int64_t val); - - void __set_operationCompleted(const int64_t val); - - void __set_hasResultSet(const bool val); - - void __set_progressUpdateResponse(const TProgressUpdateResp& val); - - bool operator == (const TGetOperationStatusResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.operationState != rhs.__isset.operationState) - return false; - else if (__isset.operationState && !(operationState == rhs.operationState)) - return false; - if (__isset.sqlState != rhs.__isset.sqlState) - return false; - else if (__isset.sqlState && !(sqlState == rhs.sqlState)) - return false; - if (__isset.errorCode != rhs.__isset.errorCode) - return false; - else if (__isset.errorCode && !(errorCode == rhs.errorCode)) - return false; - if (__isset.errorMessage != rhs.__isset.errorMessage) - return false; - else if (__isset.errorMessage && !(errorMessage == rhs.errorMessage)) - return false; - if (__isset.taskStatus != rhs.__isset.taskStatus) - return false; - else if (__isset.taskStatus && !(taskStatus == rhs.taskStatus)) - return false; - if (__isset.operationStarted != rhs.__isset.operationStarted) - return false; - else if (__isset.operationStarted && !(operationStarted == rhs.operationStarted)) - return false; - if (__isset.operationCompleted != rhs.__isset.operationCompleted) - return false; - else if (__isset.operationCompleted && !(operationCompleted == rhs.operationCompleted)) - return false; - if (__isset.hasResultSet != rhs.__isset.hasResultSet) - return false; - else if (__isset.hasResultSet && !(hasResultSet == rhs.hasResultSet)) - return false; - if (__isset.progressUpdateResponse != rhs.__isset.progressUpdateResponse) - return false; - else if (__isset.progressUpdateResponse && !(progressUpdateResponse == rhs.progressUpdateResponse)) - return false; - return true; - } - bool operator != (const TGetOperationStatusResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetOperationStatusResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetOperationStatusResp &a, TGetOperationStatusResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetOperationStatusResp& obj); - - -class TCancelOperationReq : public virtual ::apache::thrift::TBase { - public: - - TCancelOperationReq(const TCancelOperationReq&); - TCancelOperationReq& operator=(const TCancelOperationReq&); - TCancelOperationReq() { - } - - virtual ~TCancelOperationReq() throw(); - TOperationHandle operationHandle; - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TCancelOperationReq & rhs) const - { - if (!(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TCancelOperationReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCancelOperationReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCancelOperationReq &a, TCancelOperationReq &b); - -std::ostream& operator<<(std::ostream& out, const TCancelOperationReq& obj); - - -class TCancelOperationResp : public virtual ::apache::thrift::TBase { - public: - - TCancelOperationResp(const TCancelOperationResp&); - TCancelOperationResp& operator=(const TCancelOperationResp&); - TCancelOperationResp() { - } - - virtual ~TCancelOperationResp() throw(); - TStatus status; - - void __set_status(const TStatus& val); - - bool operator == (const TCancelOperationResp & rhs) const - { - if (!(status == rhs.status)) - return false; - return true; - } - bool operator != (const TCancelOperationResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCancelOperationResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCancelOperationResp &a, TCancelOperationResp &b); - -std::ostream& operator<<(std::ostream& out, const TCancelOperationResp& obj); - - -class TCloseOperationReq : public virtual ::apache::thrift::TBase { - public: - - TCloseOperationReq(const TCloseOperationReq&); - TCloseOperationReq& operator=(const TCloseOperationReq&); - TCloseOperationReq() { - } - - virtual ~TCloseOperationReq() throw(); - TOperationHandle operationHandle; - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TCloseOperationReq & rhs) const - { - if (!(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TCloseOperationReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCloseOperationReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCloseOperationReq &a, TCloseOperationReq &b); - -std::ostream& operator<<(std::ostream& out, const TCloseOperationReq& obj); - - -class TCloseOperationResp : public virtual ::apache::thrift::TBase { - public: - - TCloseOperationResp(const TCloseOperationResp&); - TCloseOperationResp& operator=(const TCloseOperationResp&); - TCloseOperationResp() { - } - - virtual ~TCloseOperationResp() throw(); - TStatus status; - - void __set_status(const TStatus& val); - - bool operator == (const TCloseOperationResp & rhs) const - { - if (!(status == rhs.status)) - return false; - return true; - } - bool operator != (const TCloseOperationResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCloseOperationResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCloseOperationResp &a, TCloseOperationResp &b); - -std::ostream& operator<<(std::ostream& out, const TCloseOperationResp& obj); - - -class TGetResultSetMetadataReq : public virtual ::apache::thrift::TBase { - public: - - TGetResultSetMetadataReq(const TGetResultSetMetadataReq&); - TGetResultSetMetadataReq& operator=(const TGetResultSetMetadataReq&); - TGetResultSetMetadataReq() { - } - - virtual ~TGetResultSetMetadataReq() throw(); - TOperationHandle operationHandle; - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetResultSetMetadataReq & rhs) const - { - if (!(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetResultSetMetadataReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetResultSetMetadataReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetResultSetMetadataReq &a, TGetResultSetMetadataReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataReq& obj); - -typedef struct _TGetResultSetMetadataResp__isset { - _TGetResultSetMetadataResp__isset() : schema(false) {} - bool schema :1; -} _TGetResultSetMetadataResp__isset; - -class TGetResultSetMetadataResp : public virtual ::apache::thrift::TBase { - public: - - TGetResultSetMetadataResp(const TGetResultSetMetadataResp&); - TGetResultSetMetadataResp& operator=(const TGetResultSetMetadataResp&); - TGetResultSetMetadataResp() { - } - - virtual ~TGetResultSetMetadataResp() throw(); - TStatus status; - TTableSchema schema; - - _TGetResultSetMetadataResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_schema(const TTableSchema& val); - - bool operator == (const TGetResultSetMetadataResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.schema != rhs.__isset.schema) - return false; - else if (__isset.schema && !(schema == rhs.schema)) - return false; - return true; - } - bool operator != (const TGetResultSetMetadataResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetResultSetMetadataResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetResultSetMetadataResp &a, TGetResultSetMetadataResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetResultSetMetadataResp& obj); - -typedef struct _TFetchResultsReq__isset { - _TFetchResultsReq__isset() : fetchType(true) {} - bool fetchType :1; -} _TFetchResultsReq__isset; - -class TFetchResultsReq : public virtual ::apache::thrift::TBase { - public: - - TFetchResultsReq(const TFetchResultsReq&); - TFetchResultsReq& operator=(const TFetchResultsReq&); - TFetchResultsReq() : orientation((TFetchOrientation::type)0), maxRows(0), fetchType(0) { - orientation = (TFetchOrientation::type)0; - - } - - virtual ~TFetchResultsReq() throw(); - TOperationHandle operationHandle; - TFetchOrientation::type orientation; - int64_t maxRows; - int16_t fetchType; - - _TFetchResultsReq__isset __isset; - - void __set_operationHandle(const TOperationHandle& val); - - void __set_orientation(const TFetchOrientation::type val); - - void __set_maxRows(const int64_t val); - - void __set_fetchType(const int16_t val); - - bool operator == (const TFetchResultsReq & rhs) const - { - if (!(operationHandle == rhs.operationHandle)) - return false; - if (!(orientation == rhs.orientation)) - return false; - if (!(maxRows == rhs.maxRows)) - return false; - if (__isset.fetchType != rhs.__isset.fetchType) - return false; - else if (__isset.fetchType && !(fetchType == rhs.fetchType)) - return false; - return true; - } - bool operator != (const TFetchResultsReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TFetchResultsReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TFetchResultsReq &a, TFetchResultsReq &b); - -std::ostream& operator<<(std::ostream& out, const TFetchResultsReq& obj); - -typedef struct _TFetchResultsResp__isset { - _TFetchResultsResp__isset() : hasMoreRows(false), results(false) {} - bool hasMoreRows :1; - bool results :1; -} _TFetchResultsResp__isset; - -class TFetchResultsResp : public virtual ::apache::thrift::TBase { - public: - - TFetchResultsResp(const TFetchResultsResp&); - TFetchResultsResp& operator=(const TFetchResultsResp&); - TFetchResultsResp() : hasMoreRows(0) { - } - - virtual ~TFetchResultsResp() throw(); - TStatus status; - bool hasMoreRows; - TRowSet results; - - _TFetchResultsResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_hasMoreRows(const bool val); - - void __set_results(const TRowSet& val); - - bool operator == (const TFetchResultsResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.hasMoreRows != rhs.__isset.hasMoreRows) - return false; - else if (__isset.hasMoreRows && !(hasMoreRows == rhs.hasMoreRows)) - return false; - if (__isset.results != rhs.__isset.results) - return false; - else if (__isset.results && !(results == rhs.results)) - return false; - return true; - } - bool operator != (const TFetchResultsResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TFetchResultsResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TFetchResultsResp &a, TFetchResultsResp &b); - -std::ostream& operator<<(std::ostream& out, const TFetchResultsResp& obj); - - -class TGetDelegationTokenReq : public virtual ::apache::thrift::TBase { - public: - - TGetDelegationTokenReq(const TGetDelegationTokenReq&); - TGetDelegationTokenReq& operator=(const TGetDelegationTokenReq&); - TGetDelegationTokenReq() : owner(), renewer() { - } - - virtual ~TGetDelegationTokenReq() throw(); - TSessionHandle sessionHandle; - std::string owner; - std::string renewer; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_owner(const std::string& val); - - void __set_renewer(const std::string& val); - - bool operator == (const TGetDelegationTokenReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (!(owner == rhs.owner)) - return false; - if (!(renewer == rhs.renewer)) - return false; - return true; - } - bool operator != (const TGetDelegationTokenReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetDelegationTokenReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetDelegationTokenReq &a, TGetDelegationTokenReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenReq& obj); - -typedef struct _TGetDelegationTokenResp__isset { - _TGetDelegationTokenResp__isset() : delegationToken(false) {} - bool delegationToken :1; -} _TGetDelegationTokenResp__isset; - -class TGetDelegationTokenResp : public virtual ::apache::thrift::TBase { - public: - - TGetDelegationTokenResp(const TGetDelegationTokenResp&); - TGetDelegationTokenResp& operator=(const TGetDelegationTokenResp&); - TGetDelegationTokenResp() : delegationToken() { - } - - virtual ~TGetDelegationTokenResp() throw(); - TStatus status; - std::string delegationToken; - - _TGetDelegationTokenResp__isset __isset; - - void __set_status(const TStatus& val); - - void __set_delegationToken(const std::string& val); - - bool operator == (const TGetDelegationTokenResp & rhs) const - { - if (!(status == rhs.status)) - return false; - if (__isset.delegationToken != rhs.__isset.delegationToken) - return false; - else if (__isset.delegationToken && !(delegationToken == rhs.delegationToken)) - return false; - return true; - } - bool operator != (const TGetDelegationTokenResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetDelegationTokenResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetDelegationTokenResp &a, TGetDelegationTokenResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetDelegationTokenResp& obj); - - -class TCancelDelegationTokenReq : public virtual ::apache::thrift::TBase { - public: - - TCancelDelegationTokenReq(const TCancelDelegationTokenReq&); - TCancelDelegationTokenReq& operator=(const TCancelDelegationTokenReq&); - TCancelDelegationTokenReq() : delegationToken() { - } - - virtual ~TCancelDelegationTokenReq() throw(); - TSessionHandle sessionHandle; - std::string delegationToken; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_delegationToken(const std::string& val); - - bool operator == (const TCancelDelegationTokenReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (!(delegationToken == rhs.delegationToken)) - return false; - return true; - } - bool operator != (const TCancelDelegationTokenReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCancelDelegationTokenReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCancelDelegationTokenReq &a, TCancelDelegationTokenReq &b); - -std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenReq& obj); - - -class TCancelDelegationTokenResp : public virtual ::apache::thrift::TBase { - public: - - TCancelDelegationTokenResp(const TCancelDelegationTokenResp&); - TCancelDelegationTokenResp& operator=(const TCancelDelegationTokenResp&); - TCancelDelegationTokenResp() { - } - - virtual ~TCancelDelegationTokenResp() throw(); - TStatus status; - - void __set_status(const TStatus& val); - - bool operator == (const TCancelDelegationTokenResp & rhs) const - { - if (!(status == rhs.status)) - return false; - return true; - } - bool operator != (const TCancelDelegationTokenResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TCancelDelegationTokenResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TCancelDelegationTokenResp &a, TCancelDelegationTokenResp &b); - -std::ostream& operator<<(std::ostream& out, const TCancelDelegationTokenResp& obj); - - -class TRenewDelegationTokenReq : public virtual ::apache::thrift::TBase { - public: - - TRenewDelegationTokenReq(const TRenewDelegationTokenReq&); - TRenewDelegationTokenReq& operator=(const TRenewDelegationTokenReq&); - TRenewDelegationTokenReq() : delegationToken() { - } - - virtual ~TRenewDelegationTokenReq() throw(); - TSessionHandle sessionHandle; - std::string delegationToken; - - void __set_sessionHandle(const TSessionHandle& val); - - void __set_delegationToken(const std::string& val); - - bool operator == (const TRenewDelegationTokenReq & rhs) const - { - if (!(sessionHandle == rhs.sessionHandle)) - return false; - if (!(delegationToken == rhs.delegationToken)) - return false; - return true; - } - bool operator != (const TRenewDelegationTokenReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TRenewDelegationTokenReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TRenewDelegationTokenReq &a, TRenewDelegationTokenReq &b); - -std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenReq& obj); - - -class TRenewDelegationTokenResp : public virtual ::apache::thrift::TBase { - public: - - TRenewDelegationTokenResp(const TRenewDelegationTokenResp&); - TRenewDelegationTokenResp& operator=(const TRenewDelegationTokenResp&); - TRenewDelegationTokenResp() { - } - - virtual ~TRenewDelegationTokenResp() throw(); - TStatus status; - - void __set_status(const TStatus& val); - - bool operator == (const TRenewDelegationTokenResp & rhs) const - { - if (!(status == rhs.status)) - return false; - return true; - } - bool operator != (const TRenewDelegationTokenResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TRenewDelegationTokenResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TRenewDelegationTokenResp &a, TRenewDelegationTokenResp &b); - -std::ostream& operator<<(std::ostream& out, const TRenewDelegationTokenResp& obj); - - -class TProgressUpdateResp : public virtual ::apache::thrift::TBase { - public: - - TProgressUpdateResp(const TProgressUpdateResp&); - TProgressUpdateResp& operator=(const TProgressUpdateResp&); - TProgressUpdateResp() : progressedPercentage(0), status((TJobExecutionStatus::type)0), footerSummary(), startTime(0) { - } - - virtual ~TProgressUpdateResp() throw(); - std::vector headerNames; - std::vector > rows; - double progressedPercentage; - TJobExecutionStatus::type status; - std::string footerSummary; - int64_t startTime; - - void __set_headerNames(const std::vector & val); - - void __set_rows(const std::vector > & val); - - void __set_progressedPercentage(const double val); - - void __set_status(const TJobExecutionStatus::type val); - - void __set_footerSummary(const std::string& val); - - void __set_startTime(const int64_t val); - - bool operator == (const TProgressUpdateResp & rhs) const - { - if (!(headerNames == rhs.headerNames)) - return false; - if (!(rows == rhs.rows)) - return false; - if (!(progressedPercentage == rhs.progressedPercentage)) - return false; - if (!(status == rhs.status)) - return false; - if (!(footerSummary == rhs.footerSummary)) - return false; - if (!(startTime == rhs.startTime)) - return false; - return true; - } - bool operator != (const TProgressUpdateResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TProgressUpdateResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TProgressUpdateResp &a, TProgressUpdateResp &b); - -std::ostream& operator<<(std::ostream& out, const TProgressUpdateResp& obj); - - -class TGetQueryIdReq : public virtual ::apache::thrift::TBase { - public: - - TGetQueryIdReq(const TGetQueryIdReq&); - TGetQueryIdReq& operator=(const TGetQueryIdReq&); - TGetQueryIdReq() { - } - - virtual ~TGetQueryIdReq() throw(); - TOperationHandle operationHandle; - - void __set_operationHandle(const TOperationHandle& val); - - bool operator == (const TGetQueryIdReq & rhs) const - { - if (!(operationHandle == rhs.operationHandle)) - return false; - return true; - } - bool operator != (const TGetQueryIdReq &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetQueryIdReq & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetQueryIdReq &a, TGetQueryIdReq &b); - -std::ostream& operator<<(std::ostream& out, const TGetQueryIdReq& obj); - - -class TGetQueryIdResp : public virtual ::apache::thrift::TBase { - public: - - TGetQueryIdResp(const TGetQueryIdResp&); - TGetQueryIdResp& operator=(const TGetQueryIdResp&); - TGetQueryIdResp() : queryId() { - } - - virtual ~TGetQueryIdResp() throw(); - std::string queryId; - - void __set_queryId(const std::string& val); - - bool operator == (const TGetQueryIdResp & rhs) const - { - if (!(queryId == rhs.queryId)) - return false; - return true; - } - bool operator != (const TGetQueryIdResp &rhs) const { - return !(*this == rhs); - } - - bool operator < (const TGetQueryIdResp & ) const; - - uint32_t read(::apache::thrift::protocol::TProtocol* iprot); - uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const; - - virtual void printTo(std::ostream& out) const; -}; - -void swap(TGetQueryIdResp &a, TGetQueryIdResp &b); - -std::ostream& operator<<(std::ostream& out, const TGetQueryIdResp& obj); - -}}}}} // namespace - -#endif diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote deleted file mode 100755 index d882caecd52c..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService-remote +++ /dev/null @@ -1,271 +0,0 @@ -#!/usr/bin/env python -# -# Autogenerated by Thrift Compiler (0.12.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py -# - -import sys -import pprint -if sys.version_info[0] > 2: - from urllib.parse import urlparse -else: - from urlparse import urlparse -from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient -from thrift.protocol.TBinaryProtocol import TBinaryProtocol - -from TCLIService import TCLIService -from TCLIService.ttypes import * - -if len(sys.argv) <= 1 or sys.argv[1] == '--help': - print('') - print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]') - print('') - print('Functions:') - print(' TOpenSessionResp OpenSession(TOpenSessionReq req)') - print(' TCloseSessionResp CloseSession(TCloseSessionReq req)') - print(' TGetInfoResp GetInfo(TGetInfoReq req)') - print(' TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req)') - print(' TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req)') - print(' TGetCatalogsResp GetCatalogs(TGetCatalogsReq req)') - print(' TGetSchemasResp GetSchemas(TGetSchemasReq req)') - print(' TGetTablesResp GetTables(TGetTablesReq req)') - print(' TGetTableTypesResp GetTableTypes(TGetTableTypesReq req)') - print(' TGetColumnsResp GetColumns(TGetColumnsReq req)') - print(' TGetFunctionsResp GetFunctions(TGetFunctionsReq req)') - print(' TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req)') - print(' TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req)') - print(' TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req)') - print(' TCancelOperationResp CancelOperation(TCancelOperationReq req)') - print(' TCloseOperationResp CloseOperation(TCloseOperationReq req)') - print(' TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req)') - print(' TFetchResultsResp FetchResults(TFetchResultsReq req)') - print(' TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req)') - print(' TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req)') - print(' TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req)') - print(' TGetQueryIdResp GetQueryId(TGetQueryIdReq req)') - print(' TSetClientInfoResp SetClientInfo(TSetClientInfoReq req)') - print('') - sys.exit(0) - -pp = pprint.PrettyPrinter(indent=2) -host = 'localhost' -port = 9090 -uri = '' -framed = False -ssl = False -validate = True -ca_certs = None -keyfile = None -certfile = None -http = False -argi = 1 - -if sys.argv[argi] == '-h': - parts = sys.argv[argi + 1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - argi += 2 - -if sys.argv[argi] == '-u': - url = urlparse(sys.argv[argi + 1]) - parts = url[1].split(':') - host = parts[0] - if len(parts) > 1: - port = int(parts[1]) - else: - port = 80 - uri = url[2] - if url[4]: - uri += '?%s' % url[4] - http = True - argi += 2 - -if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': - framed = True - argi += 1 - -if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl': - ssl = True - argi += 1 - -if sys.argv[argi] == '-novalidate': - validate = False - argi += 1 - -if sys.argv[argi] == '-ca_certs': - ca_certs = sys.argv[argi+1] - argi += 2 - -if sys.argv[argi] == '-keyfile': - keyfile = sys.argv[argi+1] - argi += 2 - -if sys.argv[argi] == '-certfile': - certfile = sys.argv[argi+1] - argi += 2 - -cmd = sys.argv[argi] -args = sys.argv[argi + 1:] - -if http: - transport = THttpClient.THttpClient(host, port, uri) -else: - if ssl: - socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile) - else: - socket = TSocket.TSocket(host, port) - if framed: - transport = TTransport.TFramedTransport(socket) - else: - transport = TTransport.TBufferedTransport(socket) -protocol = TBinaryProtocol(transport) -client = TCLIService.Client(protocol) -transport.open() - -if cmd == 'OpenSession': - if len(args) != 1: - print('OpenSession requires 1 args') - sys.exit(1) - pp.pprint(client.OpenSession(eval(args[0]),)) - -elif cmd == 'CloseSession': - if len(args) != 1: - print('CloseSession requires 1 args') - sys.exit(1) - pp.pprint(client.CloseSession(eval(args[0]),)) - -elif cmd == 'GetInfo': - if len(args) != 1: - print('GetInfo requires 1 args') - sys.exit(1) - pp.pprint(client.GetInfo(eval(args[0]),)) - -elif cmd == 'ExecuteStatement': - if len(args) != 1: - print('ExecuteStatement requires 1 args') - sys.exit(1) - pp.pprint(client.ExecuteStatement(eval(args[0]),)) - -elif cmd == 'GetTypeInfo': - if len(args) != 1: - print('GetTypeInfo requires 1 args') - sys.exit(1) - pp.pprint(client.GetTypeInfo(eval(args[0]),)) - -elif cmd == 'GetCatalogs': - if len(args) != 1: - print('GetCatalogs requires 1 args') - sys.exit(1) - pp.pprint(client.GetCatalogs(eval(args[0]),)) - -elif cmd == 'GetSchemas': - if len(args) != 1: - print('GetSchemas requires 1 args') - sys.exit(1) - pp.pprint(client.GetSchemas(eval(args[0]),)) - -elif cmd == 'GetTables': - if len(args) != 1: - print('GetTables requires 1 args') - sys.exit(1) - pp.pprint(client.GetTables(eval(args[0]),)) - -elif cmd == 'GetTableTypes': - if len(args) != 1: - print('GetTableTypes requires 1 args') - sys.exit(1) - pp.pprint(client.GetTableTypes(eval(args[0]),)) - -elif cmd == 'GetColumns': - if len(args) != 1: - print('GetColumns requires 1 args') - sys.exit(1) - pp.pprint(client.GetColumns(eval(args[0]),)) - -elif cmd == 'GetFunctions': - if len(args) != 1: - print('GetFunctions requires 1 args') - sys.exit(1) - pp.pprint(client.GetFunctions(eval(args[0]),)) - -elif cmd == 'GetPrimaryKeys': - if len(args) != 1: - print('GetPrimaryKeys requires 1 args') - sys.exit(1) - pp.pprint(client.GetPrimaryKeys(eval(args[0]),)) - -elif cmd == 'GetCrossReference': - if len(args) != 1: - print('GetCrossReference requires 1 args') - sys.exit(1) - pp.pprint(client.GetCrossReference(eval(args[0]),)) - -elif cmd == 'GetOperationStatus': - if len(args) != 1: - print('GetOperationStatus requires 1 args') - sys.exit(1) - pp.pprint(client.GetOperationStatus(eval(args[0]),)) - -elif cmd == 'CancelOperation': - if len(args) != 1: - print('CancelOperation requires 1 args') - sys.exit(1) - pp.pprint(client.CancelOperation(eval(args[0]),)) - -elif cmd == 'CloseOperation': - if len(args) != 1: - print('CloseOperation requires 1 args') - sys.exit(1) - pp.pprint(client.CloseOperation(eval(args[0]),)) - -elif cmd == 'GetResultSetMetadata': - if len(args) != 1: - print('GetResultSetMetadata requires 1 args') - sys.exit(1) - pp.pprint(client.GetResultSetMetadata(eval(args[0]),)) - -elif cmd == 'FetchResults': - if len(args) != 1: - print('FetchResults requires 1 args') - sys.exit(1) - pp.pprint(client.FetchResults(eval(args[0]),)) - -elif cmd == 'GetDelegationToken': - if len(args) != 1: - print('GetDelegationToken requires 1 args') - sys.exit(1) - pp.pprint(client.GetDelegationToken(eval(args[0]),)) - -elif cmd == 'CancelDelegationToken': - if len(args) != 1: - print('CancelDelegationToken requires 1 args') - sys.exit(1) - pp.pprint(client.CancelDelegationToken(eval(args[0]),)) - -elif cmd == 'RenewDelegationToken': - if len(args) != 1: - print('RenewDelegationToken requires 1 args') - sys.exit(1) - pp.pprint(client.RenewDelegationToken(eval(args[0]),)) - -elif cmd == 'GetQueryId': - if len(args) != 1: - print('GetQueryId requires 1 args') - sys.exit(1) - pp.pprint(client.GetQueryId(eval(args[0]),)) - -elif cmd == 'SetClientInfo': - if len(args) != 1: - print('SetClientInfo requires 1 args') - sys.exit(1) - pp.pprint(client.SetClientInfo(eval(args[0]),)) - -else: - print('Unrecognized method %s' % cmd) - sys.exit(1) - -transport.close() diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py deleted file mode 100644 index cd7a5c4872f0..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/TCLIService.py +++ /dev/null @@ -1,4401 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.12.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py -# - -from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException -from thrift.protocol.TProtocol import TProtocolException -from thrift.TRecursive import fix_spec - -import sys -import logging -from .ttypes import * -from thrift.Thrift import TProcessor -from thrift.transport import TTransport -all_structs = [] - - -class Iface(object): - def OpenSession(self, req): - """ - Parameters: - - req - - """ - pass - - def CloseSession(self, req): - """ - Parameters: - - req - - """ - pass - - def GetInfo(self, req): - """ - Parameters: - - req - - """ - pass - - def ExecuteStatement(self, req): - """ - Parameters: - - req - - """ - pass - - def GetTypeInfo(self, req): - """ - Parameters: - - req - - """ - pass - - def GetCatalogs(self, req): - """ - Parameters: - - req - - """ - pass - - def GetSchemas(self, req): - """ - Parameters: - - req - - """ - pass - - def GetTables(self, req): - """ - Parameters: - - req - - """ - pass - - def GetTableTypes(self, req): - """ - Parameters: - - req - - """ - pass - - def GetColumns(self, req): - """ - Parameters: - - req - - """ - pass - - def GetFunctions(self, req): - """ - Parameters: - - req - - """ - pass - - def GetPrimaryKeys(self, req): - """ - Parameters: - - req - - """ - pass - - def GetCrossReference(self, req): - """ - Parameters: - - req - - """ - pass - - def GetOperationStatus(self, req): - """ - Parameters: - - req - - """ - pass - - def CancelOperation(self, req): - """ - Parameters: - - req - - """ - pass - - def CloseOperation(self, req): - """ - Parameters: - - req - - """ - pass - - def GetResultSetMetadata(self, req): - """ - Parameters: - - req - - """ - pass - - def FetchResults(self, req): - """ - Parameters: - - req - - """ - pass - - def GetDelegationToken(self, req): - """ - Parameters: - - req - - """ - pass - - def CancelDelegationToken(self, req): - """ - Parameters: - - req - - """ - pass - - def RenewDelegationToken(self, req): - """ - Parameters: - - req - - """ - pass - - def GetQueryId(self, req): - """ - Parameters: - - req - - """ - pass - - def SetClientInfo(self, req): - """ - Parameters: - - req - - """ - pass - - -class Client(Iface): - def __init__(self, iprot, oprot=None): - self._iprot = self._oprot = iprot - if oprot is not None: - self._oprot = oprot - self._seqid = 0 - - def OpenSession(self, req): - """ - Parameters: - - req - - """ - self.send_OpenSession(req) - return self.recv_OpenSession() - - def send_OpenSession(self, req): - self._oprot.writeMessageBegin('OpenSession', TMessageType.CALL, self._seqid) - args = OpenSession_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_OpenSession(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = OpenSession_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result") - - def CloseSession(self, req): - """ - Parameters: - - req - - """ - self.send_CloseSession(req) - return self.recv_CloseSession() - - def send_CloseSession(self, req): - self._oprot.writeMessageBegin('CloseSession', TMessageType.CALL, self._seqid) - args = CloseSession_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_CloseSession(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = CloseSession_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "CloseSession failed: unknown result") - - def GetInfo(self, req): - """ - Parameters: - - req - - """ - self.send_GetInfo(req) - return self.recv_GetInfo() - - def send_GetInfo(self, req): - self._oprot.writeMessageBegin('GetInfo', TMessageType.CALL, self._seqid) - args = GetInfo_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetInfo(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetInfo_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetInfo failed: unknown result") - - def ExecuteStatement(self, req): - """ - Parameters: - - req - - """ - self.send_ExecuteStatement(req) - return self.recv_ExecuteStatement() - - def send_ExecuteStatement(self, req): - self._oprot.writeMessageBegin('ExecuteStatement', TMessageType.CALL, self._seqid) - args = ExecuteStatement_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_ExecuteStatement(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = ExecuteStatement_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result") - - def GetTypeInfo(self, req): - """ - Parameters: - - req - - """ - self.send_GetTypeInfo(req) - return self.recv_GetTypeInfo() - - def send_GetTypeInfo(self, req): - self._oprot.writeMessageBegin('GetTypeInfo', TMessageType.CALL, self._seqid) - args = GetTypeInfo_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetTypeInfo(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetTypeInfo_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetTypeInfo failed: unknown result") - - def GetCatalogs(self, req): - """ - Parameters: - - req - - """ - self.send_GetCatalogs(req) - return self.recv_GetCatalogs() - - def send_GetCatalogs(self, req): - self._oprot.writeMessageBegin('GetCatalogs', TMessageType.CALL, self._seqid) - args = GetCatalogs_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetCatalogs(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetCatalogs_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetCatalogs failed: unknown result") - - def GetSchemas(self, req): - """ - Parameters: - - req - - """ - self.send_GetSchemas(req) - return self.recv_GetSchemas() - - def send_GetSchemas(self, req): - self._oprot.writeMessageBegin('GetSchemas', TMessageType.CALL, self._seqid) - args = GetSchemas_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetSchemas(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetSchemas_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetSchemas failed: unknown result") - - def GetTables(self, req): - """ - Parameters: - - req - - """ - self.send_GetTables(req) - return self.recv_GetTables() - - def send_GetTables(self, req): - self._oprot.writeMessageBegin('GetTables', TMessageType.CALL, self._seqid) - args = GetTables_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetTables(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetTables_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetTables failed: unknown result") - - def GetTableTypes(self, req): - """ - Parameters: - - req - - """ - self.send_GetTableTypes(req) - return self.recv_GetTableTypes() - - def send_GetTableTypes(self, req): - self._oprot.writeMessageBegin('GetTableTypes', TMessageType.CALL, self._seqid) - args = GetTableTypes_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetTableTypes(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetTableTypes_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetTableTypes failed: unknown result") - - def GetColumns(self, req): - """ - Parameters: - - req - - """ - self.send_GetColumns(req) - return self.recv_GetColumns() - - def send_GetColumns(self, req): - self._oprot.writeMessageBegin('GetColumns', TMessageType.CALL, self._seqid) - args = GetColumns_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetColumns(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetColumns_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetColumns failed: unknown result") - - def GetFunctions(self, req): - """ - Parameters: - - req - - """ - self.send_GetFunctions(req) - return self.recv_GetFunctions() - - def send_GetFunctions(self, req): - self._oprot.writeMessageBegin('GetFunctions', TMessageType.CALL, self._seqid) - args = GetFunctions_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetFunctions(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetFunctions_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetFunctions failed: unknown result") - - def GetPrimaryKeys(self, req): - """ - Parameters: - - req - - """ - self.send_GetPrimaryKeys(req) - return self.recv_GetPrimaryKeys() - - def send_GetPrimaryKeys(self, req): - self._oprot.writeMessageBegin('GetPrimaryKeys', TMessageType.CALL, self._seqid) - args = GetPrimaryKeys_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetPrimaryKeys(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetPrimaryKeys_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetPrimaryKeys failed: unknown result") - - def GetCrossReference(self, req): - """ - Parameters: - - req - - """ - self.send_GetCrossReference(req) - return self.recv_GetCrossReference() - - def send_GetCrossReference(self, req): - self._oprot.writeMessageBegin('GetCrossReference', TMessageType.CALL, self._seqid) - args = GetCrossReference_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetCrossReference(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetCrossReference_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetCrossReference failed: unknown result") - - def GetOperationStatus(self, req): - """ - Parameters: - - req - - """ - self.send_GetOperationStatus(req) - return self.recv_GetOperationStatus() - - def send_GetOperationStatus(self, req): - self._oprot.writeMessageBegin('GetOperationStatus', TMessageType.CALL, self._seqid) - args = GetOperationStatus_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetOperationStatus(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetOperationStatus_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetOperationStatus failed: unknown result") - - def CancelOperation(self, req): - """ - Parameters: - - req - - """ - self.send_CancelOperation(req) - return self.recv_CancelOperation() - - def send_CancelOperation(self, req): - self._oprot.writeMessageBegin('CancelOperation', TMessageType.CALL, self._seqid) - args = CancelOperation_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_CancelOperation(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = CancelOperation_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "CancelOperation failed: unknown result") - - def CloseOperation(self, req): - """ - Parameters: - - req - - """ - self.send_CloseOperation(req) - return self.recv_CloseOperation() - - def send_CloseOperation(self, req): - self._oprot.writeMessageBegin('CloseOperation', TMessageType.CALL, self._seqid) - args = CloseOperation_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_CloseOperation(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = CloseOperation_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "CloseOperation failed: unknown result") - - def GetResultSetMetadata(self, req): - """ - Parameters: - - req - - """ - self.send_GetResultSetMetadata(req) - return self.recv_GetResultSetMetadata() - - def send_GetResultSetMetadata(self, req): - self._oprot.writeMessageBegin('GetResultSetMetadata', TMessageType.CALL, self._seqid) - args = GetResultSetMetadata_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetResultSetMetadata(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetResultSetMetadata_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetResultSetMetadata failed: unknown result") - - def FetchResults(self, req): - """ - Parameters: - - req - - """ - self.send_FetchResults(req) - return self.recv_FetchResults() - - def send_FetchResults(self, req): - self._oprot.writeMessageBegin('FetchResults', TMessageType.CALL, self._seqid) - args = FetchResults_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_FetchResults(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = FetchResults_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result") - - def GetDelegationToken(self, req): - """ - Parameters: - - req - - """ - self.send_GetDelegationToken(req) - return self.recv_GetDelegationToken() - - def send_GetDelegationToken(self, req): - self._oprot.writeMessageBegin('GetDelegationToken', TMessageType.CALL, self._seqid) - args = GetDelegationToken_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetDelegationToken(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetDelegationToken_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result") - - def CancelDelegationToken(self, req): - """ - Parameters: - - req - - """ - self.send_CancelDelegationToken(req) - return self.recv_CancelDelegationToken() - - def send_CancelDelegationToken(self, req): - self._oprot.writeMessageBegin('CancelDelegationToken', TMessageType.CALL, self._seqid) - args = CancelDelegationToken_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_CancelDelegationToken(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = CancelDelegationToken_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result") - - def RenewDelegationToken(self, req): - """ - Parameters: - - req - - """ - self.send_RenewDelegationToken(req) - return self.recv_RenewDelegationToken() - - def send_RenewDelegationToken(self, req): - self._oprot.writeMessageBegin('RenewDelegationToken', TMessageType.CALL, self._seqid) - args = RenewDelegationToken_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_RenewDelegationToken(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = RenewDelegationToken_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result") - - def GetQueryId(self, req): - """ - Parameters: - - req - - """ - self.send_GetQueryId(req) - return self.recv_GetQueryId() - - def send_GetQueryId(self, req): - self._oprot.writeMessageBegin('GetQueryId', TMessageType.CALL, self._seqid) - args = GetQueryId_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_GetQueryId(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = GetQueryId_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "GetQueryId failed: unknown result") - - def SetClientInfo(self, req): - """ - Parameters: - - req - - """ - self.send_SetClientInfo(req) - return self.recv_SetClientInfo() - - def send_SetClientInfo(self, req): - self._oprot.writeMessageBegin('SetClientInfo', TMessageType.CALL, self._seqid) - args = SetClientInfo_args() - args.req = req - args.write(self._oprot) - self._oprot.writeMessageEnd() - self._oprot.trans.flush() - - def recv_SetClientInfo(self): - iprot = self._iprot - (fname, mtype, rseqid) = iprot.readMessageBegin() - if mtype == TMessageType.EXCEPTION: - x = TApplicationException() - x.read(iprot) - iprot.readMessageEnd() - raise x - result = SetClientInfo_result() - result.read(iprot) - iprot.readMessageEnd() - if result.success is not None: - return result.success - raise TApplicationException(TApplicationException.MISSING_RESULT, "SetClientInfo failed: unknown result") - - -class Processor(Iface, TProcessor): - def __init__(self, handler): - self._handler = handler - self._processMap = {} - self._processMap["OpenSession"] = Processor.process_OpenSession - self._processMap["CloseSession"] = Processor.process_CloseSession - self._processMap["GetInfo"] = Processor.process_GetInfo - self._processMap["ExecuteStatement"] = Processor.process_ExecuteStatement - self._processMap["GetTypeInfo"] = Processor.process_GetTypeInfo - self._processMap["GetCatalogs"] = Processor.process_GetCatalogs - self._processMap["GetSchemas"] = Processor.process_GetSchemas - self._processMap["GetTables"] = Processor.process_GetTables - self._processMap["GetTableTypes"] = Processor.process_GetTableTypes - self._processMap["GetColumns"] = Processor.process_GetColumns - self._processMap["GetFunctions"] = Processor.process_GetFunctions - self._processMap["GetPrimaryKeys"] = Processor.process_GetPrimaryKeys - self._processMap["GetCrossReference"] = Processor.process_GetCrossReference - self._processMap["GetOperationStatus"] = Processor.process_GetOperationStatus - self._processMap["CancelOperation"] = Processor.process_CancelOperation - self._processMap["CloseOperation"] = Processor.process_CloseOperation - self._processMap["GetResultSetMetadata"] = Processor.process_GetResultSetMetadata - self._processMap["FetchResults"] = Processor.process_FetchResults - self._processMap["GetDelegationToken"] = Processor.process_GetDelegationToken - self._processMap["CancelDelegationToken"] = Processor.process_CancelDelegationToken - self._processMap["RenewDelegationToken"] = Processor.process_RenewDelegationToken - self._processMap["GetQueryId"] = Processor.process_GetQueryId - self._processMap["SetClientInfo"] = Processor.process_SetClientInfo - - def process(self, iprot, oprot): - (name, type, seqid) = iprot.readMessageBegin() - if name not in self._processMap: - iprot.skip(TType.STRUCT) - iprot.readMessageEnd() - x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) - oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) - x.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - return - else: - self._processMap[name](self, seqid, iprot, oprot) - return True - - def process_OpenSession(self, seqid, iprot, oprot): - args = OpenSession_args() - args.read(iprot) - iprot.readMessageEnd() - result = OpenSession_result() - try: - result.success = self._handler.OpenSession(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("OpenSession", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_CloseSession(self, seqid, iprot, oprot): - args = CloseSession_args() - args.read(iprot) - iprot.readMessageEnd() - result = CloseSession_result() - try: - result.success = self._handler.CloseSession(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("CloseSession", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetInfo(self, seqid, iprot, oprot): - args = GetInfo_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetInfo_result() - try: - result.success = self._handler.GetInfo(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetInfo", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_ExecuteStatement(self, seqid, iprot, oprot): - args = ExecuteStatement_args() - args.read(iprot) - iprot.readMessageEnd() - result = ExecuteStatement_result() - try: - result.success = self._handler.ExecuteStatement(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("ExecuteStatement", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetTypeInfo(self, seqid, iprot, oprot): - args = GetTypeInfo_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetTypeInfo_result() - try: - result.success = self._handler.GetTypeInfo(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetTypeInfo", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetCatalogs(self, seqid, iprot, oprot): - args = GetCatalogs_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetCatalogs_result() - try: - result.success = self._handler.GetCatalogs(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetCatalogs", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetSchemas(self, seqid, iprot, oprot): - args = GetSchemas_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetSchemas_result() - try: - result.success = self._handler.GetSchemas(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetSchemas", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetTables(self, seqid, iprot, oprot): - args = GetTables_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetTables_result() - try: - result.success = self._handler.GetTables(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetTables", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetTableTypes(self, seqid, iprot, oprot): - args = GetTableTypes_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetTableTypes_result() - try: - result.success = self._handler.GetTableTypes(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetTableTypes", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetColumns(self, seqid, iprot, oprot): - args = GetColumns_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetColumns_result() - try: - result.success = self._handler.GetColumns(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetColumns", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetFunctions(self, seqid, iprot, oprot): - args = GetFunctions_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetFunctions_result() - try: - result.success = self._handler.GetFunctions(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetFunctions", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetPrimaryKeys(self, seqid, iprot, oprot): - args = GetPrimaryKeys_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetPrimaryKeys_result() - try: - result.success = self._handler.GetPrimaryKeys(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetPrimaryKeys", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetCrossReference(self, seqid, iprot, oprot): - args = GetCrossReference_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetCrossReference_result() - try: - result.success = self._handler.GetCrossReference(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetCrossReference", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetOperationStatus(self, seqid, iprot, oprot): - args = GetOperationStatus_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetOperationStatus_result() - try: - result.success = self._handler.GetOperationStatus(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetOperationStatus", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_CancelOperation(self, seqid, iprot, oprot): - args = CancelOperation_args() - args.read(iprot) - iprot.readMessageEnd() - result = CancelOperation_result() - try: - result.success = self._handler.CancelOperation(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("CancelOperation", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_CloseOperation(self, seqid, iprot, oprot): - args = CloseOperation_args() - args.read(iprot) - iprot.readMessageEnd() - result = CloseOperation_result() - try: - result.success = self._handler.CloseOperation(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("CloseOperation", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetResultSetMetadata(self, seqid, iprot, oprot): - args = GetResultSetMetadata_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetResultSetMetadata_result() - try: - result.success = self._handler.GetResultSetMetadata(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetResultSetMetadata", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_FetchResults(self, seqid, iprot, oprot): - args = FetchResults_args() - args.read(iprot) - iprot.readMessageEnd() - result = FetchResults_result() - try: - result.success = self._handler.FetchResults(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("FetchResults", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetDelegationToken(self, seqid, iprot, oprot): - args = GetDelegationToken_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetDelegationToken_result() - try: - result.success = self._handler.GetDelegationToken(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetDelegationToken", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_CancelDelegationToken(self, seqid, iprot, oprot): - args = CancelDelegationToken_args() - args.read(iprot) - iprot.readMessageEnd() - result = CancelDelegationToken_result() - try: - result.success = self._handler.CancelDelegationToken(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("CancelDelegationToken", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_RenewDelegationToken(self, seqid, iprot, oprot): - args = RenewDelegationToken_args() - args.read(iprot) - iprot.readMessageEnd() - result = RenewDelegationToken_result() - try: - result.success = self._handler.RenewDelegationToken(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("RenewDelegationToken", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_GetQueryId(self, seqid, iprot, oprot): - args = GetQueryId_args() - args.read(iprot) - iprot.readMessageEnd() - result = GetQueryId_result() - try: - result.success = self._handler.GetQueryId(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("GetQueryId", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - - def process_SetClientInfo(self, seqid, iprot, oprot): - args = SetClientInfo_args() - args.read(iprot) - iprot.readMessageEnd() - result = SetClientInfo_result() - try: - result.success = self._handler.SetClientInfo(args.req) - msg_type = TMessageType.REPLY - except TTransport.TTransportException: - raise - except TApplicationException as ex: - logging.exception('TApplication exception in handler') - msg_type = TMessageType.EXCEPTION - result = ex - except Exception: - logging.exception('Unexpected exception in handler') - msg_type = TMessageType.EXCEPTION - result = TApplicationException(TApplicationException.INTERNAL_ERROR, 'Internal error') - oprot.writeMessageBegin("SetClientInfo", msg_type, seqid) - result.write(oprot) - oprot.writeMessageEnd() - oprot.trans.flush() - -# HELPER FUNCTIONS AND STRUCTURES - - -class OpenSession_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TOpenSessionReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('OpenSession_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__.items()] - 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) -all_structs.append(OpenSession_args) -OpenSession_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TOpenSessionReq, None], None, ), # 1 -) - - -class OpenSession_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TOpenSessionResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('OpenSession_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__.items()] - 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) -all_structs.append(OpenSession_result) -OpenSession_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TOpenSessionResp, None], None, ), # 0 -) - - -class CloseSession_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCloseSessionReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CloseSession_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__.items()] - 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) -all_structs.append(CloseSession_args) -CloseSession_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TCloseSessionReq, None], None, ), # 1 -) - - -class CloseSession_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCloseSessionResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CloseSession_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__.items()] - 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) -all_structs.append(CloseSession_result) -CloseSession_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TCloseSessionResp, None], None, ), # 0 -) - - -class GetInfo_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetInfoReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetInfo_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__.items()] - 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) -all_structs.append(GetInfo_args) -GetInfo_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetInfoReq, None], None, ), # 1 -) - - -class GetInfo_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetInfoResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetInfo_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__.items()] - 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) -all_structs.append(GetInfo_result) -GetInfo_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetInfoResp, None], None, ), # 0 -) - - -class ExecuteStatement_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('ExecuteStatement_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__.items()] - 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) -all_structs.append(ExecuteStatement_args) -ExecuteStatement_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TExecuteStatementReq, None], None, ), # 1 -) - - -class ExecuteStatement_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TExecuteStatementResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('ExecuteStatement_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__.items()] - 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) -all_structs.append(ExecuteStatement_result) -ExecuteStatement_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TExecuteStatementResp, None], None, ), # 0 -) - - -class GetTypeInfo_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetTypeInfoReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetTypeInfo_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__.items()] - 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) -all_structs.append(GetTypeInfo_args) -GetTypeInfo_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetTypeInfoReq, None], None, ), # 1 -) - - -class GetTypeInfo_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetTypeInfoResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetTypeInfo_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__.items()] - 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) -all_structs.append(GetTypeInfo_result) -GetTypeInfo_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetTypeInfoResp, None], None, ), # 0 -) - - -class GetCatalogs_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetCatalogsReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetCatalogs_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__.items()] - 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) -all_structs.append(GetCatalogs_args) -GetCatalogs_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetCatalogsReq, None], None, ), # 1 -) - - -class GetCatalogs_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetCatalogsResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetCatalogs_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__.items()] - 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) -all_structs.append(GetCatalogs_result) -GetCatalogs_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetCatalogsResp, None], None, ), # 0 -) - - -class GetSchemas_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetSchemasReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetSchemas_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__.items()] - 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) -all_structs.append(GetSchemas_args) -GetSchemas_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetSchemasReq, None], None, ), # 1 -) - - -class GetSchemas_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetSchemasResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetSchemas_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__.items()] - 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) -all_structs.append(GetSchemas_result) -GetSchemas_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetSchemasResp, None], None, ), # 0 -) - - -class GetTables_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetTablesReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetTables_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__.items()] - 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) -all_structs.append(GetTables_args) -GetTables_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetTablesReq, None], None, ), # 1 -) - - -class GetTables_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetTablesResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetTables_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__.items()] - 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) -all_structs.append(GetTables_result) -GetTables_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetTablesResp, None], None, ), # 0 -) - - -class GetTableTypes_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetTableTypesReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetTableTypes_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__.items()] - 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) -all_structs.append(GetTableTypes_args) -GetTableTypes_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetTableTypesReq, None], None, ), # 1 -) - - -class GetTableTypes_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetTableTypesResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetTableTypes_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__.items()] - 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) -all_structs.append(GetTableTypes_result) -GetTableTypes_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetTableTypesResp, None], None, ), # 0 -) - - -class GetColumns_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetColumnsReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetColumns_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__.items()] - 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) -all_structs.append(GetColumns_args) -GetColumns_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetColumnsReq, None], None, ), # 1 -) - - -class GetColumns_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetColumnsResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetColumns_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__.items()] - 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) -all_structs.append(GetColumns_result) -GetColumns_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetColumnsResp, None], None, ), # 0 -) - - -class GetFunctions_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetFunctionsReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetFunctions_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__.items()] - 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) -all_structs.append(GetFunctions_args) -GetFunctions_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetFunctionsReq, None], None, ), # 1 -) - - -class GetFunctions_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetFunctionsResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetFunctions_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__.items()] - 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) -all_structs.append(GetFunctions_result) -GetFunctions_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetFunctionsResp, None], None, ), # 0 -) - - -class GetPrimaryKeys_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetPrimaryKeysReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetPrimaryKeys_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__.items()] - 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) -all_structs.append(GetPrimaryKeys_args) -GetPrimaryKeys_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetPrimaryKeysReq, None], None, ), # 1 -) - - -class GetPrimaryKeys_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetPrimaryKeysResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetPrimaryKeys_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__.items()] - 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) -all_structs.append(GetPrimaryKeys_result) -GetPrimaryKeys_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetPrimaryKeysResp, None], None, ), # 0 -) - - -class GetCrossReference_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetCrossReferenceReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetCrossReference_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__.items()] - 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) -all_structs.append(GetCrossReference_args) -GetCrossReference_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetCrossReferenceReq, None], None, ), # 1 -) - - -class GetCrossReference_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetCrossReferenceResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetCrossReference_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__.items()] - 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) -all_structs.append(GetCrossReference_result) -GetCrossReference_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetCrossReferenceResp, None], None, ), # 0 -) - - -class GetOperationStatus_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetOperationStatusReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetOperationStatus_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__.items()] - 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) -all_structs.append(GetOperationStatus_args) -GetOperationStatus_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetOperationStatusReq, None], None, ), # 1 -) - - -class GetOperationStatus_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetOperationStatusResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetOperationStatus_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__.items()] - 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) -all_structs.append(GetOperationStatus_result) -GetOperationStatus_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetOperationStatusResp, None], None, ), # 0 -) - - -class CancelOperation_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCancelOperationReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CancelOperation_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__.items()] - 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) -all_structs.append(CancelOperation_args) -CancelOperation_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TCancelOperationReq, None], None, ), # 1 -) - - -class CancelOperation_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCancelOperationResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CancelOperation_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__.items()] - 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) -all_structs.append(CancelOperation_result) -CancelOperation_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TCancelOperationResp, None], None, ), # 0 -) - - -class CloseOperation_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCloseOperationReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CloseOperation_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__.items()] - 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) -all_structs.append(CloseOperation_args) -CloseOperation_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TCloseOperationReq, None], None, ), # 1 -) - - -class CloseOperation_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCloseOperationResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CloseOperation_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__.items()] - 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) -all_structs.append(CloseOperation_result) -CloseOperation_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TCloseOperationResp, None], None, ), # 0 -) - - -class GetResultSetMetadata_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetResultSetMetadataReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetResultSetMetadata_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__.items()] - 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) -all_structs.append(GetResultSetMetadata_args) -GetResultSetMetadata_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetResultSetMetadataReq, None], None, ), # 1 -) - - -class GetResultSetMetadata_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetResultSetMetadataResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetResultSetMetadata_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__.items()] - 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) -all_structs.append(GetResultSetMetadata_result) -GetResultSetMetadata_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetResultSetMetadataResp, None], None, ), # 0 -) - - -class FetchResults_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TFetchResultsReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('FetchResults_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__.items()] - 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) -all_structs.append(FetchResults_args) -FetchResults_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TFetchResultsReq, None], None, ), # 1 -) - - -class FetchResults_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TFetchResultsResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('FetchResults_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__.items()] - 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) -all_structs.append(FetchResults_result) -FetchResults_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TFetchResultsResp, None], None, ), # 0 -) - - -class GetDelegationToken_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetDelegationTokenReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetDelegationToken_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__.items()] - 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) -all_structs.append(GetDelegationToken_args) -GetDelegationToken_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetDelegationTokenReq, None], None, ), # 1 -) - - -class GetDelegationToken_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetDelegationTokenResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetDelegationToken_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__.items()] - 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) -all_structs.append(GetDelegationToken_result) -GetDelegationToken_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetDelegationTokenResp, None], None, ), # 0 -) - - -class CancelDelegationToken_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCancelDelegationTokenReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CancelDelegationToken_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__.items()] - 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) -all_structs.append(CancelDelegationToken_args) -CancelDelegationToken_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TCancelDelegationTokenReq, None], None, ), # 1 -) - - -class CancelDelegationToken_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TCancelDelegationTokenResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('CancelDelegationToken_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__.items()] - 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) -all_structs.append(CancelDelegationToken_result) -CancelDelegationToken_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TCancelDelegationTokenResp, None], None, ), # 0 -) - - -class RenewDelegationToken_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TRenewDelegationTokenReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('RenewDelegationToken_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__.items()] - 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) -all_structs.append(RenewDelegationToken_args) -RenewDelegationToken_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TRenewDelegationTokenReq, None], None, ), # 1 -) - - -class RenewDelegationToken_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TRenewDelegationTokenResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('RenewDelegationToken_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__.items()] - 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) -all_structs.append(RenewDelegationToken_result) -RenewDelegationToken_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TRenewDelegationTokenResp, None], None, ), # 0 -) - - -class GetQueryId_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetQueryIdReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetQueryId_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__.items()] - 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) -all_structs.append(GetQueryId_args) -GetQueryId_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TGetQueryIdReq, None], None, ), # 1 -) - - -class GetQueryId_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TGetQueryIdResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('GetQueryId_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__.items()] - 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) -all_structs.append(GetQueryId_result) -GetQueryId_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TGetQueryIdResp, None], None, ), # 0 -) - - -class SetClientInfo_args(object): - """ - Attributes: - - req - - """ - - - def __init__(self, req=None,): - self.req = req - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TSetClientInfoReq() - self.req.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('SetClientInfo_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__.items()] - 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) -all_structs.append(SetClientInfo_args) -SetClientInfo_args.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'req', [TSetClientInfoReq, None], None, ), # 1 -) - - -class SetClientInfo_result(object): - """ - Attributes: - - success - - """ - - - def __init__(self, success=None,): - self.success = success - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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 = TSetClientInfoResp() - self.success.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('SetClientInfo_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__.items()] - 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) -all_structs.append(SetClientInfo_result) -SetClientInfo_result.thrift_spec = ( - (0, TType.STRUCT, 'success', [TSetClientInfoResp, None], None, ), # 0 -) -fix_spec(all_structs) -del all_structs - diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py deleted file mode 100644 index fe5e7c20b62d..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__all__ = ['ttypes', 'constants', 'TCLIService'] diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py deleted file mode 100644 index ff858cde608f..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/constants.py +++ /dev/null @@ -1,72 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.12.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py -# - -from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException -from thrift.protocol.TProtocol import TProtocolException -from thrift.TRecursive import fix_spec - -import sys -from .ttypes import * -PRIMITIVE_TYPES = set(( - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, -)) -COMPLEX_TYPES = set(( - 10, - 11, - 12, - 13, - 14, -)) -COLLECTION_TYPES = set(( - 10, - 11, -)) -TYPE_NAMES = { - 10: "ARRAY", - 4: "BIGINT", - 9: "BINARY", - 0: "BOOLEAN", - 19: "CHAR", - 17: "DATE", - 15: "DECIMAL", - 6: "DOUBLE", - 5: "FLOAT", - 21: "INTERVAL_DAY_TIME", - 20: "INTERVAL_YEAR_MONTH", - 3: "INT", - 11: "MAP", - 16: "NULL", - 2: "SMALLINT", - 7: "STRING", - 12: "STRUCT", - 22: "TIMESTAMP WITH LOCAL TIME ZONE", - 8: "TIMESTAMP", - 1: "TINYINT", - 13: "UNIONTYPE", - 18: "VARCHAR", -} -CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" -PRECISION = "precision" -SCALE = "scale" diff --git a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py b/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py deleted file mode 100644 index 3a4f151f06dd..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-py/TCLIService/ttypes.py +++ /dev/null @@ -1,7526 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.12.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# -# options string: py -# - -from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException -from thrift.protocol.TProtocol import TProtocolException -from thrift.TRecursive import fix_spec - -import sys - -from thrift.transport import TTransport -all_structs = [] - - -class TProtocolVersion(object): - HIVE_CLI_SERVICE_PROTOCOL_V1 = 0 - HIVE_CLI_SERVICE_PROTOCOL_V2 = 1 - HIVE_CLI_SERVICE_PROTOCOL_V3 = 2 - HIVE_CLI_SERVICE_PROTOCOL_V4 = 3 - HIVE_CLI_SERVICE_PROTOCOL_V5 = 4 - HIVE_CLI_SERVICE_PROTOCOL_V6 = 5 - HIVE_CLI_SERVICE_PROTOCOL_V7 = 6 - HIVE_CLI_SERVICE_PROTOCOL_V8 = 7 - HIVE_CLI_SERVICE_PROTOCOL_V9 = 8 - HIVE_CLI_SERVICE_PROTOCOL_V10 = 9 - HIVE_CLI_SERVICE_PROTOCOL_V11 = 10 - - _VALUES_TO_NAMES = { - 0: "HIVE_CLI_SERVICE_PROTOCOL_V1", - 1: "HIVE_CLI_SERVICE_PROTOCOL_V2", - 2: "HIVE_CLI_SERVICE_PROTOCOL_V3", - 3: "HIVE_CLI_SERVICE_PROTOCOL_V4", - 4: "HIVE_CLI_SERVICE_PROTOCOL_V5", - 5: "HIVE_CLI_SERVICE_PROTOCOL_V6", - 6: "HIVE_CLI_SERVICE_PROTOCOL_V7", - 7: "HIVE_CLI_SERVICE_PROTOCOL_V8", - 8: "HIVE_CLI_SERVICE_PROTOCOL_V9", - 9: "HIVE_CLI_SERVICE_PROTOCOL_V10", - 10: "HIVE_CLI_SERVICE_PROTOCOL_V11", - } - - _NAMES_TO_VALUES = { - "HIVE_CLI_SERVICE_PROTOCOL_V1": 0, - "HIVE_CLI_SERVICE_PROTOCOL_V2": 1, - "HIVE_CLI_SERVICE_PROTOCOL_V3": 2, - "HIVE_CLI_SERVICE_PROTOCOL_V4": 3, - "HIVE_CLI_SERVICE_PROTOCOL_V5": 4, - "HIVE_CLI_SERVICE_PROTOCOL_V6": 5, - "HIVE_CLI_SERVICE_PROTOCOL_V7": 6, - "HIVE_CLI_SERVICE_PROTOCOL_V8": 7, - "HIVE_CLI_SERVICE_PROTOCOL_V9": 8, - "HIVE_CLI_SERVICE_PROTOCOL_V10": 9, - "HIVE_CLI_SERVICE_PROTOCOL_V11": 10, - } - - -class TTypeId(object): - BOOLEAN_TYPE = 0 - TINYINT_TYPE = 1 - SMALLINT_TYPE = 2 - INT_TYPE = 3 - BIGINT_TYPE = 4 - FLOAT_TYPE = 5 - DOUBLE_TYPE = 6 - STRING_TYPE = 7 - TIMESTAMP_TYPE = 8 - BINARY_TYPE = 9 - ARRAY_TYPE = 10 - MAP_TYPE = 11 - STRUCT_TYPE = 12 - UNION_TYPE = 13 - USER_DEFINED_TYPE = 14 - DECIMAL_TYPE = 15 - NULL_TYPE = 16 - DATE_TYPE = 17 - VARCHAR_TYPE = 18 - CHAR_TYPE = 19 - INTERVAL_YEAR_MONTH_TYPE = 20 - INTERVAL_DAY_TIME_TYPE = 21 - TIMESTAMPLOCALTZ_TYPE = 22 - - _VALUES_TO_NAMES = { - 0: "BOOLEAN_TYPE", - 1: "TINYINT_TYPE", - 2: "SMALLINT_TYPE", - 3: "INT_TYPE", - 4: "BIGINT_TYPE", - 5: "FLOAT_TYPE", - 6: "DOUBLE_TYPE", - 7: "STRING_TYPE", - 8: "TIMESTAMP_TYPE", - 9: "BINARY_TYPE", - 10: "ARRAY_TYPE", - 11: "MAP_TYPE", - 12: "STRUCT_TYPE", - 13: "UNION_TYPE", - 14: "USER_DEFINED_TYPE", - 15: "DECIMAL_TYPE", - 16: "NULL_TYPE", - 17: "DATE_TYPE", - 18: "VARCHAR_TYPE", - 19: "CHAR_TYPE", - 20: "INTERVAL_YEAR_MONTH_TYPE", - 21: "INTERVAL_DAY_TIME_TYPE", - 22: "TIMESTAMPLOCALTZ_TYPE", - } - - _NAMES_TO_VALUES = { - "BOOLEAN_TYPE": 0, - "TINYINT_TYPE": 1, - "SMALLINT_TYPE": 2, - "INT_TYPE": 3, - "BIGINT_TYPE": 4, - "FLOAT_TYPE": 5, - "DOUBLE_TYPE": 6, - "STRING_TYPE": 7, - "TIMESTAMP_TYPE": 8, - "BINARY_TYPE": 9, - "ARRAY_TYPE": 10, - "MAP_TYPE": 11, - "STRUCT_TYPE": 12, - "UNION_TYPE": 13, - "USER_DEFINED_TYPE": 14, - "DECIMAL_TYPE": 15, - "NULL_TYPE": 16, - "DATE_TYPE": 17, - "VARCHAR_TYPE": 18, - "CHAR_TYPE": 19, - "INTERVAL_YEAR_MONTH_TYPE": 20, - "INTERVAL_DAY_TIME_TYPE": 21, - "TIMESTAMPLOCALTZ_TYPE": 22, - } - - -class TStatusCode(object): - SUCCESS_STATUS = 0 - SUCCESS_WITH_INFO_STATUS = 1 - STILL_EXECUTING_STATUS = 2 - ERROR_STATUS = 3 - INVALID_HANDLE_STATUS = 4 - - _VALUES_TO_NAMES = { - 0: "SUCCESS_STATUS", - 1: "SUCCESS_WITH_INFO_STATUS", - 2: "STILL_EXECUTING_STATUS", - 3: "ERROR_STATUS", - 4: "INVALID_HANDLE_STATUS", - } - - _NAMES_TO_VALUES = { - "SUCCESS_STATUS": 0, - "SUCCESS_WITH_INFO_STATUS": 1, - "STILL_EXECUTING_STATUS": 2, - "ERROR_STATUS": 3, - "INVALID_HANDLE_STATUS": 4, - } - - -class TOperationState(object): - INITIALIZED_STATE = 0 - RUNNING_STATE = 1 - FINISHED_STATE = 2 - CANCELED_STATE = 3 - CLOSED_STATE = 4 - ERROR_STATE = 5 - UKNOWN_STATE = 6 - PENDING_STATE = 7 - TIMEDOUT_STATE = 8 - - _VALUES_TO_NAMES = { - 0: "INITIALIZED_STATE", - 1: "RUNNING_STATE", - 2: "FINISHED_STATE", - 3: "CANCELED_STATE", - 4: "CLOSED_STATE", - 5: "ERROR_STATE", - 6: "UKNOWN_STATE", - 7: "PENDING_STATE", - 8: "TIMEDOUT_STATE", - } - - _NAMES_TO_VALUES = { - "INITIALIZED_STATE": 0, - "RUNNING_STATE": 1, - "FINISHED_STATE": 2, - "CANCELED_STATE": 3, - "CLOSED_STATE": 4, - "ERROR_STATE": 5, - "UKNOWN_STATE": 6, - "PENDING_STATE": 7, - "TIMEDOUT_STATE": 8, - } - - -class TOperationType(object): - EXECUTE_STATEMENT = 0 - GET_TYPE_INFO = 1 - GET_CATALOGS = 2 - GET_SCHEMAS = 3 - GET_TABLES = 4 - GET_TABLE_TYPES = 5 - GET_COLUMNS = 6 - GET_FUNCTIONS = 7 - UNKNOWN = 8 - - _VALUES_TO_NAMES = { - 0: "EXECUTE_STATEMENT", - 1: "GET_TYPE_INFO", - 2: "GET_CATALOGS", - 3: "GET_SCHEMAS", - 4: "GET_TABLES", - 5: "GET_TABLE_TYPES", - 6: "GET_COLUMNS", - 7: "GET_FUNCTIONS", - 8: "UNKNOWN", - } - - _NAMES_TO_VALUES = { - "EXECUTE_STATEMENT": 0, - "GET_TYPE_INFO": 1, - "GET_CATALOGS": 2, - "GET_SCHEMAS": 3, - "GET_TABLES": 4, - "GET_TABLE_TYPES": 5, - "GET_COLUMNS": 6, - "GET_FUNCTIONS": 7, - "UNKNOWN": 8, - } - - -class TGetInfoType(object): - CLI_MAX_DRIVER_CONNECTIONS = 0 - CLI_MAX_CONCURRENT_ACTIVITIES = 1 - CLI_DATA_SOURCE_NAME = 2 - CLI_FETCH_DIRECTION = 8 - CLI_SERVER_NAME = 13 - CLI_SEARCH_PATTERN_ESCAPE = 14 - CLI_DBMS_NAME = 17 - CLI_DBMS_VER = 18 - CLI_ACCESSIBLE_TABLES = 19 - CLI_ACCESSIBLE_PROCEDURES = 20 - CLI_CURSOR_COMMIT_BEHAVIOR = 23 - CLI_DATA_SOURCE_READ_ONLY = 25 - CLI_DEFAULT_TXN_ISOLATION = 26 - CLI_IDENTIFIER_CASE = 28 - CLI_IDENTIFIER_QUOTE_CHAR = 29 - CLI_MAX_COLUMN_NAME_LEN = 30 - CLI_MAX_CURSOR_NAME_LEN = 31 - CLI_MAX_SCHEMA_NAME_LEN = 32 - CLI_MAX_CATALOG_NAME_LEN = 34 - CLI_MAX_TABLE_NAME_LEN = 35 - CLI_SCROLL_CONCURRENCY = 43 - CLI_TXN_CAPABLE = 46 - CLI_USER_NAME = 47 - CLI_TXN_ISOLATION_OPTION = 72 - CLI_INTEGRITY = 73 - CLI_GETDATA_EXTENSIONS = 81 - CLI_NULL_COLLATION = 85 - CLI_ALTER_TABLE = 86 - CLI_ORDER_BY_COLUMNS_IN_SELECT = 90 - CLI_SPECIAL_CHARACTERS = 94 - CLI_MAX_COLUMNS_IN_GROUP_BY = 97 - CLI_MAX_COLUMNS_IN_INDEX = 98 - CLI_MAX_COLUMNS_IN_ORDER_BY = 99 - CLI_MAX_COLUMNS_IN_SELECT = 100 - CLI_MAX_COLUMNS_IN_TABLE = 101 - CLI_MAX_INDEX_SIZE = 102 - CLI_MAX_ROW_SIZE = 104 - CLI_MAX_STATEMENT_LEN = 105 - CLI_MAX_TABLES_IN_SELECT = 106 - CLI_MAX_USER_NAME_LEN = 107 - CLI_OJ_CAPABILITIES = 115 - CLI_XOPEN_CLI_YEAR = 10000 - CLI_CURSOR_SENSITIVITY = 10001 - CLI_DESCRIBE_PARAMETER = 10002 - CLI_CATALOG_NAME = 10003 - CLI_COLLATION_SEQ = 10004 - CLI_MAX_IDENTIFIER_LEN = 10005 - CLI_ODBC_KEYWORDS = 10006 - - _VALUES_TO_NAMES = { - 0: "CLI_MAX_DRIVER_CONNECTIONS", - 1: "CLI_MAX_CONCURRENT_ACTIVITIES", - 2: "CLI_DATA_SOURCE_NAME", - 8: "CLI_FETCH_DIRECTION", - 13: "CLI_SERVER_NAME", - 14: "CLI_SEARCH_PATTERN_ESCAPE", - 17: "CLI_DBMS_NAME", - 18: "CLI_DBMS_VER", - 19: "CLI_ACCESSIBLE_TABLES", - 20: "CLI_ACCESSIBLE_PROCEDURES", - 23: "CLI_CURSOR_COMMIT_BEHAVIOR", - 25: "CLI_DATA_SOURCE_READ_ONLY", - 26: "CLI_DEFAULT_TXN_ISOLATION", - 28: "CLI_IDENTIFIER_CASE", - 29: "CLI_IDENTIFIER_QUOTE_CHAR", - 30: "CLI_MAX_COLUMN_NAME_LEN", - 31: "CLI_MAX_CURSOR_NAME_LEN", - 32: "CLI_MAX_SCHEMA_NAME_LEN", - 34: "CLI_MAX_CATALOG_NAME_LEN", - 35: "CLI_MAX_TABLE_NAME_LEN", - 43: "CLI_SCROLL_CONCURRENCY", - 46: "CLI_TXN_CAPABLE", - 47: "CLI_USER_NAME", - 72: "CLI_TXN_ISOLATION_OPTION", - 73: "CLI_INTEGRITY", - 81: "CLI_GETDATA_EXTENSIONS", - 85: "CLI_NULL_COLLATION", - 86: "CLI_ALTER_TABLE", - 90: "CLI_ORDER_BY_COLUMNS_IN_SELECT", - 94: "CLI_SPECIAL_CHARACTERS", - 97: "CLI_MAX_COLUMNS_IN_GROUP_BY", - 98: "CLI_MAX_COLUMNS_IN_INDEX", - 99: "CLI_MAX_COLUMNS_IN_ORDER_BY", - 100: "CLI_MAX_COLUMNS_IN_SELECT", - 101: "CLI_MAX_COLUMNS_IN_TABLE", - 102: "CLI_MAX_INDEX_SIZE", - 104: "CLI_MAX_ROW_SIZE", - 105: "CLI_MAX_STATEMENT_LEN", - 106: "CLI_MAX_TABLES_IN_SELECT", - 107: "CLI_MAX_USER_NAME_LEN", - 115: "CLI_OJ_CAPABILITIES", - 10000: "CLI_XOPEN_CLI_YEAR", - 10001: "CLI_CURSOR_SENSITIVITY", - 10002: "CLI_DESCRIBE_PARAMETER", - 10003: "CLI_CATALOG_NAME", - 10004: "CLI_COLLATION_SEQ", - 10005: "CLI_MAX_IDENTIFIER_LEN", - 10006: "CLI_ODBC_KEYWORDS", - } - - _NAMES_TO_VALUES = { - "CLI_MAX_DRIVER_CONNECTIONS": 0, - "CLI_MAX_CONCURRENT_ACTIVITIES": 1, - "CLI_DATA_SOURCE_NAME": 2, - "CLI_FETCH_DIRECTION": 8, - "CLI_SERVER_NAME": 13, - "CLI_SEARCH_PATTERN_ESCAPE": 14, - "CLI_DBMS_NAME": 17, - "CLI_DBMS_VER": 18, - "CLI_ACCESSIBLE_TABLES": 19, - "CLI_ACCESSIBLE_PROCEDURES": 20, - "CLI_CURSOR_COMMIT_BEHAVIOR": 23, - "CLI_DATA_SOURCE_READ_ONLY": 25, - "CLI_DEFAULT_TXN_ISOLATION": 26, - "CLI_IDENTIFIER_CASE": 28, - "CLI_IDENTIFIER_QUOTE_CHAR": 29, - "CLI_MAX_COLUMN_NAME_LEN": 30, - "CLI_MAX_CURSOR_NAME_LEN": 31, - "CLI_MAX_SCHEMA_NAME_LEN": 32, - "CLI_MAX_CATALOG_NAME_LEN": 34, - "CLI_MAX_TABLE_NAME_LEN": 35, - "CLI_SCROLL_CONCURRENCY": 43, - "CLI_TXN_CAPABLE": 46, - "CLI_USER_NAME": 47, - "CLI_TXN_ISOLATION_OPTION": 72, - "CLI_INTEGRITY": 73, - "CLI_GETDATA_EXTENSIONS": 81, - "CLI_NULL_COLLATION": 85, - "CLI_ALTER_TABLE": 86, - "CLI_ORDER_BY_COLUMNS_IN_SELECT": 90, - "CLI_SPECIAL_CHARACTERS": 94, - "CLI_MAX_COLUMNS_IN_GROUP_BY": 97, - "CLI_MAX_COLUMNS_IN_INDEX": 98, - "CLI_MAX_COLUMNS_IN_ORDER_BY": 99, - "CLI_MAX_COLUMNS_IN_SELECT": 100, - "CLI_MAX_COLUMNS_IN_TABLE": 101, - "CLI_MAX_INDEX_SIZE": 102, - "CLI_MAX_ROW_SIZE": 104, - "CLI_MAX_STATEMENT_LEN": 105, - "CLI_MAX_TABLES_IN_SELECT": 106, - "CLI_MAX_USER_NAME_LEN": 107, - "CLI_OJ_CAPABILITIES": 115, - "CLI_XOPEN_CLI_YEAR": 10000, - "CLI_CURSOR_SENSITIVITY": 10001, - "CLI_DESCRIBE_PARAMETER": 10002, - "CLI_CATALOG_NAME": 10003, - "CLI_COLLATION_SEQ": 10004, - "CLI_MAX_IDENTIFIER_LEN": 10005, - "CLI_ODBC_KEYWORDS": 10006, - } - - -class TFetchOrientation(object): - FETCH_NEXT = 0 - FETCH_PRIOR = 1 - FETCH_RELATIVE = 2 - FETCH_ABSOLUTE = 3 - FETCH_FIRST = 4 - FETCH_LAST = 5 - - _VALUES_TO_NAMES = { - 0: "FETCH_NEXT", - 1: "FETCH_PRIOR", - 2: "FETCH_RELATIVE", - 3: "FETCH_ABSOLUTE", - 4: "FETCH_FIRST", - 5: "FETCH_LAST", - } - - _NAMES_TO_VALUES = { - "FETCH_NEXT": 0, - "FETCH_PRIOR": 1, - "FETCH_RELATIVE": 2, - "FETCH_ABSOLUTE": 3, - "FETCH_FIRST": 4, - "FETCH_LAST": 5, - } - - -class TJobExecutionStatus(object): - IN_PROGRESS = 0 - COMPLETE = 1 - NOT_AVAILABLE = 2 - - _VALUES_TO_NAMES = { - 0: "IN_PROGRESS", - 1: "COMPLETE", - 2: "NOT_AVAILABLE", - } - - _NAMES_TO_VALUES = { - "IN_PROGRESS": 0, - "COMPLETE": 1, - "NOT_AVAILABLE": 2, - } - - -class TTypeQualifierValue(object): - """ - Attributes: - - i32Value - - stringValue - - """ - - - def __init__(self, i32Value=None, stringValue=None,): - self.i32Value = i32Value - self.stringValue = stringValue - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.i32Value = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TTypeQualifierValue') - if self.i32Value is not None: - oprot.writeFieldBegin('i32Value', TType.I32, 1) - oprot.writeI32(self.i32Value) - oprot.writeFieldEnd() - if self.stringValue is not None: - oprot.writeFieldBegin('stringValue', TType.STRING, 2) - oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TTypeQualifiers(object): - """ - Attributes: - - qualifiers - - """ - - - def __init__(self, qualifiers=None,): - self.qualifiers = qualifiers - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.MAP: - self.qualifiers = {} - (_ktype1, _vtype2, _size0) = iprot.readMapBegin() - for _i4 in range(_size0): - _key5 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val6 = TTypeQualifierValue() - _val6.read(iprot) - self.qualifiers[_key5] = _val6 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TTypeQualifiers') - if self.qualifiers is not None: - oprot.writeFieldBegin('qualifiers', TType.MAP, 1) - oprot.writeMapBegin(TType.STRING, TType.STRUCT, len(self.qualifiers)) - for kiter7, viter8 in self.qualifiers.items(): - oprot.writeString(kiter7.encode('utf-8') if sys.version_info[0] == 2 else kiter7) - viter8.write(oprot) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.qualifiers is None: - raise TProtocolException(message='Required field qualifiers is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TPrimitiveTypeEntry(object): - """ - Attributes: - - type - - typeQualifiers - - """ - - - def __init__(self, type=None, typeQualifiers=None,): - self.type = type - self.typeQualifiers = typeQualifiers - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.type = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.typeQualifiers = TTypeQualifiers() - self.typeQualifiers.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TPrimitiveTypeEntry') - if self.type is not None: - oprot.writeFieldBegin('type', TType.I32, 1) - oprot.writeI32(self.type) - oprot.writeFieldEnd() - if self.typeQualifiers is not None: - oprot.writeFieldBegin('typeQualifiers', TType.STRUCT, 2) - self.typeQualifiers.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.type is None: - raise TProtocolException(message='Required field type is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TArrayTypeEntry(object): - """ - Attributes: - - objectTypePtr - - """ - - - def __init__(self, objectTypePtr=None,): - self.objectTypePtr = objectTypePtr - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.objectTypePtr = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TArrayTypeEntry') - if self.objectTypePtr is not None: - oprot.writeFieldBegin('objectTypePtr', TType.I32, 1) - oprot.writeI32(self.objectTypePtr) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.objectTypePtr is None: - raise TProtocolException(message='Required field objectTypePtr is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TMapTypeEntry(object): - """ - Attributes: - - keyTypePtr - - valueTypePtr - - """ - - - def __init__(self, keyTypePtr=None, valueTypePtr=None,): - self.keyTypePtr = keyTypePtr - self.valueTypePtr = valueTypePtr - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.keyTypePtr = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.valueTypePtr = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TMapTypeEntry') - if self.keyTypePtr is not None: - oprot.writeFieldBegin('keyTypePtr', TType.I32, 1) - oprot.writeI32(self.keyTypePtr) - oprot.writeFieldEnd() - if self.valueTypePtr is not None: - oprot.writeFieldBegin('valueTypePtr', TType.I32, 2) - oprot.writeI32(self.valueTypePtr) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.keyTypePtr is None: - raise TProtocolException(message='Required field keyTypePtr is unset!') - if self.valueTypePtr is None: - raise TProtocolException(message='Required field valueTypePtr is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TStructTypeEntry(object): - """ - Attributes: - - nameToTypePtr - - """ - - - def __init__(self, nameToTypePtr=None,): - self.nameToTypePtr = nameToTypePtr - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.MAP: - self.nameToTypePtr = {} - (_ktype10, _vtype11, _size9) = iprot.readMapBegin() - for _i13 in range(_size9): - _key14 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val15 = iprot.readI32() - self.nameToTypePtr[_key14] = _val15 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TStructTypeEntry') - if self.nameToTypePtr is not None: - oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1) - oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr)) - for kiter16, viter17 in self.nameToTypePtr.items(): - oprot.writeString(kiter16.encode('utf-8') if sys.version_info[0] == 2 else kiter16) - oprot.writeI32(viter17) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.nameToTypePtr is None: - raise TProtocolException(message='Required field nameToTypePtr is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TUnionTypeEntry(object): - """ - Attributes: - - nameToTypePtr - - """ - - - def __init__(self, nameToTypePtr=None,): - self.nameToTypePtr = nameToTypePtr - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.MAP: - self.nameToTypePtr = {} - (_ktype19, _vtype20, _size18) = iprot.readMapBegin() - for _i22 in range(_size18): - _key23 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val24 = iprot.readI32() - self.nameToTypePtr[_key23] = _val24 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TUnionTypeEntry') - if self.nameToTypePtr is not None: - oprot.writeFieldBegin('nameToTypePtr', TType.MAP, 1) - oprot.writeMapBegin(TType.STRING, TType.I32, len(self.nameToTypePtr)) - for kiter25, viter26 in self.nameToTypePtr.items(): - oprot.writeString(kiter25.encode('utf-8') if sys.version_info[0] == 2 else kiter25) - oprot.writeI32(viter26) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.nameToTypePtr is None: - raise TProtocolException(message='Required field nameToTypePtr is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TUserDefinedTypeEntry(object): - """ - Attributes: - - typeClassName - - """ - - - def __init__(self, typeClassName=None,): - self.typeClassName = typeClassName - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.typeClassName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TUserDefinedTypeEntry') - if self.typeClassName is not None: - oprot.writeFieldBegin('typeClassName', TType.STRING, 1) - oprot.writeString(self.typeClassName.encode('utf-8') if sys.version_info[0] == 2 else self.typeClassName) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.typeClassName is None: - raise TProtocolException(message='Required field typeClassName is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TTypeEntry(object): - """ - Attributes: - - primitiveEntry - - arrayEntry - - mapEntry - - structEntry - - unionEntry - - userDefinedTypeEntry - - """ - - - def __init__(self, primitiveEntry=None, arrayEntry=None, mapEntry=None, structEntry=None, unionEntry=None, userDefinedTypeEntry=None,): - self.primitiveEntry = primitiveEntry - self.arrayEntry = arrayEntry - self.mapEntry = mapEntry - self.structEntry = structEntry - self.unionEntry = unionEntry - self.userDefinedTypeEntry = userDefinedTypeEntry - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.primitiveEntry = TPrimitiveTypeEntry() - self.primitiveEntry.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.arrayEntry = TArrayTypeEntry() - self.arrayEntry.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.mapEntry = TMapTypeEntry() - self.mapEntry.read(iprot) - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRUCT: - self.structEntry = TStructTypeEntry() - self.structEntry.read(iprot) - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRUCT: - self.unionEntry = TUnionTypeEntry() - self.unionEntry.read(iprot) - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRUCT: - self.userDefinedTypeEntry = TUserDefinedTypeEntry() - self.userDefinedTypeEntry.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TTypeEntry') - if self.primitiveEntry is not None: - oprot.writeFieldBegin('primitiveEntry', TType.STRUCT, 1) - self.primitiveEntry.write(oprot) - oprot.writeFieldEnd() - if self.arrayEntry is not None: - oprot.writeFieldBegin('arrayEntry', TType.STRUCT, 2) - self.arrayEntry.write(oprot) - oprot.writeFieldEnd() - if self.mapEntry is not None: - oprot.writeFieldBegin('mapEntry', TType.STRUCT, 3) - self.mapEntry.write(oprot) - oprot.writeFieldEnd() - if self.structEntry is not None: - oprot.writeFieldBegin('structEntry', TType.STRUCT, 4) - self.structEntry.write(oprot) - oprot.writeFieldEnd() - if self.unionEntry is not None: - oprot.writeFieldBegin('unionEntry', TType.STRUCT, 5) - self.unionEntry.write(oprot) - oprot.writeFieldEnd() - if self.userDefinedTypeEntry is not None: - oprot.writeFieldBegin('userDefinedTypeEntry', TType.STRUCT, 6) - self.userDefinedTypeEntry.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__.items()] - 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 TTypeDesc(object): - """ - Attributes: - - types - - """ - - - def __init__(self, types=None,): - self.types = types - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.types = [] - (_etype30, _size27) = iprot.readListBegin() - for _i31 in range(_size27): - _elem32 = TTypeEntry() - _elem32.read(iprot) - self.types.append(_elem32) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TTypeDesc') - if self.types is not None: - oprot.writeFieldBegin('types', TType.LIST, 1) - oprot.writeListBegin(TType.STRUCT, len(self.types)) - for iter33 in self.types: - iter33.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.types is None: - raise TProtocolException(message='Required field types is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TColumnDesc(object): - """ - Attributes: - - columnName - - typeDesc - - position - - comment - - """ - - - def __init__(self, columnName=None, typeDesc=None, position=None, comment=None,): - self.columnName = columnName - self.typeDesc = typeDesc - self.position = position - self.comment = comment - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.columnName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.typeDesc = TTypeDesc() - self.typeDesc.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.position = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.comment = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TColumnDesc') - if self.columnName is not None: - oprot.writeFieldBegin('columnName', TType.STRING, 1) - oprot.writeString(self.columnName.encode('utf-8') if sys.version_info[0] == 2 else self.columnName) - oprot.writeFieldEnd() - if self.typeDesc is not None: - oprot.writeFieldBegin('typeDesc', TType.STRUCT, 2) - self.typeDesc.write(oprot) - oprot.writeFieldEnd() - if self.position is not None: - oprot.writeFieldBegin('position', TType.I32, 3) - oprot.writeI32(self.position) - oprot.writeFieldEnd() - if self.comment is not None: - oprot.writeFieldBegin('comment', TType.STRING, 4) - oprot.writeString(self.comment.encode('utf-8') if sys.version_info[0] == 2 else self.comment) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.columnName is None: - raise TProtocolException(message='Required field columnName is unset!') - if self.typeDesc is None: - raise TProtocolException(message='Required field typeDesc is unset!') - if self.position is None: - raise TProtocolException(message='Required field position is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TTableSchema(object): - """ - Attributes: - - columns - - """ - - - def __init__(self, columns=None,): - self.columns = columns - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.columns = [] - (_etype37, _size34) = iprot.readListBegin() - for _i38 in range(_size34): - _elem39 = TColumnDesc() - _elem39.read(iprot) - self.columns.append(_elem39) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TTableSchema') - if self.columns is not None: - oprot.writeFieldBegin('columns', TType.LIST, 1) - oprot.writeListBegin(TType.STRUCT, len(self.columns)) - for iter40 in self.columns: - iter40.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.columns is None: - raise TProtocolException(message='Required field columns is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TBoolValue(object): - """ - Attributes: - - value - - """ - - - def __init__(self, value=None,): - self.value = value - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.BOOL: - self.value = iprot.readBool() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TBoolValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.BOOL, 1) - oprot.writeBool(self.value) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TByteValue(object): - """ - Attributes: - - value - - """ - - - def __init__(self, value=None,): - self.value = value - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.BYTE: - self.value = iprot.readByte() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TByteValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.BYTE, 1) - oprot.writeByte(self.value) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TI16Value(object): - """ - Attributes: - - value - - """ - - - def __init__(self, value=None,): - self.value = value - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I16: - self.value = iprot.readI16() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TI16Value') - if self.value is not None: - oprot.writeFieldBegin('value', TType.I16, 1) - oprot.writeI16(self.value) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TI32Value(object): - """ - Attributes: - - value - - """ - - - def __init__(self, value=None,): - self.value = value - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.value = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TI32Value') - if self.value is not None: - oprot.writeFieldBegin('value', TType.I32, 1) - oprot.writeI32(self.value) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TI64Value(object): - """ - Attributes: - - value - - """ - - - def __init__(self, value=None,): - self.value = value - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I64: - self.value = iprot.readI64() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TI64Value') - if self.value is not None: - oprot.writeFieldBegin('value', TType.I64, 1) - oprot.writeI64(self.value) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TDoubleValue(object): - """ - Attributes: - - value - - """ - - - def __init__(self, value=None,): - self.value = value - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.DOUBLE: - self.value = iprot.readDouble() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TDoubleValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.DOUBLE, 1) - oprot.writeDouble(self.value) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TStringValue(object): - """ - Attributes: - - value - - """ - - - def __init__(self, value=None,): - self.value = value - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.value = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TStringValue') - if self.value is not None: - oprot.writeFieldBegin('value', TType.STRING, 1) - oprot.writeString(self.value.encode('utf-8') if sys.version_info[0] == 2 else self.value) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TColumnValue(object): - """ - Attributes: - - boolVal - - byteVal - - i16Val - - i32Val - - i64Val - - doubleVal - - stringVal - - """ - - - def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None,): - self.boolVal = boolVal - self.byteVal = byteVal - self.i16Val = i16Val - self.i32Val = i32Val - self.i64Val = i64Val - self.doubleVal = doubleVal - self.stringVal = stringVal - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.boolVal = TBoolValue() - self.boolVal.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.byteVal = TByteValue() - self.byteVal.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.i16Val = TI16Value() - self.i16Val.read(iprot) - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRUCT: - self.i32Val = TI32Value() - self.i32Val.read(iprot) - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRUCT: - self.i64Val = TI64Value() - self.i64Val.read(iprot) - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRUCT: - self.doubleVal = TDoubleValue() - self.doubleVal.read(iprot) - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRUCT: - self.stringVal = TStringValue() - self.stringVal.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TColumnValue') - if self.boolVal is not None: - oprot.writeFieldBegin('boolVal', TType.STRUCT, 1) - self.boolVal.write(oprot) - oprot.writeFieldEnd() - if self.byteVal is not None: - oprot.writeFieldBegin('byteVal', TType.STRUCT, 2) - self.byteVal.write(oprot) - oprot.writeFieldEnd() - if self.i16Val is not None: - oprot.writeFieldBegin('i16Val', TType.STRUCT, 3) - self.i16Val.write(oprot) - oprot.writeFieldEnd() - if self.i32Val is not None: - oprot.writeFieldBegin('i32Val', TType.STRUCT, 4) - self.i32Val.write(oprot) - oprot.writeFieldEnd() - if self.i64Val is not None: - oprot.writeFieldBegin('i64Val', TType.STRUCT, 5) - self.i64Val.write(oprot) - oprot.writeFieldEnd() - if self.doubleVal is not None: - oprot.writeFieldBegin('doubleVal', TType.STRUCT, 6) - self.doubleVal.write(oprot) - oprot.writeFieldEnd() - if self.stringVal is not None: - oprot.writeFieldBegin('stringVal', TType.STRUCT, 7) - self.stringVal.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__.items()] - 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 TRow(object): - """ - Attributes: - - colVals - - """ - - - def __init__(self, colVals=None,): - self.colVals = colVals - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.colVals = [] - (_etype44, _size41) = iprot.readListBegin() - for _i45 in range(_size41): - _elem46 = TColumnValue() - _elem46.read(iprot) - self.colVals.append(_elem46) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TRow') - if self.colVals is not None: - oprot.writeFieldBegin('colVals', TType.LIST, 1) - oprot.writeListBegin(TType.STRUCT, len(self.colVals)) - for iter47 in self.colVals: - iter47.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.colVals is None: - raise TProtocolException(message='Required field colVals is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TBoolColumn(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype51, _size48) = iprot.readListBegin() - for _i52 in range(_size48): - _elem53 = iprot.readBool() - self.values.append(_elem53) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TBoolColumn') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.BOOL, len(self.values)) - for iter54 in self.values: - oprot.writeBool(iter54) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TByteColumn(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype58, _size55) = iprot.readListBegin() - for _i59 in range(_size55): - _elem60 = iprot.readByte() - self.values.append(_elem60) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TByteColumn') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.BYTE, len(self.values)) - for iter61 in self.values: - oprot.writeByte(iter61) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TI16Column(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype65, _size62) = iprot.readListBegin() - for _i66 in range(_size62): - _elem67 = iprot.readI16() - self.values.append(_elem67) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TI16Column') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.I16, len(self.values)) - for iter68 in self.values: - oprot.writeI16(iter68) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TI32Column(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype72, _size69) = iprot.readListBegin() - for _i73 in range(_size69): - _elem74 = iprot.readI32() - self.values.append(_elem74) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TI32Column') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.I32, len(self.values)) - for iter75 in self.values: - oprot.writeI32(iter75) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TI64Column(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype79, _size76) = iprot.readListBegin() - for _i80 in range(_size76): - _elem81 = iprot.readI64() - self.values.append(_elem81) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TI64Column') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.I64, len(self.values)) - for iter82 in self.values: - oprot.writeI64(iter82) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TDoubleColumn(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype86, _size83) = iprot.readListBegin() - for _i87 in range(_size83): - _elem88 = iprot.readDouble() - self.values.append(_elem88) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TDoubleColumn') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.DOUBLE, len(self.values)) - for iter89 in self.values: - oprot.writeDouble(iter89) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TStringColumn(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype93, _size90) = iprot.readListBegin() - for _i94 in range(_size90): - _elem95 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.values.append(_elem95) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TStringColumn') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.STRING, len(self.values)) - for iter96 in self.values: - oprot.writeString(iter96.encode('utf-8') if sys.version_info[0] == 2 else iter96) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TBinaryColumn(object): - """ - Attributes: - - values - - nulls - - """ - - - def __init__(self, values=None, nulls=None,): - self.values = values - self.nulls = nulls - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.values = [] - (_etype100, _size97) = iprot.readListBegin() - for _i101 in range(_size97): - _elem102 = iprot.readBinary() - self.values.append(_elem102) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.nulls = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TBinaryColumn') - if self.values is not None: - oprot.writeFieldBegin('values', TType.LIST, 1) - oprot.writeListBegin(TType.STRING, len(self.values)) - for iter103 in self.values: - oprot.writeBinary(iter103) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.nulls is not None: - oprot.writeFieldBegin('nulls', TType.STRING, 2) - oprot.writeBinary(self.nulls) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.values is None: - raise TProtocolException(message='Required field values is unset!') - if self.nulls is None: - raise TProtocolException(message='Required field nulls is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TColumn(object): - """ - Attributes: - - boolVal - - byteVal - - i16Val - - i32Val - - i64Val - - doubleVal - - stringVal - - binaryVal - - """ - - - def __init__(self, boolVal=None, byteVal=None, i16Val=None, i32Val=None, i64Val=None, doubleVal=None, stringVal=None, binaryVal=None,): - self.boolVal = boolVal - self.byteVal = byteVal - self.i16Val = i16Val - self.i32Val = i32Val - self.i64Val = i64Val - self.doubleVal = doubleVal - self.stringVal = stringVal - self.binaryVal = binaryVal - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.boolVal = TBoolColumn() - self.boolVal.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRUCT: - self.byteVal = TByteColumn() - self.byteVal.read(iprot) - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.i16Val = TI16Column() - self.i16Val.read(iprot) - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRUCT: - self.i32Val = TI32Column() - self.i32Val.read(iprot) - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRUCT: - self.i64Val = TI64Column() - self.i64Val.read(iprot) - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRUCT: - self.doubleVal = TDoubleColumn() - self.doubleVal.read(iprot) - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRUCT: - self.stringVal = TStringColumn() - self.stringVal.read(iprot) - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.STRUCT: - self.binaryVal = TBinaryColumn() - self.binaryVal.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TColumn') - if self.boolVal is not None: - oprot.writeFieldBegin('boolVal', TType.STRUCT, 1) - self.boolVal.write(oprot) - oprot.writeFieldEnd() - if self.byteVal is not None: - oprot.writeFieldBegin('byteVal', TType.STRUCT, 2) - self.byteVal.write(oprot) - oprot.writeFieldEnd() - if self.i16Val is not None: - oprot.writeFieldBegin('i16Val', TType.STRUCT, 3) - self.i16Val.write(oprot) - oprot.writeFieldEnd() - if self.i32Val is not None: - oprot.writeFieldBegin('i32Val', TType.STRUCT, 4) - self.i32Val.write(oprot) - oprot.writeFieldEnd() - if self.i64Val is not None: - oprot.writeFieldBegin('i64Val', TType.STRUCT, 5) - self.i64Val.write(oprot) - oprot.writeFieldEnd() - if self.doubleVal is not None: - oprot.writeFieldBegin('doubleVal', TType.STRUCT, 6) - self.doubleVal.write(oprot) - oprot.writeFieldEnd() - if self.stringVal is not None: - oprot.writeFieldBegin('stringVal', TType.STRUCT, 7) - self.stringVal.write(oprot) - oprot.writeFieldEnd() - if self.binaryVal is not None: - oprot.writeFieldBegin('binaryVal', TType.STRUCT, 8) - self.binaryVal.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__.items()] - 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 TRowSet(object): - """ - Attributes: - - startRowOffset - - rows - - columns - - binaryColumns - - columnCount - - """ - - - def __init__(self, startRowOffset=None, rows=None, columns=None, binaryColumns=None, columnCount=None,): - self.startRowOffset = startRowOffset - self.rows = rows - self.columns = columns - self.binaryColumns = binaryColumns - self.columnCount = columnCount - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I64: - self.startRowOffset = iprot.readI64() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.LIST: - self.rows = [] - (_etype107, _size104) = iprot.readListBegin() - for _i108 in range(_size104): - _elem109 = TRow() - _elem109.read(iprot) - self.rows.append(_elem109) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.LIST: - self.columns = [] - (_etype113, _size110) = iprot.readListBegin() - for _i114 in range(_size110): - _elem115 = TColumn() - _elem115.read(iprot) - self.columns.append(_elem115) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.binaryColumns = iprot.readBinary() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I32: - self.columnCount = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TRowSet') - if self.startRowOffset is not None: - oprot.writeFieldBegin('startRowOffset', TType.I64, 1) - oprot.writeI64(self.startRowOffset) - oprot.writeFieldEnd() - if self.rows is not None: - oprot.writeFieldBegin('rows', TType.LIST, 2) - oprot.writeListBegin(TType.STRUCT, len(self.rows)) - for iter116 in self.rows: - iter116.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.columns is not None: - oprot.writeFieldBegin('columns', TType.LIST, 3) - oprot.writeListBegin(TType.STRUCT, len(self.columns)) - for iter117 in self.columns: - iter117.write(oprot) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.binaryColumns is not None: - oprot.writeFieldBegin('binaryColumns', TType.STRING, 4) - oprot.writeBinary(self.binaryColumns) - oprot.writeFieldEnd() - if self.columnCount is not None: - oprot.writeFieldBegin('columnCount', TType.I32, 5) - oprot.writeI32(self.columnCount) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.startRowOffset is None: - raise TProtocolException(message='Required field startRowOffset is unset!') - if self.rows is None: - raise TProtocolException(message='Required field rows is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TStatus(object): - """ - Attributes: - - statusCode - - infoMessages - - sqlState - - errorCode - - errorMessage - - """ - - - def __init__(self, statusCode=None, infoMessages=None, sqlState=None, errorCode=None, errorMessage=None,): - self.statusCode = statusCode - self.infoMessages = infoMessages - self.sqlState = sqlState - self.errorCode = errorCode - self.errorMessage = errorMessage - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.statusCode = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.LIST: - self.infoMessages = [] - (_etype121, _size118) = iprot.readListBegin() - for _i122 in range(_size118): - _elem123 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.infoMessages.append(_elem123) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.sqlState = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.errorCode = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.errorMessage = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TStatus') - if self.statusCode is not None: - oprot.writeFieldBegin('statusCode', TType.I32, 1) - oprot.writeI32(self.statusCode) - oprot.writeFieldEnd() - if self.infoMessages is not None: - oprot.writeFieldBegin('infoMessages', TType.LIST, 2) - oprot.writeListBegin(TType.STRING, len(self.infoMessages)) - for iter124 in self.infoMessages: - oprot.writeString(iter124.encode('utf-8') if sys.version_info[0] == 2 else iter124) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.sqlState is not None: - oprot.writeFieldBegin('sqlState', TType.STRING, 3) - oprot.writeString(self.sqlState.encode('utf-8') if sys.version_info[0] == 2 else self.sqlState) - oprot.writeFieldEnd() - if self.errorCode is not None: - oprot.writeFieldBegin('errorCode', TType.I32, 4) - oprot.writeI32(self.errorCode) - oprot.writeFieldEnd() - if self.errorMessage is not None: - oprot.writeFieldBegin('errorMessage', TType.STRING, 5) - oprot.writeString(self.errorMessage.encode('utf-8') if sys.version_info[0] == 2 else self.errorMessage) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.statusCode is None: - raise TProtocolException(message='Required field statusCode is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 THandleIdentifier(object): - """ - Attributes: - - guid - - secret - - """ - - - def __init__(self, guid=None, secret=None,): - self.guid = guid - self.secret = secret - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.guid = iprot.readBinary() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.secret = iprot.readBinary() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('THandleIdentifier') - if self.guid is not None: - oprot.writeFieldBegin('guid', TType.STRING, 1) - oprot.writeBinary(self.guid) - oprot.writeFieldEnd() - if self.secret is not None: - oprot.writeFieldBegin('secret', TType.STRING, 2) - oprot.writeBinary(self.secret) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.guid is None: - raise TProtocolException(message='Required field guid is unset!') - if self.secret is None: - raise TProtocolException(message='Required field secret is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TSessionHandle(object): - """ - Attributes: - - sessionId - - """ - - - def __init__(self, sessionId=None,): - self.sessionId = sessionId - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.sessionId = THandleIdentifier() - self.sessionId.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TSessionHandle') - if self.sessionId is not None: - oprot.writeFieldBegin('sessionId', TType.STRUCT, 1) - self.sessionId.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionId is None: - raise TProtocolException(message='Required field sessionId is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TOperationHandle(object): - """ - Attributes: - - operationId - - operationType - - hasResultSet - - modifiedRowCount - - """ - - - def __init__(self, operationId=None, operationType=None, hasResultSet=None, modifiedRowCount=None,): - self.operationId = operationId - self.operationType = operationType - self.hasResultSet = hasResultSet - self.modifiedRowCount = modifiedRowCount - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.operationId = THandleIdentifier() - self.operationId.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.operationType = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.BOOL: - self.hasResultSet = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.DOUBLE: - self.modifiedRowCount = iprot.readDouble() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TOperationHandle') - if self.operationId is not None: - oprot.writeFieldBegin('operationId', TType.STRUCT, 1) - self.operationId.write(oprot) - oprot.writeFieldEnd() - if self.operationType is not None: - oprot.writeFieldBegin('operationType', TType.I32, 2) - oprot.writeI32(self.operationType) - oprot.writeFieldEnd() - if self.hasResultSet is not None: - oprot.writeFieldBegin('hasResultSet', TType.BOOL, 3) - oprot.writeBool(self.hasResultSet) - oprot.writeFieldEnd() - if self.modifiedRowCount is not None: - oprot.writeFieldBegin('modifiedRowCount', TType.DOUBLE, 4) - oprot.writeDouble(self.modifiedRowCount) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.operationId is None: - raise TProtocolException(message='Required field operationId is unset!') - if self.operationType is None: - raise TProtocolException(message='Required field operationType is unset!') - if self.hasResultSet is None: - raise TProtocolException(message='Required field hasResultSet is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TOpenSessionReq(object): - """ - Attributes: - - client_protocol - - username - - password - - configuration - - """ - - - def __init__(self, client_protocol=9, username=None, password=None, configuration=None,): - self.client_protocol = client_protocol - self.username = username - self.password = password - self.configuration = configuration - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.client_protocol = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.STRING: - self.username = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.password = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.MAP: - self.configuration = {} - (_ktype126, _vtype127, _size125) = iprot.readMapBegin() - for _i129 in range(_size125): - _key130 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val131 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.configuration[_key130] = _val131 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TOpenSessionReq') - if self.client_protocol is not None: - oprot.writeFieldBegin('client_protocol', TType.I32, 1) - oprot.writeI32(self.client_protocol) - oprot.writeFieldEnd() - if self.username is not None: - oprot.writeFieldBegin('username', TType.STRING, 2) - oprot.writeString(self.username.encode('utf-8') if sys.version_info[0] == 2 else self.username) - oprot.writeFieldEnd() - if self.password is not None: - oprot.writeFieldBegin('password', TType.STRING, 3) - oprot.writeString(self.password.encode('utf-8') if sys.version_info[0] == 2 else self.password) - oprot.writeFieldEnd() - if self.configuration is not None: - oprot.writeFieldBegin('configuration', TType.MAP, 4) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) - for kiter132, viter133 in self.configuration.items(): - oprot.writeString(kiter132.encode('utf-8') if sys.version_info[0] == 2 else kiter132) - oprot.writeString(viter133.encode('utf-8') if sys.version_info[0] == 2 else viter133) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.client_protocol is None: - raise TProtocolException(message='Required field client_protocol is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TOpenSessionResp(object): - """ - Attributes: - - status - - serverProtocolVersion - - sessionHandle - - configuration - - """ - - - def __init__(self, status=None, serverProtocolVersion=9, sessionHandle=None, configuration=None,): - self.status = status - self.serverProtocolVersion = serverProtocolVersion - self.sessionHandle = sessionHandle - self.configuration = configuration - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.serverProtocolVersion = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.sessionHandle = TSessionHandle() - self.sessionHandle.read(iprot) - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.MAP: - self.configuration = {} - (_ktype135, _vtype136, _size134) = iprot.readMapBegin() - for _i138 in range(_size134): - _key139 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val140 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.configuration[_key139] = _val140 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TOpenSessionResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - if self.serverProtocolVersion is not None: - oprot.writeFieldBegin('serverProtocolVersion', TType.I32, 2) - oprot.writeI32(self.serverProtocolVersion) - oprot.writeFieldEnd() - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 3) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.configuration is not None: - oprot.writeFieldBegin('configuration', TType.MAP, 4) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) - for kiter141, viter142 in self.configuration.items(): - oprot.writeString(kiter141.encode('utf-8') if sys.version_info[0] == 2 else kiter141) - oprot.writeString(viter142.encode('utf-8') if sys.version_info[0] == 2 else viter142) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - if self.serverProtocolVersion is None: - raise TProtocolException(message='Required field serverProtocolVersion is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TSetClientInfoReq(object): - """ - Attributes: - - sessionHandle - - configuration - - """ - - - def __init__(self, sessionHandle=None, configuration=None,): - self.sessionHandle = sessionHandle - self.configuration = configuration - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.MAP: - self.configuration = {} - (_ktype144, _vtype145, _size143) = iprot.readMapBegin() - for _i147 in range(_size143): - _key148 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val149 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.configuration[_key148] = _val149 - iprot.readMapEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TSetClientInfoReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.configuration is not None: - oprot.writeFieldBegin('configuration', TType.MAP, 2) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.configuration)) - for kiter150, viter151 in self.configuration.items(): - oprot.writeString(kiter150.encode('utf-8') if sys.version_info[0] == 2 else kiter150) - oprot.writeString(viter151.encode('utf-8') if sys.version_info[0] == 2 else viter151) - oprot.writeMapEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TSetClientInfoResp(object): - """ - Attributes: - - status - - """ - - - def __init__(self, status=None,): - self.status = status - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TSetClientInfoResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCloseSessionReq(object): - """ - Attributes: - - sessionHandle - - """ - - - def __init__(self, sessionHandle=None,): - self.sessionHandle = sessionHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCloseSessionReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCloseSessionResp(object): - """ - Attributes: - - status - - """ - - - def __init__(self, status=None,): - self.status = status - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCloseSessionResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetInfoValue(object): - """ - Attributes: - - stringValue - - smallIntValue - - integerBitmask - - integerFlag - - binaryValue - - lenValue - - """ - - - def __init__(self, stringValue=None, smallIntValue=None, integerBitmask=None, integerFlag=None, binaryValue=None, lenValue=None,): - self.stringValue = stringValue - self.smallIntValue = smallIntValue - self.integerBitmask = integerBitmask - self.integerFlag = integerFlag - self.binaryValue = binaryValue - self.lenValue = lenValue - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.stringValue = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I16: - self.smallIntValue = iprot.readI16() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I32: - self.integerBitmask = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.integerFlag = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I32: - self.binaryValue = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.I64: - self.lenValue = iprot.readI64() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetInfoValue') - if self.stringValue is not None: - oprot.writeFieldBegin('stringValue', TType.STRING, 1) - oprot.writeString(self.stringValue.encode('utf-8') if sys.version_info[0] == 2 else self.stringValue) - oprot.writeFieldEnd() - if self.smallIntValue is not None: - oprot.writeFieldBegin('smallIntValue', TType.I16, 2) - oprot.writeI16(self.smallIntValue) - oprot.writeFieldEnd() - if self.integerBitmask is not None: - oprot.writeFieldBegin('integerBitmask', TType.I32, 3) - oprot.writeI32(self.integerBitmask) - oprot.writeFieldEnd() - if self.integerFlag is not None: - oprot.writeFieldBegin('integerFlag', TType.I32, 4) - oprot.writeI32(self.integerFlag) - oprot.writeFieldEnd() - if self.binaryValue is not None: - oprot.writeFieldBegin('binaryValue', TType.I32, 5) - oprot.writeI32(self.binaryValue) - oprot.writeFieldEnd() - if self.lenValue is not None: - oprot.writeFieldBegin('lenValue', TType.I64, 6) - oprot.writeI64(self.lenValue) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetInfoReq(object): - """ - Attributes: - - sessionHandle - - infoType - - """ - - - def __init__(self, sessionHandle=None, infoType=None,): - self.sessionHandle = sessionHandle - self.infoType = infoType - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.infoType = iprot.readI32() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetInfoReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.infoType is not None: - oprot.writeFieldBegin('infoType', TType.I32, 2) - oprot.writeI32(self.infoType) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - if self.infoType is None: - raise TProtocolException(message='Required field infoType is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetInfoResp(object): - """ - Attributes: - - status - - infoValue - - """ - - - def __init__(self, status=None, infoValue=None,): - self.status = status - self.infoValue = infoValue - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.infoValue = TGetInfoValue() - self.infoValue.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetInfoResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - if self.infoValue is not None: - oprot.writeFieldBegin('infoValue', TType.STRUCT, 2) - self.infoValue.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - if self.infoValue is None: - raise TProtocolException(message='Required field infoValue is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TExecuteStatementReq(object): - """ - Attributes: - - sessionHandle - - statement - - confOverlay - - runAsync - - queryTimeout - - """ - - - def __init__(self, sessionHandle=None, statement=None, confOverlay=None, runAsync=False, queryTimeout=0,): - self.sessionHandle = sessionHandle - self.statement = statement - self.confOverlay = confOverlay - self.runAsync = runAsync - self.queryTimeout = queryTimeout - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.statement = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.MAP: - self.confOverlay = {} - (_ktype153, _vtype154, _size152) = iprot.readMapBegin() - for _i156 in range(_size152): - _key157 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _val158 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.confOverlay[_key157] = _val158 - iprot.readMapEnd() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.BOOL: - self.runAsync = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.I64: - self.queryTimeout = iprot.readI64() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TExecuteStatementReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.statement is not None: - oprot.writeFieldBegin('statement', TType.STRING, 2) - oprot.writeString(self.statement.encode('utf-8') if sys.version_info[0] == 2 else self.statement) - oprot.writeFieldEnd() - if self.confOverlay is not None: - oprot.writeFieldBegin('confOverlay', TType.MAP, 3) - oprot.writeMapBegin(TType.STRING, TType.STRING, len(self.confOverlay)) - for kiter159, viter160 in self.confOverlay.items(): - oprot.writeString(kiter159.encode('utf-8') if sys.version_info[0] == 2 else kiter159) - oprot.writeString(viter160.encode('utf-8') if sys.version_info[0] == 2 else viter160) - oprot.writeMapEnd() - oprot.writeFieldEnd() - if self.runAsync is not None: - oprot.writeFieldBegin('runAsync', TType.BOOL, 4) - oprot.writeBool(self.runAsync) - oprot.writeFieldEnd() - if self.queryTimeout is not None: - oprot.writeFieldBegin('queryTimeout', TType.I64, 5) - oprot.writeI64(self.queryTimeout) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - if self.statement is None: - raise TProtocolException(message='Required field statement is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TExecuteStatementResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TExecuteStatementResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetTypeInfoReq(object): - """ - Attributes: - - sessionHandle - - """ - - - def __init__(self, sessionHandle=None,): - self.sessionHandle = sessionHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetTypeInfoReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetTypeInfoResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetTypeInfoResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetCatalogsReq(object): - """ - Attributes: - - sessionHandle - - """ - - - def __init__(self, sessionHandle=None,): - self.sessionHandle = sessionHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetCatalogsReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetCatalogsResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetCatalogsResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetSchemasReq(object): - """ - Attributes: - - sessionHandle - - catalogName - - schemaName - - """ - - - def __init__(self, sessionHandle=None, catalogName=None, schemaName=None,): - self.sessionHandle = sessionHandle - self.catalogName = catalogName - self.schemaName = schemaName - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetSchemasReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.catalogName is not None: - oprot.writeFieldBegin('catalogName', TType.STRING, 2) - oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) - oprot.writeFieldEnd() - if self.schemaName is not None: - oprot.writeFieldBegin('schemaName', TType.STRING, 3) - oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetSchemasResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetSchemasResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetTablesReq(object): - """ - Attributes: - - sessionHandle - - catalogName - - schemaName - - tableName - - tableTypes - - """ - - - def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None, tableTypes=None,): - self.sessionHandle = sessionHandle - self.catalogName = catalogName - self.schemaName = schemaName - self.tableName = tableName - self.tableTypes = tableTypes - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.tableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.LIST: - self.tableTypes = [] - (_etype164, _size161) = iprot.readListBegin() - for _i165 in range(_size161): - _elem166 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.tableTypes.append(_elem166) - iprot.readListEnd() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetTablesReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.catalogName is not None: - oprot.writeFieldBegin('catalogName', TType.STRING, 2) - oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) - oprot.writeFieldEnd() - if self.schemaName is not None: - oprot.writeFieldBegin('schemaName', TType.STRING, 3) - oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) - oprot.writeFieldEnd() - if self.tableName is not None: - oprot.writeFieldBegin('tableName', TType.STRING, 4) - oprot.writeString(self.tableName.encode('utf-8') if sys.version_info[0] == 2 else self.tableName) - oprot.writeFieldEnd() - if self.tableTypes is not None: - oprot.writeFieldBegin('tableTypes', TType.LIST, 5) - oprot.writeListBegin(TType.STRING, len(self.tableTypes)) - for iter167 in self.tableTypes: - oprot.writeString(iter167.encode('utf-8') if sys.version_info[0] == 2 else iter167) - oprot.writeListEnd() - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetTablesResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetTablesResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetTableTypesReq(object): - """ - Attributes: - - sessionHandle - - """ - - - def __init__(self, sessionHandle=None,): - self.sessionHandle = sessionHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetTableTypesReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetTableTypesResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetTableTypesResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetColumnsReq(object): - """ - Attributes: - - sessionHandle - - catalogName - - schemaName - - tableName - - columnName - - """ - - - def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None, columnName=None,): - self.sessionHandle = sessionHandle - self.catalogName = catalogName - self.schemaName = schemaName - self.tableName = tableName - self.columnName = columnName - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.tableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.columnName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetColumnsReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.catalogName is not None: - oprot.writeFieldBegin('catalogName', TType.STRING, 2) - oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) - oprot.writeFieldEnd() - if self.schemaName is not None: - oprot.writeFieldBegin('schemaName', TType.STRING, 3) - oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) - oprot.writeFieldEnd() - if self.tableName is not None: - oprot.writeFieldBegin('tableName', TType.STRING, 4) - oprot.writeString(self.tableName.encode('utf-8') if sys.version_info[0] == 2 else self.tableName) - oprot.writeFieldEnd() - if self.columnName is not None: - oprot.writeFieldBegin('columnName', TType.STRING, 5) - oprot.writeString(self.columnName.encode('utf-8') if sys.version_info[0] == 2 else self.columnName) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetColumnsResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetColumnsResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetFunctionsReq(object): - """ - Attributes: - - sessionHandle - - catalogName - - schemaName - - functionName - - """ - - - def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, functionName=None,): - self.sessionHandle = sessionHandle - self.catalogName = catalogName - self.schemaName = schemaName - self.functionName = functionName - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.functionName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetFunctionsReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.catalogName is not None: - oprot.writeFieldBegin('catalogName', TType.STRING, 2) - oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) - oprot.writeFieldEnd() - if self.schemaName is not None: - oprot.writeFieldBegin('schemaName', TType.STRING, 3) - oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) - oprot.writeFieldEnd() - if self.functionName is not None: - oprot.writeFieldBegin('functionName', TType.STRING, 4) - oprot.writeString(self.functionName.encode('utf-8') if sys.version_info[0] == 2 else self.functionName) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - if self.functionName is None: - raise TProtocolException(message='Required field functionName is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetFunctionsResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetFunctionsResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetPrimaryKeysReq(object): - """ - Attributes: - - sessionHandle - - catalogName - - schemaName - - tableName - - """ - - - def __init__(self, sessionHandle=None, catalogName=None, schemaName=None, tableName=None,): - self.sessionHandle = sessionHandle - self.catalogName = catalogName - self.schemaName = schemaName - self.tableName = tableName - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.catalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.schemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.tableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetPrimaryKeysReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.catalogName is not None: - oprot.writeFieldBegin('catalogName', TType.STRING, 2) - oprot.writeString(self.catalogName.encode('utf-8') if sys.version_info[0] == 2 else self.catalogName) - oprot.writeFieldEnd() - if self.schemaName is not None: - oprot.writeFieldBegin('schemaName', TType.STRING, 3) - oprot.writeString(self.schemaName.encode('utf-8') if sys.version_info[0] == 2 else self.schemaName) - oprot.writeFieldEnd() - if self.tableName is not None: - oprot.writeFieldBegin('tableName', TType.STRING, 4) - oprot.writeString(self.tableName.encode('utf-8') if sys.version_info[0] == 2 else self.tableName) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetPrimaryKeysResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetPrimaryKeysResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetCrossReferenceReq(object): - """ - Attributes: - - sessionHandle - - parentCatalogName - - parentSchemaName - - parentTableName - - foreignCatalogName - - foreignSchemaName - - foreignTableName - - """ - - - def __init__(self, sessionHandle=None, parentCatalogName=None, parentSchemaName=None, parentTableName=None, foreignCatalogName=None, foreignSchemaName=None, foreignTableName=None,): - self.sessionHandle = sessionHandle - self.parentCatalogName = parentCatalogName - self.parentSchemaName = parentSchemaName - self.parentTableName = parentTableName - self.foreignCatalogName = foreignCatalogName - self.foreignSchemaName = foreignSchemaName - self.foreignTableName = foreignTableName - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.parentCatalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.parentSchemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.STRING: - self.parentTableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.foreignCatalogName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRING: - self.foreignSchemaName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.STRING: - self.foreignTableName = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetCrossReferenceReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.parentCatalogName is not None: - oprot.writeFieldBegin('parentCatalogName', TType.STRING, 2) - oprot.writeString(self.parentCatalogName.encode('utf-8') if sys.version_info[0] == 2 else self.parentCatalogName) - oprot.writeFieldEnd() - if self.parentSchemaName is not None: - oprot.writeFieldBegin('parentSchemaName', TType.STRING, 3) - oprot.writeString(self.parentSchemaName.encode('utf-8') if sys.version_info[0] == 2 else self.parentSchemaName) - oprot.writeFieldEnd() - if self.parentTableName is not None: - oprot.writeFieldBegin('parentTableName', TType.STRING, 4) - oprot.writeString(self.parentTableName.encode('utf-8') if sys.version_info[0] == 2 else self.parentTableName) - oprot.writeFieldEnd() - if self.foreignCatalogName is not None: - oprot.writeFieldBegin('foreignCatalogName', TType.STRING, 5) - oprot.writeString(self.foreignCatalogName.encode('utf-8') if sys.version_info[0] == 2 else self.foreignCatalogName) - oprot.writeFieldEnd() - if self.foreignSchemaName is not None: - oprot.writeFieldBegin('foreignSchemaName', TType.STRING, 6) - oprot.writeString(self.foreignSchemaName.encode('utf-8') if sys.version_info[0] == 2 else self.foreignSchemaName) - oprot.writeFieldEnd() - if self.foreignTableName is not None: - oprot.writeFieldBegin('foreignTableName', TType.STRING, 7) - oprot.writeString(self.foreignTableName.encode('utf-8') if sys.version_info[0] == 2 else self.foreignTableName) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetCrossReferenceResp(object): - """ - Attributes: - - status - - operationHandle - - """ - - - def __init__(self, status=None, operationHandle=None,): - self.status = status - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetCrossReferenceResp') - 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() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetOperationStatusReq(object): - """ - Attributes: - - operationHandle - - getProgressUpdate - - """ - - - def __init__(self, operationHandle=None, getProgressUpdate=None,): - self.operationHandle = operationHandle - self.getProgressUpdate = getProgressUpdate - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() - self.operationHandle.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.BOOL: - self.getProgressUpdate = iprot.readBool() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetOperationStatusReq') - if self.operationHandle is not None: - oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) - self.operationHandle.write(oprot) - oprot.writeFieldEnd() - if self.getProgressUpdate is not None: - oprot.writeFieldBegin('getProgressUpdate', TType.BOOL, 2) - oprot.writeBool(self.getProgressUpdate) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.operationHandle is None: - raise TProtocolException(message='Required field operationHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetOperationStatusResp(object): - """ - Attributes: - - status - - operationState - - sqlState - - errorCode - - errorMessage - - taskStatus - - operationStarted - - operationCompleted - - hasResultSet - - progressUpdateResponse - - """ - - - def __init__(self, status=None, operationState=None, sqlState=None, errorCode=None, errorMessage=None, taskStatus=None, operationStarted=None, operationCompleted=None, hasResultSet=None, progressUpdateResponse=None,): - self.status = status - self.operationState = operationState - self.sqlState = sqlState - self.errorCode = errorCode - self.errorMessage = errorMessage - self.taskStatus = taskStatus - self.operationStarted = operationStarted - self.operationCompleted = operationCompleted - self.hasResultSet = hasResultSet - self.progressUpdateResponse = progressUpdateResponse - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.I32: - self.operationState = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.sqlState = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.errorCode = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.errorMessage = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.STRING: - self.taskStatus = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 7: - if ftype == TType.I64: - self.operationStarted = iprot.readI64() - else: - iprot.skip(ftype) - elif fid == 8: - if ftype == TType.I64: - self.operationCompleted = iprot.readI64() - else: - iprot.skip(ftype) - elif fid == 9: - if ftype == TType.BOOL: - self.hasResultSet = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 10: - if ftype == TType.STRUCT: - self.progressUpdateResponse = TProgressUpdateResp() - self.progressUpdateResponse.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetOperationStatusResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - if self.operationState is not None: - oprot.writeFieldBegin('operationState', TType.I32, 2) - oprot.writeI32(self.operationState) - oprot.writeFieldEnd() - if self.sqlState is not None: - oprot.writeFieldBegin('sqlState', TType.STRING, 3) - oprot.writeString(self.sqlState.encode('utf-8') if sys.version_info[0] == 2 else self.sqlState) - oprot.writeFieldEnd() - if self.errorCode is not None: - oprot.writeFieldBegin('errorCode', TType.I32, 4) - oprot.writeI32(self.errorCode) - oprot.writeFieldEnd() - if self.errorMessage is not None: - oprot.writeFieldBegin('errorMessage', TType.STRING, 5) - oprot.writeString(self.errorMessage.encode('utf-8') if sys.version_info[0] == 2 else self.errorMessage) - oprot.writeFieldEnd() - if self.taskStatus is not None: - oprot.writeFieldBegin('taskStatus', TType.STRING, 6) - oprot.writeString(self.taskStatus.encode('utf-8') if sys.version_info[0] == 2 else self.taskStatus) - oprot.writeFieldEnd() - if self.operationStarted is not None: - oprot.writeFieldBegin('operationStarted', TType.I64, 7) - oprot.writeI64(self.operationStarted) - oprot.writeFieldEnd() - if self.operationCompleted is not None: - oprot.writeFieldBegin('operationCompleted', TType.I64, 8) - oprot.writeI64(self.operationCompleted) - oprot.writeFieldEnd() - if self.hasResultSet is not None: - oprot.writeFieldBegin('hasResultSet', TType.BOOL, 9) - oprot.writeBool(self.hasResultSet) - oprot.writeFieldEnd() - if self.progressUpdateResponse is not None: - oprot.writeFieldBegin('progressUpdateResponse', TType.STRUCT, 10) - self.progressUpdateResponse.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCancelOperationReq(object): - """ - Attributes: - - operationHandle - - """ - - - def __init__(self, operationHandle=None,): - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() - self.operationHandle.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCancelOperationReq') - if self.operationHandle is not None: - oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) - self.operationHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.operationHandle is None: - raise TProtocolException(message='Required field operationHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCancelOperationResp(object): - """ - Attributes: - - status - - """ - - - def __init__(self, status=None,): - self.status = status - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCancelOperationResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCloseOperationReq(object): - """ - Attributes: - - operationHandle - - """ - - - def __init__(self, operationHandle=None,): - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() - self.operationHandle.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCloseOperationReq') - if self.operationHandle is not None: - oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) - self.operationHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.operationHandle is None: - raise TProtocolException(message='Required field operationHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCloseOperationResp(object): - """ - Attributes: - - status - - """ - - - def __init__(self, status=None,): - self.status = status - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCloseOperationResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetResultSetMetadataReq(object): - """ - Attributes: - - operationHandle - - """ - - - def __init__(self, operationHandle=None,): - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() - self.operationHandle.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetResultSetMetadataReq') - if self.operationHandle is not None: - oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) - self.operationHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.operationHandle is None: - raise TProtocolException(message='Required field operationHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetResultSetMetadataResp(object): - """ - Attributes: - - status - - schema - - """ - - - def __init__(self, status=None, schema=None,): - self.status = status - self.schema = schema - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.schema = TTableSchema() - self.schema.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetResultSetMetadataResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - if self.schema is not None: - oprot.writeFieldBegin('schema', TType.STRUCT, 2) - self.schema.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TFetchResultsReq(object): - """ - Attributes: - - operationHandle - - orientation - - maxRows - - fetchType - - """ - - - def __init__(self, operationHandle=None, orientation=0, maxRows=None, fetchType=0,): - self.operationHandle = operationHandle - self.orientation = orientation - self.maxRows = maxRows - self.fetchType = fetchType - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() - self.operationHandle.read(iprot) - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.I32: - self.orientation = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.I64: - self.maxRows = iprot.readI64() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I16: - self.fetchType = iprot.readI16() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TFetchResultsReq') - if self.operationHandle is not None: - oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) - self.operationHandle.write(oprot) - oprot.writeFieldEnd() - if self.orientation is not None: - oprot.writeFieldBegin('orientation', TType.I32, 2) - oprot.writeI32(self.orientation) - oprot.writeFieldEnd() - if self.maxRows is not None: - oprot.writeFieldBegin('maxRows', TType.I64, 3) - oprot.writeI64(self.maxRows) - oprot.writeFieldEnd() - if self.fetchType is not None: - oprot.writeFieldBegin('fetchType', TType.I16, 4) - oprot.writeI16(self.fetchType) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.operationHandle is None: - raise TProtocolException(message='Required field operationHandle is unset!') - if self.orientation is None: - raise TProtocolException(message='Required field orientation is unset!') - if self.maxRows is None: - raise TProtocolException(message='Required field maxRows is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TFetchResultsResp(object): - """ - Attributes: - - status - - hasMoreRows - - results - - """ - - - def __init__(self, status=None, hasMoreRows=None, results=None,): - self.status = status - self.hasMoreRows = hasMoreRows - self.results = results - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.BOOL: - self.hasMoreRows = iprot.readBool() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRUCT: - self.results = TRowSet() - self.results.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TFetchResultsResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - if self.hasMoreRows is not None: - oprot.writeFieldBegin('hasMoreRows', TType.BOOL, 2) - oprot.writeBool(self.hasMoreRows) - oprot.writeFieldEnd() - if self.results is not None: - oprot.writeFieldBegin('results', TType.STRUCT, 3) - self.results.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetDelegationTokenReq(object): - """ - Attributes: - - sessionHandle - - owner - - renewer - - """ - - - def __init__(self, sessionHandle=None, owner=None, renewer=None,): - self.sessionHandle = sessionHandle - self.owner = owner - self.renewer = renewer - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.owner = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.STRING: - self.renewer = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetDelegationTokenReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.owner is not None: - oprot.writeFieldBegin('owner', TType.STRING, 2) - oprot.writeString(self.owner.encode('utf-8') if sys.version_info[0] == 2 else self.owner) - oprot.writeFieldEnd() - if self.renewer is not None: - oprot.writeFieldBegin('renewer', TType.STRING, 3) - oprot.writeString(self.renewer.encode('utf-8') if sys.version_info[0] == 2 else self.renewer) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - if self.owner is None: - raise TProtocolException(message='Required field owner is unset!') - if self.renewer is None: - raise TProtocolException(message='Required field renewer is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetDelegationTokenResp(object): - """ - Attributes: - - status - - delegationToken - - """ - - - def __init__(self, status=None, delegationToken=None,): - self.status = status - self.delegationToken = delegationToken - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.delegationToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetDelegationTokenResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - if self.delegationToken is not None: - oprot.writeFieldBegin('delegationToken', TType.STRING, 2) - oprot.writeString(self.delegationToken.encode('utf-8') if sys.version_info[0] == 2 else self.delegationToken) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCancelDelegationTokenReq(object): - """ - Attributes: - - sessionHandle - - delegationToken - - """ - - - def __init__(self, sessionHandle=None, delegationToken=None,): - self.sessionHandle = sessionHandle - self.delegationToken = delegationToken - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.delegationToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCancelDelegationTokenReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.delegationToken is not None: - oprot.writeFieldBegin('delegationToken', TType.STRING, 2) - oprot.writeString(self.delegationToken.encode('utf-8') if sys.version_info[0] == 2 else self.delegationToken) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - if self.delegationToken is None: - raise TProtocolException(message='Required field delegationToken is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TCancelDelegationTokenResp(object): - """ - Attributes: - - status - - """ - - - def __init__(self, status=None,): - self.status = status - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TCancelDelegationTokenResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TRenewDelegationTokenReq(object): - """ - Attributes: - - sessionHandle - - delegationToken - - """ - - - def __init__(self, sessionHandle=None, delegationToken=None,): - self.sessionHandle = sessionHandle - self.delegationToken = delegationToken - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.STRING: - self.delegationToken = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TRenewDelegationTokenReq') - if self.sessionHandle is not None: - oprot.writeFieldBegin('sessionHandle', TType.STRUCT, 1) - self.sessionHandle.write(oprot) - oprot.writeFieldEnd() - if self.delegationToken is not None: - oprot.writeFieldBegin('delegationToken', TType.STRING, 2) - oprot.writeString(self.delegationToken.encode('utf-8') if sys.version_info[0] == 2 else self.delegationToken) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.sessionHandle is None: - raise TProtocolException(message='Required field sessionHandle is unset!') - if self.delegationToken is None: - raise TProtocolException(message='Required field delegationToken is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TRenewDelegationTokenResp(object): - """ - Attributes: - - status - - """ - - - def __init__(self, status=None,): - self.status = status - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TRenewDelegationTokenResp') - if self.status is not None: - oprot.writeFieldBegin('status', TType.STRUCT, 1) - self.status.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TProgressUpdateResp(object): - """ - Attributes: - - headerNames - - rows - - progressedPercentage - - status - - footerSummary - - startTime - - """ - - - def __init__(self, headerNames=None, rows=None, progressedPercentage=None, status=None, footerSummary=None, startTime=None,): - self.headerNames = headerNames - self.rows = rows - self.progressedPercentage = progressedPercentage - self.status = status - self.footerSummary = footerSummary - self.startTime = startTime - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.LIST: - self.headerNames = [] - (_etype171, _size168) = iprot.readListBegin() - for _i172 in range(_size168): - _elem173 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - self.headerNames.append(_elem173) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 2: - if ftype == TType.LIST: - self.rows = [] - (_etype177, _size174) = iprot.readListBegin() - for _i178 in range(_size174): - _elem179 = [] - (_etype183, _size180) = iprot.readListBegin() - for _i184 in range(_size180): - _elem185 = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - _elem179.append(_elem185) - iprot.readListEnd() - self.rows.append(_elem179) - iprot.readListEnd() - else: - iprot.skip(ftype) - elif fid == 3: - if ftype == TType.DOUBLE: - self.progressedPercentage = iprot.readDouble() - else: - iprot.skip(ftype) - elif fid == 4: - if ftype == TType.I32: - self.status = iprot.readI32() - else: - iprot.skip(ftype) - elif fid == 5: - if ftype == TType.STRING: - self.footerSummary = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - elif fid == 6: - if ftype == TType.I64: - self.startTime = iprot.readI64() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TProgressUpdateResp') - if self.headerNames is not None: - oprot.writeFieldBegin('headerNames', TType.LIST, 1) - oprot.writeListBegin(TType.STRING, len(self.headerNames)) - for iter186 in self.headerNames: - oprot.writeString(iter186.encode('utf-8') if sys.version_info[0] == 2 else iter186) - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.rows is not None: - oprot.writeFieldBegin('rows', TType.LIST, 2) - oprot.writeListBegin(TType.LIST, len(self.rows)) - for iter187 in self.rows: - oprot.writeListBegin(TType.STRING, len(iter187)) - for iter188 in iter187: - oprot.writeString(iter188.encode('utf-8') if sys.version_info[0] == 2 else iter188) - oprot.writeListEnd() - oprot.writeListEnd() - oprot.writeFieldEnd() - if self.progressedPercentage is not None: - oprot.writeFieldBegin('progressedPercentage', TType.DOUBLE, 3) - oprot.writeDouble(self.progressedPercentage) - oprot.writeFieldEnd() - if self.status is not None: - oprot.writeFieldBegin('status', TType.I32, 4) - oprot.writeI32(self.status) - oprot.writeFieldEnd() - if self.footerSummary is not None: - oprot.writeFieldBegin('footerSummary', TType.STRING, 5) - oprot.writeString(self.footerSummary.encode('utf-8') if sys.version_info[0] == 2 else self.footerSummary) - oprot.writeFieldEnd() - if self.startTime is not None: - oprot.writeFieldBegin('startTime', TType.I64, 6) - oprot.writeI64(self.startTime) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.headerNames is None: - raise TProtocolException(message='Required field headerNames is unset!') - if self.rows is None: - raise TProtocolException(message='Required field rows is unset!') - if self.progressedPercentage is None: - raise TProtocolException(message='Required field progressedPercentage is unset!') - if self.status is None: - raise TProtocolException(message='Required field status is unset!') - if self.footerSummary is None: - raise TProtocolException(message='Required field footerSummary is unset!') - if self.startTime is None: - raise TProtocolException(message='Required field startTime is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetQueryIdReq(object): - """ - Attributes: - - operationHandle - - """ - - - def __init__(self, operationHandle=None,): - self.operationHandle = operationHandle - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [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.operationHandle = TOperationHandle() - self.operationHandle.read(iprot) - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetQueryIdReq') - if self.operationHandle is not None: - oprot.writeFieldBegin('operationHandle', TType.STRUCT, 1) - self.operationHandle.write(oprot) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.operationHandle is None: - raise TProtocolException(message='Required field operationHandle is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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 TGetQueryIdResp(object): - """ - Attributes: - - queryId - - """ - - - def __init__(self, queryId=None,): - self.queryId = queryId - - def read(self, iprot): - if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: - iprot._fast_decode(self, iprot, [self.__class__, self.thrift_spec]) - return - iprot.readStructBegin() - while True: - (fname, ftype, fid) = iprot.readFieldBegin() - if ftype == TType.STOP: - break - if fid == 1: - if ftype == TType.STRING: - self.queryId = iprot.readString().decode('utf-8') if sys.version_info[0] == 2 else iprot.readString() - else: - iprot.skip(ftype) - else: - iprot.skip(ftype) - iprot.readFieldEnd() - iprot.readStructEnd() - - def write(self, oprot): - if oprot._fast_encode is not None and self.thrift_spec is not None: - oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec])) - return - oprot.writeStructBegin('TGetQueryIdResp') - if self.queryId is not None: - oprot.writeFieldBegin('queryId', TType.STRING, 1) - oprot.writeString(self.queryId.encode('utf-8') if sys.version_info[0] == 2 else self.queryId) - oprot.writeFieldEnd() - oprot.writeFieldStop() - oprot.writeStructEnd() - - def validate(self): - if self.queryId is None: - raise TProtocolException(message='Required field queryId is unset!') - return - - def __repr__(self): - L = ['%s=%r' % (key, value) - for key, value in self.__dict__.items()] - 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) -all_structs.append(TTypeQualifierValue) -TTypeQualifierValue.thrift_spec = ( - None, # 0 - (1, TType.I32, 'i32Value', None, None, ), # 1 - (2, TType.STRING, 'stringValue', 'UTF8', None, ), # 2 -) -all_structs.append(TTypeQualifiers) -TTypeQualifiers.thrift_spec = ( - None, # 0 - (1, TType.MAP, 'qualifiers', (TType.STRING, 'UTF8', TType.STRUCT, [TTypeQualifierValue, None], False), None, ), # 1 -) -all_structs.append(TPrimitiveTypeEntry) -TPrimitiveTypeEntry.thrift_spec = ( - None, # 0 - (1, TType.I32, 'type', None, None, ), # 1 - (2, TType.STRUCT, 'typeQualifiers', [TTypeQualifiers, None], None, ), # 2 -) -all_structs.append(TArrayTypeEntry) -TArrayTypeEntry.thrift_spec = ( - None, # 0 - (1, TType.I32, 'objectTypePtr', None, None, ), # 1 -) -all_structs.append(TMapTypeEntry) -TMapTypeEntry.thrift_spec = ( - None, # 0 - (1, TType.I32, 'keyTypePtr', None, None, ), # 1 - (2, TType.I32, 'valueTypePtr', None, None, ), # 2 -) -all_structs.append(TStructTypeEntry) -TStructTypeEntry.thrift_spec = ( - None, # 0 - (1, TType.MAP, 'nameToTypePtr', (TType.STRING, 'UTF8', TType.I32, None, False), None, ), # 1 -) -all_structs.append(TUnionTypeEntry) -TUnionTypeEntry.thrift_spec = ( - None, # 0 - (1, TType.MAP, 'nameToTypePtr', (TType.STRING, 'UTF8', TType.I32, None, False), None, ), # 1 -) -all_structs.append(TUserDefinedTypeEntry) -TUserDefinedTypeEntry.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'typeClassName', 'UTF8', None, ), # 1 -) -all_structs.append(TTypeEntry) -TTypeEntry.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'primitiveEntry', [TPrimitiveTypeEntry, None], None, ), # 1 - (2, TType.STRUCT, 'arrayEntry', [TArrayTypeEntry, None], None, ), # 2 - (3, TType.STRUCT, 'mapEntry', [TMapTypeEntry, None], None, ), # 3 - (4, TType.STRUCT, 'structEntry', [TStructTypeEntry, None], None, ), # 4 - (5, TType.STRUCT, 'unionEntry', [TUnionTypeEntry, None], None, ), # 5 - (6, TType.STRUCT, 'userDefinedTypeEntry', [TUserDefinedTypeEntry, None], None, ), # 6 -) -all_structs.append(TTypeDesc) -TTypeDesc.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'types', (TType.STRUCT, [TTypeEntry, None], False), None, ), # 1 -) -all_structs.append(TColumnDesc) -TColumnDesc.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'columnName', 'UTF8', None, ), # 1 - (2, TType.STRUCT, 'typeDesc', [TTypeDesc, None], None, ), # 2 - (3, TType.I32, 'position', None, None, ), # 3 - (4, TType.STRING, 'comment', 'UTF8', None, ), # 4 -) -all_structs.append(TTableSchema) -TTableSchema.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'columns', (TType.STRUCT, [TColumnDesc, None], False), None, ), # 1 -) -all_structs.append(TBoolValue) -TBoolValue.thrift_spec = ( - None, # 0 - (1, TType.BOOL, 'value', None, None, ), # 1 -) -all_structs.append(TByteValue) -TByteValue.thrift_spec = ( - None, # 0 - (1, TType.BYTE, 'value', None, None, ), # 1 -) -all_structs.append(TI16Value) -TI16Value.thrift_spec = ( - None, # 0 - (1, TType.I16, 'value', None, None, ), # 1 -) -all_structs.append(TI32Value) -TI32Value.thrift_spec = ( - None, # 0 - (1, TType.I32, 'value', None, None, ), # 1 -) -all_structs.append(TI64Value) -TI64Value.thrift_spec = ( - None, # 0 - (1, TType.I64, 'value', None, None, ), # 1 -) -all_structs.append(TDoubleValue) -TDoubleValue.thrift_spec = ( - None, # 0 - (1, TType.DOUBLE, 'value', None, None, ), # 1 -) -all_structs.append(TStringValue) -TStringValue.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'value', 'UTF8', None, ), # 1 -) -all_structs.append(TColumnValue) -TColumnValue.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'boolVal', [TBoolValue, None], None, ), # 1 - (2, TType.STRUCT, 'byteVal', [TByteValue, None], None, ), # 2 - (3, TType.STRUCT, 'i16Val', [TI16Value, None], None, ), # 3 - (4, TType.STRUCT, 'i32Val', [TI32Value, None], None, ), # 4 - (5, TType.STRUCT, 'i64Val', [TI64Value, None], None, ), # 5 - (6, TType.STRUCT, 'doubleVal', [TDoubleValue, None], None, ), # 6 - (7, TType.STRUCT, 'stringVal', [TStringValue, None], None, ), # 7 -) -all_structs.append(TRow) -TRow.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'colVals', (TType.STRUCT, [TColumnValue, None], False), None, ), # 1 -) -all_structs.append(TBoolColumn) -TBoolColumn.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.BOOL, None, False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TByteColumn) -TByteColumn.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.BYTE, None, False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TI16Column) -TI16Column.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.I16, None, False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TI32Column) -TI32Column.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.I32, None, False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TI64Column) -TI64Column.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.I64, None, False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TDoubleColumn) -TDoubleColumn.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.DOUBLE, None, False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TStringColumn) -TStringColumn.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.STRING, 'UTF8', False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TBinaryColumn) -TBinaryColumn.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'values', (TType.STRING, 'BINARY', False), None, ), # 1 - (2, TType.STRING, 'nulls', 'BINARY', None, ), # 2 -) -all_structs.append(TColumn) -TColumn.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'boolVal', [TBoolColumn, None], None, ), # 1 - (2, TType.STRUCT, 'byteVal', [TByteColumn, None], None, ), # 2 - (3, TType.STRUCT, 'i16Val', [TI16Column, None], None, ), # 3 - (4, TType.STRUCT, 'i32Val', [TI32Column, None], None, ), # 4 - (5, TType.STRUCT, 'i64Val', [TI64Column, None], None, ), # 5 - (6, TType.STRUCT, 'doubleVal', [TDoubleColumn, None], None, ), # 6 - (7, TType.STRUCT, 'stringVal', [TStringColumn, None], None, ), # 7 - (8, TType.STRUCT, 'binaryVal', [TBinaryColumn, None], None, ), # 8 -) -all_structs.append(TRowSet) -TRowSet.thrift_spec = ( - None, # 0 - (1, TType.I64, 'startRowOffset', None, None, ), # 1 - (2, TType.LIST, 'rows', (TType.STRUCT, [TRow, None], False), None, ), # 2 - (3, TType.LIST, 'columns', (TType.STRUCT, [TColumn, None], False), None, ), # 3 - (4, TType.STRING, 'binaryColumns', 'BINARY', None, ), # 4 - (5, TType.I32, 'columnCount', None, None, ), # 5 -) -all_structs.append(TStatus) -TStatus.thrift_spec = ( - None, # 0 - (1, TType.I32, 'statusCode', None, None, ), # 1 - (2, TType.LIST, 'infoMessages', (TType.STRING, 'UTF8', False), None, ), # 2 - (3, TType.STRING, 'sqlState', 'UTF8', None, ), # 3 - (4, TType.I32, 'errorCode', None, None, ), # 4 - (5, TType.STRING, 'errorMessage', 'UTF8', None, ), # 5 -) -all_structs.append(THandleIdentifier) -THandleIdentifier.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'guid', 'BINARY', None, ), # 1 - (2, TType.STRING, 'secret', 'BINARY', None, ), # 2 -) -all_structs.append(TSessionHandle) -TSessionHandle.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionId', [THandleIdentifier, None], None, ), # 1 -) -all_structs.append(TOperationHandle) -TOperationHandle.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'operationId', [THandleIdentifier, None], None, ), # 1 - (2, TType.I32, 'operationType', None, None, ), # 2 - (3, TType.BOOL, 'hasResultSet', None, None, ), # 3 - (4, TType.DOUBLE, 'modifiedRowCount', None, None, ), # 4 -) -all_structs.append(TOpenSessionReq) -TOpenSessionReq.thrift_spec = ( - None, # 0 - (1, TType.I32, 'client_protocol', None, 9, ), # 1 - (2, TType.STRING, 'username', 'UTF8', None, ), # 2 - (3, TType.STRING, 'password', 'UTF8', None, ), # 3 - (4, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 -) -all_structs.append(TOpenSessionResp) -TOpenSessionResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.I32, 'serverProtocolVersion', None, 9, ), # 2 - (3, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 3 - (4, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 4 -) -all_structs.append(TSetClientInfoReq) -TSetClientInfoReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.MAP, 'configuration', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 2 -) -all_structs.append(TSetClientInfoResp) -TSetClientInfoResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 -) -all_structs.append(TCloseSessionReq) -TCloseSessionReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 -) -all_structs.append(TCloseSessionResp) -TCloseSessionResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 -) -all_structs.append(TGetInfoValue) -TGetInfoValue.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'stringValue', 'UTF8', None, ), # 1 - (2, TType.I16, 'smallIntValue', None, None, ), # 2 - (3, TType.I32, 'integerBitmask', None, None, ), # 3 - (4, TType.I32, 'integerFlag', None, None, ), # 4 - (5, TType.I32, 'binaryValue', None, None, ), # 5 - (6, TType.I64, 'lenValue', None, None, ), # 6 -) -all_structs.append(TGetInfoReq) -TGetInfoReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.I32, 'infoType', None, None, ), # 2 -) -all_structs.append(TGetInfoResp) -TGetInfoResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'infoValue', [TGetInfoValue, None], None, ), # 2 -) -all_structs.append(TExecuteStatementReq) -TExecuteStatementReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'statement', 'UTF8', None, ), # 2 - (3, TType.MAP, 'confOverlay', (TType.STRING, 'UTF8', TType.STRING, 'UTF8', False), None, ), # 3 - (4, TType.BOOL, 'runAsync', None, False, ), # 4 - (5, TType.I64, 'queryTimeout', None, 0, ), # 5 -) -all_structs.append(TExecuteStatementResp) -TExecuteStatementResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetTypeInfoReq) -TGetTypeInfoReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 -) -all_structs.append(TGetTypeInfoResp) -TGetTypeInfoResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetCatalogsReq) -TGetCatalogsReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 -) -all_structs.append(TGetCatalogsResp) -TGetCatalogsResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetSchemasReq) -TGetSchemasReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 - (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 -) -all_structs.append(TGetSchemasResp) -TGetSchemasResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetTablesReq) -TGetTablesReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 - (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 - (4, TType.STRING, 'tableName', 'UTF8', None, ), # 4 - (5, TType.LIST, 'tableTypes', (TType.STRING, 'UTF8', False), None, ), # 5 -) -all_structs.append(TGetTablesResp) -TGetTablesResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetTableTypesReq) -TGetTableTypesReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 -) -all_structs.append(TGetTableTypesResp) -TGetTableTypesResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetColumnsReq) -TGetColumnsReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 - (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 - (4, TType.STRING, 'tableName', 'UTF8', None, ), # 4 - (5, TType.STRING, 'columnName', 'UTF8', None, ), # 5 -) -all_structs.append(TGetColumnsResp) -TGetColumnsResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetFunctionsReq) -TGetFunctionsReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 - (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 - (4, TType.STRING, 'functionName', 'UTF8', None, ), # 4 -) -all_structs.append(TGetFunctionsResp) -TGetFunctionsResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetPrimaryKeysReq) -TGetPrimaryKeysReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'catalogName', 'UTF8', None, ), # 2 - (3, TType.STRING, 'schemaName', 'UTF8', None, ), # 3 - (4, TType.STRING, 'tableName', 'UTF8', None, ), # 4 -) -all_structs.append(TGetPrimaryKeysResp) -TGetPrimaryKeysResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetCrossReferenceReq) -TGetCrossReferenceReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'parentCatalogName', 'UTF8', None, ), # 2 - (3, TType.STRING, 'parentSchemaName', 'UTF8', None, ), # 3 - (4, TType.STRING, 'parentTableName', 'UTF8', None, ), # 4 - (5, TType.STRING, 'foreignCatalogName', 'UTF8', None, ), # 5 - (6, TType.STRING, 'foreignSchemaName', 'UTF8', None, ), # 6 - (7, TType.STRING, 'foreignTableName', 'UTF8', None, ), # 7 -) -all_structs.append(TGetCrossReferenceResp) -TGetCrossReferenceResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 2 -) -all_structs.append(TGetOperationStatusReq) -TGetOperationStatusReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 - (2, TType.BOOL, 'getProgressUpdate', None, None, ), # 2 -) -all_structs.append(TGetOperationStatusResp) -TGetOperationStatusResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.I32, 'operationState', None, None, ), # 2 - (3, TType.STRING, 'sqlState', 'UTF8', None, ), # 3 - (4, TType.I32, 'errorCode', None, None, ), # 4 - (5, TType.STRING, 'errorMessage', 'UTF8', None, ), # 5 - (6, TType.STRING, 'taskStatus', 'UTF8', None, ), # 6 - (7, TType.I64, 'operationStarted', None, None, ), # 7 - (8, TType.I64, 'operationCompleted', None, None, ), # 8 - (9, TType.BOOL, 'hasResultSet', None, None, ), # 9 - (10, TType.STRUCT, 'progressUpdateResponse', [TProgressUpdateResp, None], None, ), # 10 -) -all_structs.append(TCancelOperationReq) -TCancelOperationReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 -) -all_structs.append(TCancelOperationResp) -TCancelOperationResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 -) -all_structs.append(TCloseOperationReq) -TCloseOperationReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 -) -all_structs.append(TCloseOperationResp) -TCloseOperationResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 -) -all_structs.append(TGetResultSetMetadataReq) -TGetResultSetMetadataReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 -) -all_structs.append(TGetResultSetMetadataResp) -TGetResultSetMetadataResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRUCT, 'schema', [TTableSchema, None], None, ), # 2 -) -all_structs.append(TFetchResultsReq) -TFetchResultsReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 - (2, TType.I32, 'orientation', None, 0, ), # 2 - (3, TType.I64, 'maxRows', None, None, ), # 3 - (4, TType.I16, 'fetchType', None, 0, ), # 4 -) -all_structs.append(TFetchResultsResp) -TFetchResultsResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.BOOL, 'hasMoreRows', None, None, ), # 2 - (3, TType.STRUCT, 'results', [TRowSet, None], None, ), # 3 -) -all_structs.append(TGetDelegationTokenReq) -TGetDelegationTokenReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'owner', 'UTF8', None, ), # 2 - (3, TType.STRING, 'renewer', 'UTF8', None, ), # 3 -) -all_structs.append(TGetDelegationTokenResp) -TGetDelegationTokenResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 - (2, TType.STRING, 'delegationToken', 'UTF8', None, ), # 2 -) -all_structs.append(TCancelDelegationTokenReq) -TCancelDelegationTokenReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'delegationToken', 'UTF8', None, ), # 2 -) -all_structs.append(TCancelDelegationTokenResp) -TCancelDelegationTokenResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 -) -all_structs.append(TRenewDelegationTokenReq) -TRenewDelegationTokenReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'sessionHandle', [TSessionHandle, None], None, ), # 1 - (2, TType.STRING, 'delegationToken', 'UTF8', None, ), # 2 -) -all_structs.append(TRenewDelegationTokenResp) -TRenewDelegationTokenResp.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'status', [TStatus, None], None, ), # 1 -) -all_structs.append(TProgressUpdateResp) -TProgressUpdateResp.thrift_spec = ( - None, # 0 - (1, TType.LIST, 'headerNames', (TType.STRING, 'UTF8', False), None, ), # 1 - (2, TType.LIST, 'rows', (TType.LIST, (TType.STRING, 'UTF8', False), False), None, ), # 2 - (3, TType.DOUBLE, 'progressedPercentage', None, None, ), # 3 - (4, TType.I32, 'status', None, None, ), # 4 - (5, TType.STRING, 'footerSummary', 'UTF8', None, ), # 5 - (6, TType.I64, 'startTime', None, None, ), # 6 -) -all_structs.append(TGetQueryIdReq) -TGetQueryIdReq.thrift_spec = ( - None, # 0 - (1, TType.STRUCT, 'operationHandle', [TOperationHandle, None], None, ), # 1 -) -all_structs.append(TGetQueryIdResp) -TGetQueryIdResp.thrift_spec = ( - None, # 0 - (1, TType.STRING, 'queryId', 'UTF8', None, ), # 1 -) -fix_spec(all_structs) -del all_structs diff --git a/sql/thriftserver/src/gen/thrift/gen-py/__init__.py b/sql/thriftserver/src/gen/thrift/gen-py/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb deleted file mode 100644 index 6d6161539d7e..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service.rb +++ /dev/null @@ -1,1266 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.12.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -require 'thrift' -require 't_c_l_i_service_types' - -module TCLIService - class Client - include ::Thrift::Client - - def OpenSession(req) - send_OpenSession(req) - return recv_OpenSession() - end - - def send_OpenSession(req) - send_message('OpenSession', OpenSession_args, :req => req) - end - - def recv_OpenSession() - result = receive_message(OpenSession_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'OpenSession failed: unknown result') - end - - def CloseSession(req) - send_CloseSession(req) - return recv_CloseSession() - end - - def send_CloseSession(req) - send_message('CloseSession', CloseSession_args, :req => req) - end - - def recv_CloseSession() - result = receive_message(CloseSession_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CloseSession failed: unknown result') - end - - def GetInfo(req) - send_GetInfo(req) - return recv_GetInfo() - end - - def send_GetInfo(req) - send_message('GetInfo', GetInfo_args, :req => req) - end - - def recv_GetInfo() - result = receive_message(GetInfo_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetInfo failed: unknown result') - end - - def ExecuteStatement(req) - send_ExecuteStatement(req) - return recv_ExecuteStatement() - end - - def send_ExecuteStatement(req) - send_message('ExecuteStatement', ExecuteStatement_args, :req => req) - end - - def recv_ExecuteStatement() - result = receive_message(ExecuteStatement_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'ExecuteStatement failed: unknown result') - end - - def GetTypeInfo(req) - send_GetTypeInfo(req) - return recv_GetTypeInfo() - end - - def send_GetTypeInfo(req) - send_message('GetTypeInfo', GetTypeInfo_args, :req => req) - end - - def recv_GetTypeInfo() - result = receive_message(GetTypeInfo_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetTypeInfo failed: unknown result') - end - - def GetCatalogs(req) - send_GetCatalogs(req) - return recv_GetCatalogs() - end - - def send_GetCatalogs(req) - send_message('GetCatalogs', GetCatalogs_args, :req => req) - end - - def recv_GetCatalogs() - result = receive_message(GetCatalogs_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetCatalogs failed: unknown result') - end - - def GetSchemas(req) - send_GetSchemas(req) - return recv_GetSchemas() - end - - def send_GetSchemas(req) - send_message('GetSchemas', GetSchemas_args, :req => req) - end - - def recv_GetSchemas() - result = receive_message(GetSchemas_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetSchemas failed: unknown result') - end - - def GetTables(req) - send_GetTables(req) - return recv_GetTables() - end - - def send_GetTables(req) - send_message('GetTables', GetTables_args, :req => req) - end - - def recv_GetTables() - result = receive_message(GetTables_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetTables failed: unknown result') - end - - def GetTableTypes(req) - send_GetTableTypes(req) - return recv_GetTableTypes() - end - - def send_GetTableTypes(req) - send_message('GetTableTypes', GetTableTypes_args, :req => req) - end - - def recv_GetTableTypes() - result = receive_message(GetTableTypes_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetTableTypes failed: unknown result') - end - - def GetColumns(req) - send_GetColumns(req) - return recv_GetColumns() - end - - def send_GetColumns(req) - send_message('GetColumns', GetColumns_args, :req => req) - end - - def recv_GetColumns() - result = receive_message(GetColumns_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetColumns failed: unknown result') - end - - def GetFunctions(req) - send_GetFunctions(req) - return recv_GetFunctions() - end - - def send_GetFunctions(req) - send_message('GetFunctions', GetFunctions_args, :req => req) - end - - def recv_GetFunctions() - result = receive_message(GetFunctions_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetFunctions failed: unknown result') - end - - def GetPrimaryKeys(req) - send_GetPrimaryKeys(req) - return recv_GetPrimaryKeys() - end - - def send_GetPrimaryKeys(req) - send_message('GetPrimaryKeys', GetPrimaryKeys_args, :req => req) - end - - def recv_GetPrimaryKeys() - result = receive_message(GetPrimaryKeys_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetPrimaryKeys failed: unknown result') - end - - def GetCrossReference(req) - send_GetCrossReference(req) - return recv_GetCrossReference() - end - - def send_GetCrossReference(req) - send_message('GetCrossReference', GetCrossReference_args, :req => req) - end - - def recv_GetCrossReference() - result = receive_message(GetCrossReference_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetCrossReference failed: unknown result') - end - - def GetOperationStatus(req) - send_GetOperationStatus(req) - return recv_GetOperationStatus() - end - - def send_GetOperationStatus(req) - send_message('GetOperationStatus', GetOperationStatus_args, :req => req) - end - - def recv_GetOperationStatus() - result = receive_message(GetOperationStatus_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetOperationStatus failed: unknown result') - end - - def CancelOperation(req) - send_CancelOperation(req) - return recv_CancelOperation() - end - - def send_CancelOperation(req) - send_message('CancelOperation', CancelOperation_args, :req => req) - end - - def recv_CancelOperation() - result = receive_message(CancelOperation_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CancelOperation failed: unknown result') - end - - def CloseOperation(req) - send_CloseOperation(req) - return recv_CloseOperation() - end - - def send_CloseOperation(req) - send_message('CloseOperation', CloseOperation_args, :req => req) - end - - def recv_CloseOperation() - result = receive_message(CloseOperation_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CloseOperation failed: unknown result') - end - - def GetResultSetMetadata(req) - send_GetResultSetMetadata(req) - return recv_GetResultSetMetadata() - end - - def send_GetResultSetMetadata(req) - send_message('GetResultSetMetadata', GetResultSetMetadata_args, :req => req) - end - - def recv_GetResultSetMetadata() - result = receive_message(GetResultSetMetadata_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetResultSetMetadata failed: unknown result') - end - - def FetchResults(req) - send_FetchResults(req) - return recv_FetchResults() - end - - def send_FetchResults(req) - send_message('FetchResults', FetchResults_args, :req => req) - end - - def recv_FetchResults() - result = receive_message(FetchResults_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'FetchResults failed: unknown result') - end - - def GetDelegationToken(req) - send_GetDelegationToken(req) - return recv_GetDelegationToken() - end - - def send_GetDelegationToken(req) - send_message('GetDelegationToken', GetDelegationToken_args, :req => req) - end - - def recv_GetDelegationToken() - result = receive_message(GetDelegationToken_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetDelegationToken failed: unknown result') - end - - def CancelDelegationToken(req) - send_CancelDelegationToken(req) - return recv_CancelDelegationToken() - end - - def send_CancelDelegationToken(req) - send_message('CancelDelegationToken', CancelDelegationToken_args, :req => req) - end - - def recv_CancelDelegationToken() - result = receive_message(CancelDelegationToken_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'CancelDelegationToken failed: unknown result') - end - - def RenewDelegationToken(req) - send_RenewDelegationToken(req) - return recv_RenewDelegationToken() - end - - def send_RenewDelegationToken(req) - send_message('RenewDelegationToken', RenewDelegationToken_args, :req => req) - end - - def recv_RenewDelegationToken() - result = receive_message(RenewDelegationToken_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'RenewDelegationToken failed: unknown result') - end - - def GetQueryId(req) - send_GetQueryId(req) - return recv_GetQueryId() - end - - def send_GetQueryId(req) - send_message('GetQueryId', GetQueryId_args, :req => req) - end - - def recv_GetQueryId() - result = receive_message(GetQueryId_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'GetQueryId failed: unknown result') - end - - def SetClientInfo(req) - send_SetClientInfo(req) - return recv_SetClientInfo() - end - - def send_SetClientInfo(req) - send_message('SetClientInfo', SetClientInfo_args, :req => req) - end - - def recv_SetClientInfo() - result = receive_message(SetClientInfo_result) - return result.success unless result.success.nil? - raise ::Thrift::ApplicationException.new(::Thrift::ApplicationException::MISSING_RESULT, 'SetClientInfo failed: unknown result') - end - - end - - class Processor - include ::Thrift::Processor - - def process_OpenSession(seqid, iprot, oprot) - args = read_args(iprot, OpenSession_args) - result = OpenSession_result.new() - result.success = @handler.OpenSession(args.req) - write_result(result, oprot, 'OpenSession', seqid) - end - - def process_CloseSession(seqid, iprot, oprot) - args = read_args(iprot, CloseSession_args) - result = CloseSession_result.new() - result.success = @handler.CloseSession(args.req) - write_result(result, oprot, 'CloseSession', seqid) - end - - def process_GetInfo(seqid, iprot, oprot) - args = read_args(iprot, GetInfo_args) - result = GetInfo_result.new() - result.success = @handler.GetInfo(args.req) - write_result(result, oprot, 'GetInfo', seqid) - end - - def process_ExecuteStatement(seqid, iprot, oprot) - args = read_args(iprot, ExecuteStatement_args) - result = ExecuteStatement_result.new() - result.success = @handler.ExecuteStatement(args.req) - write_result(result, oprot, 'ExecuteStatement', seqid) - end - - def process_GetTypeInfo(seqid, iprot, oprot) - args = read_args(iprot, GetTypeInfo_args) - result = GetTypeInfo_result.new() - result.success = @handler.GetTypeInfo(args.req) - write_result(result, oprot, 'GetTypeInfo', seqid) - end - - def process_GetCatalogs(seqid, iprot, oprot) - args = read_args(iprot, GetCatalogs_args) - result = GetCatalogs_result.new() - result.success = @handler.GetCatalogs(args.req) - write_result(result, oprot, 'GetCatalogs', seqid) - end - - def process_GetSchemas(seqid, iprot, oprot) - args = read_args(iprot, GetSchemas_args) - result = GetSchemas_result.new() - result.success = @handler.GetSchemas(args.req) - write_result(result, oprot, 'GetSchemas', seqid) - end - - def process_GetTables(seqid, iprot, oprot) - args = read_args(iprot, GetTables_args) - result = GetTables_result.new() - result.success = @handler.GetTables(args.req) - write_result(result, oprot, 'GetTables', seqid) - end - - def process_GetTableTypes(seqid, iprot, oprot) - args = read_args(iprot, GetTableTypes_args) - result = GetTableTypes_result.new() - result.success = @handler.GetTableTypes(args.req) - write_result(result, oprot, 'GetTableTypes', seqid) - end - - def process_GetColumns(seqid, iprot, oprot) - args = read_args(iprot, GetColumns_args) - result = GetColumns_result.new() - result.success = @handler.GetColumns(args.req) - write_result(result, oprot, 'GetColumns', seqid) - end - - def process_GetFunctions(seqid, iprot, oprot) - args = read_args(iprot, GetFunctions_args) - result = GetFunctions_result.new() - result.success = @handler.GetFunctions(args.req) - write_result(result, oprot, 'GetFunctions', seqid) - end - - def process_GetPrimaryKeys(seqid, iprot, oprot) - args = read_args(iprot, GetPrimaryKeys_args) - result = GetPrimaryKeys_result.new() - result.success = @handler.GetPrimaryKeys(args.req) - write_result(result, oprot, 'GetPrimaryKeys', seqid) - end - - def process_GetCrossReference(seqid, iprot, oprot) - args = read_args(iprot, GetCrossReference_args) - result = GetCrossReference_result.new() - result.success = @handler.GetCrossReference(args.req) - write_result(result, oprot, 'GetCrossReference', seqid) - end - - def process_GetOperationStatus(seqid, iprot, oprot) - args = read_args(iprot, GetOperationStatus_args) - result = GetOperationStatus_result.new() - result.success = @handler.GetOperationStatus(args.req) - write_result(result, oprot, 'GetOperationStatus', seqid) - end - - def process_CancelOperation(seqid, iprot, oprot) - args = read_args(iprot, CancelOperation_args) - result = CancelOperation_result.new() - result.success = @handler.CancelOperation(args.req) - write_result(result, oprot, 'CancelOperation', seqid) - end - - def process_CloseOperation(seqid, iprot, oprot) - args = read_args(iprot, CloseOperation_args) - result = CloseOperation_result.new() - result.success = @handler.CloseOperation(args.req) - write_result(result, oprot, 'CloseOperation', seqid) - end - - def process_GetResultSetMetadata(seqid, iprot, oprot) - args = read_args(iprot, GetResultSetMetadata_args) - result = GetResultSetMetadata_result.new() - result.success = @handler.GetResultSetMetadata(args.req) - write_result(result, oprot, 'GetResultSetMetadata', seqid) - end - - def process_FetchResults(seqid, iprot, oprot) - args = read_args(iprot, FetchResults_args) - result = FetchResults_result.new() - result.success = @handler.FetchResults(args.req) - write_result(result, oprot, 'FetchResults', seqid) - end - - def process_GetDelegationToken(seqid, iprot, oprot) - args = read_args(iprot, GetDelegationToken_args) - result = GetDelegationToken_result.new() - result.success = @handler.GetDelegationToken(args.req) - write_result(result, oprot, 'GetDelegationToken', seqid) - end - - def process_CancelDelegationToken(seqid, iprot, oprot) - args = read_args(iprot, CancelDelegationToken_args) - result = CancelDelegationToken_result.new() - result.success = @handler.CancelDelegationToken(args.req) - write_result(result, oprot, 'CancelDelegationToken', seqid) - end - - def process_RenewDelegationToken(seqid, iprot, oprot) - args = read_args(iprot, RenewDelegationToken_args) - result = RenewDelegationToken_result.new() - result.success = @handler.RenewDelegationToken(args.req) - write_result(result, oprot, 'RenewDelegationToken', seqid) - end - - def process_GetQueryId(seqid, iprot, oprot) - args = read_args(iprot, GetQueryId_args) - result = GetQueryId_result.new() - result.success = @handler.GetQueryId(args.req) - write_result(result, oprot, 'GetQueryId', seqid) - end - - def process_SetClientInfo(seqid, iprot, oprot) - args = read_args(iprot, SetClientInfo_args) - result = SetClientInfo_result.new() - result.success = @handler.SetClientInfo(args.req) - write_result(result, oprot, 'SetClientInfo', seqid) - end - - end - - # HELPER FUNCTIONS AND STRUCTURES - - class OpenSession_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TOpenSessionReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class OpenSession_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TOpenSessionResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CloseSession_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCloseSessionReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CloseSession_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCloseSessionResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetInfo_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetInfoReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetInfo_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetInfoResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class ExecuteStatement_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 ExecuteStatement_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TExecuteStatementResp} - } - - 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 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetTypeInfoReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetTypeInfo_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetTypeInfoResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetCatalogs_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetCatalogsReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetCatalogs_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetCatalogsResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetSchemas_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetSchemasReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetSchemas_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetSchemasResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetTables_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetTablesReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetTables_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetTablesResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetTableTypes_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetTableTypesReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetTableTypes_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetTableTypesResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetColumns_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetColumnsReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetColumns_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetColumnsResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetFunctions_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetFunctionsReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetFunctions_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetFunctionsResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetPrimaryKeys_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetPrimaryKeysReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetPrimaryKeys_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetPrimaryKeysResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetCrossReference_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetCrossReferenceReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetCrossReference_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetCrossReferenceResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetOperationStatus_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetOperationStatusReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetOperationStatus_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetOperationStatusResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CancelOperation_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCancelOperationReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CancelOperation_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCancelOperationResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CloseOperation_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCloseOperationReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CloseOperation_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCloseOperationResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetResultSetMetadata_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetResultSetMetadataReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetResultSetMetadata_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetResultSetMetadataResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class FetchResults_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TFetchResultsReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class FetchResults_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TFetchResultsResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetDelegationToken_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetDelegationTokenReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetDelegationToken_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetDelegationTokenResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CancelDelegationToken_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TCancelDelegationTokenReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class CancelDelegationToken_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TCancelDelegationTokenResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class RenewDelegationToken_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TRenewDelegationTokenReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class RenewDelegationToken_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TRenewDelegationTokenResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetQueryId_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TGetQueryIdReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class GetQueryId_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TGetQueryIdResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class SetClientInfo_args - include ::Thrift::Struct, ::Thrift::Struct_Union - REQ = 1 - - FIELDS = { - REQ => {:type => ::Thrift::Types::STRUCT, :name => 'req', :class => ::TSetClientInfoReq} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - - class SetClientInfo_result - include ::Thrift::Struct, ::Thrift::Struct_Union - SUCCESS = 0 - - FIELDS = { - SUCCESS => {:type => ::Thrift::Types::STRUCT, :name => 'success', :class => ::TSetClientInfoResp} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self - end - -end - diff --git a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb deleted file mode 100644 index 2dc7371004f8..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_constants.rb +++ /dev/null @@ -1,74 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.12.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -require 'thrift' -require 't_c_l_i_service_types' - -PRIMITIVE_TYPES = Set.new([ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, -]) - -COMPLEX_TYPES = Set.new([ - 10, - 11, - 12, - 13, - 14, -]) - -COLLECTION_TYPES = Set.new([ - 10, - 11, -]) - -TYPE_NAMES = { - 10 => %q"ARRAY", - 4 => %q"BIGINT", - 9 => %q"BINARY", - 0 => %q"BOOLEAN", - 19 => %q"CHAR", - 17 => %q"DATE", - 15 => %q"DECIMAL", - 6 => %q"DOUBLE", - 5 => %q"FLOAT", - 21 => %q"INTERVAL_DAY_TIME", - 20 => %q"INTERVAL_YEAR_MONTH", - 3 => %q"INT", - 11 => %q"MAP", - 16 => %q"NULL", - 2 => %q"SMALLINT", - 7 => %q"STRING", - 12 => %q"STRUCT", - 22 => %q"TIMESTAMP WITH LOCAL TIME ZONE", - 8 => %q"TIMESTAMP", - 1 => %q"TINYINT", - 13 => %q"UNIONTYPE", - 18 => %q"VARCHAR", -} - -CHARACTER_MAXIMUM_LENGTH = %q"characterMaximumLength" - -PRECISION = %q"precision" - -SCALE = %q"scale" - diff --git a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb b/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb deleted file mode 100644 index 434d6e775eae..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-rb/t_c_l_i_service_types.rb +++ /dev/null @@ -1,2156 +0,0 @@ -# -# Autogenerated by Thrift Compiler (0.12.0) -# -# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING -# - -require 'thrift' - -module TProtocolVersion - HIVE_CLI_SERVICE_PROTOCOL_V1 = 0 - HIVE_CLI_SERVICE_PROTOCOL_V2 = 1 - HIVE_CLI_SERVICE_PROTOCOL_V3 = 2 - HIVE_CLI_SERVICE_PROTOCOL_V4 = 3 - HIVE_CLI_SERVICE_PROTOCOL_V5 = 4 - HIVE_CLI_SERVICE_PROTOCOL_V6 = 5 - HIVE_CLI_SERVICE_PROTOCOL_V7 = 6 - HIVE_CLI_SERVICE_PROTOCOL_V8 = 7 - HIVE_CLI_SERVICE_PROTOCOL_V9 = 8 - HIVE_CLI_SERVICE_PROTOCOL_V10 = 9 - HIVE_CLI_SERVICE_PROTOCOL_V11 = 10 - VALUE_MAP = {0 => "HIVE_CLI_SERVICE_PROTOCOL_V1", 1 => "HIVE_CLI_SERVICE_PROTOCOL_V2", 2 => "HIVE_CLI_SERVICE_PROTOCOL_V3", 3 => "HIVE_CLI_SERVICE_PROTOCOL_V4", 4 => "HIVE_CLI_SERVICE_PROTOCOL_V5", 5 => "HIVE_CLI_SERVICE_PROTOCOL_V6", 6 => "HIVE_CLI_SERVICE_PROTOCOL_V7", 7 => "HIVE_CLI_SERVICE_PROTOCOL_V8", 8 => "HIVE_CLI_SERVICE_PROTOCOL_V9", 9 => "HIVE_CLI_SERVICE_PROTOCOL_V10", 10 => "HIVE_CLI_SERVICE_PROTOCOL_V11"} - VALID_VALUES = Set.new([HIVE_CLI_SERVICE_PROTOCOL_V1, HIVE_CLI_SERVICE_PROTOCOL_V2, HIVE_CLI_SERVICE_PROTOCOL_V3, HIVE_CLI_SERVICE_PROTOCOL_V4, HIVE_CLI_SERVICE_PROTOCOL_V5, HIVE_CLI_SERVICE_PROTOCOL_V6, HIVE_CLI_SERVICE_PROTOCOL_V7, HIVE_CLI_SERVICE_PROTOCOL_V8, HIVE_CLI_SERVICE_PROTOCOL_V9, HIVE_CLI_SERVICE_PROTOCOL_V10, HIVE_CLI_SERVICE_PROTOCOL_V11]).freeze -end - -module TTypeId - BOOLEAN_TYPE = 0 - TINYINT_TYPE = 1 - SMALLINT_TYPE = 2 - INT_TYPE = 3 - BIGINT_TYPE = 4 - FLOAT_TYPE = 5 - DOUBLE_TYPE = 6 - STRING_TYPE = 7 - TIMESTAMP_TYPE = 8 - BINARY_TYPE = 9 - ARRAY_TYPE = 10 - MAP_TYPE = 11 - STRUCT_TYPE = 12 - UNION_TYPE = 13 - USER_DEFINED_TYPE = 14 - DECIMAL_TYPE = 15 - NULL_TYPE = 16 - DATE_TYPE = 17 - VARCHAR_TYPE = 18 - CHAR_TYPE = 19 - INTERVAL_YEAR_MONTH_TYPE = 20 - INTERVAL_DAY_TIME_TYPE = 21 - TIMESTAMPLOCALTZ_TYPE = 22 - VALUE_MAP = {0 => "BOOLEAN_TYPE", 1 => "TINYINT_TYPE", 2 => "SMALLINT_TYPE", 3 => "INT_TYPE", 4 => "BIGINT_TYPE", 5 => "FLOAT_TYPE", 6 => "DOUBLE_TYPE", 7 => "STRING_TYPE", 8 => "TIMESTAMP_TYPE", 9 => "BINARY_TYPE", 10 => "ARRAY_TYPE", 11 => "MAP_TYPE", 12 => "STRUCT_TYPE", 13 => "UNION_TYPE", 14 => "USER_DEFINED_TYPE", 15 => "DECIMAL_TYPE", 16 => "NULL_TYPE", 17 => "DATE_TYPE", 18 => "VARCHAR_TYPE", 19 => "CHAR_TYPE", 20 => "INTERVAL_YEAR_MONTH_TYPE", 21 => "INTERVAL_DAY_TIME_TYPE", 22 => "TIMESTAMPLOCALTZ_TYPE"} - VALID_VALUES = Set.new([BOOLEAN_TYPE, TINYINT_TYPE, SMALLINT_TYPE, INT_TYPE, BIGINT_TYPE, FLOAT_TYPE, DOUBLE_TYPE, STRING_TYPE, TIMESTAMP_TYPE, BINARY_TYPE, ARRAY_TYPE, MAP_TYPE, STRUCT_TYPE, UNION_TYPE, USER_DEFINED_TYPE, DECIMAL_TYPE, NULL_TYPE, DATE_TYPE, VARCHAR_TYPE, CHAR_TYPE, INTERVAL_YEAR_MONTH_TYPE, INTERVAL_DAY_TIME_TYPE, TIMESTAMPLOCALTZ_TYPE]).freeze -end - -module TStatusCode - SUCCESS_STATUS = 0 - SUCCESS_WITH_INFO_STATUS = 1 - STILL_EXECUTING_STATUS = 2 - ERROR_STATUS = 3 - INVALID_HANDLE_STATUS = 4 - VALUE_MAP = {0 => "SUCCESS_STATUS", 1 => "SUCCESS_WITH_INFO_STATUS", 2 => "STILL_EXECUTING_STATUS", 3 => "ERROR_STATUS", 4 => "INVALID_HANDLE_STATUS"} - VALID_VALUES = Set.new([SUCCESS_STATUS, SUCCESS_WITH_INFO_STATUS, STILL_EXECUTING_STATUS, ERROR_STATUS, INVALID_HANDLE_STATUS]).freeze -end - -module TOperationState - INITIALIZED_STATE = 0 - RUNNING_STATE = 1 - FINISHED_STATE = 2 - CANCELED_STATE = 3 - CLOSED_STATE = 4 - ERROR_STATE = 5 - UKNOWN_STATE = 6 - PENDING_STATE = 7 - TIMEDOUT_STATE = 8 - VALUE_MAP = {0 => "INITIALIZED_STATE", 1 => "RUNNING_STATE", 2 => "FINISHED_STATE", 3 => "CANCELED_STATE", 4 => "CLOSED_STATE", 5 => "ERROR_STATE", 6 => "UKNOWN_STATE", 7 => "PENDING_STATE", 8 => "TIMEDOUT_STATE"} - VALID_VALUES = Set.new([INITIALIZED_STATE, RUNNING_STATE, FINISHED_STATE, CANCELED_STATE, CLOSED_STATE, ERROR_STATE, UKNOWN_STATE, PENDING_STATE, TIMEDOUT_STATE]).freeze -end - -module TOperationType - EXECUTE_STATEMENT = 0 - GET_TYPE_INFO = 1 - GET_CATALOGS = 2 - GET_SCHEMAS = 3 - GET_TABLES = 4 - GET_TABLE_TYPES = 5 - GET_COLUMNS = 6 - GET_FUNCTIONS = 7 - UNKNOWN = 8 - VALUE_MAP = {0 => "EXECUTE_STATEMENT", 1 => "GET_TYPE_INFO", 2 => "GET_CATALOGS", 3 => "GET_SCHEMAS", 4 => "GET_TABLES", 5 => "GET_TABLE_TYPES", 6 => "GET_COLUMNS", 7 => "GET_FUNCTIONS", 8 => "UNKNOWN"} - VALID_VALUES = Set.new([EXECUTE_STATEMENT, GET_TYPE_INFO, GET_CATALOGS, GET_SCHEMAS, GET_TABLES, GET_TABLE_TYPES, GET_COLUMNS, GET_FUNCTIONS, UNKNOWN]).freeze -end - -module TGetInfoType - CLI_MAX_DRIVER_CONNECTIONS = 0 - CLI_MAX_CONCURRENT_ACTIVITIES = 1 - CLI_DATA_SOURCE_NAME = 2 - CLI_FETCH_DIRECTION = 8 - CLI_SERVER_NAME = 13 - CLI_SEARCH_PATTERN_ESCAPE = 14 - CLI_DBMS_NAME = 17 - CLI_DBMS_VER = 18 - CLI_ACCESSIBLE_TABLES = 19 - CLI_ACCESSIBLE_PROCEDURES = 20 - CLI_CURSOR_COMMIT_BEHAVIOR = 23 - CLI_DATA_SOURCE_READ_ONLY = 25 - CLI_DEFAULT_TXN_ISOLATION = 26 - CLI_IDENTIFIER_CASE = 28 - CLI_IDENTIFIER_QUOTE_CHAR = 29 - CLI_MAX_COLUMN_NAME_LEN = 30 - CLI_MAX_CURSOR_NAME_LEN = 31 - CLI_MAX_SCHEMA_NAME_LEN = 32 - CLI_MAX_CATALOG_NAME_LEN = 34 - CLI_MAX_TABLE_NAME_LEN = 35 - CLI_SCROLL_CONCURRENCY = 43 - CLI_TXN_CAPABLE = 46 - CLI_USER_NAME = 47 - CLI_TXN_ISOLATION_OPTION = 72 - CLI_INTEGRITY = 73 - CLI_GETDATA_EXTENSIONS = 81 - CLI_NULL_COLLATION = 85 - CLI_ALTER_TABLE = 86 - CLI_ORDER_BY_COLUMNS_IN_SELECT = 90 - CLI_SPECIAL_CHARACTERS = 94 - CLI_MAX_COLUMNS_IN_GROUP_BY = 97 - CLI_MAX_COLUMNS_IN_INDEX = 98 - CLI_MAX_COLUMNS_IN_ORDER_BY = 99 - CLI_MAX_COLUMNS_IN_SELECT = 100 - CLI_MAX_COLUMNS_IN_TABLE = 101 - CLI_MAX_INDEX_SIZE = 102 - CLI_MAX_ROW_SIZE = 104 - CLI_MAX_STATEMENT_LEN = 105 - CLI_MAX_TABLES_IN_SELECT = 106 - CLI_MAX_USER_NAME_LEN = 107 - CLI_OJ_CAPABILITIES = 115 - CLI_XOPEN_CLI_YEAR = 10000 - CLI_CURSOR_SENSITIVITY = 10001 - CLI_DESCRIBE_PARAMETER = 10002 - CLI_CATALOG_NAME = 10003 - CLI_COLLATION_SEQ = 10004 - CLI_MAX_IDENTIFIER_LEN = 10005 - CLI_ODBC_KEYWORDS = 10006 - VALUE_MAP = {0 => "CLI_MAX_DRIVER_CONNECTIONS", 1 => "CLI_MAX_CONCURRENT_ACTIVITIES", 2 => "CLI_DATA_SOURCE_NAME", 8 => "CLI_FETCH_DIRECTION", 13 => "CLI_SERVER_NAME", 14 => "CLI_SEARCH_PATTERN_ESCAPE", 17 => "CLI_DBMS_NAME", 18 => "CLI_DBMS_VER", 19 => "CLI_ACCESSIBLE_TABLES", 20 => "CLI_ACCESSIBLE_PROCEDURES", 23 => "CLI_CURSOR_COMMIT_BEHAVIOR", 25 => "CLI_DATA_SOURCE_READ_ONLY", 26 => "CLI_DEFAULT_TXN_ISOLATION", 28 => "CLI_IDENTIFIER_CASE", 29 => "CLI_IDENTIFIER_QUOTE_CHAR", 30 => "CLI_MAX_COLUMN_NAME_LEN", 31 => "CLI_MAX_CURSOR_NAME_LEN", 32 => "CLI_MAX_SCHEMA_NAME_LEN", 34 => "CLI_MAX_CATALOG_NAME_LEN", 35 => "CLI_MAX_TABLE_NAME_LEN", 43 => "CLI_SCROLL_CONCURRENCY", 46 => "CLI_TXN_CAPABLE", 47 => "CLI_USER_NAME", 72 => "CLI_TXN_ISOLATION_OPTION", 73 => "CLI_INTEGRITY", 81 => "CLI_GETDATA_EXTENSIONS", 85 => "CLI_NULL_COLLATION", 86 => "CLI_ALTER_TABLE", 90 => "CLI_ORDER_BY_COLUMNS_IN_SELECT", 94 => "CLI_SPECIAL_CHARACTERS", 97 => "CLI_MAX_COLUMNS_IN_GROUP_BY", 98 => "CLI_MAX_COLUMNS_IN_INDEX", 99 => "CLI_MAX_COLUMNS_IN_ORDER_BY", 100 => "CLI_MAX_COLUMNS_IN_SELECT", 101 => "CLI_MAX_COLUMNS_IN_TABLE", 102 => "CLI_MAX_INDEX_SIZE", 104 => "CLI_MAX_ROW_SIZE", 105 => "CLI_MAX_STATEMENT_LEN", 106 => "CLI_MAX_TABLES_IN_SELECT", 107 => "CLI_MAX_USER_NAME_LEN", 115 => "CLI_OJ_CAPABILITIES", 10000 => "CLI_XOPEN_CLI_YEAR", 10001 => "CLI_CURSOR_SENSITIVITY", 10002 => "CLI_DESCRIBE_PARAMETER", 10003 => "CLI_CATALOG_NAME", 10004 => "CLI_COLLATION_SEQ", 10005 => "CLI_MAX_IDENTIFIER_LEN", 10006 => "CLI_ODBC_KEYWORDS"} - VALID_VALUES = Set.new([CLI_MAX_DRIVER_CONNECTIONS, CLI_MAX_CONCURRENT_ACTIVITIES, CLI_DATA_SOURCE_NAME, CLI_FETCH_DIRECTION, CLI_SERVER_NAME, CLI_SEARCH_PATTERN_ESCAPE, CLI_DBMS_NAME, CLI_DBMS_VER, CLI_ACCESSIBLE_TABLES, CLI_ACCESSIBLE_PROCEDURES, CLI_CURSOR_COMMIT_BEHAVIOR, CLI_DATA_SOURCE_READ_ONLY, CLI_DEFAULT_TXN_ISOLATION, CLI_IDENTIFIER_CASE, CLI_IDENTIFIER_QUOTE_CHAR, CLI_MAX_COLUMN_NAME_LEN, CLI_MAX_CURSOR_NAME_LEN, CLI_MAX_SCHEMA_NAME_LEN, CLI_MAX_CATALOG_NAME_LEN, CLI_MAX_TABLE_NAME_LEN, CLI_SCROLL_CONCURRENCY, CLI_TXN_CAPABLE, CLI_USER_NAME, CLI_TXN_ISOLATION_OPTION, CLI_INTEGRITY, CLI_GETDATA_EXTENSIONS, CLI_NULL_COLLATION, CLI_ALTER_TABLE, CLI_ORDER_BY_COLUMNS_IN_SELECT, CLI_SPECIAL_CHARACTERS, CLI_MAX_COLUMNS_IN_GROUP_BY, CLI_MAX_COLUMNS_IN_INDEX, CLI_MAX_COLUMNS_IN_ORDER_BY, CLI_MAX_COLUMNS_IN_SELECT, CLI_MAX_COLUMNS_IN_TABLE, CLI_MAX_INDEX_SIZE, CLI_MAX_ROW_SIZE, CLI_MAX_STATEMENT_LEN, CLI_MAX_TABLES_IN_SELECT, CLI_MAX_USER_NAME_LEN, CLI_OJ_CAPABILITIES, CLI_XOPEN_CLI_YEAR, CLI_CURSOR_SENSITIVITY, CLI_DESCRIBE_PARAMETER, CLI_CATALOG_NAME, CLI_COLLATION_SEQ, CLI_MAX_IDENTIFIER_LEN, CLI_ODBC_KEYWORDS]).freeze -end - -module TFetchOrientation - FETCH_NEXT = 0 - FETCH_PRIOR = 1 - FETCH_RELATIVE = 2 - FETCH_ABSOLUTE = 3 - FETCH_FIRST = 4 - FETCH_LAST = 5 - VALUE_MAP = {0 => "FETCH_NEXT", 1 => "FETCH_PRIOR", 2 => "FETCH_RELATIVE", 3 => "FETCH_ABSOLUTE", 4 => "FETCH_FIRST", 5 => "FETCH_LAST"} - VALID_VALUES = Set.new([FETCH_NEXT, FETCH_PRIOR, FETCH_RELATIVE, FETCH_ABSOLUTE, FETCH_FIRST, FETCH_LAST]).freeze -end - -module TJobExecutionStatus - IN_PROGRESS = 0 - COMPLETE = 1 - NOT_AVAILABLE = 2 - VALUE_MAP = {0 => "IN_PROGRESS", 1 => "COMPLETE", 2 => "NOT_AVAILABLE"} - VALID_VALUES = Set.new([IN_PROGRESS, COMPLETE, NOT_AVAILABLE]).freeze -end - -class TTypeQualifierValue < ::Thrift::Union; end - -class TTypeQualifiers; end - -class TPrimitiveTypeEntry; end - -class TArrayTypeEntry; end - -class TMapTypeEntry; end - -class TStructTypeEntry; end - -class TUnionTypeEntry; end - -class TUserDefinedTypeEntry; end - -class TTypeEntry < ::Thrift::Union; end - -class TTypeDesc; end - -class TColumnDesc; end - -class TTableSchema; end - -class TBoolValue; end - -class TByteValue; end - -class TI16Value; end - -class TI32Value; end - -class TI64Value; end - -class TDoubleValue; end - -class TStringValue; end - -class TColumnValue < ::Thrift::Union; end - -class TRow; end - -class TBoolColumn; end - -class TByteColumn; end - -class TI16Column; end - -class TI32Column; end - -class TI64Column; end - -class TDoubleColumn; end - -class TStringColumn; end - -class TBinaryColumn; end - -class TColumn < ::Thrift::Union; end - -class TRowSet; end - -class TStatus; end - -class THandleIdentifier; end - -class TSessionHandle; end - -class TOperationHandle; end - -class TOpenSessionReq; end - -class TOpenSessionResp; end - -class TSetClientInfoReq; end - -class TSetClientInfoResp; end - -class TCloseSessionReq; end - -class TCloseSessionResp; end - -class TGetInfoValue < ::Thrift::Union; end - -class TGetInfoReq; end - -class TGetInfoResp; end - -class TExecuteStatementReq; end - -class TExecuteStatementResp; end - -class TGetTypeInfoReq; end - -class TGetTypeInfoResp; end - -class TGetCatalogsReq; end - -class TGetCatalogsResp; end - -class TGetSchemasReq; end - -class TGetSchemasResp; end - -class TGetTablesReq; end - -class TGetTablesResp; end - -class TGetTableTypesReq; end - -class TGetTableTypesResp; end - -class TGetColumnsReq; end - -class TGetColumnsResp; end - -class TGetFunctionsReq; end - -class TGetFunctionsResp; end - -class TGetPrimaryKeysReq; end - -class TGetPrimaryKeysResp; end - -class TGetCrossReferenceReq; end - -class TGetCrossReferenceResp; end - -class TGetOperationStatusReq; end - -class TGetOperationStatusResp; end - -class TCancelOperationReq; end - -class TCancelOperationResp; end - -class TCloseOperationReq; end - -class TCloseOperationResp; end - -class TGetResultSetMetadataReq; end - -class TGetResultSetMetadataResp; end - -class TFetchResultsReq; end - -class TFetchResultsResp; end - -class TGetDelegationTokenReq; end - -class TGetDelegationTokenResp; end - -class TCancelDelegationTokenReq; end - -class TCancelDelegationTokenResp; end - -class TRenewDelegationTokenReq; end - -class TRenewDelegationTokenResp; end - -class TProgressUpdateResp; end - -class TGetQueryIdReq; end - -class TGetQueryIdResp; end - -class TTypeQualifierValue < ::Thrift::Union - include ::Thrift::Struct_Union - class << self - def i32Value(val) - TTypeQualifierValue.new(:i32Value, val) - end - - def stringValue(val) - TTypeQualifierValue.new(:stringValue, val) - end - end - - I32VALUE = 1 - STRINGVALUE = 2 - - FIELDS = { - I32VALUE => {:type => ::Thrift::Types::I32, :name => 'i32Value', :optional => true}, - STRINGVALUE => {:type => ::Thrift::Types::STRING, :name => 'stringValue', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? - end - - ::Thrift::Union.generate_accessors self -end - -class TTypeQualifiers - include ::Thrift::Struct, ::Thrift::Struct_Union - QUALIFIERS = 1 - - FIELDS = { - QUALIFIERS => {:type => ::Thrift::Types::MAP, :name => 'qualifiers', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRUCT, :class => ::TTypeQualifierValue}} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field qualifiers is unset!') unless @qualifiers - end - - ::Thrift::Struct.generate_accessors self -end - -class TPrimitiveTypeEntry - include ::Thrift::Struct, ::Thrift::Struct_Union - TYPE = 1 - TYPEQUALIFIERS = 2 - - FIELDS = { - TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::TTypeId}, - TYPEQUALIFIERS => {:type => ::Thrift::Types::STRUCT, :name => 'typeQualifiers', :class => ::TTypeQualifiers, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type - unless @type.nil? || ::TTypeId::VALID_VALUES.include?(@type) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TArrayTypeEntry - include ::Thrift::Struct, ::Thrift::Struct_Union - OBJECTTYPEPTR = 1 - - FIELDS = { - OBJECTTYPEPTR => {:type => ::Thrift::Types::I32, :name => 'objectTypePtr'} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field objectTypePtr is unset!') unless @objectTypePtr - end - - ::Thrift::Struct.generate_accessors self -end - -class TMapTypeEntry - include ::Thrift::Struct, ::Thrift::Struct_Union - KEYTYPEPTR = 1 - VALUETYPEPTR = 2 - - FIELDS = { - KEYTYPEPTR => {:type => ::Thrift::Types::I32, :name => 'keyTypePtr'}, - VALUETYPEPTR => {:type => ::Thrift::Types::I32, :name => 'valueTypePtr'} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field keyTypePtr is unset!') unless @keyTypePtr - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field valueTypePtr is unset!') unless @valueTypePtr - end - - ::Thrift::Struct.generate_accessors self -end - -class TStructTypeEntry - include ::Thrift::Struct, ::Thrift::Struct_Union - NAMETOTYPEPTR = 1 - - FIELDS = { - NAMETOTYPEPTR => {:type => ::Thrift::Types::MAP, :name => 'nameToTypePtr', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I32}} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nameToTypePtr is unset!') unless @nameToTypePtr - end - - ::Thrift::Struct.generate_accessors self -end - -class TUnionTypeEntry - include ::Thrift::Struct, ::Thrift::Struct_Union - NAMETOTYPEPTR = 1 - - FIELDS = { - NAMETOTYPEPTR => {:type => ::Thrift::Types::MAP, :name => 'nameToTypePtr', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::I32}} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nameToTypePtr is unset!') unless @nameToTypePtr - end - - ::Thrift::Struct.generate_accessors self -end - -class TUserDefinedTypeEntry - include ::Thrift::Struct, ::Thrift::Struct_Union - TYPECLASSNAME = 1 - - FIELDS = { - TYPECLASSNAME => {:type => ::Thrift::Types::STRING, :name => 'typeClassName'} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field typeClassName is unset!') unless @typeClassName - end - - ::Thrift::Struct.generate_accessors self -end - -class TTypeEntry < ::Thrift::Union - include ::Thrift::Struct_Union - class << self - def primitiveEntry(val) - TTypeEntry.new(:primitiveEntry, val) - end - - def arrayEntry(val) - TTypeEntry.new(:arrayEntry, val) - end - - def mapEntry(val) - TTypeEntry.new(:mapEntry, val) - end - - def structEntry(val) - TTypeEntry.new(:structEntry, val) - end - - def unionEntry(val) - TTypeEntry.new(:unionEntry, val) - end - - def userDefinedTypeEntry(val) - TTypeEntry.new(:userDefinedTypeEntry, val) - end - end - - PRIMITIVEENTRY = 1 - ARRAYENTRY = 2 - MAPENTRY = 3 - STRUCTENTRY = 4 - UNIONENTRY = 5 - USERDEFINEDTYPEENTRY = 6 - - FIELDS = { - PRIMITIVEENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'primitiveEntry', :class => ::TPrimitiveTypeEntry, :optional => true}, - ARRAYENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'arrayEntry', :class => ::TArrayTypeEntry, :optional => true}, - MAPENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'mapEntry', :class => ::TMapTypeEntry, :optional => true}, - STRUCTENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'structEntry', :class => ::TStructTypeEntry, :optional => true}, - UNIONENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'unionEntry', :class => ::TUnionTypeEntry, :optional => true}, - USERDEFINEDTYPEENTRY => {:type => ::Thrift::Types::STRUCT, :name => 'userDefinedTypeEntry', :class => ::TUserDefinedTypeEntry, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? - end - - ::Thrift::Union.generate_accessors self -end - -class TTypeDesc - include ::Thrift::Struct, ::Thrift::Struct_Union - TYPES = 1 - - FIELDS = { - TYPES => {:type => ::Thrift::Types::LIST, :name => 'types', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TTypeEntry}} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field types is unset!') unless @types - end - - ::Thrift::Struct.generate_accessors self -end - -class TColumnDesc - include ::Thrift::Struct, ::Thrift::Struct_Union - COLUMNNAME = 1 - TYPEDESC = 2 - POSITION = 3 - COMMENT = 4 - - FIELDS = { - COLUMNNAME => {:type => ::Thrift::Types::STRING, :name => 'columnName'}, - TYPEDESC => {:type => ::Thrift::Types::STRUCT, :name => 'typeDesc', :class => ::TTypeDesc}, - POSITION => {:type => ::Thrift::Types::I32, :name => 'position'}, - COMMENT => {:type => ::Thrift::Types::STRING, :name => 'comment', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columnName is unset!') unless @columnName - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field typeDesc is unset!') unless @typeDesc - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field position is unset!') unless @position - end - - ::Thrift::Struct.generate_accessors self -end - -class TTableSchema - include ::Thrift::Struct, ::Thrift::Struct_Union - COLUMNS = 1 - - FIELDS = { - COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumnDesc}} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field columns is unset!') unless @columns - end - - ::Thrift::Struct.generate_accessors self -end - -class TBoolValue - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 - - FIELDS = { - VALUE => {:type => ::Thrift::Types::BOOL, :name => 'value', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self -end - -class TByteValue - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 - - FIELDS = { - VALUE => {:type => ::Thrift::Types::BYTE, :name => 'value', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self -end - -class TI16Value - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 - - FIELDS = { - VALUE => {:type => ::Thrift::Types::I16, :name => 'value', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self -end - -class TI32Value - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 - - FIELDS = { - VALUE => {:type => ::Thrift::Types::I32, :name => 'value', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self -end - -class TI64Value - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 - - FIELDS = { - VALUE => {:type => ::Thrift::Types::I64, :name => 'value', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self -end - -class TDoubleValue - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 - - FIELDS = { - VALUE => {:type => ::Thrift::Types::DOUBLE, :name => 'value', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self -end - -class TStringValue - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUE = 1 - - FIELDS = { - VALUE => {:type => ::Thrift::Types::STRING, :name => 'value', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - end - - ::Thrift::Struct.generate_accessors self -end - -class TColumnValue < ::Thrift::Union - include ::Thrift::Struct_Union - class << self - def boolVal(val) - TColumnValue.new(:boolVal, val) - end - - def byteVal(val) - TColumnValue.new(:byteVal, val) - end - - def i16Val(val) - TColumnValue.new(:i16Val, val) - end - - def i32Val(val) - TColumnValue.new(:i32Val, val) - end - - def i64Val(val) - TColumnValue.new(:i64Val, val) - end - - def doubleVal(val) - TColumnValue.new(:doubleVal, val) - end - - def stringVal(val) - TColumnValue.new(:stringVal, val) - end - end - - BOOLVAL = 1 - BYTEVAL = 2 - I16VAL = 3 - I32VAL = 4 - I64VAL = 5 - DOUBLEVAL = 6 - STRINGVAL = 7 - - FIELDS = { - BOOLVAL => {:type => ::Thrift::Types::STRUCT, :name => 'boolVal', :class => ::TBoolValue, :optional => true}, - BYTEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'byteVal', :class => ::TByteValue, :optional => true}, - I16VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i16Val', :class => ::TI16Value, :optional => true}, - I32VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i32Val', :class => ::TI32Value, :optional => true}, - I64VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i64Val', :class => ::TI64Value, :optional => true}, - DOUBLEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'doubleVal', :class => ::TDoubleValue, :optional => true}, - STRINGVAL => {:type => ::Thrift::Types::STRUCT, :name => 'stringVal', :class => ::TStringValue, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? - end - - ::Thrift::Union.generate_accessors self -end - -class TRow - include ::Thrift::Struct, ::Thrift::Struct_Union - COLVALS = 1 - - FIELDS = { - COLVALS => {:type => ::Thrift::Types::LIST, :name => 'colVals', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumnValue}} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field colVals is unset!') unless @colVals - end - - ::Thrift::Struct.generate_accessors self -end - -class TBoolColumn - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BOOL}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TByteColumn - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::BYTE}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TI16Column - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I16}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TI32Column - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I32}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TI64Column - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::I64}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TDoubleColumn - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::DOUBLE}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TStringColumn - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TBinaryColumn - include ::Thrift::Struct, ::Thrift::Struct_Union - VALUES = 1 - NULLS = 2 - - FIELDS = { - VALUES => {:type => ::Thrift::Types::LIST, :name => 'values', :element => {:type => ::Thrift::Types::STRING, :binary => true}}, - NULLS => {:type => ::Thrift::Types::STRING, :name => 'nulls', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field nulls is unset!') unless @nulls - end - - ::Thrift::Struct.generate_accessors self -end - -class TColumn < ::Thrift::Union - include ::Thrift::Struct_Union - class << self - def boolVal(val) - TColumn.new(:boolVal, val) - end - - def byteVal(val) - TColumn.new(:byteVal, val) - end - - def i16Val(val) - TColumn.new(:i16Val, val) - end - - def i32Val(val) - TColumn.new(:i32Val, val) - end - - def i64Val(val) - TColumn.new(:i64Val, val) - end - - def doubleVal(val) - TColumn.new(:doubleVal, val) - end - - def stringVal(val) - TColumn.new(:stringVal, val) - end - - def binaryVal(val) - TColumn.new(:binaryVal, val) - end - end - - BOOLVAL = 1 - BYTEVAL = 2 - I16VAL = 3 - I32VAL = 4 - I64VAL = 5 - DOUBLEVAL = 6 - STRINGVAL = 7 - BINARYVAL = 8 - - FIELDS = { - BOOLVAL => {:type => ::Thrift::Types::STRUCT, :name => 'boolVal', :class => ::TBoolColumn, :optional => true}, - BYTEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'byteVal', :class => ::TByteColumn, :optional => true}, - I16VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i16Val', :class => ::TI16Column, :optional => true}, - I32VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i32Val', :class => ::TI32Column, :optional => true}, - I64VAL => {:type => ::Thrift::Types::STRUCT, :name => 'i64Val', :class => ::TI64Column, :optional => true}, - DOUBLEVAL => {:type => ::Thrift::Types::STRUCT, :name => 'doubleVal', :class => ::TDoubleColumn, :optional => true}, - STRINGVAL => {:type => ::Thrift::Types::STRUCT, :name => 'stringVal', :class => ::TStringColumn, :optional => true}, - BINARYVAL => {:type => ::Thrift::Types::STRUCT, :name => 'binaryVal', :class => ::TBinaryColumn, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? - end - - ::Thrift::Union.generate_accessors self -end - -class TRowSet - include ::Thrift::Struct, ::Thrift::Struct_Union - STARTROWOFFSET = 1 - ROWS = 2 - COLUMNS = 3 - BINARYCOLUMNS = 4 - COLUMNCOUNT = 5 - - FIELDS = { - STARTROWOFFSET => {:type => ::Thrift::Types::I64, :name => 'startRowOffset'}, - ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TRow}}, - COLUMNS => {:type => ::Thrift::Types::LIST, :name => 'columns', :element => {:type => ::Thrift::Types::STRUCT, :class => ::TColumn}, :optional => true}, - BINARYCOLUMNS => {:type => ::Thrift::Types::STRING, :name => 'binaryColumns', :binary => true, :optional => true}, - COLUMNCOUNT => {:type => ::Thrift::Types::I32, :name => 'columnCount', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startRowOffset is unset!') unless @startRowOffset - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field rows is unset!') unless @rows - end - - ::Thrift::Struct.generate_accessors self -end - -class TStatus - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUSCODE = 1 - INFOMESSAGES = 2 - SQLSTATE = 3 - ERRORCODE = 4 - ERRORMESSAGE = 5 - - FIELDS = { - STATUSCODE => {:type => ::Thrift::Types::I32, :name => 'statusCode', :enum_class => ::TStatusCode}, - INFOMESSAGES => {:type => ::Thrift::Types::LIST, :name => 'infoMessages', :element => {:type => ::Thrift::Types::STRING}, :optional => true}, - SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'sqlState', :optional => true}, - ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :optional => true}, - ERRORMESSAGE => {:type => ::Thrift::Types::STRING, :name => 'errorMessage', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field statusCode is unset!') unless @statusCode - unless @statusCode.nil? || ::TStatusCode::VALID_VALUES.include?(@statusCode) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field statusCode!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class THandleIdentifier - include ::Thrift::Struct, ::Thrift::Struct_Union - GUID = 1 - SECRET = 2 - - FIELDS = { - GUID => {:type => ::Thrift::Types::STRING, :name => 'guid', :binary => true}, - SECRET => {:type => ::Thrift::Types::STRING, :name => 'secret', :binary => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field guid is unset!') unless @guid - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field secret is unset!') unless @secret - end - - ::Thrift::Struct.generate_accessors self -end - -class TSessionHandle - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONID = 1 - - FIELDS = { - SESSIONID => {:type => ::Thrift::Types::STRUCT, :name => 'sessionId', :class => ::THandleIdentifier} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionId is unset!') unless @sessionId - end - - ::Thrift::Struct.generate_accessors self -end - -class TOperationHandle - include ::Thrift::Struct, ::Thrift::Struct_Union - OPERATIONID = 1 - OPERATIONTYPE = 2 - HASRESULTSET = 3 - MODIFIEDROWCOUNT = 4 - - FIELDS = { - OPERATIONID => {:type => ::Thrift::Types::STRUCT, :name => 'operationId', :class => ::THandleIdentifier}, - OPERATIONTYPE => {:type => ::Thrift::Types::I32, :name => 'operationType', :enum_class => ::TOperationType}, - HASRESULTSET => {:type => ::Thrift::Types::BOOL, :name => 'hasResultSet'}, - MODIFIEDROWCOUNT => {:type => ::Thrift::Types::DOUBLE, :name => 'modifiedRowCount', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationId is unset!') unless @operationId - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationType is unset!') unless @operationType - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field hasResultSet is unset!') if @hasResultSet.nil? - unless @operationType.nil? || ::TOperationType::VALID_VALUES.include?(@operationType) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field operationType!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TOpenSessionReq - include ::Thrift::Struct, ::Thrift::Struct_Union - CLIENT_PROTOCOL = 1 - USERNAME = 2 - PASSWORD = 3 - CONFIGURATION = 4 - - FIELDS = { - CLIENT_PROTOCOL => {:type => ::Thrift::Types::I32, :name => 'client_protocol', :default => 9, :enum_class => ::TProtocolVersion}, - USERNAME => {:type => ::Thrift::Types::STRING, :name => 'username', :optional => true}, - PASSWORD => {:type => ::Thrift::Types::STRING, :name => 'password', :optional => true}, - CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field client_protocol is unset!') unless @client_protocol - unless @client_protocol.nil? || ::TProtocolVersion::VALID_VALUES.include?(@client_protocol) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field client_protocol!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TOpenSessionResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - SERVERPROTOCOLVERSION = 2 - SESSIONHANDLE = 3 - CONFIGURATION = 4 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - SERVERPROTOCOLVERSION => {:type => ::Thrift::Types::I32, :name => 'serverProtocolVersion', :default => 9, :enum_class => ::TProtocolVersion}, - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle, :optional => true}, - CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :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 serverProtocolVersion is unset!') unless @serverProtocolVersion - unless @serverProtocolVersion.nil? || ::TProtocolVersion::VALID_VALUES.include?(@serverProtocolVersion) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field serverProtocolVersion!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TSetClientInfoReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - CONFIGURATION = 2 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - CONFIGURATION => {:type => ::Thrift::Types::MAP, :name => 'configuration', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TSetClientInfoResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TCloseSessionReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TCloseSessionResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetInfoValue < ::Thrift::Union - include ::Thrift::Struct_Union - class << self - def stringValue(val) - TGetInfoValue.new(:stringValue, val) - end - - def smallIntValue(val) - TGetInfoValue.new(:smallIntValue, val) - end - - def integerBitmask(val) - TGetInfoValue.new(:integerBitmask, val) - end - - def integerFlag(val) - TGetInfoValue.new(:integerFlag, val) - end - - def binaryValue(val) - TGetInfoValue.new(:binaryValue, val) - end - - def lenValue(val) - TGetInfoValue.new(:lenValue, val) - end - end - - STRINGVALUE = 1 - SMALLINTVALUE = 2 - INTEGERBITMASK = 3 - INTEGERFLAG = 4 - BINARYVALUE = 5 - LENVALUE = 6 - - FIELDS = { - STRINGVALUE => {:type => ::Thrift::Types::STRING, :name => 'stringValue', :optional => true}, - SMALLINTVALUE => {:type => ::Thrift::Types::I16, :name => 'smallIntValue', :optional => true}, - INTEGERBITMASK => {:type => ::Thrift::Types::I32, :name => 'integerBitmask', :optional => true}, - INTEGERFLAG => {:type => ::Thrift::Types::I32, :name => 'integerFlag', :optional => true}, - BINARYVALUE => {:type => ::Thrift::Types::I32, :name => 'binaryValue', :optional => true}, - LENVALUE => {:type => ::Thrift::Types::I64, :name => 'lenValue', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? - end - - ::Thrift::Union.generate_accessors self -end - -class TGetInfoReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - INFOTYPE = 2 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - INFOTYPE => {:type => ::Thrift::Types::I32, :name => 'infoType', :enum_class => ::TGetInfoType} - } - - 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 infoType is unset!') unless @infoType - unless @infoType.nil? || ::TGetInfoType::VALID_VALUES.include?(@infoType) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field infoType!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetInfoResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - INFOVALUE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - INFOVALUE => {:type => ::Thrift::Types::STRUCT, :name => 'infoValue', :class => ::TGetInfoValue} - } - - 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 infoValue is unset!') unless @infoValue - end - - ::Thrift::Struct.generate_accessors self -end - -class TExecuteStatementReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - STATEMENT = 2 - CONFOVERLAY = 3 - RUNASYNC = 4 - QUERYTIMEOUT = 5 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - STATEMENT => {:type => ::Thrift::Types::STRING, :name => 'statement'}, - CONFOVERLAY => {:type => ::Thrift::Types::MAP, :name => 'confOverlay', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true}, - RUNASYNC => {:type => ::Thrift::Types::BOOL, :name => 'runAsync', :default => false, :optional => true}, - QUERYTIMEOUT => {:type => ::Thrift::Types::I64, :name => 'queryTimeout', :default => 0, :optional => true} - } - - 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 statement is unset!') unless @statement - end - - ::Thrift::Struct.generate_accessors self -end - -class TExecuteStatementResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetTypeInfoReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetTypeInfoResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetCatalogsReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetCatalogsResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetSchemasReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - CATALOGNAME = 2 - SCHEMANAME = 3 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, - SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetSchemasResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetTablesReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - CATALOGNAME = 2 - SCHEMANAME = 3 - TABLENAME = 4 - TABLETYPES = 5 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, - SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, - TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName', :optional => true}, - TABLETYPES => {:type => ::Thrift::Types::LIST, :name => 'tableTypes', :element => {:type => ::Thrift::Types::STRING}, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetTablesResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetTableTypesReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetTableTypesResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetColumnsReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - CATALOGNAME = 2 - SCHEMANAME = 3 - TABLENAME = 4 - COLUMNNAME = 5 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, - SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, - TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName', :optional => true}, - COLUMNNAME => {:type => ::Thrift::Types::STRING, :name => 'columnName', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetColumnsResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetFunctionsReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - CATALOGNAME = 2 - SCHEMANAME = 3 - FUNCTIONNAME = 4 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, - SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, - FUNCTIONNAME => {:type => ::Thrift::Types::STRING, :name => 'functionName'} - } - - 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 functionName is unset!') unless @functionName - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetFunctionsResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetPrimaryKeysReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - CATALOGNAME = 2 - SCHEMANAME = 3 - TABLENAME = 4 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - CATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'catalogName', :optional => true}, - SCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'schemaName', :optional => true}, - TABLENAME => {:type => ::Thrift::Types::STRING, :name => 'tableName', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetPrimaryKeysResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetCrossReferenceReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - PARENTCATALOGNAME = 2 - PARENTSCHEMANAME = 3 - PARENTTABLENAME = 4 - FOREIGNCATALOGNAME = 5 - FOREIGNSCHEMANAME = 6 - FOREIGNTABLENAME = 7 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - PARENTCATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'parentCatalogName', :optional => true}, - PARENTSCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'parentSchemaName', :optional => true}, - PARENTTABLENAME => {:type => ::Thrift::Types::STRING, :name => 'parentTableName', :optional => true}, - FOREIGNCATALOGNAME => {:type => ::Thrift::Types::STRING, :name => 'foreignCatalogName', :optional => true}, - FOREIGNSCHEMANAME => {:type => ::Thrift::Types::STRING, :name => 'foreignSchemaName', :optional => true}, - FOREIGNTABLENAME => {:type => ::Thrift::Types::STRING, :name => 'foreignTableName', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field sessionHandle is unset!') unless @sessionHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetCrossReferenceResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONHANDLE = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetOperationStatusReq - include ::Thrift::Struct, ::Thrift::Struct_Union - OPERATIONHANDLE = 1 - GETPROGRESSUPDATE = 2 - - FIELDS = { - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle}, - GETPROGRESSUPDATE => {:type => ::Thrift::Types::BOOL, :name => 'getProgressUpdate', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationHandle is unset!') unless @operationHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetOperationStatusResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - OPERATIONSTATE = 2 - SQLSTATE = 3 - ERRORCODE = 4 - ERRORMESSAGE = 5 - TASKSTATUS = 6 - OPERATIONSTARTED = 7 - OPERATIONCOMPLETED = 8 - HASRESULTSET = 9 - PROGRESSUPDATERESPONSE = 10 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - OPERATIONSTATE => {:type => ::Thrift::Types::I32, :name => 'operationState', :optional => true, :enum_class => ::TOperationState}, - SQLSTATE => {:type => ::Thrift::Types::STRING, :name => 'sqlState', :optional => true}, - ERRORCODE => {:type => ::Thrift::Types::I32, :name => 'errorCode', :optional => true}, - ERRORMESSAGE => {:type => ::Thrift::Types::STRING, :name => 'errorMessage', :optional => true}, - TASKSTATUS => {:type => ::Thrift::Types::STRING, :name => 'taskStatus', :optional => true}, - OPERATIONSTARTED => {:type => ::Thrift::Types::I64, :name => 'operationStarted', :optional => true}, - OPERATIONCOMPLETED => {:type => ::Thrift::Types::I64, :name => 'operationCompleted', :optional => true}, - HASRESULTSET => {:type => ::Thrift::Types::BOOL, :name => 'hasResultSet', :optional => true}, - PROGRESSUPDATERESPONSE => {:type => ::Thrift::Types::STRUCT, :name => 'progressUpdateResponse', :class => ::TProgressUpdateResp, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - unless @operationState.nil? || ::TOperationState::VALID_VALUES.include?(@operationState) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field operationState!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TCancelOperationReq - include ::Thrift::Struct, ::Thrift::Struct_Union - OPERATIONHANDLE = 1 - - FIELDS = { - 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 operationHandle is unset!') unless @operationHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TCancelOperationResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TCloseOperationReq - include ::Thrift::Struct, ::Thrift::Struct_Union - OPERATIONHANDLE = 1 - - FIELDS = { - 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 operationHandle is unset!') unless @operationHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TCloseOperationResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetResultSetMetadataReq - include ::Thrift::Struct, ::Thrift::Struct_Union - OPERATIONHANDLE = 1 - - FIELDS = { - 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 operationHandle is unset!') unless @operationHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetResultSetMetadataResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - SCHEMA = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - SCHEMA => {:type => ::Thrift::Types::STRUCT, :name => 'schema', :class => ::TTableSchema, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TFetchResultsReq - include ::Thrift::Struct, ::Thrift::Struct_Union - OPERATIONHANDLE = 1 - ORIENTATION = 2 - MAXROWS = 3 - FETCHTYPE = 4 - - FIELDS = { - OPERATIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'operationHandle', :class => ::TOperationHandle}, - ORIENTATION => {:type => ::Thrift::Types::I32, :name => 'orientation', :default => 0, :enum_class => ::TFetchOrientation}, - MAXROWS => {:type => ::Thrift::Types::I64, :name => 'maxRows'}, - FETCHTYPE => {:type => ::Thrift::Types::I16, :name => 'fetchType', :default => 0, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field operationHandle is unset!') unless @operationHandle - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field orientation is unset!') unless @orientation - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field maxRows is unset!') unless @maxRows - unless @orientation.nil? || ::TFetchOrientation::VALID_VALUES.include?(@orientation) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field orientation!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TFetchResultsResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - HASMOREROWS = 2 - RESULTS = 3 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - HASMOREROWS => {:type => ::Thrift::Types::BOOL, :name => 'hasMoreRows', :optional => true}, - RESULTS => {:type => ::Thrift::Types::STRUCT, :name => 'results', :class => ::TRowSet, :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetDelegationTokenReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - OWNER = 2 - RENEWER = 3 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - OWNER => {:type => ::Thrift::Types::STRING, :name => 'owner'}, - RENEWER => {:type => ::Thrift::Types::STRING, :name => 'renewer'} - } - - 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 owner is unset!') unless @owner - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field renewer is unset!') unless @renewer - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetDelegationTokenResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - DELEGATIONTOKEN = 2 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus}, - DELEGATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'delegationToken', :optional => true} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TCancelDelegationTokenReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - DELEGATIONTOKEN = 2 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - DELEGATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'delegationToken'} - } - - 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 delegationToken is unset!') unless @delegationToken - end - - ::Thrift::Struct.generate_accessors self -end - -class TCancelDelegationTokenResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TRenewDelegationTokenReq - include ::Thrift::Struct, ::Thrift::Struct_Union - SESSIONHANDLE = 1 - DELEGATIONTOKEN = 2 - - FIELDS = { - SESSIONHANDLE => {:type => ::Thrift::Types::STRUCT, :name => 'sessionHandle', :class => ::TSessionHandle}, - DELEGATIONTOKEN => {:type => ::Thrift::Types::STRING, :name => 'delegationToken'} - } - - 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 delegationToken is unset!') unless @delegationToken - end - - ::Thrift::Struct.generate_accessors self -end - -class TRenewDelegationTokenResp - include ::Thrift::Struct, ::Thrift::Struct_Union - STATUS = 1 - - FIELDS = { - STATUS => {:type => ::Thrift::Types::STRUCT, :name => 'status', :class => ::TStatus} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - end - - ::Thrift::Struct.generate_accessors self -end - -class TProgressUpdateResp - include ::Thrift::Struct, ::Thrift::Struct_Union - HEADERNAMES = 1 - ROWS = 2 - PROGRESSEDPERCENTAGE = 3 - STATUS = 4 - FOOTERSUMMARY = 5 - STARTTIME = 6 - - FIELDS = { - HEADERNAMES => {:type => ::Thrift::Types::LIST, :name => 'headerNames', :element => {:type => ::Thrift::Types::STRING}}, - ROWS => {:type => ::Thrift::Types::LIST, :name => 'rows', :element => {:type => ::Thrift::Types::LIST, :element => {:type => ::Thrift::Types::STRING}}}, - PROGRESSEDPERCENTAGE => {:type => ::Thrift::Types::DOUBLE, :name => 'progressedPercentage'}, - STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :enum_class => ::TJobExecutionStatus}, - FOOTERSUMMARY => {:type => ::Thrift::Types::STRING, :name => 'footerSummary'}, - STARTTIME => {:type => ::Thrift::Types::I64, :name => 'startTime'} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field headerNames is unset!') unless @headerNames - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field rows is unset!') unless @rows - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field progressedPercentage is unset!') unless @progressedPercentage - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field footerSummary is unset!') unless @footerSummary - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field startTime is unset!') unless @startTime - unless @status.nil? || ::TJobExecutionStatus::VALID_VALUES.include?(@status) - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field status!') - end - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetQueryIdReq - include ::Thrift::Struct, ::Thrift::Struct_Union - OPERATIONHANDLE = 1 - - FIELDS = { - 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 operationHandle is unset!') unless @operationHandle - end - - ::Thrift::Struct.generate_accessors self -end - -class TGetQueryIdResp - include ::Thrift::Struct, ::Thrift::Struct_Union - QUERYID = 1 - - FIELDS = { - QUERYID => {:type => ::Thrift::Types::STRING, :name => 'queryId'} - } - - def struct_fields; FIELDS; end - - def validate - raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field queryId is unset!') unless @queryId - end - - ::Thrift::Struct.generate_accessors self -end - From fc2648f30c26c9f5fb67708aebb56d0b9dbbd706 Mon Sep 17 00:00:00 2001 From: Yuming Wang Date: Fri, 25 Oct 2019 00:20:45 +0800 Subject: [PATCH 06/55] Maven generate thrift source code --- pom.xml | 67 - sql/thriftserver/pom.xml | 32 +- .../service/rpc/thrift/TArrayTypeEntry.java | 363 - .../service/rpc/thrift/TBinaryColumn.java | 531 - .../spark/service/rpc/thrift/TBoolColumn.java | 531 - .../spark/service/rpc/thrift/TBoolValue.java | 368 - .../spark/service/rpc/thrift/TByteColumn.java | 531 - .../spark/service/rpc/thrift/TByteValue.java | 368 - .../spark/service/rpc/thrift/TCLIService.java | 20448 ---------------- .../rpc/thrift/TCLIServiceConstants.java | 81 - .../rpc/thrift/TCancelDelegationTokenReq.java | 474 - .../thrift/TCancelDelegationTokenResp.java | 373 - .../rpc/thrift/TCancelOperationReq.java | 373 - .../rpc/thrift/TCancelOperationResp.java | 373 - .../rpc/thrift/TCloseOperationReq.java | 373 - .../rpc/thrift/TCloseOperationResp.java | 373 - .../service/rpc/thrift/TCloseSessionReq.java | 373 - .../service/rpc/thrift/TCloseSessionResp.java | 373 - .../spark/service/rpc/thrift/TColumn.java | 713 - .../spark/service/rpc/thrift/TColumnDesc.java | 680 - .../service/rpc/thrift/TColumnValue.java | 652 - .../service/rpc/thrift/TDoubleColumn.java | 531 - .../service/rpc/thrift/TDoubleValue.java | 368 - .../rpc/thrift/TExecuteStatementReq.java | 840 - .../rpc/thrift/TExecuteStatementResp.java | 488 - .../service/rpc/thrift/TFetchOrientation.java | 55 - .../service/rpc/thrift/TFetchResultsReq.java | 689 - .../service/rpc/thrift/TFetchResultsResp.java | 590 - .../service/rpc/thrift/TGetCatalogsReq.java | 373 - .../service/rpc/thrift/TGetCatalogsResp.java | 488 - .../service/rpc/thrift/TGetColumnsReq.java | 801 - .../service/rpc/thrift/TGetColumnsResp.java | 488 - .../rpc/thrift/TGetCrossReferenceReq.java | 1013 - .../rpc/thrift/TGetCrossReferenceResp.java | 488 - .../rpc/thrift/TGetDelegationTokenReq.java | 575 - .../rpc/thrift/TGetDelegationTokenResp.java | 483 - .../service/rpc/thrift/TGetFunctionsReq.java | 690 - .../service/rpc/thrift/TGetFunctionsResp.java | 488 - .../spark/service/rpc/thrift/TGetInfoReq.java | 486 - .../service/rpc/thrift/TGetInfoResp.java | 476 - .../service/rpc/thrift/TGetInfoType.java | 181 - .../service/rpc/thrift/TGetInfoValue.java | 574 - .../rpc/thrift/TGetOperationStatusReq.java | 479 - .../rpc/thrift/TGetOperationStatusResp.java | 1317 - .../rpc/thrift/TGetPrimaryKeysReq.java | 695 - .../rpc/thrift/TGetPrimaryKeysResp.java | 488 - .../service/rpc/thrift/TGetQueryIdReq.java | 373 - .../service/rpc/thrift/TGetQueryIdResp.java | 368 - .../rpc/thrift/TGetResultSetMetadataReq.java | 373 - .../rpc/thrift/TGetResultSetMetadataResp.java | 488 - .../service/rpc/thrift/TGetSchemasReq.java | 589 - .../service/rpc/thrift/TGetSchemasResp.java | 488 - .../service/rpc/thrift/TGetTableTypesReq.java | 373 - .../rpc/thrift/TGetTableTypesResp.java | 488 - .../service/rpc/thrift/TGetTablesReq.java | 851 - .../service/rpc/thrift/TGetTablesResp.java | 488 - .../service/rpc/thrift/TGetTypeInfoReq.java | 373 - .../service/rpc/thrift/TGetTypeInfoResp.java | 488 - .../service/rpc/thrift/THandleIdentifier.java | 493 - .../spark/service/rpc/thrift/TI16Column.java | 531 - .../spark/service/rpc/thrift/TI16Value.java | 368 - .../spark/service/rpc/thrift/TI32Column.java | 531 - .../spark/service/rpc/thrift/TI32Value.java | 368 - .../spark/service/rpc/thrift/TI64Column.java | 531 - .../spark/service/rpc/thrift/TI64Value.java | 368 - .../rpc/thrift/TJobExecutionStatus.java | 46 - .../service/rpc/thrift/TMapTypeEntry.java | 455 - .../service/rpc/thrift/TOpenSessionReq.java | 757 - .../service/rpc/thrift/TOpenSessionResp.java | 762 - .../service/rpc/thrift/TOperationHandle.java | 684 - .../service/rpc/thrift/TOperationState.java | 64 - .../service/rpc/thrift/TOperationType.java | 64 - .../rpc/thrift/TPrimitiveTypeEntry.java | 495 - .../rpc/thrift/TProgressUpdateResp.java | 1008 - .../service/rpc/thrift/TProtocolVersion.java | 70 - .../rpc/thrift/TRenewDelegationTokenReq.java | 474 - .../rpc/thrift/TRenewDelegationTokenResp.java | 373 - .../apache/spark/service/rpc/thrift/TRow.java | 423 - .../spark/service/rpc/thrift/TRowSet.java | 900 - .../service/rpc/thrift/TSessionHandle.java | 373 - .../service/rpc/thrift/TSetClientInfoReq.java | 535 - .../rpc/thrift/TSetClientInfoResp.java | 373 - .../spark/service/rpc/thrift/TStatus.java | 854 - .../spark/service/rpc/thrift/TStatusCode.java | 52 - .../service/rpc/thrift/TStringColumn.java | 531 - .../service/rpc/thrift/TStringValue.java | 372 - .../service/rpc/thrift/TStructTypeEntry.java | 431 - .../service/rpc/thrift/TTableSchema.java | 423 - .../spark/service/rpc/thrift/TTypeDesc.java | 423 - .../spark/service/rpc/thrift/TTypeEntry.java | 591 - .../spark/service/rpc/thrift/TTypeId.java | 106 - .../rpc/thrift/TTypeQualifierValue.java | 342 - .../service/rpc/thrift/TTypeQualifiers.java | 433 - .../service/rpc/thrift/TUnionTypeEntry.java | 431 - .../rpc/thrift/TUserDefinedTypeEntry.java | 368 - 95 files changed, 30 insertions(+), 64707 deletions(-) delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java delete mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java diff --git a/pom.xml b/pom.xml index 7d38a7feaed9..b31748446437 100644 --- a/pom.xml +++ b/pom.xml @@ -240,11 +240,6 @@ ${session.executionRootDirectory} 1g - - - you-must-set-this-to-run-thrift - ${basedir}/src/gen/thrift - -I ${thrift.home} --gen java:beans,hashcode,generated_annotations=undated @@ -3089,67 +3084,5 @@ sparkr - - - thriftif - - - - org.apache.maven.plugins - maven-antrun-plugin - - - generate-thrift-sources - generate-sources - - - - - - - - - - - - - - - - - - - - - - run - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - - - enforce-property - - enforce - - - - - thrift.home - - - true - - - - - - - diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index d26c7b9651ae..f3a889d338d3 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -130,19 +130,47 @@ target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes + + org.apache.thrift.tools + maven-thrift-plugin + 0.1.11 + + /usr/local/opt/thrift@0.9/bin/thrift + ../thriftserver/if + + + + thrift-sources + generate-sources + + compile + + + + thrift-test-sources + generate-test-sources + + testCompile + + + + + org.codehaus.mojo build-helper-maven-plugin - add-source + add-thrift-sources generate-sources add-source - src/gen/thrift/gen-javabean + + ${project.build.directory}/target/generated-sources/thrift + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java deleted file mode 100644 index 8c860e2d016d..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TArrayTypeEntry.java +++ /dev/null @@ -1,363 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry"); - - private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TArrayTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TArrayTypeEntryTupleSchemeFactory(); - - private int objectTypePtr; // 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 { - OBJECT_TYPE_PTR((short)1, "objectTypePtr"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OBJECT_TYPE_PTR - return OBJECT_TYPE_PTR; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __OBJECTTYPEPTR_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap); - } - - public TArrayTypeEntry() { - } - - public TArrayTypeEntry( - int objectTypePtr) - { - this(); - this.objectTypePtr = objectTypePtr; - setObjectTypePtrIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TArrayTypeEntry(TArrayTypeEntry other) { - __isset_bitfield = other.__isset_bitfield; - this.objectTypePtr = other.objectTypePtr; - } - - public TArrayTypeEntry deepCopy() { - return new TArrayTypeEntry(this); - } - - @Override - public void clear() { - setObjectTypePtrIsSet(false); - this.objectTypePtr = 0; - } - - public int getObjectTypePtr() { - return this.objectTypePtr; - } - - public void setObjectTypePtr(int objectTypePtr) { - this.objectTypePtr = objectTypePtr; - setObjectTypePtrIsSet(true); - } - - public void unsetObjectTypePtr() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); - } - - /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetObjectTypePtr() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); - } - - public void setObjectTypePtrIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OBJECT_TYPE_PTR: - if (value == null) { - unsetObjectTypePtr(); - } else { - setObjectTypePtr((java.lang.Integer)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OBJECT_TYPE_PTR: - return getObjectTypePtr(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OBJECT_TYPE_PTR: - return isSetObjectTypePtr(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TArrayTypeEntry) - return this.equals((TArrayTypeEntry)that); - return false; - } - - public boolean equals(TArrayTypeEntry that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_objectTypePtr = true; - boolean that_present_objectTypePtr = true; - if (this_present_objectTypePtr || that_present_objectTypePtr) { - if (!(this_present_objectTypePtr && that_present_objectTypePtr)) - return false; - if (this.objectTypePtr != that.objectTypePtr) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + objectTypePtr; - - return hashCode; - } - - @Override - public int compareTo(TArrayTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetObjectTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectTypePtr, other.objectTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TArrayTypeEntry("); - boolean first = true; - - sb.append("objectTypePtr:"); - sb.append(this.objectTypePtr); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetObjectTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'objectTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TArrayTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TArrayTypeEntryStandardScheme getScheme() { - return new TArrayTypeEntryStandardScheme(); - } - } - - private static class TArrayTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry 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: // OBJECT_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.objectTypePtr = iprot.readI32(); - struct.setObjectTypePtrIsSet(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, TArrayTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(OBJECT_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.objectTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TArrayTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TArrayTypeEntryTupleScheme getScheme() { - return new TArrayTypeEntryTupleScheme(); - } - } - - private static class TArrayTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeI32(struct.objectTypePtr); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.objectTypePtr = iprot.readI32(); - struct.setObjectTypePtrIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java deleted file mode 100644 index 592f1609df82..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBinaryColumn.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBinaryColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBinaryColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryColumn.class, metaDataMap); - } - - public TBinaryColumn() { - } - - public TBinaryColumn( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TBinaryColumn(TBinaryColumn other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TBinaryColumn deepCopy() { - return new TBinaryColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(java.nio.ByteBuffer elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TBinaryColumn) - return this.equals((TBinaryColumn)that); - return false; - } - - public boolean equals(TBinaryColumn that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TBinaryColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TBinaryColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.values, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TBinaryColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TBinaryColumnStandardScheme getScheme() { - return new TBinaryColumnStandardScheme(); - } - } - - private static class TBinaryColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list110.size); - @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem111; - for (int _i112 = 0; _i112 < _list110.size; ++_i112) - { - _elem111 = iprot.readBinary(); - struct.values.add(_elem111); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TBinaryColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (java.nio.ByteBuffer _iter113 : struct.values) - { - oprot.writeBinary(_iter113); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBinaryColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TBinaryColumnTupleScheme getScheme() { - return new TBinaryColumnTupleScheme(); - } - } - - private static class TBinaryColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (java.nio.ByteBuffer _iter114 : struct.values) - { - oprot.writeBinary(_iter114); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new java.util.ArrayList(_list115.size); - @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem116; - for (int _i117 = 0; _i117 < _list115.size; ++_i117) - { - _elem116 = iprot.readBinary(); - struct.values.add(_elem116); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java deleted file mode 100644 index 2ecee7b80d8c..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolColumn.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolColumn.class, metaDataMap); - } - - public TBoolColumn() { - } - - public TBoolColumn( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TBoolColumn(TBoolColumn other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TBoolColumn deepCopy() { - return new TBoolColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(boolean elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TBoolColumn) - return this.equals((TBoolColumn)that); - return false; - } - - public boolean equals(TBoolColumn that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TBoolColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TBoolColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TBoolColumnStandardScheme getScheme() { - return new TBoolColumnStandardScheme(); - } - } - - private static class TBoolColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list54.size); - boolean _elem55; - for (int _i56 = 0; _i56 < _list54.size; ++_i56) - { - _elem55 = iprot.readBool(); - struct.values.add(_elem55); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TBoolColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.values.size())); - for (boolean _iter57 : struct.values) - { - oprot.writeBool(_iter57); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBoolColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TBoolColumnTupleScheme getScheme() { - return new TBoolColumnTupleScheme(); - } - } - - private static class TBoolColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (boolean _iter58 : struct.values) - { - oprot.writeBool(_iter58); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); - struct.values = new java.util.ArrayList(_list59.size); - boolean _elem60; - for (int _i61 = 0; _i61 < _list59.size; ++_i61) - { - _elem60 = iprot.readBool(); - struct.values.add(_elem60); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java deleted file mode 100644 index b08f37e99546..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TBoolValue.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolValueTupleSchemeFactory(); - - private boolean value; // 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 { - VALUE((short)1, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolValue.class, metaDataMap); - } - - public TBoolValue() { - } - - /** - * Performs a deep copy on other. - */ - public TBoolValue(TBoolValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TBoolValue deepCopy() { - return new TBoolValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = false; - } - - public boolean isValue() { - return this.value; - } - - public void setValue(boolean value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((java.lang.Boolean)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return isValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TBoolValue) - return this.equals((TBoolValue)that); - return false; - } - - public boolean equals(TBoolValue that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + ((value) ? 131071 : 524287); - - return hashCode; - } - - @Override - public int compareTo(TBoolValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TBoolValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TBoolValueStandardScheme getScheme() { - return new TBoolValueStandardScheme(); - } - } - - private static class TBoolValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue 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: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.value = iprot.readBool(); - struct.setValueIsSet(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, TBoolValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeBool(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBoolValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TBoolValueTupleScheme getScheme() { - return new TBoolValueTupleScheme(); - } - } - - private static class TBoolValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeBool(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readBool(); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java deleted file mode 100644 index d5739c3e00f5..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteColumn.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteColumn.class, metaDataMap); - } - - public TByteColumn() { - } - - public TByteColumn( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TByteColumn(TByteColumn other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TByteColumn deepCopy() { - return new TByteColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(byte elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TByteColumn) - return this.equals((TByteColumn)that); - return false; - } - - public boolean equals(TByteColumn that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TByteColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TByteColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TByteColumnStandardScheme getScheme() { - return new TByteColumnStandardScheme(); - } - } - - private static class TByteColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list62.size); - byte _elem63; - for (int _i64 = 0; _i64 < _list62.size; ++_i64) - { - _elem63 = iprot.readByte(); - struct.values.add(_elem63); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TByteColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, struct.values.size())); - for (byte _iter65 : struct.values) - { - oprot.writeByte(_iter65); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TByteColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TByteColumnTupleScheme getScheme() { - return new TByteColumnTupleScheme(); - } - } - - private static class TByteColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (byte _iter66 : struct.values) - { - oprot.writeByte(_iter66); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); - struct.values = new java.util.ArrayList(_list67.size); - byte _elem68; - for (int _i69 = 0; _i69 < _list67.size; ++_i69) - { - _elem68 = iprot.readByte(); - struct.values.add(_elem68); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java deleted file mode 100644 index 2c3510ce9258..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TByteValue.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteValueTupleSchemeFactory(); - - private byte value; // 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 { - VALUE((short)1, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteValue.class, metaDataMap); - } - - public TByteValue() { - } - - /** - * Performs a deep copy on other. - */ - public TByteValue(TByteValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TByteValue deepCopy() { - return new TByteValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public byte getValue() { - return this.value; - } - - public void setValue(byte value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((java.lang.Byte)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TByteValue) - return this.equals((TByteValue)that); - return false; - } - - public boolean equals(TByteValue that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + (int) (value); - - return hashCode; - } - - @Override - public int compareTo(TByteValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TByteValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TByteValueStandardScheme getScheme() { - return new TByteValueStandardScheme(); - } - } - - private static class TByteValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue 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: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { - struct.value = iprot.readByte(); - struct.setValueIsSet(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, TByteValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeByte(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TByteValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TByteValueTupleScheme getScheme() { - return new TByteValueTupleScheme(); - } - } - - private static class TByteValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeByte(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readByte(); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java deleted file mode 100644 index 46a465ca7132..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIService.java +++ /dev/null @@ -1,20448 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCLIService { - - public interface Iface { - - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException; - - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException; - - public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException; - - public TExecuteStatementResp ExecuteStatement(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; - - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException; - - public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException; - - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException; - - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException; - - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException; - - public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException; - - public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException; - - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException; - - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException; - - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException; - - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException; - - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException; - - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException; - - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException; - - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException; - - public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException; - - public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void ExecuteStatement(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; - - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException - { - send_OpenSession(req); - return recv_OpenSession(); - } - - public void send_OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException - { - OpenSession_args args = new OpenSession_args(); - args.setReq(req); - sendBase("OpenSession", args); - } - - public TOpenSessionResp recv_OpenSession() throws org.apache.thrift.TException - { - OpenSession_result result = new OpenSession_result(); - receiveBase(result, "OpenSession"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result"); - } - - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException - { - send_CloseSession(req); - return recv_CloseSession(); - } - - public void send_CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException - { - CloseSession_args args = new CloseSession_args(); - args.setReq(req); - sendBase("CloseSession", args); - } - - public TCloseSessionResp recv_CloseSession() throws org.apache.thrift.TException - { - CloseSession_result result = new CloseSession_result(); - receiveBase(result, "CloseSession"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseSession failed: unknown result"); - } - - public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException - { - send_GetInfo(req); - return recv_GetInfo(); - } - - public void send_GetInfo(TGetInfoReq req) throws org.apache.thrift.TException - { - GetInfo_args args = new GetInfo_args(); - args.setReq(req); - sendBase("GetInfo", args); - } - - public TGetInfoResp recv_GetInfo() throws org.apache.thrift.TException - { - GetInfo_result result = new GetInfo_result(); - receiveBase(result, "GetInfo"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetInfo failed: unknown result"); - } - - public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException - { - send_ExecuteStatement(req); - return recv_ExecuteStatement(); - } - - public void send_ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException - { - ExecuteStatement_args args = new ExecuteStatement_args(); - args.setReq(req); - sendBase("ExecuteStatement", args); - } - - public TExecuteStatementResp recv_ExecuteStatement() throws org.apache.thrift.TException - { - ExecuteStatement_result result = new ExecuteStatement_result(); - receiveBase(result, "ExecuteStatement"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result"); - } - - public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException - { - send_GetTypeInfo(req); - return recv_GetTypeInfo(); - } - - public void send_GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException - { - GetTypeInfo_args args = new GetTypeInfo_args(); - args.setReq(req); - sendBase("GetTypeInfo", args); - } - - public TGetTypeInfoResp recv_GetTypeInfo() throws org.apache.thrift.TException - { - GetTypeInfo_result result = new GetTypeInfo_result(); - receiveBase(result, "GetTypeInfo"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTypeInfo failed: unknown result"); - } - - public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException - { - send_GetCatalogs(req); - return recv_GetCatalogs(); - } - - public void send_GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException - { - GetCatalogs_args args = new GetCatalogs_args(); - args.setReq(req); - sendBase("GetCatalogs", args); - } - - public TGetCatalogsResp recv_GetCatalogs() throws org.apache.thrift.TException - { - GetCatalogs_result result = new GetCatalogs_result(); - receiveBase(result, "GetCatalogs"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCatalogs failed: unknown result"); - } - - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException - { - send_GetSchemas(req); - return recv_GetSchemas(); - } - - public void send_GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException - { - GetSchemas_args args = new GetSchemas_args(); - args.setReq(req); - sendBase("GetSchemas", args); - } - - public TGetSchemasResp recv_GetSchemas() throws org.apache.thrift.TException - { - GetSchemas_result result = new GetSchemas_result(); - receiveBase(result, "GetSchemas"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetSchemas failed: unknown result"); - } - - public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException - { - send_GetTables(req); - return recv_GetTables(); - } - - public void send_GetTables(TGetTablesReq req) throws org.apache.thrift.TException - { - GetTables_args args = new GetTables_args(); - args.setReq(req); - sendBase("GetTables", args); - } - - public TGetTablesResp recv_GetTables() throws org.apache.thrift.TException - { - GetTables_result result = new GetTables_result(); - receiveBase(result, "GetTables"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTables failed: unknown result"); - } - - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException - { - send_GetTableTypes(req); - return recv_GetTableTypes(); - } - - public void send_GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException - { - GetTableTypes_args args = new GetTableTypes_args(); - args.setReq(req); - sendBase("GetTableTypes", args); - } - - public TGetTableTypesResp recv_GetTableTypes() throws org.apache.thrift.TException - { - GetTableTypes_result result = new GetTableTypes_result(); - receiveBase(result, "GetTableTypes"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTableTypes failed: unknown result"); - } - - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException - { - send_GetColumns(req); - return recv_GetColumns(); - } - - public void send_GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException - { - GetColumns_args args = new GetColumns_args(); - args.setReq(req); - sendBase("GetColumns", args); - } - - public TGetColumnsResp recv_GetColumns() throws org.apache.thrift.TException - { - GetColumns_result result = new GetColumns_result(); - receiveBase(result, "GetColumns"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetColumns failed: unknown result"); - } - - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException - { - send_GetFunctions(req); - return recv_GetFunctions(); - } - - public void send_GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException - { - GetFunctions_args args = new GetFunctions_args(); - args.setReq(req); - sendBase("GetFunctions", args); - } - - public TGetFunctionsResp recv_GetFunctions() throws org.apache.thrift.TException - { - GetFunctions_result result = new GetFunctions_result(); - receiveBase(result, "GetFunctions"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetFunctions failed: unknown result"); - } - - public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException - { - send_GetPrimaryKeys(req); - return recv_GetPrimaryKeys(); - } - - public void send_GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException - { - GetPrimaryKeys_args args = new GetPrimaryKeys_args(); - args.setReq(req); - sendBase("GetPrimaryKeys", args); - } - - public TGetPrimaryKeysResp recv_GetPrimaryKeys() throws org.apache.thrift.TException - { - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - receiveBase(result, "GetPrimaryKeys"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetPrimaryKeys failed: unknown result"); - } - - public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException - { - send_GetCrossReference(req); - return recv_GetCrossReference(); - } - - public void send_GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException - { - GetCrossReference_args args = new GetCrossReference_args(); - args.setReq(req); - sendBase("GetCrossReference", args); - } - - public TGetCrossReferenceResp recv_GetCrossReference() throws org.apache.thrift.TException - { - GetCrossReference_result result = new GetCrossReference_result(); - receiveBase(result, "GetCrossReference"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCrossReference failed: unknown result"); - } - - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException - { - send_GetOperationStatus(req); - return recv_GetOperationStatus(); - } - - public void send_GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException - { - GetOperationStatus_args args = new GetOperationStatus_args(); - args.setReq(req); - sendBase("GetOperationStatus", args); - } - - public TGetOperationStatusResp recv_GetOperationStatus() throws org.apache.thrift.TException - { - GetOperationStatus_result result = new GetOperationStatus_result(); - receiveBase(result, "GetOperationStatus"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetOperationStatus failed: unknown result"); - } - - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException - { - send_CancelOperation(req); - return recv_CancelOperation(); - } - - public void send_CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException - { - CancelOperation_args args = new CancelOperation_args(); - args.setReq(req); - sendBase("CancelOperation", args); - } - - public TCancelOperationResp recv_CancelOperation() throws org.apache.thrift.TException - { - CancelOperation_result result = new CancelOperation_result(); - receiveBase(result, "CancelOperation"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelOperation failed: unknown result"); - } - - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException - { - send_CloseOperation(req); - return recv_CloseOperation(); - } - - public void send_CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException - { - CloseOperation_args args = new CloseOperation_args(); - args.setReq(req); - sendBase("CloseOperation", args); - } - - public TCloseOperationResp recv_CloseOperation() throws org.apache.thrift.TException - { - CloseOperation_result result = new CloseOperation_result(); - receiveBase(result, "CloseOperation"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseOperation failed: unknown result"); - } - - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException - { - send_GetResultSetMetadata(req); - return recv_GetResultSetMetadata(); - } - - public void send_GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException - { - GetResultSetMetadata_args args = new GetResultSetMetadata_args(); - args.setReq(req); - sendBase("GetResultSetMetadata", args); - } - - public TGetResultSetMetadataResp recv_GetResultSetMetadata() throws org.apache.thrift.TException - { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - receiveBase(result, "GetResultSetMetadata"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetResultSetMetadata failed: unknown result"); - } - - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException - { - send_FetchResults(req); - return recv_FetchResults(); - } - - public void send_FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException - { - FetchResults_args args = new FetchResults_args(); - args.setReq(req); - sendBase("FetchResults", args); - } - - public TFetchResultsResp recv_FetchResults() throws org.apache.thrift.TException - { - FetchResults_result result = new FetchResults_result(); - receiveBase(result, "FetchResults"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result"); - } - - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException - { - send_GetDelegationToken(req); - return recv_GetDelegationToken(); - } - - public void send_GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException - { - GetDelegationToken_args args = new GetDelegationToken_args(); - args.setReq(req); - sendBase("GetDelegationToken", args); - } - - public TGetDelegationTokenResp recv_GetDelegationToken() throws org.apache.thrift.TException - { - GetDelegationToken_result result = new GetDelegationToken_result(); - receiveBase(result, "GetDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result"); - } - - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException - { - send_CancelDelegationToken(req); - return recv_CancelDelegationToken(); - } - - public void send_CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException - { - CancelDelegationToken_args args = new CancelDelegationToken_args(); - args.setReq(req); - sendBase("CancelDelegationToken", args); - } - - public TCancelDelegationTokenResp recv_CancelDelegationToken() throws org.apache.thrift.TException - { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - receiveBase(result, "CancelDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result"); - } - - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException - { - send_RenewDelegationToken(req); - return recv_RenewDelegationToken(); - } - - public void send_RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException - { - RenewDelegationToken_args args = new RenewDelegationToken_args(); - args.setReq(req); - sendBase("RenewDelegationToken", args); - } - - public TRenewDelegationTokenResp recv_RenewDelegationToken() throws org.apache.thrift.TException - { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - receiveBase(result, "RenewDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result"); - } - - public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException - { - send_GetQueryId(req); - return recv_GetQueryId(); - } - - public void send_GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException - { - GetQueryId_args args = new GetQueryId_args(); - args.setReq(req); - sendBase("GetQueryId", args); - } - - public TGetQueryIdResp recv_GetQueryId() throws org.apache.thrift.TException - { - GetQueryId_result result = new GetQueryId_result(); - receiveBase(result, "GetQueryId"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetQueryId failed: unknown result"); - } - - public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException - { - send_SetClientInfo(req); - return recv_SetClientInfo(); - } - - public void send_SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException - { - SetClientInfo_args args = new SetClientInfo_args(); - args.setReq(req); - sendBase("SetClientInfo", args); - } - - public TSetClientInfoResp recv_SetClientInfo() throws org.apache.thrift.TException - { - SetClientInfo_result result = new SetClientInfo_result(); - receiveBase(result, "SetClientInfo"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "SetClientInfo failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - OpenSession_call method_call = new OpenSession_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { - private TOpenSessionReq req; - public OpenSession_call(TOpenSessionReq 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("OpenSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); - OpenSession_args args = new OpenSession_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TOpenSessionResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_OpenSession(); - } - } - - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCloseSessionReq req; - public CloseSession_call(TCloseSessionReq 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("CloseSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CloseSession_args args = new CloseSession_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCloseSessionResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_CloseSession(); - } - } - - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetInfo_call method_call = new GetInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetInfoReq req; - public GetInfo_call(TGetInfoReq 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("GetInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetInfo_args args = new GetInfo_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetInfoResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetInfo(); - } - } - - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - ExecuteStatement_call method_call = new ExecuteStatement_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { - private TExecuteStatementReq req; - public ExecuteStatement_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("ExecuteStatement", org.apache.thrift.protocol.TMessageType.CALL, 0)); - ExecuteStatement_args args = new ExecuteStatement_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TExecuteStatementResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_ExecuteStatement(); - } - } - - 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); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTypeInfoReq req; - public GetTypeInfo_call(TGetTypeInfoReq 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("GetTypeInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTypeInfo_args args = new GetTypeInfo_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetTypeInfo(); - } - } - - public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetCatalogs_call method_call = new GetCatalogs_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetCatalogsReq req; - public GetCatalogs_call(TGetCatalogsReq 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("GetCatalogs", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetCatalogs_args args = new GetCatalogs_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetCatalogsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetCatalogs(); - } - } - - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetSchemas_call method_call = new GetSchemas_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetSchemasReq req; - public GetSchemas_call(TGetSchemasReq 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("GetSchemas", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetSchemas_args args = new GetSchemas_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetSchemasResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetSchemas(); - } - } - - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTables_call method_call = new GetTables_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTablesReq req; - public GetTables_call(TGetTablesReq 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("GetTables", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTables_args args = new GetTables_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTablesResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetTables(); - } - } - - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTableTypes_call method_call = new GetTableTypes_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTableTypesReq req; - public GetTableTypes_call(TGetTableTypesReq 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("GetTableTypes", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTableTypes_args args = new GetTableTypes_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTableTypesResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetTableTypes(); - } - } - - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetColumns_call method_call = new GetColumns_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetColumnsReq req; - public GetColumns_call(TGetColumnsReq 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("GetColumns", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetColumns_args args = new GetColumns_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetColumnsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetColumns(); - } - } - - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetFunctions_call method_call = new GetFunctions_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetFunctionsReq req; - public GetFunctions_call(TGetFunctionsReq 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("GetFunctions", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetFunctions_args args = new GetFunctions_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetFunctionsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetFunctions(); - } - } - - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetPrimaryKeys_call method_call = new GetPrimaryKeys_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetPrimaryKeysReq req; - public GetPrimaryKeys_call(TGetPrimaryKeysReq 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("GetPrimaryKeys", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetPrimaryKeys_args args = new GetPrimaryKeys_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetPrimaryKeysResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetPrimaryKeys(); - } - } - - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetCrossReference_call method_call = new GetCrossReference_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetCrossReferenceReq req; - public GetCrossReference_call(TGetCrossReferenceReq 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("GetCrossReference", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetCrossReference_args args = new GetCrossReference_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetCrossReferenceResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetCrossReference(); - } - } - - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetOperationStatus_call method_call = new GetOperationStatus_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetOperationStatusReq req; - public GetOperationStatus_call(TGetOperationStatusReq 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("GetOperationStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetOperationStatus_args args = new GetOperationStatus_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetOperationStatus(); - } - } - - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CancelOperation_call method_call = new CancelOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCancelOperationReq req; - public CancelOperation_call(TCancelOperationReq 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("CancelOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CancelOperation_args args = new CancelOperation_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCancelOperationResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_CancelOperation(); - } - } - - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CloseOperation_call method_call = new CloseOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCloseOperationReq req; - public CloseOperation_call(TCloseOperationReq 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("CloseOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CloseOperation_args args = new CloseOperation_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCloseOperationResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_CloseOperation(); - } - } - - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetResultSetMetadata_call method_call = new GetResultSetMetadata_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetResultSetMetadataReq req; - public GetResultSetMetadata_call(TGetResultSetMetadataReq 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("GetResultSetMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetResultSetMetadata_args args = new GetResultSetMetadata_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetResultSetMetadata(); - } - } - - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - FetchResults_call method_call = new FetchResults_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { - private TFetchResultsReq req; - public FetchResults_call(TFetchResultsReq 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("FetchResults", org.apache.thrift.protocol.TMessageType.CALL, 0)); - FetchResults_args args = new FetchResults_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TFetchResultsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_FetchResults(); - } - } - - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetDelegationToken_call method_call = new GetDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetDelegationTokenReq req; - public GetDelegationToken_call(TGetDelegationTokenReq 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("GetDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetDelegationToken_args args = new GetDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetDelegationToken(); - } - } - - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CancelDelegationToken_call method_call = new CancelDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCancelDelegationTokenReq req; - public CancelDelegationToken_call(TCancelDelegationTokenReq 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("CancelDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CancelDelegationToken_args args = new CancelDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_CancelDelegationToken(); - } - } - - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - RenewDelegationToken_call method_call = new RenewDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TRenewDelegationTokenReq req; - public RenewDelegationToken_call(TRenewDelegationTokenReq 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("RenewDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - RenewDelegationToken_args args = new RenewDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_RenewDelegationToken(); - } - } - - public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetQueryId_call method_call = new GetQueryId_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetQueryId_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetQueryIdReq req; - public GetQueryId_call(TGetQueryIdReq 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("GetQueryId", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetQueryId_args args = new GetQueryId_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetQueryIdResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_GetQueryId(); - } - } - - public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - SetClientInfo_call method_call = new SetClientInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class SetClientInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private TSetClientInfoReq req; - public SetClientInfo_call(TSetClientInfoReq 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("SetClientInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - SetClientInfo_args args = new SetClientInfo_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TSetClientInfoResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.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_SetClientInfo(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new java.util.HashMap>())); - } - - protected Processor(I iface, java.util.Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static java.util.Map> getProcessMap(java.util.Map> processMap) { - processMap.put("OpenSession", new OpenSession()); - processMap.put("CloseSession", new CloseSession()); - processMap.put("GetInfo", new GetInfo()); - processMap.put("ExecuteStatement", new ExecuteStatement()); - processMap.put("GetTypeInfo", new GetTypeInfo()); - processMap.put("GetCatalogs", new GetCatalogs()); - processMap.put("GetSchemas", new GetSchemas()); - processMap.put("GetTables", new GetTables()); - processMap.put("GetTableTypes", new GetTableTypes()); - processMap.put("GetColumns", new GetColumns()); - processMap.put("GetFunctions", new GetFunctions()); - processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); - processMap.put("GetCrossReference", new GetCrossReference()); - processMap.put("GetOperationStatus", new GetOperationStatus()); - processMap.put("CancelOperation", new CancelOperation()); - processMap.put("CloseOperation", new CloseOperation()); - processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); - processMap.put("FetchResults", new FetchResults()); - processMap.put("GetDelegationToken", new GetDelegationToken()); - processMap.put("CancelDelegationToken", new CancelDelegationToken()); - processMap.put("RenewDelegationToken", new RenewDelegationToken()); - processMap.put("GetQueryId", new GetQueryId()); - processMap.put("SetClientInfo", new SetClientInfo()); - return processMap; - } - - public static class OpenSession extends org.apache.thrift.ProcessFunction { - public OpenSession() { - super("OpenSession"); - } - - public OpenSession_args getEmptyArgsInstance() { - return new OpenSession_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public OpenSession_result getResult(I iface, OpenSession_args args) throws org.apache.thrift.TException { - OpenSession_result result = new OpenSession_result(); - result.success = iface.OpenSession(args.req); - return result; - } - } - - public static class CloseSession extends org.apache.thrift.ProcessFunction { - public CloseSession() { - super("CloseSession"); - } - - public CloseSession_args getEmptyArgsInstance() { - return new CloseSession_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { - CloseSession_result result = new CloseSession_result(); - result.success = iface.CloseSession(args.req); - return result; - } - } - - public static class GetInfo extends org.apache.thrift.ProcessFunction { - public GetInfo() { - super("GetInfo"); - } - - public GetInfo_args getEmptyArgsInstance() { - return new GetInfo_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.thrift.TException { - GetInfo_result result = new GetInfo_result(); - result.success = iface.GetInfo(args.req); - return result; - } - } - - public static class ExecuteStatement extends org.apache.thrift.ProcessFunction { - public ExecuteStatement() { - super("ExecuteStatement"); - } - - public ExecuteStatement_args getEmptyArgsInstance() { - return new ExecuteStatement_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) throws org.apache.thrift.TException { - ExecuteStatement_result result = new ExecuteStatement_result(); - result.success = iface.ExecuteStatement(args.req); - return result; - } - } - - public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { - public GetTypeInfo() { - super("GetTypeInfo"); - } - - public GetTypeInfo_args getEmptyArgsInstance() { - return new GetTypeInfo_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.apache.thrift.TException { - GetTypeInfo_result result = new GetTypeInfo_result(); - result.success = iface.GetTypeInfo(args.req); - return result; - } - } - - public static class GetCatalogs extends org.apache.thrift.ProcessFunction { - public GetCatalogs() { - super("GetCatalogs"); - } - - public GetCatalogs_args getEmptyArgsInstance() { - return new GetCatalogs_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.apache.thrift.TException { - GetCatalogs_result result = new GetCatalogs_result(); - result.success = iface.GetCatalogs(args.req); - return result; - } - } - - public static class GetSchemas extends org.apache.thrift.ProcessFunction { - public GetSchemas() { - super("GetSchemas"); - } - - public GetSchemas_args getEmptyArgsInstance() { - return new GetSchemas_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apache.thrift.TException { - GetSchemas_result result = new GetSchemas_result(); - result.success = iface.GetSchemas(args.req); - return result; - } - } - - public static class GetTables extends org.apache.thrift.ProcessFunction { - public GetTables() { - super("GetTables"); - } - - public GetTables_args getEmptyArgsInstance() { - return new GetTables_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetTables_result getResult(I iface, GetTables_args args) throws org.apache.thrift.TException { - GetTables_result result = new GetTables_result(); - result.success = iface.GetTables(args.req); - return result; - } - } - - public static class GetTableTypes extends org.apache.thrift.ProcessFunction { - public GetTableTypes() { - super("GetTableTypes"); - } - - public GetTableTypes_args getEmptyArgsInstance() { - return new GetTableTypes_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws org.apache.thrift.TException { - GetTableTypes_result result = new GetTableTypes_result(); - result.success = iface.GetTableTypes(args.req); - return result; - } - } - - public static class GetColumns extends org.apache.thrift.ProcessFunction { - public GetColumns() { - super("GetColumns"); - } - - public GetColumns_args getEmptyArgsInstance() { - return new GetColumns_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apache.thrift.TException { - GetColumns_result result = new GetColumns_result(); - result.success = iface.GetColumns(args.req); - return result; - } - } - - public static class GetFunctions extends org.apache.thrift.ProcessFunction { - public GetFunctions() { - super("GetFunctions"); - } - - public GetFunctions_args getEmptyArgsInstance() { - return new GetFunctions_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org.apache.thrift.TException { - GetFunctions_result result = new GetFunctions_result(); - result.success = iface.GetFunctions(args.req); - return result; - } - } - - public static class GetPrimaryKeys extends org.apache.thrift.ProcessFunction { - public GetPrimaryKeys() { - super("GetPrimaryKeys"); - } - - public GetPrimaryKeys_args getEmptyArgsInstance() { - return new GetPrimaryKeys_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetPrimaryKeys_result getResult(I iface, GetPrimaryKeys_args args) throws org.apache.thrift.TException { - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - result.success = iface.GetPrimaryKeys(args.req); - return result; - } - } - - public static class GetCrossReference extends org.apache.thrift.ProcessFunction { - public GetCrossReference() { - super("GetCrossReference"); - } - - public GetCrossReference_args getEmptyArgsInstance() { - return new GetCrossReference_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetCrossReference_result getResult(I iface, GetCrossReference_args args) throws org.apache.thrift.TException { - GetCrossReference_result result = new GetCrossReference_result(); - result.success = iface.GetCrossReference(args.req); - return result; - } - } - - public static class GetOperationStatus extends org.apache.thrift.ProcessFunction { - public GetOperationStatus() { - super("GetOperationStatus"); - } - - public GetOperationStatus_args getEmptyArgsInstance() { - return new GetOperationStatus_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args) throws org.apache.thrift.TException { - GetOperationStatus_result result = new GetOperationStatus_result(); - result.success = iface.GetOperationStatus(args.req); - return result; - } - } - - public static class CancelOperation extends org.apache.thrift.ProcessFunction { - public CancelOperation() { - super("CancelOperation"); - } - - public CancelOperation_args getEmptyArgsInstance() { - return new CancelOperation_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public CancelOperation_result getResult(I iface, CancelOperation_args args) throws org.apache.thrift.TException { - CancelOperation_result result = new CancelOperation_result(); - result.success = iface.CancelOperation(args.req); - return result; - } - } - - public static class CloseOperation extends org.apache.thrift.ProcessFunction { - public CloseOperation() { - super("CloseOperation"); - } - - public CloseOperation_args getEmptyArgsInstance() { - return new CloseOperation_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public CloseOperation_result getResult(I iface, CloseOperation_args args) throws org.apache.thrift.TException { - CloseOperation_result result = new CloseOperation_result(); - result.success = iface.CloseOperation(args.req); - return result; - } - } - - public static class GetResultSetMetadata extends org.apache.thrift.ProcessFunction { - public GetResultSetMetadata() { - super("GetResultSetMetadata"); - } - - public GetResultSetMetadata_args getEmptyArgsInstance() { - return new GetResultSetMetadata_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args args) throws org.apache.thrift.TException { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - result.success = iface.GetResultSetMetadata(args.req); - return result; - } - } - - public static class FetchResults extends org.apache.thrift.ProcessFunction { - public FetchResults() { - super("FetchResults"); - } - - public FetchResults_args getEmptyArgsInstance() { - return new FetchResults_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public FetchResults_result getResult(I iface, FetchResults_args args) throws org.apache.thrift.TException { - FetchResults_result result = new FetchResults_result(); - result.success = iface.FetchResults(args.req); - return result; - } - } - - public static class GetDelegationToken extends org.apache.thrift.ProcessFunction { - public GetDelegationToken() { - super("GetDelegationToken"); - } - - public GetDelegationToken_args getEmptyArgsInstance() { - return new GetDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args) throws org.apache.thrift.TException { - GetDelegationToken_result result = new GetDelegationToken_result(); - result.success = iface.GetDelegationToken(args.req); - return result; - } - } - - public static class CancelDelegationToken extends org.apache.thrift.ProcessFunction { - public CancelDelegationToken() { - super("CancelDelegationToken"); - } - - public CancelDelegationToken_args getEmptyArgsInstance() { - return new CancelDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_args args) throws org.apache.thrift.TException { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - result.success = iface.CancelDelegationToken(args.req); - return result; - } - } - - public static class RenewDelegationToken extends org.apache.thrift.ProcessFunction { - public RenewDelegationToken() { - super("RenewDelegationToken"); - } - - public RenewDelegationToken_args getEmptyArgsInstance() { - return new RenewDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args args) throws org.apache.thrift.TException { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - result.success = iface.RenewDelegationToken(args.req); - return result; - } - } - - public static class GetQueryId extends org.apache.thrift.ProcessFunction { - public GetQueryId() { - super("GetQueryId"); - } - - public GetQueryId_args getEmptyArgsInstance() { - return new GetQueryId_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public GetQueryId_result getResult(I iface, GetQueryId_args args) throws org.apache.thrift.TException { - GetQueryId_result result = new GetQueryId_result(); - result.success = iface.GetQueryId(args.req); - return result; - } - } - - public static class SetClientInfo extends org.apache.thrift.ProcessFunction { - public SetClientInfo() { - super("SetClientInfo"); - } - - public SetClientInfo_args getEmptyArgsInstance() { - return new SetClientInfo_args(); - } - - protected boolean isOneway() { - return false; - } - - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - - public SetClientInfo_result getResult(I iface, SetClientInfo_args args) throws org.apache.thrift.TException { - SetClientInfo_result result = new SetClientInfo_result(); - result.success = iface.SetClientInfo(args.req); - return result; - } - } - - } - - public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { - private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); - public AsyncProcessor(I iface) { - super(iface, getProcessMap(new java.util.HashMap>())); - } - - protected AsyncProcessor(I iface, java.util.Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static java.util.Map> getProcessMap(java.util.Map> processMap) { - processMap.put("OpenSession", new OpenSession()); - processMap.put("CloseSession", new CloseSession()); - processMap.put("GetInfo", new GetInfo()); - processMap.put("ExecuteStatement", new ExecuteStatement()); - processMap.put("GetTypeInfo", new GetTypeInfo()); - processMap.put("GetCatalogs", new GetCatalogs()); - processMap.put("GetSchemas", new GetSchemas()); - processMap.put("GetTables", new GetTables()); - processMap.put("GetTableTypes", new GetTableTypes()); - processMap.put("GetColumns", new GetColumns()); - processMap.put("GetFunctions", new GetFunctions()); - processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); - processMap.put("GetCrossReference", new GetCrossReference()); - processMap.put("GetOperationStatus", new GetOperationStatus()); - processMap.put("CancelOperation", new CancelOperation()); - processMap.put("CloseOperation", new CloseOperation()); - processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); - processMap.put("FetchResults", new FetchResults()); - processMap.put("GetDelegationToken", new GetDelegationToken()); - processMap.put("CancelDelegationToken", new CancelDelegationToken()); - processMap.put("RenewDelegationToken", new RenewDelegationToken()); - processMap.put("GetQueryId", new GetQueryId()); - processMap.put("SetClientInfo", new SetClientInfo()); - return processMap; - } - - public static class OpenSession extends org.apache.thrift.AsyncProcessFunction { - public OpenSession() { - super("OpenSession"); - } - - public OpenSession_args getEmptyArgsInstance() { - return new OpenSession_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TOpenSessionResp o) { - OpenSession_result result = new OpenSession_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - OpenSession_result result = new OpenSession_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.OpenSession(args.req,resultHandler); - } - } - - public static class CloseSession extends org.apache.thrift.AsyncProcessFunction { - public CloseSession() { - super("CloseSession"); - } - - public CloseSession_args getEmptyArgsInstance() { - return new CloseSession_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TCloseSessionResp o) { - CloseSession_result result = new CloseSession_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - CloseSession_result result = new CloseSession_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.CloseSession(args.req,resultHandler); - } - } - - public static class GetInfo extends org.apache.thrift.AsyncProcessFunction { - public GetInfo() { - super("GetInfo"); - } - - public GetInfo_args getEmptyArgsInstance() { - return new GetInfo_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetInfoResp o) { - GetInfo_result result = new GetInfo_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetInfo_result result = new GetInfo_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetInfo(args.req,resultHandler); - } - } - - public static class ExecuteStatement extends org.apache.thrift.AsyncProcessFunction { - public ExecuteStatement() { - super("ExecuteStatement"); - } - - public ExecuteStatement_args getEmptyArgsInstance() { - return new ExecuteStatement_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TExecuteStatementResp o) { - ExecuteStatement_result result = new ExecuteStatement_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - ExecuteStatement_result result = new ExecuteStatement_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.ExecuteStatement(args.req,resultHandler); - } - } - - public static class GetTypeInfo extends org.apache.thrift.AsyncProcessFunction { - public GetTypeInfo() { - super("GetTypeInfo"); - } - - public GetTypeInfo_args getEmptyArgsInstance() { - return new GetTypeInfo_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetTypeInfoResp o) { - GetTypeInfo_result result = new GetTypeInfo_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetTypeInfo_result result = new GetTypeInfo_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetTypeInfo(args.req,resultHandler); - } - } - - public static class GetCatalogs extends org.apache.thrift.AsyncProcessFunction { - public GetCatalogs() { - super("GetCatalogs"); - } - - public GetCatalogs_args getEmptyArgsInstance() { - return new GetCatalogs_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetCatalogsResp o) { - GetCatalogs_result result = new GetCatalogs_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetCatalogs_result result = new GetCatalogs_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetCatalogs(args.req,resultHandler); - } - } - - public static class GetSchemas extends org.apache.thrift.AsyncProcessFunction { - public GetSchemas() { - super("GetSchemas"); - } - - public GetSchemas_args getEmptyArgsInstance() { - return new GetSchemas_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetSchemasResp o) { - GetSchemas_result result = new GetSchemas_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetSchemas_result result = new GetSchemas_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetSchemas(args.req,resultHandler); - } - } - - public static class GetTables extends org.apache.thrift.AsyncProcessFunction { - public GetTables() { - super("GetTables"); - } - - public GetTables_args getEmptyArgsInstance() { - return new GetTables_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetTablesResp o) { - GetTables_result result = new GetTables_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetTables_result result = new GetTables_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetTables(args.req,resultHandler); - } - } - - public static class GetTableTypes extends org.apache.thrift.AsyncProcessFunction { - public GetTableTypes() { - super("GetTableTypes"); - } - - public GetTableTypes_args getEmptyArgsInstance() { - return new GetTableTypes_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetTableTypesResp o) { - GetTableTypes_result result = new GetTableTypes_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetTableTypes_result result = new GetTableTypes_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetTableTypes(args.req,resultHandler); - } - } - - public static class GetColumns extends org.apache.thrift.AsyncProcessFunction { - public GetColumns() { - super("GetColumns"); - } - - public GetColumns_args getEmptyArgsInstance() { - return new GetColumns_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetColumnsResp o) { - GetColumns_result result = new GetColumns_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetColumns_result result = new GetColumns_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetColumns(args.req,resultHandler); - } - } - - public static class GetFunctions extends org.apache.thrift.AsyncProcessFunction { - public GetFunctions() { - super("GetFunctions"); - } - - public GetFunctions_args getEmptyArgsInstance() { - return new GetFunctions_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetFunctionsResp o) { - GetFunctions_result result = new GetFunctions_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetFunctions_result result = new GetFunctions_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetFunctions(args.req,resultHandler); - } - } - - public static class GetPrimaryKeys extends org.apache.thrift.AsyncProcessFunction { - public GetPrimaryKeys() { - super("GetPrimaryKeys"); - } - - public GetPrimaryKeys_args getEmptyArgsInstance() { - return new GetPrimaryKeys_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetPrimaryKeysResp o) { - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetPrimaryKeys(args.req,resultHandler); - } - } - - public static class GetCrossReference extends org.apache.thrift.AsyncProcessFunction { - public GetCrossReference() { - super("GetCrossReference"); - } - - public GetCrossReference_args getEmptyArgsInstance() { - return new GetCrossReference_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetCrossReferenceResp o) { - GetCrossReference_result result = new GetCrossReference_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetCrossReference_result result = new GetCrossReference_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetCrossReference(args.req,resultHandler); - } - } - - public static class GetOperationStatus extends org.apache.thrift.AsyncProcessFunction { - public GetOperationStatus() { - super("GetOperationStatus"); - } - - public GetOperationStatus_args getEmptyArgsInstance() { - return new GetOperationStatus_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetOperationStatusResp o) { - GetOperationStatus_result result = new GetOperationStatus_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetOperationStatus_result result = new GetOperationStatus_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetOperationStatus(args.req,resultHandler); - } - } - - public static class CancelOperation extends org.apache.thrift.AsyncProcessFunction { - public CancelOperation() { - super("CancelOperation"); - } - - public CancelOperation_args getEmptyArgsInstance() { - return new CancelOperation_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TCancelOperationResp o) { - CancelOperation_result result = new CancelOperation_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - CancelOperation_result result = new CancelOperation_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.CancelOperation(args.req,resultHandler); - } - } - - public static class CloseOperation extends org.apache.thrift.AsyncProcessFunction { - public CloseOperation() { - super("CloseOperation"); - } - - public CloseOperation_args getEmptyArgsInstance() { - return new CloseOperation_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TCloseOperationResp o) { - CloseOperation_result result = new CloseOperation_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - CloseOperation_result result = new CloseOperation_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.CloseOperation(args.req,resultHandler); - } - } - - public static class GetResultSetMetadata extends org.apache.thrift.AsyncProcessFunction { - public GetResultSetMetadata() { - super("GetResultSetMetadata"); - } - - public GetResultSetMetadata_args getEmptyArgsInstance() { - return new GetResultSetMetadata_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetResultSetMetadataResp o) { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetResultSetMetadata(args.req,resultHandler); - } - } - - public static class FetchResults extends org.apache.thrift.AsyncProcessFunction { - public FetchResults() { - super("FetchResults"); - } - - public FetchResults_args getEmptyArgsInstance() { - return new FetchResults_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TFetchResultsResp o) { - FetchResults_result result = new FetchResults_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - FetchResults_result result = new FetchResults_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.FetchResults(args.req,resultHandler); - } - } - - public static class GetDelegationToken extends org.apache.thrift.AsyncProcessFunction { - public GetDelegationToken() { - super("GetDelegationToken"); - } - - public GetDelegationToken_args getEmptyArgsInstance() { - return new GetDelegationToken_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetDelegationTokenResp o) { - GetDelegationToken_result result = new GetDelegationToken_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetDelegationToken_result result = new GetDelegationToken_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetDelegationToken(args.req,resultHandler); - } - } - - public static class CancelDelegationToken extends org.apache.thrift.AsyncProcessFunction { - public CancelDelegationToken() { - super("CancelDelegationToken"); - } - - public CancelDelegationToken_args getEmptyArgsInstance() { - return new CancelDelegationToken_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TCancelDelegationTokenResp o) { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - CancelDelegationToken_result result = new CancelDelegationToken_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.CancelDelegationToken(args.req,resultHandler); - } - } - - public static class RenewDelegationToken extends org.apache.thrift.AsyncProcessFunction { - public RenewDelegationToken() { - super("RenewDelegationToken"); - } - - public RenewDelegationToken_args getEmptyArgsInstance() { - return new RenewDelegationToken_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TRenewDelegationTokenResp o) { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - RenewDelegationToken_result result = new RenewDelegationToken_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.RenewDelegationToken(args.req,resultHandler); - } - } - - public static class GetQueryId extends org.apache.thrift.AsyncProcessFunction { - public GetQueryId() { - super("GetQueryId"); - } - - public GetQueryId_args getEmptyArgsInstance() { - return new GetQueryId_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TGetQueryIdResp o) { - GetQueryId_result result = new GetQueryId_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - GetQueryId_result result = new GetQueryId_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetQueryId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.GetQueryId(args.req,resultHandler); - } - } - - public static class SetClientInfo extends org.apache.thrift.AsyncProcessFunction { - public SetClientInfo() { - super("SetClientInfo"); - } - - public SetClientInfo_args getEmptyArgsInstance() { - return new SetClientInfo_args(); - } - - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { - public void onComplete(TSetClientInfoResp o) { - SetClientInfo_result result = new SetClientInfo_result(); - result.success = o; - try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); - } - } - public void onError(java.lang.Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; - SetClientInfo_result result = new SetClientInfo_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); - } - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, SetClientInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - iface.SetClientInfo(args.req,resultHandler); - } - } - - } - - public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OpenSession_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OpenSession_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TOpenSessionReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TOpenSessionReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_args.class, metaDataMap); - } - - public OpenSession_args() { - } - - public OpenSession_args( - TOpenSessionReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public OpenSession_args(OpenSession_args other) { - if (other.isSetReq()) { - this.req = new TOpenSessionReq(other.req); - } - } - - public OpenSession_args deepCopy() { - return new OpenSession_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TOpenSessionReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TOpenSessionReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TOpenSessionReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof OpenSession_args) - return this.equals((OpenSession_args)that); - return false; - } - - public boolean equals(OpenSession_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(OpenSession_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_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, java.lang.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 OpenSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public OpenSession_argsStandardScheme getScheme() { - return new OpenSession_argsStandardScheme(); - } - } - - private static class OpenSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_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 TOpenSessionReq(); - 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, OpenSession_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 OpenSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public OpenSession_argsTupleScheme getScheme() { - return new OpenSession_argsTupleScheme(); - } - } - - private static class OpenSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, OpenSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TOpenSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OpenSession_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OpenSession_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TOpenSessionResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TOpenSessionResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_result.class, metaDataMap); - } - - public OpenSession_result() { - } - - public OpenSession_result( - TOpenSessionResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public OpenSession_result(OpenSession_result other) { - if (other.isSetSuccess()) { - this.success = new TOpenSessionResp(other.success); - } - } - - public OpenSession_result deepCopy() { - return new OpenSession_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TOpenSessionResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TOpenSessionResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TOpenSessionResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof OpenSession_result) - return this.equals((OpenSession_result)that); - return false; - } - - public boolean equals(OpenSession_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(OpenSession_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_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, java.lang.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 OpenSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public OpenSession_resultStandardScheme getScheme() { - return new OpenSession_resultStandardScheme(); - } - } - - private static class OpenSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_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 TOpenSessionResp(); - 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, OpenSession_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 OpenSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public OpenSession_resultTupleScheme getScheme() { - return new OpenSession_resultTupleScheme(); - } - } - - private static class OpenSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, OpenSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TOpenSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseSession_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseSession_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCloseSessionReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseSessionReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_args.class, metaDataMap); - } - - public CloseSession_args() { - } - - public CloseSession_args( - TCloseSessionReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CloseSession_args(CloseSession_args other) { - if (other.isSetReq()) { - this.req = new TCloseSessionReq(other.req); - } - } - - public CloseSession_args deepCopy() { - return new CloseSession_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TCloseSessionReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TCloseSessionReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCloseSessionReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CloseSession_args) - return this.equals((CloseSession_args)that); - return false; - } - - public boolean equals(CloseSession_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CloseSession_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_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, java.lang.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 CloseSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseSession_argsStandardScheme getScheme() { - return new CloseSession_argsStandardScheme(); - } - } - - private static class CloseSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_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 TCloseSessionReq(); - 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, CloseSession_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 CloseSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseSession_argsTupleScheme getScheme() { - return new CloseSession_argsTupleScheme(); - } - } - - private static class CloseSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CloseSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCloseSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseSession_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseSession_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCloseSessionResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseSessionResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_result.class, metaDataMap); - } - - public CloseSession_result() { - } - - public CloseSession_result( - TCloseSessionResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CloseSession_result(CloseSession_result other) { - if (other.isSetSuccess()) { - this.success = new TCloseSessionResp(other.success); - } - } - - public CloseSession_result deepCopy() { - return new CloseSession_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TCloseSessionResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseSessionResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCloseSessionResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CloseSession_result) - return this.equals((CloseSession_result)that); - return false; - } - - public boolean equals(CloseSession_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CloseSession_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_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, java.lang.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 CloseSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseSession_resultStandardScheme getScheme() { - return new CloseSession_resultStandardScheme(); - } - } - - private static class CloseSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_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 TCloseSessionResp(); - 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, CloseSession_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 CloseSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseSession_resultTupleScheme getScheme() { - return new CloseSession_resultTupleScheme(); - } - } - - private static class CloseSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CloseSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCloseSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetInfo_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetInfo_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetInfoReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetInfoReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_args.class, metaDataMap); - } - - public GetInfo_args() { - } - - public GetInfo_args( - TGetInfoReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetInfo_args(GetInfo_args other) { - if (other.isSetReq()) { - this.req = new TGetInfoReq(other.req); - } - } - - public GetInfo_args deepCopy() { - return new GetInfo_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetInfoReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetInfoReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetInfoReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetInfo_args) - return this.equals((GetInfo_args)that); - return false; - } - - public boolean equals(GetInfo_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_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, java.lang.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 GetInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetInfo_argsStandardScheme getScheme() { - return new GetInfo_argsStandardScheme(); - } - } - - private static class GetInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_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 TGetInfoReq(); - 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, GetInfo_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 GetInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetInfo_argsTupleScheme getScheme() { - return new GetInfo_argsTupleScheme(); - } - } - - private static class GetInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetInfo_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetInfo_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetInfoResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetInfoResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_result.class, metaDataMap); - } - - public GetInfo_result() { - } - - public GetInfo_result( - TGetInfoResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetInfo_result(GetInfo_result other) { - if (other.isSetSuccess()) { - this.success = new TGetInfoResp(other.success); - } - } - - public GetInfo_result deepCopy() { - return new GetInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetInfoResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetInfoResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetInfoResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetInfo_result) - return this.equals((GetInfo_result)that); - return false; - } - - public boolean equals(GetInfo_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_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, java.lang.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 GetInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetInfo_resultStandardScheme getScheme() { - return new GetInfo_resultStandardScheme(); - } - } - - private static class GetInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_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 TGetInfoResp(); - 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, GetInfo_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 GetInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetInfo_resultTupleScheme getScheme() { - return new GetInfo_resultTupleScheme(); - } - } - - private static class GetInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExecuteStatement_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExecuteStatement_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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 = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_args.class, metaDataMap); - } - - public ExecuteStatement_args() { - } - - public ExecuteStatement_args( - TExecuteStatementReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public ExecuteStatement_args(ExecuteStatement_args other) { - if (other.isSetReq()) { - this.req = new TExecuteStatementReq(other.req); - } - } - - public ExecuteStatement_args deepCopy() { - return new ExecuteStatement_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TExecuteStatementReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TExecuteStatementReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof ExecuteStatement_args) - return this.equals((ExecuteStatement_args)that); - return false; - } - - public boolean equals(ExecuteStatement_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(ExecuteStatement_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_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, java.lang.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 ExecuteStatement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public ExecuteStatement_argsStandardScheme getScheme() { - return new ExecuteStatement_argsStandardScheme(); - } - } - - private static class ExecuteStatement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_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, ExecuteStatement_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 ExecuteStatement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public ExecuteStatement_argsTupleScheme getScheme() { - return new ExecuteStatement_argsTupleScheme(); - } - } - - private static class ExecuteStatement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, ExecuteStatement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TExecuteStatementReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExecuteStatement_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExecuteStatement_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TExecuteStatementResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TExecuteStatementResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_result.class, metaDataMap); - } - - public ExecuteStatement_result() { - } - - public ExecuteStatement_result( - TExecuteStatementResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public ExecuteStatement_result(ExecuteStatement_result other) { - if (other.isSetSuccess()) { - this.success = new TExecuteStatementResp(other.success); - } - } - - public ExecuteStatement_result deepCopy() { - return new ExecuteStatement_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TExecuteStatementResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TExecuteStatementResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TExecuteStatementResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof ExecuteStatement_result) - return this.equals((ExecuteStatement_result)that); - return false; - } - - public boolean equals(ExecuteStatement_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(ExecuteStatement_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_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, java.lang.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 ExecuteStatement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public ExecuteStatement_resultStandardScheme getScheme() { - return new ExecuteStatement_resultStandardScheme(); - } - } - - private static class ExecuteStatement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_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 TExecuteStatementResp(); - 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, ExecuteStatement_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 ExecuteStatement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public ExecuteStatement_resultTupleScheme getScheme() { - return new ExecuteStatement_resultTupleScheme(); - } - } - - private static class ExecuteStatement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, ExecuteStatement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TExecuteStatementResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTypeInfo_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTypeInfo_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetTypeInfoReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTypeInfoReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_args.class, metaDataMap); - } - - public GetTypeInfo_args() { - } - - public GetTypeInfo_args( - TGetTypeInfoReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTypeInfo_args(GetTypeInfo_args other) { - if (other.isSetReq()) { - this.req = new TGetTypeInfoReq(other.req); - } - } - - public GetTypeInfo_args deepCopy() { - return new GetTypeInfo_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetTypeInfoReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetTypeInfoReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTypeInfoReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetTypeInfo_args) - return this.equals((GetTypeInfo_args)that); - return false; - } - - public boolean equals(GetTypeInfo_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetTypeInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_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, java.lang.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 GetTypeInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTypeInfo_argsStandardScheme getScheme() { - return new GetTypeInfo_argsStandardScheme(); - } - } - - private static class GetTypeInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_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 TGetTypeInfoReq(); - 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, GetTypeInfo_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 GetTypeInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTypeInfo_argsTupleScheme getScheme() { - return new GetTypeInfo_argsTupleScheme(); - } - } - - private static class GetTypeInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetTypeInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTypeInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTypeInfo_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTypeInfo_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetTypeInfoResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTypeInfoResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_result.class, metaDataMap); - } - - public GetTypeInfo_result() { - } - - public GetTypeInfo_result( - TGetTypeInfoResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTypeInfo_result(GetTypeInfo_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTypeInfoResp(other.success); - } - } - - public GetTypeInfo_result deepCopy() { - return new GetTypeInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetTypeInfoResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTypeInfoResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTypeInfoResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetTypeInfo_result) - return this.equals((GetTypeInfo_result)that); - return false; - } - - public boolean equals(GetTypeInfo_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetTypeInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_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, java.lang.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 GetTypeInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTypeInfo_resultStandardScheme getScheme() { - return new GetTypeInfo_resultStandardScheme(); - } - } - - private static class GetTypeInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_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 TGetTypeInfoResp(); - 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, GetTypeInfo_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 GetTypeInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTypeInfo_resultTupleScheme getScheme() { - return new GetTypeInfo_resultTupleScheme(); - } - } - - private static class GetTypeInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetTypeInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTypeInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCatalogs_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCatalogs_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetCatalogsReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCatalogsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_args.class, metaDataMap); - } - - public GetCatalogs_args() { - } - - public GetCatalogs_args( - TGetCatalogsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetCatalogs_args(GetCatalogs_args other) { - if (other.isSetReq()) { - this.req = new TGetCatalogsReq(other.req); - } - } - - public GetCatalogs_args deepCopy() { - return new GetCatalogs_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetCatalogsReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetCatalogsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetCatalogsReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetCatalogs_args) - return this.equals((GetCatalogs_args)that); - return false; - } - - public boolean equals(GetCatalogs_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetCatalogs_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_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, java.lang.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 GetCatalogs_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCatalogs_argsStandardScheme getScheme() { - return new GetCatalogs_argsStandardScheme(); - } - } - - private static class GetCatalogs_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_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 TGetCatalogsReq(); - 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, GetCatalogs_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 GetCatalogs_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCatalogs_argsTupleScheme getScheme() { - return new GetCatalogs_argsTupleScheme(); - } - } - - private static class GetCatalogs_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetCatalogs_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetCatalogsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCatalogs_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCatalogs_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetCatalogsResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCatalogsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_result.class, metaDataMap); - } - - public GetCatalogs_result() { - } - - public GetCatalogs_result( - TGetCatalogsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetCatalogs_result(GetCatalogs_result other) { - if (other.isSetSuccess()) { - this.success = new TGetCatalogsResp(other.success); - } - } - - public GetCatalogs_result deepCopy() { - return new GetCatalogs_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetCatalogsResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCatalogsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetCatalogsResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetCatalogs_result) - return this.equals((GetCatalogs_result)that); - return false; - } - - public boolean equals(GetCatalogs_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetCatalogs_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_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, java.lang.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 GetCatalogs_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCatalogs_resultStandardScheme getScheme() { - return new GetCatalogs_resultStandardScheme(); - } - } - - private static class GetCatalogs_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_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 TGetCatalogsResp(); - 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, GetCatalogs_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 GetCatalogs_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCatalogs_resultTupleScheme getScheme() { - return new GetCatalogs_resultTupleScheme(); - } - } - - private static class GetCatalogs_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetCatalogs_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetCatalogsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetSchemas_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetSchemas_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetSchemasReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetSchemasReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_args.class, metaDataMap); - } - - public GetSchemas_args() { - } - - public GetSchemas_args( - TGetSchemasReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetSchemas_args(GetSchemas_args other) { - if (other.isSetReq()) { - this.req = new TGetSchemasReq(other.req); - } - } - - public GetSchemas_args deepCopy() { - return new GetSchemas_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetSchemasReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetSchemasReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetSchemasReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetSchemas_args) - return this.equals((GetSchemas_args)that); - return false; - } - - public boolean equals(GetSchemas_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetSchemas_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_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, java.lang.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 GetSchemas_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetSchemas_argsStandardScheme getScheme() { - return new GetSchemas_argsStandardScheme(); - } - } - - private static class GetSchemas_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_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 TGetSchemasReq(); - 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, GetSchemas_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 GetSchemas_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetSchemas_argsTupleScheme getScheme() { - return new GetSchemas_argsTupleScheme(); - } - } - - private static class GetSchemas_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetSchemas_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetSchemasReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetSchemas_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetSchemas_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetSchemasResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetSchemasResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_result.class, metaDataMap); - } - - public GetSchemas_result() { - } - - public GetSchemas_result( - TGetSchemasResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetSchemas_result(GetSchemas_result other) { - if (other.isSetSuccess()) { - this.success = new TGetSchemasResp(other.success); - } - } - - public GetSchemas_result deepCopy() { - return new GetSchemas_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetSchemasResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetSchemasResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetSchemasResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetSchemas_result) - return this.equals((GetSchemas_result)that); - return false; - } - - public boolean equals(GetSchemas_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetSchemas_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_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, java.lang.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 GetSchemas_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetSchemas_resultStandardScheme getScheme() { - return new GetSchemas_resultStandardScheme(); - } - } - - private static class GetSchemas_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_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 TGetSchemasResp(); - 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, GetSchemas_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 GetSchemas_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetSchemas_resultTupleScheme getScheme() { - return new GetSchemas_resultTupleScheme(); - } - } - - private static class GetSchemas_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetSchemas_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetSchemasResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTables_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTables_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetTablesReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTablesReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_args.class, metaDataMap); - } - - public GetTables_args() { - } - - public GetTables_args( - TGetTablesReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTables_args(GetTables_args other) { - if (other.isSetReq()) { - this.req = new TGetTablesReq(other.req); - } - } - - public GetTables_args deepCopy() { - return new GetTables_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetTablesReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetTablesReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTablesReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetTables_args) - return this.equals((GetTables_args)that); - return false; - } - - public boolean equals(GetTables_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetTables_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_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, java.lang.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 GetTables_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTables_argsStandardScheme getScheme() { - return new GetTables_argsStandardScheme(); - } - } - - private static class GetTables_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_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 TGetTablesReq(); - 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, GetTables_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 GetTables_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTables_argsTupleScheme getScheme() { - return new GetTables_argsTupleScheme(); - } - } - - private static class GetTables_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetTables_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTablesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTables_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTables_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetTablesResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTablesResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_result.class, metaDataMap); - } - - public GetTables_result() { - } - - public GetTables_result( - TGetTablesResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTables_result(GetTables_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTablesResp(other.success); - } - } - - public GetTables_result deepCopy() { - return new GetTables_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetTablesResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTablesResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTablesResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetTables_result) - return this.equals((GetTables_result)that); - return false; - } - - public boolean equals(GetTables_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetTables_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_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, java.lang.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 GetTables_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTables_resultStandardScheme getScheme() { - return new GetTables_resultStandardScheme(); - } - } - - private static class GetTables_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_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 TGetTablesResp(); - 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, GetTables_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 GetTables_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTables_resultTupleScheme getScheme() { - return new GetTables_resultTupleScheme(); - } - } - - private static class GetTables_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetTables_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTablesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTableTypes_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTableTypes_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetTableTypesReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTableTypesReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_args.class, metaDataMap); - } - - public GetTableTypes_args() { - } - - public GetTableTypes_args( - TGetTableTypesReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTableTypes_args(GetTableTypes_args other) { - if (other.isSetReq()) { - this.req = new TGetTableTypesReq(other.req); - } - } - - public GetTableTypes_args deepCopy() { - return new GetTableTypes_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetTableTypesReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetTableTypesReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTableTypesReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetTableTypes_args) - return this.equals((GetTableTypes_args)that); - return false; - } - - public boolean equals(GetTableTypes_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetTableTypes_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_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, java.lang.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 GetTableTypes_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTableTypes_argsStandardScheme getScheme() { - return new GetTableTypes_argsStandardScheme(); - } - } - - private static class GetTableTypes_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_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 TGetTableTypesReq(); - 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, GetTableTypes_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 GetTableTypes_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTableTypes_argsTupleScheme getScheme() { - return new GetTableTypes_argsTupleScheme(); - } - } - - private static class GetTableTypes_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetTableTypes_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTableTypesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTableTypes_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTableTypes_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetTableTypesResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTableTypesResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_result.class, metaDataMap); - } - - public GetTableTypes_result() { - } - - public GetTableTypes_result( - TGetTableTypesResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTableTypes_result(GetTableTypes_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTableTypesResp(other.success); - } - } - - public GetTableTypes_result deepCopy() { - return new GetTableTypes_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetTableTypesResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTableTypesResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTableTypesResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetTableTypes_result) - return this.equals((GetTableTypes_result)that); - return false; - } - - public boolean equals(GetTableTypes_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetTableTypes_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_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, java.lang.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 GetTableTypes_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTableTypes_resultStandardScheme getScheme() { - return new GetTableTypes_resultStandardScheme(); - } - } - - private static class GetTableTypes_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_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 TGetTableTypesResp(); - 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, GetTableTypes_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 GetTableTypes_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetTableTypes_resultTupleScheme getScheme() { - return new GetTableTypes_resultTupleScheme(); - } - } - - private static class GetTableTypes_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetTableTypes_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTableTypesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetColumns_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetColumns_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetColumnsReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetColumnsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_args.class, metaDataMap); - } - - public GetColumns_args() { - } - - public GetColumns_args( - TGetColumnsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetColumns_args(GetColumns_args other) { - if (other.isSetReq()) { - this.req = new TGetColumnsReq(other.req); - } - } - - public GetColumns_args deepCopy() { - return new GetColumns_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetColumnsReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetColumnsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetColumnsReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetColumns_args) - return this.equals((GetColumns_args)that); - return false; - } - - public boolean equals(GetColumns_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetColumns_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_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, java.lang.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 GetColumns_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetColumns_argsStandardScheme getScheme() { - return new GetColumns_argsStandardScheme(); - } - } - - private static class GetColumns_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_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 TGetColumnsReq(); - 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, GetColumns_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 GetColumns_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetColumns_argsTupleScheme getScheme() { - return new GetColumns_argsTupleScheme(); - } - } - - private static class GetColumns_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetColumns_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetColumnsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetColumns_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetColumns_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetColumnsResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetColumnsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_result.class, metaDataMap); - } - - public GetColumns_result() { - } - - public GetColumns_result( - TGetColumnsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetColumns_result(GetColumns_result other) { - if (other.isSetSuccess()) { - this.success = new TGetColumnsResp(other.success); - } - } - - public GetColumns_result deepCopy() { - return new GetColumns_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetColumnsResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetColumnsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetColumnsResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetColumns_result) - return this.equals((GetColumns_result)that); - return false; - } - - public boolean equals(GetColumns_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetColumns_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_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, java.lang.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 GetColumns_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetColumns_resultStandardScheme getScheme() { - return new GetColumns_resultStandardScheme(); - } - } - - private static class GetColumns_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_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 TGetColumnsResp(); - 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, GetColumns_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 GetColumns_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetColumns_resultTupleScheme getScheme() { - return new GetColumns_resultTupleScheme(); - } - } - - private static class GetColumns_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetColumns_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetColumnsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetFunctions_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetFunctions_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetFunctionsReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetFunctionsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_args.class, metaDataMap); - } - - public GetFunctions_args() { - } - - public GetFunctions_args( - TGetFunctionsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetFunctions_args(GetFunctions_args other) { - if (other.isSetReq()) { - this.req = new TGetFunctionsReq(other.req); - } - } - - public GetFunctions_args deepCopy() { - return new GetFunctions_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetFunctionsReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetFunctionsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetFunctionsReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetFunctions_args) - return this.equals((GetFunctions_args)that); - return false; - } - - public boolean equals(GetFunctions_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetFunctions_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_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, java.lang.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 GetFunctions_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetFunctions_argsStandardScheme getScheme() { - return new GetFunctions_argsStandardScheme(); - } - } - - private static class GetFunctions_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_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 TGetFunctionsReq(); - 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, GetFunctions_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 GetFunctions_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetFunctions_argsTupleScheme getScheme() { - return new GetFunctions_argsTupleScheme(); - } - } - - private static class GetFunctions_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetFunctions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetFunctionsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetFunctions_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetFunctions_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetFunctionsResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetFunctionsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_result.class, metaDataMap); - } - - public GetFunctions_result() { - } - - public GetFunctions_result( - TGetFunctionsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetFunctions_result(GetFunctions_result other) { - if (other.isSetSuccess()) { - this.success = new TGetFunctionsResp(other.success); - } - } - - public GetFunctions_result deepCopy() { - return new GetFunctions_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetFunctionsResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetFunctionsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetFunctionsResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetFunctions_result) - return this.equals((GetFunctions_result)that); - return false; - } - - public boolean equals(GetFunctions_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetFunctions_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_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, java.lang.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 GetFunctions_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetFunctions_resultStandardScheme getScheme() { - return new GetFunctions_resultStandardScheme(); - } - } - - private static class GetFunctions_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_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 TGetFunctionsResp(); - 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, GetFunctions_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 GetFunctions_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetFunctions_resultTupleScheme getScheme() { - return new GetFunctions_resultTupleScheme(); - } - } - - private static class GetFunctions_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetFunctions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetFunctionsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetPrimaryKeys_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetPrimaryKeys_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetPrimaryKeysReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_args.class, metaDataMap); - } - - public GetPrimaryKeys_args() { - } - - public GetPrimaryKeys_args( - TGetPrimaryKeysReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetPrimaryKeys_args(GetPrimaryKeys_args other) { - if (other.isSetReq()) { - this.req = new TGetPrimaryKeysReq(other.req); - } - } - - public GetPrimaryKeys_args deepCopy() { - return new GetPrimaryKeys_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetPrimaryKeysReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetPrimaryKeysReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetPrimaryKeys_args) - return this.equals((GetPrimaryKeys_args)that); - return false; - } - - public boolean equals(GetPrimaryKeys_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetPrimaryKeys_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_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, java.lang.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 GetPrimaryKeys_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetPrimaryKeys_argsStandardScheme getScheme() { - return new GetPrimaryKeys_argsStandardScheme(); - } - } - - private static class GetPrimaryKeys_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_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 TGetPrimaryKeysReq(); - 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, GetPrimaryKeys_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 GetPrimaryKeys_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetPrimaryKeys_argsTupleScheme getScheme() { - return new GetPrimaryKeys_argsTupleScheme(); - } - } - - private static class GetPrimaryKeys_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetPrimaryKeysReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetPrimaryKeys_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetPrimaryKeys_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetPrimaryKeysResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_result.class, metaDataMap); - } - - public GetPrimaryKeys_result() { - } - - public GetPrimaryKeys_result( - TGetPrimaryKeysResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetPrimaryKeys_result(GetPrimaryKeys_result other) { - if (other.isSetSuccess()) { - this.success = new TGetPrimaryKeysResp(other.success); - } - } - - public GetPrimaryKeys_result deepCopy() { - return new GetPrimaryKeys_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetPrimaryKeysResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetPrimaryKeysResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetPrimaryKeys_result) - return this.equals((GetPrimaryKeys_result)that); - return false; - } - - public boolean equals(GetPrimaryKeys_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetPrimaryKeys_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_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, java.lang.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 GetPrimaryKeys_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetPrimaryKeys_resultStandardScheme getScheme() { - return new GetPrimaryKeys_resultStandardScheme(); - } - } - - private static class GetPrimaryKeys_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_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 TGetPrimaryKeysResp(); - 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, GetPrimaryKeys_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 GetPrimaryKeys_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetPrimaryKeys_resultTupleScheme getScheme() { - return new GetPrimaryKeys_resultTupleScheme(); - } - } - - private static class GetPrimaryKeys_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetPrimaryKeysResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetCrossReference_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCrossReference_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCrossReference_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetCrossReferenceReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCrossReferenceReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_args.class, metaDataMap); - } - - public GetCrossReference_args() { - } - - public GetCrossReference_args( - TGetCrossReferenceReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetCrossReference_args(GetCrossReference_args other) { - if (other.isSetReq()) { - this.req = new TGetCrossReferenceReq(other.req); - } - } - - public GetCrossReference_args deepCopy() { - return new GetCrossReference_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetCrossReferenceReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetCrossReferenceReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetCrossReferenceReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetCrossReference_args) - return this.equals((GetCrossReference_args)that); - return false; - } - - public boolean equals(GetCrossReference_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetCrossReference_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_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, java.lang.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 GetCrossReference_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCrossReference_argsStandardScheme getScheme() { - return new GetCrossReference_argsStandardScheme(); - } - } - - private static class GetCrossReference_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_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 TGetCrossReferenceReq(); - 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, GetCrossReference_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 GetCrossReference_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCrossReference_argsTupleScheme getScheme() { - return new GetCrossReference_argsTupleScheme(); - } - } - - private static class GetCrossReference_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetCrossReference_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetCrossReferenceReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetCrossReference_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCrossReference_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCrossReference_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetCrossReferenceResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCrossReferenceResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_result.class, metaDataMap); - } - - public GetCrossReference_result() { - } - - public GetCrossReference_result( - TGetCrossReferenceResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetCrossReference_result(GetCrossReference_result other) { - if (other.isSetSuccess()) { - this.success = new TGetCrossReferenceResp(other.success); - } - } - - public GetCrossReference_result deepCopy() { - return new GetCrossReference_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetCrossReferenceResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCrossReferenceResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetCrossReferenceResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetCrossReference_result) - return this.equals((GetCrossReference_result)that); - return false; - } - - public boolean equals(GetCrossReference_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetCrossReference_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_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, java.lang.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 GetCrossReference_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCrossReference_resultStandardScheme getScheme() { - return new GetCrossReference_resultStandardScheme(); - } - } - - private static class GetCrossReference_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_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 TGetCrossReferenceResp(); - 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, GetCrossReference_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 GetCrossReference_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetCrossReference_resultTupleScheme getScheme() { - return new GetCrossReference_resultTupleScheme(); - } - } - - private static class GetCrossReference_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetCrossReference_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetCrossReferenceResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetOperationStatus_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetOperationStatus_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetOperationStatusReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetOperationStatusReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_args.class, metaDataMap); - } - - public GetOperationStatus_args() { - } - - public GetOperationStatus_args( - TGetOperationStatusReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetOperationStatus_args(GetOperationStatus_args other) { - if (other.isSetReq()) { - this.req = new TGetOperationStatusReq(other.req); - } - } - - public GetOperationStatus_args deepCopy() { - return new GetOperationStatus_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetOperationStatusReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetOperationStatusReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetOperationStatusReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetOperationStatus_args) - return this.equals((GetOperationStatus_args)that); - return false; - } - - public boolean equals(GetOperationStatus_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetOperationStatus_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_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, java.lang.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 GetOperationStatus_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetOperationStatus_argsStandardScheme getScheme() { - return new GetOperationStatus_argsStandardScheme(); - } - } - - private static class GetOperationStatus_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_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 TGetOperationStatusReq(); - 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, GetOperationStatus_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 GetOperationStatus_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetOperationStatus_argsTupleScheme getScheme() { - return new GetOperationStatus_argsTupleScheme(); - } - } - - private static class GetOperationStatus_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetOperationStatus_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetOperationStatusReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetOperationStatus_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetOperationStatus_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetOperationStatusResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetOperationStatusResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_result.class, metaDataMap); - } - - public GetOperationStatus_result() { - } - - public GetOperationStatus_result( - TGetOperationStatusResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetOperationStatus_result(GetOperationStatus_result other) { - if (other.isSetSuccess()) { - this.success = new TGetOperationStatusResp(other.success); - } - } - - public GetOperationStatus_result deepCopy() { - return new GetOperationStatus_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetOperationStatusResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetOperationStatusResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetOperationStatusResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetOperationStatus_result) - return this.equals((GetOperationStatus_result)that); - return false; - } - - public boolean equals(GetOperationStatus_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetOperationStatus_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_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, java.lang.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 GetOperationStatus_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetOperationStatus_resultStandardScheme getScheme() { - return new GetOperationStatus_resultStandardScheme(); - } - } - - private static class GetOperationStatus_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_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 TGetOperationStatusResp(); - 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, GetOperationStatus_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 GetOperationStatus_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetOperationStatus_resultTupleScheme getScheme() { - return new GetOperationStatus_resultTupleScheme(); - } - } - - private static class GetOperationStatus_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetOperationStatus_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetOperationStatusResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelOperation_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelOperation_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCancelOperationReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelOperationReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_args.class, metaDataMap); - } - - public CancelOperation_args() { - } - - public CancelOperation_args( - TCancelOperationReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CancelOperation_args(CancelOperation_args other) { - if (other.isSetReq()) { - this.req = new TCancelOperationReq(other.req); - } - } - - public CancelOperation_args deepCopy() { - return new CancelOperation_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TCancelOperationReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TCancelOperationReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCancelOperationReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CancelOperation_args) - return this.equals((CancelOperation_args)that); - return false; - } - - public boolean equals(CancelOperation_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CancelOperation_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_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, java.lang.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 CancelOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelOperation_argsStandardScheme getScheme() { - return new CancelOperation_argsStandardScheme(); - } - } - - private static class CancelOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_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 TCancelOperationReq(); - 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, CancelOperation_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 CancelOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelOperation_argsTupleScheme getScheme() { - return new CancelOperation_argsTupleScheme(); - } - } - - private static class CancelOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CancelOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCancelOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelOperation_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelOperation_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCancelOperationResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelOperationResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_result.class, metaDataMap); - } - - public CancelOperation_result() { - } - - public CancelOperation_result( - TCancelOperationResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CancelOperation_result(CancelOperation_result other) { - if (other.isSetSuccess()) { - this.success = new TCancelOperationResp(other.success); - } - } - - public CancelOperation_result deepCopy() { - return new CancelOperation_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TCancelOperationResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelOperationResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCancelOperationResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CancelOperation_result) - return this.equals((CancelOperation_result)that); - return false; - } - - public boolean equals(CancelOperation_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CancelOperation_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_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, java.lang.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 CancelOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelOperation_resultStandardScheme getScheme() { - return new CancelOperation_resultStandardScheme(); - } - } - - private static class CancelOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_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 TCancelOperationResp(); - 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, CancelOperation_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 CancelOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelOperation_resultTupleScheme getScheme() { - return new CancelOperation_resultTupleScheme(); - } - } - - private static class CancelOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CancelOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCancelOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseOperation_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseOperation_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCloseOperationReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseOperationReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_args.class, metaDataMap); - } - - public CloseOperation_args() { - } - - public CloseOperation_args( - TCloseOperationReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CloseOperation_args(CloseOperation_args other) { - if (other.isSetReq()) { - this.req = new TCloseOperationReq(other.req); - } - } - - public CloseOperation_args deepCopy() { - return new CloseOperation_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TCloseOperationReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TCloseOperationReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCloseOperationReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CloseOperation_args) - return this.equals((CloseOperation_args)that); - return false; - } - - public boolean equals(CloseOperation_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CloseOperation_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_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, java.lang.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 CloseOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseOperation_argsStandardScheme getScheme() { - return new CloseOperation_argsStandardScheme(); - } - } - - private static class CloseOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_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 TCloseOperationReq(); - 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, CloseOperation_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 CloseOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseOperation_argsTupleScheme getScheme() { - return new CloseOperation_argsTupleScheme(); - } - } - - private static class CloseOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CloseOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCloseOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseOperation_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseOperation_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCloseOperationResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseOperationResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_result.class, metaDataMap); - } - - public CloseOperation_result() { - } - - public CloseOperation_result( - TCloseOperationResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CloseOperation_result(CloseOperation_result other) { - if (other.isSetSuccess()) { - this.success = new TCloseOperationResp(other.success); - } - } - - public CloseOperation_result deepCopy() { - return new CloseOperation_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TCloseOperationResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseOperationResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCloseOperationResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CloseOperation_result) - return this.equals((CloseOperation_result)that); - return false; - } - - public boolean equals(CloseOperation_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CloseOperation_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_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, java.lang.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 CloseOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseOperation_resultStandardScheme getScheme() { - return new CloseOperation_resultStandardScheme(); - } - } - - private static class CloseOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_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 TCloseOperationResp(); - 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, CloseOperation_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 CloseOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CloseOperation_resultTupleScheme getScheme() { - return new CloseOperation_resultTupleScheme(); - } - } - - private static class CloseOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CloseOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCloseOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetResultSetMetadataReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_args.class, metaDataMap); - } - - public GetResultSetMetadata_args() { - } - - public GetResultSetMetadata_args( - TGetResultSetMetadataReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetResultSetMetadata_args(GetResultSetMetadata_args other) { - if (other.isSetReq()) { - this.req = new TGetResultSetMetadataReq(other.req); - } - } - - public GetResultSetMetadata_args deepCopy() { - return new GetResultSetMetadata_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetResultSetMetadataReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetResultSetMetadataReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetResultSetMetadata_args) - return this.equals((GetResultSetMetadata_args)that); - return false; - } - - public boolean equals(GetResultSetMetadata_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetResultSetMetadata_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_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, java.lang.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 GetResultSetMetadata_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetResultSetMetadata_argsStandardScheme getScheme() { - return new GetResultSetMetadata_argsStandardScheme(); - } - } - - private static class GetResultSetMetadata_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_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 TGetResultSetMetadataReq(); - 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, GetResultSetMetadata_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 GetResultSetMetadata_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetResultSetMetadata_argsTupleScheme getScheme() { - return new GetResultSetMetadata_argsTupleScheme(); - } - } - - private static class GetResultSetMetadata_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetResultSetMetadataReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetResultSetMetadataResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_result.class, metaDataMap); - } - - public GetResultSetMetadata_result() { - } - - public GetResultSetMetadata_result( - TGetResultSetMetadataResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetResultSetMetadata_result(GetResultSetMetadata_result other) { - if (other.isSetSuccess()) { - this.success = new TGetResultSetMetadataResp(other.success); - } - } - - public GetResultSetMetadata_result deepCopy() { - return new GetResultSetMetadata_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetResultSetMetadataResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetResultSetMetadataResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetResultSetMetadata_result) - return this.equals((GetResultSetMetadata_result)that); - return false; - } - - public boolean equals(GetResultSetMetadata_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetResultSetMetadata_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_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, java.lang.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 GetResultSetMetadata_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetResultSetMetadata_resultStandardScheme getScheme() { - return new GetResultSetMetadata_resultStandardScheme(); - } - } - - private static class GetResultSetMetadata_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_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 TGetResultSetMetadataResp(); - 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, GetResultSetMetadata_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 GetResultSetMetadata_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetResultSetMetadata_resultTupleScheme getScheme() { - return new GetResultSetMetadata_resultTupleScheme(); - } - } - - private static class GetResultSetMetadata_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetResultSetMetadataResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FetchResults_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FetchResults_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TFetchResultsReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TFetchResultsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_args.class, metaDataMap); - } - - public FetchResults_args() { - } - - public FetchResults_args( - TFetchResultsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public FetchResults_args(FetchResults_args other) { - if (other.isSetReq()) { - this.req = new TFetchResultsReq(other.req); - } - } - - public FetchResults_args deepCopy() { - return new FetchResults_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TFetchResultsReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TFetchResultsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TFetchResultsReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof FetchResults_args) - return this.equals((FetchResults_args)that); - return false; - } - - public boolean equals(FetchResults_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(FetchResults_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_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, java.lang.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 FetchResults_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public FetchResults_argsStandardScheme getScheme() { - return new FetchResults_argsStandardScheme(); - } - } - - private static class FetchResults_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_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 TFetchResultsReq(); - 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, FetchResults_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 FetchResults_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public FetchResults_argsTupleScheme getScheme() { - return new FetchResults_argsTupleScheme(); - } - } - - private static class FetchResults_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, FetchResults_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TFetchResultsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FetchResults_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FetchResults_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TFetchResultsResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TFetchResultsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_result.class, metaDataMap); - } - - public FetchResults_result() { - } - - public FetchResults_result( - TFetchResultsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public FetchResults_result(FetchResults_result other) { - if (other.isSetSuccess()) { - this.success = new TFetchResultsResp(other.success); - } - } - - public FetchResults_result deepCopy() { - return new FetchResults_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TFetchResultsResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TFetchResultsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TFetchResultsResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof FetchResults_result) - return this.equals((FetchResults_result)that); - return false; - } - - public boolean equals(FetchResults_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(FetchResults_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_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, java.lang.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 FetchResults_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public FetchResults_resultStandardScheme getScheme() { - return new FetchResults_resultStandardScheme(); - } - } - - private static class FetchResults_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_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 TFetchResultsResp(); - 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, FetchResults_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 FetchResults_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public FetchResults_resultTupleScheme getScheme() { - return new FetchResults_resultTupleScheme(); - } - } - - private static class FetchResults_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, FetchResults_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TFetchResultsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetDelegationToken_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetDelegationToken_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetDelegationTokenReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_args.class, metaDataMap); - } - - public GetDelegationToken_args() { - } - - public GetDelegationToken_args( - TGetDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetDelegationToken_args(GetDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TGetDelegationTokenReq(other.req); - } - } - - public GetDelegationToken_args deepCopy() { - return new GetDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetDelegationTokenReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetDelegationTokenReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetDelegationToken_args) - return this.equals((GetDelegationToken_args)that); - return false; - } - - public boolean equals(GetDelegationToken_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_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, java.lang.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 GetDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetDelegationToken_argsStandardScheme getScheme() { - return new GetDelegationToken_argsStandardScheme(); - } - } - - private static class GetDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_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 TGetDelegationTokenReq(); - 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, GetDelegationToken_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 GetDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetDelegationToken_argsTupleScheme getScheme() { - return new GetDelegationToken_argsTupleScheme(); - } - } - - private static class GetDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetDelegationToken_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetDelegationToken_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetDelegationTokenResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_result.class, metaDataMap); - } - - public GetDelegationToken_result() { - } - - public GetDelegationToken_result( - TGetDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetDelegationToken_result(GetDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TGetDelegationTokenResp(other.success); - } - } - - public GetDelegationToken_result deepCopy() { - return new GetDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetDelegationTokenResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetDelegationTokenResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetDelegationToken_result) - return this.equals((GetDelegationToken_result)that); - return false; - } - - public boolean equals(GetDelegationToken_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_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, java.lang.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 GetDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetDelegationToken_resultStandardScheme getScheme() { - return new GetDelegationToken_resultStandardScheme(); - } - } - - private static class GetDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_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 TGetDelegationTokenResp(); - 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, GetDelegationToken_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 GetDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetDelegationToken_resultTupleScheme getScheme() { - return new GetDelegationToken_resultTupleScheme(); - } - } - - private static class GetDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelDelegationTokenReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_args.class, metaDataMap); - } - - public CancelDelegationToken_args() { - } - - public CancelDelegationToken_args( - TCancelDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CancelDelegationToken_args(CancelDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TCancelDelegationTokenReq(other.req); - } - } - - public CancelDelegationToken_args deepCopy() { - return new CancelDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TCancelDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCancelDelegationTokenReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CancelDelegationToken_args) - return this.equals((CancelDelegationToken_args)that); - return false; - } - - public boolean equals(CancelDelegationToken_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CancelDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_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, java.lang.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 CancelDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelDelegationToken_argsStandardScheme getScheme() { - return new CancelDelegationToken_argsStandardScheme(); - } - } - - private static class CancelDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_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 TCancelDelegationTokenReq(); - 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, CancelDelegationToken_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 CancelDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelDelegationToken_argsTupleScheme getScheme() { - return new CancelDelegationToken_argsTupleScheme(); - } - } - - private static class CancelDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCancelDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelDelegationTokenResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_result.class, metaDataMap); - } - - public CancelDelegationToken_result() { - } - - public CancelDelegationToken_result( - TCancelDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CancelDelegationToken_result(CancelDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TCancelDelegationTokenResp(other.success); - } - } - - public CancelDelegationToken_result deepCopy() { - return new CancelDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TCancelDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCancelDelegationTokenResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof CancelDelegationToken_result) - return this.equals((CancelDelegationToken_result)that); - return false; - } - - public boolean equals(CancelDelegationToken_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(CancelDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_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, java.lang.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 CancelDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelDelegationToken_resultStandardScheme getScheme() { - return new CancelDelegationToken_resultStandardScheme(); - } - } - - private static class CancelDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_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 TCancelDelegationTokenResp(); - 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, CancelDelegationToken_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 CancelDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public CancelDelegationToken_resultTupleScheme getScheme() { - return new CancelDelegationToken_resultTupleScheme(); - } - } - - private static class CancelDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCancelDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TRenewDelegationTokenReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_args.class, metaDataMap); - } - - public RenewDelegationToken_args() { - } - - public RenewDelegationToken_args( - TRenewDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public RenewDelegationToken_args(RenewDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TRenewDelegationTokenReq(other.req); - } - } - - public RenewDelegationToken_args deepCopy() { - return new RenewDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TRenewDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TRenewDelegationTokenReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof RenewDelegationToken_args) - return this.equals((RenewDelegationToken_args)that); - return false; - } - - public boolean equals(RenewDelegationToken_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(RenewDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_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, java.lang.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 RenewDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public RenewDelegationToken_argsStandardScheme getScheme() { - return new RenewDelegationToken_argsStandardScheme(); - } - } - - private static class RenewDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_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 TRenewDelegationTokenReq(); - 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, RenewDelegationToken_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 RenewDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public RenewDelegationToken_argsTupleScheme getScheme() { - return new RenewDelegationToken_argsTupleScheme(); - } - } - - private static class RenewDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TRenewDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TRenewDelegationTokenResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_result.class, metaDataMap); - } - - public RenewDelegationToken_result() { - } - - public RenewDelegationToken_result( - TRenewDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public RenewDelegationToken_result(RenewDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TRenewDelegationTokenResp(other.success); - } - } - - public RenewDelegationToken_result deepCopy() { - return new RenewDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TRenewDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TRenewDelegationTokenResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof RenewDelegationToken_result) - return this.equals((RenewDelegationToken_result)that); - return false; - } - - public boolean equals(RenewDelegationToken_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(RenewDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_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, java.lang.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 RenewDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public RenewDelegationToken_resultStandardScheme getScheme() { - return new RenewDelegationToken_resultStandardScheme(); - } - } - - private static class RenewDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_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 TRenewDelegationTokenResp(); - 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, RenewDelegationToken_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 RenewDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public RenewDelegationToken_resultTupleScheme getScheme() { - return new RenewDelegationToken_resultTupleScheme(); - } - } - - private static class RenewDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TRenewDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetQueryId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetQueryId_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetQueryId_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetQueryIdReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetQueryIdReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_args.class, metaDataMap); - } - - public GetQueryId_args() { - } - - public GetQueryId_args( - TGetQueryIdReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetQueryId_args(GetQueryId_args other) { - if (other.isSetReq()) { - this.req = new TGetQueryIdReq(other.req); - } - } - - public GetQueryId_args deepCopy() { - return new GetQueryId_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetQueryIdReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TGetQueryIdReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetQueryIdReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetQueryId_args) - return this.equals((GetQueryId_args)that); - return false; - } - - public boolean equals(GetQueryId_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetQueryId_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_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, java.lang.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 GetQueryId_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetQueryId_argsStandardScheme getScheme() { - return new GetQueryId_argsStandardScheme(); - } - } - - private static class GetQueryId_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_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 TGetQueryIdReq(); - 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, GetQueryId_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 GetQueryId_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetQueryId_argsTupleScheme getScheme() { - return new GetQueryId_argsTupleScheme(); - } - } - - private static class GetQueryId_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetQueryId_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetQueryIdReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class GetQueryId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetQueryId_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetQueryId_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TGetQueryIdResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetQueryIdResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_result.class, metaDataMap); - } - - public GetQueryId_result() { - } - - public GetQueryId_result( - TGetQueryIdResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetQueryId_result(GetQueryId_result other) { - if (other.isSetSuccess()) { - this.success = new TGetQueryIdResp(other.success); - } - } - - public GetQueryId_result deepCopy() { - return new GetQueryId_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TGetQueryIdResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetQueryIdResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetQueryIdResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof GetQueryId_result) - return this.equals((GetQueryId_result)that); - return false; - } - - public boolean equals(GetQueryId_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(GetQueryId_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_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, java.lang.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 GetQueryId_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetQueryId_resultStandardScheme getScheme() { - return new GetQueryId_resultStandardScheme(); - } - } - - private static class GetQueryId_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_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 TGetQueryIdResp(); - 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, GetQueryId_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 GetQueryId_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public GetQueryId_resultTupleScheme getScheme() { - return new GetQueryId_resultTupleScheme(); - } - } - - private static class GetQueryId_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, GetQueryId_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetQueryIdResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class SetClientInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SetClientInfo_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SetClientInfo_argsTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSetClientInfoReq 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TSetClientInfoReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_args.class, metaDataMap); - } - - public SetClientInfo_args() { - } - - public SetClientInfo_args( - TSetClientInfoReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public SetClientInfo_args(SetClientInfo_args other) { - if (other.isSetReq()) { - this.req = new TSetClientInfoReq(other.req); - } - } - - public SetClientInfo_args deepCopy() { - return new SetClientInfo_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - @org.apache.thrift.annotation.Nullable - public TSetClientInfoReq getReq() { - return this.req; - } - - public void setReq(@org.apache.thrift.annotation.Nullable TSetClientInfoReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TSetClientInfoReq)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof SetClientInfo_args) - return this.equals((SetClientInfo_args)that); - return false; - } - - public boolean equals(SetClientInfo_args that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(SetClientInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_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, java.lang.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 SetClientInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public SetClientInfo_argsStandardScheme getScheme() { - return new SetClientInfo_argsStandardScheme(); - } - } - - private static class SetClientInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_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 TSetClientInfoReq(); - 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, SetClientInfo_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 SetClientInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public SetClientInfo_argsTupleScheme getScheme() { - return new SetClientInfo_argsTupleScheme(); - } - } - - private static class SetClientInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, SetClientInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TSetClientInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - - public static class SetClientInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SetClientInfo_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SetClientInfo_resultTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSetClientInfoResp 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 java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TSetClientInfoResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_result.class, metaDataMap); - } - - public SetClientInfo_result() { - } - - public SetClientInfo_result( - TSetClientInfoResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public SetClientInfo_result(SetClientInfo_result other) { - if (other.isSetSuccess()) { - this.success = new TSetClientInfoResp(other.success); - } - } - - public SetClientInfo_result deepCopy() { - return new SetClientInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - @org.apache.thrift.annotation.Nullable - public TSetClientInfoResp getSuccess() { - return this.success; - } - - public void setSuccess(@org.apache.thrift.annotation.Nullable TSetClientInfoResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TSetClientInfoResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof SetClientInfo_result) - return this.equals((SetClientInfo_result)that); - return false; - } - - public boolean equals(SetClientInfo_result that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(SetClientInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_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, java.lang.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 SetClientInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public SetClientInfo_resultStandardScheme getScheme() { - return new SetClientInfo_resultStandardScheme(); - } - } - - private static class SetClientInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_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 TSetClientInfoResp(); - 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, SetClientInfo_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 SetClientInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public SetClientInfo_resultTupleScheme getScheme() { - return new SetClientInfo_resultTupleScheme(); - } - } - - private static class SetClientInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.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, SetClientInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TSetClientInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } - } - -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java deleted file mode 100644 index 2a46ad57531e..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCLIServiceConstants.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -public class TCLIServiceConstants { - - public static final java.util.Set PRIMITIVE_TYPES = java.util.EnumSet.noneOf(TTypeId.class); - static { - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.BOOLEAN_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.TINYINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.SMALLINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.INT_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.BIGINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.FLOAT_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.DOUBLE_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.STRING_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMP_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.BINARY_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.DECIMAL_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.NULL_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.DATE_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.VARCHAR_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.CHAR_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE); - PRIMITIVE_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE); - } - - public static final java.util.Set COMPLEX_TYPES = java.util.EnumSet.noneOf(TTypeId.class); - static { - COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.ARRAY_TYPE); - COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.MAP_TYPE); - COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.STRUCT_TYPE); - COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.UNION_TYPE); - COMPLEX_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.USER_DEFINED_TYPE); - } - - public static final java.util.Set COLLECTION_TYPES = java.util.EnumSet.noneOf(TTypeId.class); - static { - COLLECTION_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.ARRAY_TYPE); - COLLECTION_TYPES.add(org.apache.spark.service.rpc.thrift.TTypeId.MAP_TYPE); - } - - public static final java.util.Map TYPE_NAMES = new java.util.EnumMap(TTypeId.class); - static { - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.ARRAY_TYPE, "ARRAY"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.BIGINT_TYPE, "BIGINT"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.BINARY_TYPE, "BINARY"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.BOOLEAN_TYPE, "BOOLEAN"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.CHAR_TYPE, "CHAR"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.DATE_TYPE, "DATE"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.DECIMAL_TYPE, "DECIMAL"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.DOUBLE_TYPE, "DOUBLE"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.FLOAT_TYPE, "FLOAT"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.INT_TYPE, "INT"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.MAP_TYPE, "MAP"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.NULL_TYPE, "NULL"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.SMALLINT_TYPE, "SMALLINT"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.STRING_TYPE, "STRING"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.STRUCT_TYPE, "STRUCT"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE, "TIMESTAMP WITH LOCAL TIME ZONE"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.TINYINT_TYPE, "TINYINT"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.UNION_TYPE, "UNIONTYPE"); - TYPE_NAMES.put(org.apache.spark.service.rpc.thrift.TTypeId.VARCHAR_TYPE, "VARCHAR"); - } - - public static final java.lang.String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; - - public static final java.lang.String PRECISION = "precision"; - - public static final java.lang.String SCALE = "scale"; - -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java deleted file mode 100644 index c0e79e71d06f..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenReq.java +++ /dev/null @@ -1,474 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenReq"); - - 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenReq.class, metaDataMap); - } - - public TCancelDelegationTokenReq() { - } - - public TCancelDelegationTokenReq( - TSessionHandle sessionHandle, - java.lang.String delegationToken) - { - this(); - this.sessionHandle = sessionHandle; - this.delegationToken = delegationToken; - } - - /** - * Performs a deep copy on other. - */ - public TCancelDelegationTokenReq(TCancelDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TCancelDelegationTokenReq deepCopy() { - return new TCancelDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.delegationToken = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCancelDelegationTokenReq) - return this.equals((TCancelDelegationTokenReq)that); - return false; - } - - public boolean equals(TCancelDelegationTokenReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); - if (isSetDelegationToken()) - hashCode = hashCode * 8191 + delegationToken.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCancelDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenReq("); - 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("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - 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 (!isSetDelegationToken()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TCancelDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelDelegationTokenReqStandardScheme getScheme() { - return new TCancelDelegationTokenReqStandardScheme(); - } - } - - private static class TCancelDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenReq 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: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(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, TCancelDelegationTokenReq 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.delegationToken != null) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelDelegationTokenReqTupleScheme getScheme() { - return new TCancelDelegationTokenReqTupleScheme(); - } - } - - private static class TCancelDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.delegationToken); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java deleted file mode 100644 index 22b18f2aa9ca..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelDelegationTokenResp.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { - STATUS((short)1, "status"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap); - } - - public TCancelDelegationTokenResp() { - } - - public TCancelDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCancelDelegationTokenResp(TCancelDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCancelDelegationTokenResp deepCopy() { - return new TCancelDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCancelDelegationTokenResp) - return this.equals((TCancelDelegationTokenResp)that); - return false; - } - - public boolean equals(TCancelDelegationTokenResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCancelDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TCancelDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelDelegationTokenRespStandardScheme getScheme() { - return new TCancelDelegationTokenRespStandardScheme(); - } - } - - private static class TCancelDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp 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; - 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, TCancelDelegationTokenResp 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelDelegationTokenRespTupleScheme getScheme() { - return new TCancelDelegationTokenRespTupleScheme(); - } - } - - private static class TCancelDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java deleted file mode 100644 index ef0ced4ae7b0..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq"); - - 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)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable 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 { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationReq.class, metaDataMap); - } - - public TCancelOperationReq() { - } - - public TCancelOperationReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCancelOperationReq(TCancelOperationReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TCancelOperationReq deepCopy() { - return new TCancelOperationReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCancelOperationReq) - return this.equals((TCancelOperationReq)that); - return false; - } - - public boolean equals(TCancelOperationReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCancelOperationReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationReq("); - boolean first = true; - - 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 (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - 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, java.lang.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 TCancelOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelOperationReqStandardScheme getScheme() { - return new TCancelOperationReqStandardScheme(); - } - } - - private static class TCancelOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq 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: // 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, TCancelOperationReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelOperationReqTupleScheme getScheme() { - return new TCancelOperationReqTupleScheme(); - } - } - - private static class TCancelOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java deleted file mode 100644 index 5b352b3fca1a..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCancelOperationResp.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { - STATUS((short)1, "status"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationResp.class, metaDataMap); - } - - public TCancelOperationResp() { - } - - public TCancelOperationResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCancelOperationResp(TCancelOperationResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCancelOperationResp deepCopy() { - return new TCancelOperationResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCancelOperationResp) - return this.equals((TCancelOperationResp)that); - return false; - } - - public boolean equals(TCancelOperationResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCancelOperationResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TCancelOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelOperationRespStandardScheme getScheme() { - return new TCancelOperationRespStandardScheme(); - } - } - - private static class TCancelOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationResp 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; - 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, TCancelOperationResp 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCancelOperationRespTupleScheme getScheme() { - return new TCancelOperationRespTupleScheme(); - } - } - - private static class TCancelOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java deleted file mode 100644 index bcae7b3b5e9d..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationReq"); - - 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)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable 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 { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationReq.class, metaDataMap); - } - - public TCloseOperationReq() { - } - - public TCloseOperationReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCloseOperationReq(TCloseOperationReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TCloseOperationReq deepCopy() { - return new TCloseOperationReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCloseOperationReq) - return this.equals((TCloseOperationReq)that); - return false; - } - - public boolean equals(TCloseOperationReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCloseOperationReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationReq("); - boolean first = true; - - 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 (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - 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, java.lang.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 TCloseOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseOperationReqStandardScheme getScheme() { - return new TCloseOperationReqStandardScheme(); - } - } - - private static class TCloseOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationReq 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: // 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, TCloseOperationReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseOperationReqTupleScheme getScheme() { - return new TCloseOperationReqTupleScheme(); - } - } - - private static class TCloseOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java deleted file mode 100644 index da4f84aa443d..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseOperationResp.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { - STATUS((short)1, "status"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationResp.class, metaDataMap); - } - - public TCloseOperationResp() { - } - - public TCloseOperationResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCloseOperationResp(TCloseOperationResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCloseOperationResp deepCopy() { - return new TCloseOperationResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCloseOperationResp) - return this.equals((TCloseOperationResp)that); - return false; - } - - public boolean equals(TCloseOperationResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCloseOperationResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TCloseOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseOperationRespStandardScheme getScheme() { - return new TCloseOperationRespStandardScheme(); - } - } - - private static class TCloseOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationResp 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; - 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, TCloseOperationResp 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseOperationRespTupleScheme getScheme() { - return new TCloseOperationRespTupleScheme(); - } - } - - private static class TCloseOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java deleted file mode 100644 index 61d1b3b9830a..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionReq"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionReq.class, metaDataMap); - } - - public TCloseSessionReq() { - } - - public TCloseSessionReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCloseSessionReq(TCloseSessionReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TCloseSessionReq deepCopy() { - return new TCloseSessionReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCloseSessionReq) - return this.equals((TCloseSessionReq)that); - return false; - } - - public boolean equals(TCloseSessionReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCloseSessionReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TCloseSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseSessionReqStandardScheme getScheme() { - return new TCloseSessionReqStandardScheme(); - } - } - - private static class TCloseSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionReq 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; - 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, TCloseSessionReq 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseSessionReqTupleScheme getScheme() { - return new TCloseSessionReqTupleScheme(); - } - } - - private static class TCloseSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java deleted file mode 100644 index 31ae25fcd494..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TCloseSessionResp.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { - STATUS((short)1, "status"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionResp.class, metaDataMap); - } - - public TCloseSessionResp() { - } - - public TCloseSessionResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCloseSessionResp(TCloseSessionResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCloseSessionResp deepCopy() { - return new TCloseSessionResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TCloseSessionResp) - return this.equals((TCloseSessionResp)that); - return false; - } - - public boolean equals(TCloseSessionResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TCloseSessionResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TCloseSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseSessionRespStandardScheme getScheme() { - return new TCloseSessionRespStandardScheme(); - } - } - - private static class TCloseSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionResp 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; - 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, TCloseSessionResp 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TCloseSessionRespTupleScheme getScheme() { - return new TCloseSessionRespTupleScheme(); - } - } - - private static class TCloseSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java deleted file mode 100644 index dc3a7ee249ba..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumn.java +++ /dev/null @@ -1,713 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TColumn extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); - private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); - private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); - private static final org.apache.thrift.protocol.TField BINARY_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryVal", org.apache.thrift.protocol.TType.STRUCT, (short)8); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_VAL((short)1, "boolVal"), - BYTE_VAL((short)2, "byteVal"), - I16_VAL((short)3, "i16Val"), - I32_VAL((short)4, "i32Val"), - I64_VAL((short)5, "i64Val"), - DOUBLE_VAL((short)6, "doubleVal"), - STRING_VAL((short)7, "stringVal"), - BINARY_VAL((short)8, "binaryVal"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // BOOL_VAL - return BOOL_VAL; - case 2: // BYTE_VAL - return BYTE_VAL; - case 3: // I16_VAL - return I16_VAL; - case 4: // I32_VAL - return I32_VAL; - case 5: // I64_VAL - return I64_VAL; - case 6: // DOUBLE_VAL - return DOUBLE_VAL; - case 7: // STRING_VAL - return STRING_VAL; - case 8: // BINARY_VAL - return BINARY_VAL; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolColumn.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteColumn.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Column.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Column.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Column.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleColumn.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringColumn.class))); - tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryColumn.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); - } - - public TColumn() { - super(); - } - - public TColumn(_Fields setField, java.lang.Object value) { - super(setField, value); - } - - public TColumn(TColumn other) { - super(other); - } - public TColumn deepCopy() { - return new TColumn(this); - } - - public static TColumn boolVal(TBoolColumn value) { - TColumn x = new TColumn(); - x.setBoolVal(value); - return x; - } - - public static TColumn byteVal(TByteColumn value) { - TColumn x = new TColumn(); - x.setByteVal(value); - return x; - } - - public static TColumn i16Val(TI16Column value) { - TColumn x = new TColumn(); - x.setI16Val(value); - return x; - } - - public static TColumn i32Val(TI32Column value) { - TColumn x = new TColumn(); - x.setI32Val(value); - return x; - } - - public static TColumn i64Val(TI64Column value) { - TColumn x = new TColumn(); - x.setI64Val(value); - return x; - } - - public static TColumn doubleVal(TDoubleColumn value) { - TColumn x = new TColumn(); - x.setDoubleVal(value); - return x; - } - - public static TColumn stringVal(TStringColumn value) { - TColumn x = new TColumn(); - x.setStringVal(value); - return x; - } - - public static TColumn binaryVal(TBinaryColumn value) { - TColumn x = new TColumn(); - x.setBinaryVal(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { - switch (setField) { - case BOOL_VAL: - if (value instanceof TBoolColumn) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); - case BYTE_VAL: - if (value instanceof TByteColumn) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); - case I16_VAL: - if (value instanceof TI16Column) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); - case I32_VAL: - if (value instanceof TI32Column) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); - case I64_VAL: - if (value instanceof TI64Column) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); - case DOUBLE_VAL: - if (value instanceof TDoubleColumn) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); - case STRING_VAL: - if (value instanceof TStringColumn) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); - case BINARY_VAL: - if (value instanceof TBinaryColumn) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - if (field.type == BOOL_VAL_FIELD_DESC.type) { - TBoolColumn boolVal; - boolVal = new TBoolColumn(); - boolVal.read(iprot); - return boolVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BYTE_VAL: - if (field.type == BYTE_VAL_FIELD_DESC.type) { - TByteColumn byteVal; - byteVal = new TByteColumn(); - byteVal.read(iprot); - return byteVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I16_VAL: - if (field.type == I16_VAL_FIELD_DESC.type) { - TI16Column i16Val; - i16Val = new TI16Column(); - i16Val.read(iprot); - return i16Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I32_VAL: - if (field.type == I32_VAL_FIELD_DESC.type) { - TI32Column i32Val; - i32Val = new TI32Column(); - i32Val.read(iprot); - return i32Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I64_VAL: - if (field.type == I64_VAL_FIELD_DESC.type) { - TI64Column i64Val; - i64Val = new TI64Column(); - i64Val.read(iprot); - return i64Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_VAL: - if (field.type == DOUBLE_VAL_FIELD_DESC.type) { - TDoubleColumn doubleVal; - doubleVal = new TDoubleColumn(); - doubleVal.read(iprot); - return doubleVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VAL: - if (field.type == STRING_VAL_FIELD_DESC.type) { - TStringColumn stringVal; - stringVal = new TStringColumn(); - stringVal.read(iprot); - return stringVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BINARY_VAL: - if (field.type == BINARY_VAL_FIELD_DESC.type) { - TBinaryColumn binaryVal; - binaryVal = new TBinaryColumn(); - binaryVal.read(iprot); - return binaryVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolColumn boolVal = (TBoolColumn)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteColumn byteVal = (TByteColumn)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Column i16Val = (TI16Column)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Column i32Val = (TI32Column)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Column i64Val = (TI64Column)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleColumn doubleVal = (TDoubleColumn)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringColumn stringVal = (TStringColumn)value_; - stringVal.write(oprot); - return; - case BINARY_VAL: - TBinaryColumn binaryVal = (TBinaryColumn)value_; - binaryVal.write(oprot); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - TBoolColumn boolVal; - boolVal = new TBoolColumn(); - boolVal.read(iprot); - return boolVal; - case BYTE_VAL: - TByteColumn byteVal; - byteVal = new TByteColumn(); - byteVal.read(iprot); - return byteVal; - case I16_VAL: - TI16Column i16Val; - i16Val = new TI16Column(); - i16Val.read(iprot); - return i16Val; - case I32_VAL: - TI32Column i32Val; - i32Val = new TI32Column(); - i32Val.read(iprot); - return i32Val; - case I64_VAL: - TI64Column i64Val; - i64Val = new TI64Column(); - i64Val.read(iprot); - return i64Val; - case DOUBLE_VAL: - TDoubleColumn doubleVal; - doubleVal = new TDoubleColumn(); - doubleVal.read(iprot); - return doubleVal; - case STRING_VAL: - TStringColumn stringVal; - stringVal = new TStringColumn(); - stringVal.read(iprot); - return stringVal; - case BINARY_VAL: - TBinaryColumn binaryVal; - binaryVal = new TBinaryColumn(); - binaryVal.read(iprot); - return binaryVal; - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolColumn boolVal = (TBoolColumn)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteColumn byteVal = (TByteColumn)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Column i16Val = (TI16Column)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Column i32Val = (TI32Column)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Column i64Val = (TI64Column)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleColumn doubleVal = (TDoubleColumn)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringColumn stringVal = (TStringColumn)value_; - stringVal.write(oprot); - return; - case BINARY_VAL: - TBinaryColumn binaryVal = (TBinaryColumn)value_; - binaryVal.write(oprot); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case BOOL_VAL: - return BOOL_VAL_FIELD_DESC; - case BYTE_VAL: - return BYTE_VAL_FIELD_DESC; - case I16_VAL: - return I16_VAL_FIELD_DESC; - case I32_VAL: - return I32_VAL_FIELD_DESC; - case I64_VAL: - return I64_VAL_FIELD_DESC; - case DOUBLE_VAL: - return DOUBLE_VAL_FIELD_DESC; - case STRING_VAL: - return STRING_VAL_FIELD_DESC; - case BINARY_VAL: - return BINARY_VAL_FIELD_DESC; - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TBoolColumn getBoolVal() { - if (getSetField() == _Fields.BOOL_VAL) { - return (TBoolColumn)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBoolVal(TBoolColumn value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.BOOL_VAL; - value_ = value; - } - - public TByteColumn getByteVal() { - if (getSetField() == _Fields.BYTE_VAL) { - return (TByteColumn)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setByteVal(TByteColumn value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.BYTE_VAL; - value_ = value; - } - - public TI16Column getI16Val() { - if (getSetField() == _Fields.I16_VAL) { - return (TI16Column)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI16Val(TI16Column value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.I16_VAL; - value_ = value; - } - - public TI32Column getI32Val() { - if (getSetField() == _Fields.I32_VAL) { - return (TI32Column)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Val(TI32Column value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.I32_VAL; - value_ = value; - } - - public TI64Column getI64Val() { - if (getSetField() == _Fields.I64_VAL) { - return (TI64Column)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI64Val(TI64Column value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.I64_VAL; - value_ = value; - } - - public TDoubleColumn getDoubleVal() { - if (getSetField() == _Fields.DOUBLE_VAL) { - return (TDoubleColumn)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDoubleVal(TDoubleColumn value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.DOUBLE_VAL; - value_ = value; - } - - public TStringColumn getStringVal() { - if (getSetField() == _Fields.STRING_VAL) { - return (TStringColumn)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringVal(TStringColumn value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.STRING_VAL; - value_ = value; - } - - public TBinaryColumn getBinaryVal() { - if (getSetField() == _Fields.BINARY_VAL) { - return (TBinaryColumn)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBinaryVal(TBinaryColumn value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.BINARY_VAL; - value_ = value; - } - - public boolean isSetBoolVal() { - return setField_ == _Fields.BOOL_VAL; - } - - - public boolean isSetByteVal() { - return setField_ == _Fields.BYTE_VAL; - } - - - public boolean isSetI16Val() { - return setField_ == _Fields.I16_VAL; - } - - - public boolean isSetI32Val() { - return setField_ == _Fields.I32_VAL; - } - - - public boolean isSetI64Val() { - return setField_ == _Fields.I64_VAL; - } - - - public boolean isSetDoubleVal() { - return setField_ == _Fields.DOUBLE_VAL; - } - - - public boolean isSetStringVal() { - return setField_ == _Fields.STRING_VAL; - } - - - public boolean isSetBinaryVal() { - return setField_ == _Fields.BINARY_VAL; - } - - - public boolean equals(java.lang.Object other) { - if (other instanceof TColumn) { - return equals((TColumn)other); - } else { - return false; - } - } - - public boolean equals(TColumn other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TColumn other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - java.util.List list = new java.util.ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - 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, java.lang.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); - } - } - - -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java deleted file mode 100644 index c537a3f5637c..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnDesc.java +++ /dev/null @@ -1,680 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnDesc"); - - private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField TYPE_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("typeDesc", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField POSITION_FIELD_DESC = new org.apache.thrift.protocol.TField("position", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TColumnDescStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TColumnDescTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // required - private @org.apache.thrift.annotation.Nullable TTypeDesc typeDesc; // required - private int position; // required - private @org.apache.thrift.annotation.Nullable java.lang.String comment; // 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 { - COLUMN_NAME((short)1, "columnName"), - TYPE_DESC((short)2, "typeDesc"), - POSITION((short)3, "position"), - COMMENT((short)4, "comment"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COLUMN_NAME - return COLUMN_NAME; - case 2: // TYPE_DESC - return TYPE_DESC; - case 3: // POSITION - return POSITION; - case 4: // COMMENT - return COMMENT; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __POSITION_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.COMMENT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TYPE_DESC, new org.apache.thrift.meta_data.FieldMetaData("typeDesc", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeDesc.class))); - tmpMap.put(_Fields.POSITION, new org.apache.thrift.meta_data.FieldMetaData("position", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); - } - - public TColumnDesc() { - } - - public TColumnDesc( - java.lang.String columnName, - TTypeDesc typeDesc, - int position) - { - this(); - this.columnName = columnName; - this.typeDesc = typeDesc; - this.position = position; - setPositionIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TColumnDesc(TColumnDesc other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetColumnName()) { - this.columnName = other.columnName; - } - if (other.isSetTypeDesc()) { - this.typeDesc = new TTypeDesc(other.typeDesc); - } - this.position = other.position; - if (other.isSetComment()) { - this.comment = other.comment; - } - } - - public TColumnDesc deepCopy() { - return new TColumnDesc(this); - } - - @Override - public void clear() { - this.columnName = null; - this.typeDesc = null; - setPositionIsSet(false); - this.position = 0; - this.comment = null; - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getColumnName() { - return this.columnName; - } - - public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { - this.columnName = columnName; - } - - public void unsetColumnName() { - this.columnName = null; - } - - /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnName() { - return this.columnName != null; - } - - public void setColumnNameIsSet(boolean value) { - if (!value) { - this.columnName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public TTypeDesc getTypeDesc() { - return this.typeDesc; - } - - public void setTypeDesc(@org.apache.thrift.annotation.Nullable TTypeDesc typeDesc) { - this.typeDesc = typeDesc; - } - - public void unsetTypeDesc() { - this.typeDesc = null; - } - - /** Returns true if field typeDesc is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeDesc() { - return this.typeDesc != null; - } - - public void setTypeDescIsSet(boolean value) { - if (!value) { - this.typeDesc = null; - } - } - - public int getPosition() { - return this.position; - } - - public void setPosition(int position) { - this.position = position; - setPositionIsSet(true); - } - - public void unsetPosition() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); - } - - /** Returns true if field position is set (has been assigned a value) and false otherwise */ - public boolean isSetPosition() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); - } - - public void setPositionIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getComment() { - return this.comment; - } - - public void setComment(@org.apache.thrift.annotation.Nullable java.lang.String comment) { - this.comment = comment; - } - - public void unsetComment() { - this.comment = null; - } - - /** Returns true if field comment is set (has been assigned a value) and false otherwise */ - public boolean isSetComment() { - return this.comment != null; - } - - public void setCommentIsSet(boolean value) { - if (!value) { - this.comment = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case COLUMN_NAME: - if (value == null) { - unsetColumnName(); - } else { - setColumnName((java.lang.String)value); - } - break; - - case TYPE_DESC: - if (value == null) { - unsetTypeDesc(); - } else { - setTypeDesc((TTypeDesc)value); - } - break; - - case POSITION: - if (value == null) { - unsetPosition(); - } else { - setPosition((java.lang.Integer)value); - } - break; - - case COMMENT: - if (value == null) { - unsetComment(); - } else { - setComment((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case COLUMN_NAME: - return getColumnName(); - - case TYPE_DESC: - return getTypeDesc(); - - case POSITION: - return getPosition(); - - case COMMENT: - return getComment(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case COLUMN_NAME: - return isSetColumnName(); - case TYPE_DESC: - return isSetTypeDesc(); - case POSITION: - return isSetPosition(); - case COMMENT: - return isSetComment(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TColumnDesc) - return this.equals((TColumnDesc)that); - return false; - } - - public boolean equals(TColumnDesc that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_columnName = true && this.isSetColumnName(); - boolean that_present_columnName = true && that.isSetColumnName(); - if (this_present_columnName || that_present_columnName) { - if (!(this_present_columnName && that_present_columnName)) - return false; - if (!this.columnName.equals(that.columnName)) - return false; - } - - boolean this_present_typeDesc = true && this.isSetTypeDesc(); - boolean that_present_typeDesc = true && that.isSetTypeDesc(); - if (this_present_typeDesc || that_present_typeDesc) { - if (!(this_present_typeDesc && that_present_typeDesc)) - return false; - if (!this.typeDesc.equals(that.typeDesc)) - return false; - } - - boolean this_present_position = true; - boolean that_present_position = true; - if (this_present_position || that_present_position) { - if (!(this_present_position && that_present_position)) - return false; - if (this.position != that.position) - return false; - } - - boolean this_present_comment = true && this.isSetComment(); - boolean that_present_comment = true && that.isSetComment(); - if (this_present_comment || that_present_comment) { - if (!(this_present_comment && that_present_comment)) - return false; - if (!this.comment.equals(that.comment)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); - if (isSetColumnName()) - hashCode = hashCode * 8191 + columnName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTypeDesc()) ? 131071 : 524287); - if (isSetTypeDesc()) - hashCode = hashCode * 8191 + typeDesc.hashCode(); - - hashCode = hashCode * 8191 + position; - - hashCode = hashCode * 8191 + ((isSetComment()) ? 131071 : 524287); - if (isSetComment()) - hashCode = hashCode * 8191 + comment.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TColumnDesc other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeDesc, other.typeDesc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPosition()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.position, other.position); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetComment()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TColumnDesc("); - boolean first = true; - - sb.append("columnName:"); - if (this.columnName == null) { - sb.append("null"); - } else { - sb.append(this.columnName); - } - first = false; - if (!first) sb.append(", "); - sb.append("typeDesc:"); - if (this.typeDesc == null) { - sb.append("null"); - } else { - sb.append(this.typeDesc); - } - first = false; - if (!first) sb.append(", "); - sb.append("position:"); - sb.append(this.position); - first = false; - if (isSetComment()) { - if (!first) sb.append(", "); - sb.append("comment:"); - if (this.comment == null) { - sb.append("null"); - } else { - sb.append(this.comment); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColumnName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnName' is unset! Struct:" + toString()); - } - - if (!isSetTypeDesc()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeDesc' is unset! Struct:" + toString()); - } - - if (!isSetPosition()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'position' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (typeDesc != null) { - typeDesc.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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TColumnDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TColumnDescStandardScheme getScheme() { - return new TColumnDescStandardScheme(); - } - } - - private static class TColumnDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc 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: // COLUMN_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TYPE_DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.typeDesc = new TTypeDesc(); - struct.typeDesc.read(iprot); - struct.setTypeDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // POSITION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.position = iprot.readI32(); - struct.setPositionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // COMMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.comment = iprot.readString(); - struct.setCommentIsSet(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, TColumnDesc struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.columnName != null) { - oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); - oprot.writeString(struct.columnName); - oprot.writeFieldEnd(); - } - if (struct.typeDesc != null) { - oprot.writeFieldBegin(TYPE_DESC_FIELD_DESC); - struct.typeDesc.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(POSITION_FIELD_DESC); - oprot.writeI32(struct.position); - oprot.writeFieldEnd(); - if (struct.comment != null) { - if (struct.isSetComment()) { - oprot.writeFieldBegin(COMMENT_FIELD_DESC); - oprot.writeString(struct.comment); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TColumnDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TColumnDescTupleScheme getScheme() { - return new TColumnDescTupleScheme(); - } - } - - private static class TColumnDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeString(struct.columnName); - struct.typeDesc.write(oprot); - oprot.writeI32(struct.position); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetComment()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetComment()) { - oprot.writeString(struct.comment); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - struct.typeDesc = new TTypeDesc(); - struct.typeDesc.read(iprot); - struct.setTypeDescIsSet(true); - struct.position = iprot.readI32(); - struct.setPositionIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.comment = iprot.readString(); - struct.setCommentIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java deleted file mode 100644 index 61cceebeb8da..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TColumnValue.java +++ /dev/null @@ -1,652 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TColumnValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); - private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); - private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_VAL((short)1, "boolVal"), - BYTE_VAL((short)2, "byteVal"), - I16_VAL((short)3, "i16Val"), - I32_VAL((short)4, "i32Val"), - I64_VAL((short)5, "i64Val"), - DOUBLE_VAL((short)6, "doubleVal"), - STRING_VAL((short)7, "stringVal"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // BOOL_VAL - return BOOL_VAL; - case 2: // BYTE_VAL - return BYTE_VAL; - case 3: // I16_VAL - return I16_VAL; - case 4: // I32_VAL - return I32_VAL; - case 5: // I64_VAL - return I64_VAL; - case 6: // DOUBLE_VAL - return DOUBLE_VAL; - case 7: // STRING_VAL - return STRING_VAL; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolValue.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteValue.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Value.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Value.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Value.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); - } - - public TColumnValue() { - super(); - } - - public TColumnValue(_Fields setField, java.lang.Object value) { - super(setField, value); - } - - public TColumnValue(TColumnValue other) { - super(other); - } - public TColumnValue deepCopy() { - return new TColumnValue(this); - } - - public static TColumnValue boolVal(TBoolValue value) { - TColumnValue x = new TColumnValue(); - x.setBoolVal(value); - return x; - } - - public static TColumnValue byteVal(TByteValue value) { - TColumnValue x = new TColumnValue(); - x.setByteVal(value); - return x; - } - - public static TColumnValue i16Val(TI16Value value) { - TColumnValue x = new TColumnValue(); - x.setI16Val(value); - return x; - } - - public static TColumnValue i32Val(TI32Value value) { - TColumnValue x = new TColumnValue(); - x.setI32Val(value); - return x; - } - - public static TColumnValue i64Val(TI64Value value) { - TColumnValue x = new TColumnValue(); - x.setI64Val(value); - return x; - } - - public static TColumnValue doubleVal(TDoubleValue value) { - TColumnValue x = new TColumnValue(); - x.setDoubleVal(value); - return x; - } - - public static TColumnValue stringVal(TStringValue value) { - TColumnValue x = new TColumnValue(); - x.setStringVal(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { - switch (setField) { - case BOOL_VAL: - if (value instanceof TBoolValue) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); - case BYTE_VAL: - if (value instanceof TByteValue) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); - case I16_VAL: - if (value instanceof TI16Value) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); - case I32_VAL: - if (value instanceof TI32Value) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); - case I64_VAL: - if (value instanceof TI64Value) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); - case DOUBLE_VAL: - if (value instanceof TDoubleValue) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); - case STRING_VAL: - if (value instanceof TStringValue) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - if (field.type == BOOL_VAL_FIELD_DESC.type) { - TBoolValue boolVal; - boolVal = new TBoolValue(); - boolVal.read(iprot); - return boolVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BYTE_VAL: - if (field.type == BYTE_VAL_FIELD_DESC.type) { - TByteValue byteVal; - byteVal = new TByteValue(); - byteVal.read(iprot); - return byteVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I16_VAL: - if (field.type == I16_VAL_FIELD_DESC.type) { - TI16Value i16Val; - i16Val = new TI16Value(); - i16Val.read(iprot); - return i16Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I32_VAL: - if (field.type == I32_VAL_FIELD_DESC.type) { - TI32Value i32Val; - i32Val = new TI32Value(); - i32Val.read(iprot); - return i32Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I64_VAL: - if (field.type == I64_VAL_FIELD_DESC.type) { - TI64Value i64Val; - i64Val = new TI64Value(); - i64Val.read(iprot); - return i64Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_VAL: - if (field.type == DOUBLE_VAL_FIELD_DESC.type) { - TDoubleValue doubleVal; - doubleVal = new TDoubleValue(); - doubleVal.read(iprot); - return doubleVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VAL: - if (field.type == STRING_VAL_FIELD_DESC.type) { - TStringValue stringVal; - stringVal = new TStringValue(); - stringVal.read(iprot); - return stringVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolValue boolVal = (TBoolValue)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteValue byteVal = (TByteValue)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Value i16Val = (TI16Value)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Value i32Val = (TI32Value)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Value i64Val = (TI64Value)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleValue doubleVal = (TDoubleValue)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringValue stringVal = (TStringValue)value_; - stringVal.write(oprot); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - TBoolValue boolVal; - boolVal = new TBoolValue(); - boolVal.read(iprot); - return boolVal; - case BYTE_VAL: - TByteValue byteVal; - byteVal = new TByteValue(); - byteVal.read(iprot); - return byteVal; - case I16_VAL: - TI16Value i16Val; - i16Val = new TI16Value(); - i16Val.read(iprot); - return i16Val; - case I32_VAL: - TI32Value i32Val; - i32Val = new TI32Value(); - i32Val.read(iprot); - return i32Val; - case I64_VAL: - TI64Value i64Val; - i64Val = new TI64Value(); - i64Val.read(iprot); - return i64Val; - case DOUBLE_VAL: - TDoubleValue doubleVal; - doubleVal = new TDoubleValue(); - doubleVal.read(iprot); - return doubleVal; - case STRING_VAL: - TStringValue stringVal; - stringVal = new TStringValue(); - stringVal.read(iprot); - return stringVal; - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolValue boolVal = (TBoolValue)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteValue byteVal = (TByteValue)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Value i16Val = (TI16Value)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Value i32Val = (TI32Value)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Value i64Val = (TI64Value)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleValue doubleVal = (TDoubleValue)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringValue stringVal = (TStringValue)value_; - stringVal.write(oprot); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case BOOL_VAL: - return BOOL_VAL_FIELD_DESC; - case BYTE_VAL: - return BYTE_VAL_FIELD_DESC; - case I16_VAL: - return I16_VAL_FIELD_DESC; - case I32_VAL: - return I32_VAL_FIELD_DESC; - case I64_VAL: - return I64_VAL_FIELD_DESC; - case DOUBLE_VAL: - return DOUBLE_VAL_FIELD_DESC; - case STRING_VAL: - return STRING_VAL_FIELD_DESC; - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TBoolValue getBoolVal() { - if (getSetField() == _Fields.BOOL_VAL) { - return (TBoolValue)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBoolVal(TBoolValue value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.BOOL_VAL; - value_ = value; - } - - public TByteValue getByteVal() { - if (getSetField() == _Fields.BYTE_VAL) { - return (TByteValue)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setByteVal(TByteValue value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.BYTE_VAL; - value_ = value; - } - - public TI16Value getI16Val() { - if (getSetField() == _Fields.I16_VAL) { - return (TI16Value)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI16Val(TI16Value value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.I16_VAL; - value_ = value; - } - - public TI32Value getI32Val() { - if (getSetField() == _Fields.I32_VAL) { - return (TI32Value)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Val(TI32Value value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.I32_VAL; - value_ = value; - } - - public TI64Value getI64Val() { - if (getSetField() == _Fields.I64_VAL) { - return (TI64Value)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI64Val(TI64Value value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.I64_VAL; - value_ = value; - } - - public TDoubleValue getDoubleVal() { - if (getSetField() == _Fields.DOUBLE_VAL) { - return (TDoubleValue)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDoubleVal(TDoubleValue value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.DOUBLE_VAL; - value_ = value; - } - - public TStringValue getStringVal() { - if (getSetField() == _Fields.STRING_VAL) { - return (TStringValue)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringVal(TStringValue value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.STRING_VAL; - value_ = value; - } - - public boolean isSetBoolVal() { - return setField_ == _Fields.BOOL_VAL; - } - - - public boolean isSetByteVal() { - return setField_ == _Fields.BYTE_VAL; - } - - - public boolean isSetI16Val() { - return setField_ == _Fields.I16_VAL; - } - - - public boolean isSetI32Val() { - return setField_ == _Fields.I32_VAL; - } - - - public boolean isSetI64Val() { - return setField_ == _Fields.I64_VAL; - } - - - public boolean isSetDoubleVal() { - return setField_ == _Fields.DOUBLE_VAL; - } - - - public boolean isSetStringVal() { - return setField_ == _Fields.STRING_VAL; - } - - - public boolean equals(java.lang.Object other) { - if (other instanceof TColumnValue) { - return equals((TColumnValue)other); - } else { - return false; - } - } - - public boolean equals(TColumnValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TColumnValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - java.util.List list = new java.util.ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - 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, java.lang.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); - } - } - - -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java deleted file mode 100644 index bec4619c91a3..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleColumn.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleColumn.class, metaDataMap); - } - - public TDoubleColumn() { - } - - public TDoubleColumn( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TDoubleColumn(TDoubleColumn other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TDoubleColumn deepCopy() { - return new TDoubleColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(double elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TDoubleColumn) - return this.equals((TDoubleColumn)that); - return false; - } - - public boolean equals(TDoubleColumn that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TDoubleColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TDoubleColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TDoubleColumnStandardScheme getScheme() { - return new TDoubleColumnStandardScheme(); - } - } - - private static class TDoubleColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list94.size); - double _elem95; - for (int _i96 = 0; _i96 < _list94.size; ++_i96) - { - _elem95 = iprot.readDouble(); - struct.values.add(_elem95); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TDoubleColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, struct.values.size())); - for (double _iter97 : struct.values) - { - oprot.writeDouble(_iter97); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TDoubleColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TDoubleColumnTupleScheme getScheme() { - return new TDoubleColumnTupleScheme(); - } - } - - private static class TDoubleColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (double _iter98 : struct.values) - { - oprot.writeDouble(_iter98); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); - struct.values = new java.util.ArrayList(_list99.size); - double _elem100; - for (int _i101 = 0; _i101 < _list99.size; ++_i101) - { - _elem100 = iprot.readDouble(); - struct.values.add(_elem100); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java deleted file mode 100644 index 04c9dbe9db42..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TDoubleValue.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleValueTupleSchemeFactory(); - - private double value; // 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 { - VALUE((short)1, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleValue.class, metaDataMap); - } - - public TDoubleValue() { - } - - /** - * Performs a deep copy on other. - */ - public TDoubleValue(TDoubleValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TDoubleValue deepCopy() { - return new TDoubleValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0.0; - } - - public double getValue() { - return this.value; - } - - public void setValue(double value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((java.lang.Double)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TDoubleValue) - return this.equals((TDoubleValue)that); - return false; - } - - public boolean equals(TDoubleValue that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); - - return hashCode; - } - - @Override - public int compareTo(TDoubleValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TDoubleValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TDoubleValueStandardScheme getScheme() { - return new TDoubleValueStandardScheme(); - } - } - - private static class TDoubleValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue 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: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(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, TDoubleValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeDouble(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TDoubleValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TDoubleValueTupleScheme getScheme() { - return new TDoubleValueTupleScheme(); - } - } - - private static class TDoubleValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeDouble(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java deleted file mode 100644 index bd8dacf147eb..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementReq.java +++ /dev/null @@ -1,840 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq"); - - 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 STATEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("statement", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField CONF_OVERLAY_FIELD_DESC = new org.apache.thrift.protocol.TField("confOverlay", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField RUN_ASYNC_FIELD_DESC = new org.apache.thrift.protocol.TField("runAsync", org.apache.thrift.protocol.TType.BOOL, (short)4); - private static final org.apache.thrift.protocol.TField QUERY_TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("queryTimeout", org.apache.thrift.protocol.TType.I64, (short)5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExecuteStatementReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExecuteStatementReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String statement; // required - private @org.apache.thrift.annotation.Nullable java.util.Map confOverlay; // optional - private boolean runAsync; // optional - private long queryTimeout; // 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 { - SESSION_HANDLE((short)1, "sessionHandle"), - STATEMENT((short)2, "statement"), - CONF_OVERLAY((short)3, "confOverlay"), - RUN_ASYNC((short)4, "runAsync"), - QUERY_TIMEOUT((short)5, "queryTimeout"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // STATEMENT - return STATEMENT; - case 3: // CONF_OVERLAY - return CONF_OVERLAY; - case 4: // RUN_ASYNC - return RUN_ASYNC; - case 5: // QUERY_TIMEOUT - return QUERY_TIMEOUT; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __RUNASYNC_ISSET_ID = 0; - private static final int __QUERYTIMEOUT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC,_Fields.QUERY_TIMEOUT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CONF_OVERLAY, new org.apache.thrift.meta_data.FieldMetaData("confOverlay", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.RUN_ASYNC, new org.apache.thrift.meta_data.FieldMetaData("runAsync", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.QUERY_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("queryTimeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap); - } - - public TExecuteStatementReq() { - this.runAsync = false; - - this.queryTimeout = 0L; - - } - - public TExecuteStatementReq( - TSessionHandle sessionHandle, - java.lang.String statement) - { - this(); - this.sessionHandle = sessionHandle; - this.statement = statement; - } - - /** - * Performs a deep copy on other. - */ - public TExecuteStatementReq(TExecuteStatementReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetStatement()) { - this.statement = other.statement; - } - if (other.isSetConfOverlay()) { - java.util.Map __this__confOverlay = new java.util.HashMap(other.confOverlay); - this.confOverlay = __this__confOverlay; - } - this.runAsync = other.runAsync; - this.queryTimeout = other.queryTimeout; - } - - public TExecuteStatementReq deepCopy() { - return new TExecuteStatementReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.statement = null; - this.confOverlay = null; - this.runAsync = false; - - this.queryTimeout = 0L; - - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getStatement() { - return this.statement; - } - - public void setStatement(@org.apache.thrift.annotation.Nullable java.lang.String statement) { - this.statement = statement; - } - - public void unsetStatement() { - this.statement = null; - } - - /** Returns true if field statement is set (has been assigned a value) and false otherwise */ - public boolean isSetStatement() { - return this.statement != null; - } - - public void setStatementIsSet(boolean value) { - if (!value) { - this.statement = null; - } - } - - public int getConfOverlaySize() { - return (this.confOverlay == null) ? 0 : this.confOverlay.size(); - } - - public void putToConfOverlay(java.lang.String key, java.lang.String val) { - if (this.confOverlay == null) { - this.confOverlay = new java.util.HashMap(); - } - this.confOverlay.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfOverlay() { - return this.confOverlay; - } - - public void setConfOverlay(@org.apache.thrift.annotation.Nullable java.util.Map confOverlay) { - this.confOverlay = confOverlay; - } - - public void unsetConfOverlay() { - this.confOverlay = null; - } - - /** Returns true if field confOverlay is set (has been assigned a value) and false otherwise */ - public boolean isSetConfOverlay() { - return this.confOverlay != null; - } - - public void setConfOverlayIsSet(boolean value) { - if (!value) { - this.confOverlay = null; - } - } - - public boolean isRunAsync() { - return this.runAsync; - } - - public void setRunAsync(boolean runAsync) { - this.runAsync = runAsync; - setRunAsyncIsSet(true); - } - - public void unsetRunAsync() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); - } - - /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */ - public boolean isSetRunAsync() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); - } - - public void setRunAsyncIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); - } - - public long getQueryTimeout() { - return this.queryTimeout; - } - - public void setQueryTimeout(long queryTimeout) { - this.queryTimeout = queryTimeout; - setQueryTimeoutIsSet(true); - } - - public void unsetQueryTimeout() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); - } - - /** Returns true if field queryTimeout is set (has been assigned a value) and false otherwise */ - public boolean isSetQueryTimeout() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); - } - - public void setQueryTimeoutIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case STATEMENT: - if (value == null) { - unsetStatement(); - } else { - setStatement((java.lang.String)value); - } - break; - - case CONF_OVERLAY: - if (value == null) { - unsetConfOverlay(); - } else { - setConfOverlay((java.util.Map)value); - } - break; - - case RUN_ASYNC: - if (value == null) { - unsetRunAsync(); - } else { - setRunAsync((java.lang.Boolean)value); - } - break; - - case QUERY_TIMEOUT: - if (value == null) { - unsetQueryTimeout(); - } else { - setQueryTimeout((java.lang.Long)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case STATEMENT: - return getStatement(); - - case CONF_OVERLAY: - return getConfOverlay(); - - case RUN_ASYNC: - return isRunAsync(); - - case QUERY_TIMEOUT: - return getQueryTimeout(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case STATEMENT: - return isSetStatement(); - case CONF_OVERLAY: - return isSetConfOverlay(); - case RUN_ASYNC: - return isSetRunAsync(); - case QUERY_TIMEOUT: - return isSetQueryTimeout(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TExecuteStatementReq) - return this.equals((TExecuteStatementReq)that); - return false; - } - - public boolean equals(TExecuteStatementReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_statement = true && this.isSetStatement(); - boolean that_present_statement = true && that.isSetStatement(); - if (this_present_statement || that_present_statement) { - if (!(this_present_statement && that_present_statement)) - return false; - if (!this.statement.equals(that.statement)) - return false; - } - - boolean this_present_confOverlay = true && this.isSetConfOverlay(); - boolean that_present_confOverlay = true && that.isSetConfOverlay(); - if (this_present_confOverlay || that_present_confOverlay) { - if (!(this_present_confOverlay && that_present_confOverlay)) - return false; - if (!this.confOverlay.equals(that.confOverlay)) - return false; - } - - boolean this_present_runAsync = true && this.isSetRunAsync(); - boolean that_present_runAsync = true && that.isSetRunAsync(); - if (this_present_runAsync || that_present_runAsync) { - if (!(this_present_runAsync && that_present_runAsync)) - return false; - if (this.runAsync != that.runAsync) - return false; - } - - boolean this_present_queryTimeout = true && this.isSetQueryTimeout(); - boolean that_present_queryTimeout = true && that.isSetQueryTimeout(); - if (this_present_queryTimeout || that_present_queryTimeout) { - if (!(this_present_queryTimeout && that_present_queryTimeout)) - return false; - if (this.queryTimeout != that.queryTimeout) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetStatement()) ? 131071 : 524287); - if (isSetStatement()) - hashCode = hashCode * 8191 + statement.hashCode(); - - hashCode = hashCode * 8191 + ((isSetConfOverlay()) ? 131071 : 524287); - if (isSetConfOverlay()) - hashCode = hashCode * 8191 + confOverlay.hashCode(); - - hashCode = hashCode * 8191 + ((isSetRunAsync()) ? 131071 : 524287); - if (isSetRunAsync()) - hashCode = hashCode * 8191 + ((runAsync) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetQueryTimeout()) ? 131071 : 524287); - if (isSetQueryTimeout()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(queryTimeout); - - return hashCode; - } - - @Override - public int compareTo(TExecuteStatementReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatement()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statement, other.statement); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfOverlay()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.confOverlay, other.confOverlay); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRunAsync()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runAsync, other.runAsync); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQueryTimeout()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryTimeout, other.queryTimeout); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementReq("); - 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("statement:"); - if (this.statement == null) { - sb.append("null"); - } else { - sb.append(this.statement); - } - first = false; - if (isSetConfOverlay()) { - if (!first) sb.append(", "); - sb.append("confOverlay:"); - if (this.confOverlay == null) { - sb.append("null"); - } else { - sb.append(this.confOverlay); - } - first = false; - } - if (isSetRunAsync()) { - if (!first) sb.append(", "); - sb.append("runAsync:"); - sb.append(this.runAsync); - first = false; - } - if (isSetQueryTimeout()) { - if (!first) sb.append(", "); - sb.append("queryTimeout:"); - sb.append(this.queryTimeout); - 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 (!isSetStatement()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TExecuteStatementReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TExecuteStatementReqStandardScheme getScheme() { - return new TExecuteStatementReqStandardScheme(); - } - } - - private static class TExecuteStatementReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq 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: // STATEMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.statement = iprot.readString(); - struct.setStatementIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CONF_OVERLAY - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map172 = iprot.readMapBegin(); - struct.confOverlay = new java.util.HashMap(2*_map172.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key173; - @org.apache.thrift.annotation.Nullable java.lang.String _val174; - for (int _i175 = 0; _i175 < _map172.size; ++_i175) - { - _key173 = iprot.readString(); - _val174 = iprot.readString(); - struct.confOverlay.put(_key173, _val174); - } - iprot.readMapEnd(); - } - struct.setConfOverlayIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // RUN_ASYNC - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.runAsync = iprot.readBool(); - struct.setRunAsyncIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // QUERY_TIMEOUT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.queryTimeout = iprot.readI64(); - struct.setQueryTimeoutIsSet(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, TExecuteStatementReq 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.statement != null) { - oprot.writeFieldBegin(STATEMENT_FIELD_DESC); - oprot.writeString(struct.statement); - oprot.writeFieldEnd(); - } - if (struct.confOverlay != null) { - if (struct.isSetConfOverlay()) { - oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); - for (java.util.Map.Entry _iter176 : struct.confOverlay.entrySet()) - { - oprot.writeString(_iter176.getKey()); - oprot.writeString(_iter176.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.isSetRunAsync()) { - oprot.writeFieldBegin(RUN_ASYNC_FIELD_DESC); - oprot.writeBool(struct.runAsync); - oprot.writeFieldEnd(); - } - if (struct.isSetQueryTimeout()) { - oprot.writeFieldBegin(QUERY_TIMEOUT_FIELD_DESC); - oprot.writeI64(struct.queryTimeout); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TExecuteStatementReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TExecuteStatementReqTupleScheme getScheme() { - return new TExecuteStatementReqTupleScheme(); - } - } - - private static class TExecuteStatementReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.statement); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetConfOverlay()) { - optionals.set(0); - } - if (struct.isSetRunAsync()) { - optionals.set(1); - } - if (struct.isSetQueryTimeout()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetConfOverlay()) { - { - oprot.writeI32(struct.confOverlay.size()); - for (java.util.Map.Entry _iter177 : struct.confOverlay.entrySet()) - { - oprot.writeString(_iter177.getKey()); - oprot.writeString(_iter177.getValue()); - } - } - } - if (struct.isSetRunAsync()) { - oprot.writeBool(struct.runAsync); - } - if (struct.isSetQueryTimeout()) { - oprot.writeI64(struct.queryTimeout); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.statement = iprot.readString(); - struct.setStatementIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.confOverlay = new java.util.HashMap(2*_map178.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key179; - @org.apache.thrift.annotation.Nullable java.lang.String _val180; - for (int _i181 = 0; _i181 < _map178.size; ++_i181) - { - _key179 = iprot.readString(); - _val180 = iprot.readString(); - struct.confOverlay.put(_key179, _val180); - } - } - struct.setConfOverlayIsSet(true); - } - if (incoming.get(1)) { - struct.runAsync = iprot.readBool(); - struct.setRunAsyncIsSet(true); - } - if (incoming.get(2)) { - struct.queryTimeout = iprot.readI64(); - struct.setQueryTimeoutIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java deleted file mode 100644 index b32ebd05cad0..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TExecuteStatementResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExecuteStatementRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExecuteStatementRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementResp.class, metaDataMap); - } - - public TExecuteStatementResp() { - } - - public TExecuteStatementResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TExecuteStatementResp(TExecuteStatementResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TExecuteStatementResp deepCopy() { - return new TExecuteStatementResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TExecuteStatementResp) - return this.equals((TExecuteStatementResp)that); - return false; - } - - public boolean equals(TExecuteStatementResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TExecuteStatementResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TExecuteStatementRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TExecuteStatementRespStandardScheme getScheme() { - return new TExecuteStatementRespStandardScheme(); - } - } - - private static class TExecuteStatementRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementResp 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; - 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, TExecuteStatementResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TExecuteStatementRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TExecuteStatementRespTupleScheme getScheme() { - return new TExecuteStatementRespTupleScheme(); - } - } - - private static class TExecuteStatementRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java deleted file mode 100644 index b1cb20fb5492..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchOrientation.java +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TFetchOrientation implements org.apache.thrift.TEnum { - FETCH_NEXT(0), - FETCH_PRIOR(1), - FETCH_RELATIVE(2), - FETCH_ABSOLUTE(3), - FETCH_FIRST(4), - FETCH_LAST(5); - - private final int value; - - private TFetchOrientation(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TFetchOrientation findByValue(int value) { - switch (value) { - case 0: - return FETCH_NEXT; - case 1: - return FETCH_PRIOR; - case 2: - return FETCH_RELATIVE; - case 3: - return FETCH_ABSOLUTE; - case 4: - return FETCH_FIRST; - case 5: - return FETCH_LAST; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java deleted file mode 100644 index db1bd0fa58dc..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsReq.java +++ /dev/null @@ -1,689 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq"); - - 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)1); - private static final org.apache.thrift.protocol.TField ORIENTATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orientation", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRows", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField FETCH_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchType", org.apache.thrift.protocol.TType.I16, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFetchResultsReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFetchResultsReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required - private @org.apache.thrift.annotation.Nullable TFetchOrientation orientation; // required - private long maxRows; // required - private short fetchType; // 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 { - OPERATION_HANDLE((short)1, "operationHandle"), - /** - * - * @see TFetchOrientation - */ - ORIENTATION((short)2, "orientation"), - MAX_ROWS((short)3, "maxRows"), - FETCH_TYPE((short)4, "fetchType"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - case 2: // ORIENTATION - return ORIENTATION; - case 3: // MAX_ROWS - return MAX_ROWS; - case 4: // FETCH_TYPE - return FETCH_TYPE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __MAXROWS_ISSET_ID = 0; - private static final int __FETCHTYPE_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.FETCH_TYPE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFetchOrientation.class))); - tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("maxRows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap); - } - - public TFetchResultsReq() { - this.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.FETCH_NEXT; - - this.fetchType = (short)0; - - } - - public TFetchResultsReq( - TOperationHandle operationHandle, - TFetchOrientation orientation, - long maxRows) - { - this(); - this.operationHandle = operationHandle; - this.orientation = orientation; - this.maxRows = maxRows; - setMaxRowsIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TFetchResultsReq(TFetchResultsReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - if (other.isSetOrientation()) { - this.orientation = other.orientation; - } - this.maxRows = other.maxRows; - this.fetchType = other.fetchType; - } - - public TFetchResultsReq deepCopy() { - return new TFetchResultsReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - this.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.FETCH_NEXT; - - setMaxRowsIsSet(false); - this.maxRows = 0; - this.fetchType = (short)0; - - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - /** - * - * @see TFetchOrientation - */ - @org.apache.thrift.annotation.Nullable - public TFetchOrientation getOrientation() { - return this.orientation; - } - - /** - * - * @see TFetchOrientation - */ - public void setOrientation(@org.apache.thrift.annotation.Nullable TFetchOrientation orientation) { - this.orientation = orientation; - } - - public void unsetOrientation() { - this.orientation = null; - } - - /** Returns true if field orientation is set (has been assigned a value) and false otherwise */ - public boolean isSetOrientation() { - return this.orientation != null; - } - - public void setOrientationIsSet(boolean value) { - if (!value) { - this.orientation = null; - } - } - - public long getMaxRows() { - return this.maxRows; - } - - public void setMaxRows(long maxRows) { - this.maxRows = maxRows; - setMaxRowsIsSet(true); - } - - public void unsetMaxRows() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); - } - - /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */ - public boolean isSetMaxRows() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); - } - - public void setMaxRowsIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); - } - - public short getFetchType() { - return this.fetchType; - } - - public void setFetchType(short fetchType) { - this.fetchType = fetchType; - setFetchTypeIsSet(true); - } - - public void unsetFetchType() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); - } - - /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */ - public boolean isSetFetchType() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); - } - - public void setFetchTypeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - case ORIENTATION: - if (value == null) { - unsetOrientation(); - } else { - setOrientation((TFetchOrientation)value); - } - break; - - case MAX_ROWS: - if (value == null) { - unsetMaxRows(); - } else { - setMaxRows((java.lang.Long)value); - } - break; - - case FETCH_TYPE: - if (value == null) { - unsetFetchType(); - } else { - setFetchType((java.lang.Short)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - case ORIENTATION: - return getOrientation(); - - case MAX_ROWS: - return getMaxRows(); - - case FETCH_TYPE: - return getFetchType(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - case ORIENTATION: - return isSetOrientation(); - case MAX_ROWS: - return isSetMaxRows(); - case FETCH_TYPE: - return isSetFetchType(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TFetchResultsReq) - return this.equals((TFetchResultsReq)that); - return false; - } - - public boolean equals(TFetchResultsReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_orientation = true && this.isSetOrientation(); - boolean that_present_orientation = true && that.isSetOrientation(); - if (this_present_orientation || that_present_orientation) { - if (!(this_present_orientation && that_present_orientation)) - return false; - if (!this.orientation.equals(that.orientation)) - return false; - } - - boolean this_present_maxRows = true; - boolean that_present_maxRows = true; - if (this_present_maxRows || that_present_maxRows) { - if (!(this_present_maxRows && that_present_maxRows)) - return false; - if (this.maxRows != that.maxRows) - return false; - } - - boolean this_present_fetchType = true && this.isSetFetchType(); - boolean that_present_fetchType = true && that.isSetFetchType(); - if (this_present_fetchType || that_present_fetchType) { - if (!(this_present_fetchType && that_present_fetchType)) - return false; - if (this.fetchType != that.fetchType) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOrientation()) ? 131071 : 524287); - if (isSetOrientation()) - hashCode = hashCode * 8191 + orientation.getValue(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(maxRows); - - hashCode = hashCode * 8191 + ((isSetFetchType()) ? 131071 : 524287); - if (isSetFetchType()) - hashCode = hashCode * 8191 + fetchType; - - return hashCode; - } - - @Override - public int compareTo(TFetchResultsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOrientation()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orientation, other.orientation); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaxRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRows, other.maxRows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFetchType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchType, other.fetchType); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("orientation:"); - if (this.orientation == null) { - sb.append("null"); - } else { - sb.append(this.orientation); - } - first = false; - if (!first) sb.append(", "); - sb.append("maxRows:"); - sb.append(this.maxRows); - first = false; - if (isSetFetchType()) { - if (!first) sb.append(", "); - sb.append("fetchType:"); - sb.append(this.fetchType); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - if (!isSetOrientation()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'orientation' is unset! Struct:" + toString()); - } - - if (!isSetMaxRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'maxRows' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TFetchResultsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TFetchResultsReqStandardScheme getScheme() { - return new TFetchResultsReqStandardScheme(); - } - } - - private static class TFetchResultsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq 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: // 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 2: // ORIENTATION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.findByValue(iprot.readI32()); - struct.setOrientationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // MAX_ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.maxRows = iprot.readI64(); - struct.setMaxRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // FETCH_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.fetchType = iprot.readI16(); - struct.setFetchTypeIsSet(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, TFetchResultsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.orientation != null) { - oprot.writeFieldBegin(ORIENTATION_FIELD_DESC); - oprot.writeI32(struct.orientation.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC); - oprot.writeI64(struct.maxRows); - oprot.writeFieldEnd(); - if (struct.isSetFetchType()) { - oprot.writeFieldBegin(FETCH_TYPE_FIELD_DESC); - oprot.writeI16(struct.fetchType); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TFetchResultsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TFetchResultsReqTupleScheme getScheme() { - return new TFetchResultsReqTupleScheme(); - } - } - - private static class TFetchResultsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle.write(oprot); - oprot.writeI32(struct.orientation.getValue()); - oprot.writeI64(struct.maxRows); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetFetchType()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFetchType()) { - oprot.writeI16(struct.fetchType); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - struct.orientation = org.apache.spark.service.rpc.thrift.TFetchOrientation.findByValue(iprot.readI32()); - struct.setOrientationIsSet(true); - struct.maxRows = iprot.readI64(); - struct.setMaxRowsIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.fetchType = iprot.readI16(); - struct.setFetchTypeIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java deleted file mode 100644 index 4effd2524d88..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TFetchResultsResp.java +++ /dev/null @@ -1,590 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsResp"); - - 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 HAS_MORE_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMoreRows", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFetchResultsRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFetchResultsRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private boolean hasMoreRows; // optional - private @org.apache.thrift.annotation.Nullable TRowSet results; // 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"), - HAS_MORE_ROWS((short)2, "hasMoreRows"), - RESULTS((short)3, "results"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // HAS_MORE_ROWS - return HAS_MORE_ROWS; - case 3: // RESULTS - return RESULTS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __HASMOREROWS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.HAS_MORE_ROWS,_Fields.RESULTS}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.HAS_MORE_ROWS, new org.apache.thrift.meta_data.FieldMetaData("hasMoreRows", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsResp.class, metaDataMap); - } - - public TFetchResultsResp() { - } - - public TFetchResultsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TFetchResultsResp(TFetchResultsResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - this.hasMoreRows = other.hasMoreRows; - if (other.isSetResults()) { - this.results = new TRowSet(other.results); - } - } - - public TFetchResultsResp deepCopy() { - return new TFetchResultsResp(this); - } - - @Override - public void clear() { - this.status = null; - setHasMoreRowsIsSet(false); - this.hasMoreRows = false; - this.results = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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 boolean isHasMoreRows() { - return this.hasMoreRows; - } - - public void setHasMoreRows(boolean hasMoreRows) { - this.hasMoreRows = hasMoreRows; - setHasMoreRowsIsSet(true); - } - - public void unsetHasMoreRows() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); - } - - /** Returns true if field hasMoreRows is set (has been assigned a value) and false otherwise */ - public boolean isSetHasMoreRows() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); - } - - public void setHasMoreRowsIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); - } - - @org.apache.thrift.annotation.Nullable - public TRowSet getResults() { - return this.results; - } - - public void setResults(@org.apache.thrift.annotation.Nullable TRowSet results) { - this.results = results; - } - - public void unsetResults() { - this.results = null; - } - - /** Returns true if field results is set (has been assigned a value) and false otherwise */ - public boolean isSetResults() { - return this.results != null; - } - - public void setResultsIsSet(boolean value) { - if (!value) { - this.results = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case HAS_MORE_ROWS: - if (value == null) { - unsetHasMoreRows(); - } else { - setHasMoreRows((java.lang.Boolean)value); - } - break; - - case RESULTS: - if (value == null) { - unsetResults(); - } else { - setResults((TRowSet)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case HAS_MORE_ROWS: - return isHasMoreRows(); - - case RESULTS: - return getResults(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case HAS_MORE_ROWS: - return isSetHasMoreRows(); - case RESULTS: - return isSetResults(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TFetchResultsResp) - return this.equals((TFetchResultsResp)that); - return false; - } - - public boolean equals(TFetchResultsResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_hasMoreRows = true && this.isSetHasMoreRows(); - boolean that_present_hasMoreRows = true && that.isSetHasMoreRows(); - if (this_present_hasMoreRows || that_present_hasMoreRows) { - if (!(this_present_hasMoreRows && that_present_hasMoreRows)) - return false; - if (this.hasMoreRows != that.hasMoreRows) - return false; - } - - boolean this_present_results = true && this.isSetResults(); - boolean that_present_results = true && that.isSetResults(); - if (this_present_results || that_present_results) { - if (!(this_present_results && that_present_results)) - return false; - if (!this.results.equals(that.results)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetHasMoreRows()) ? 131071 : 524287); - if (isSetHasMoreRows()) - hashCode = hashCode * 8191 + ((hasMoreRows) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetResults()) ? 131071 : 524287); - if (isSetResults()) - hashCode = hashCode * 8191 + results.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TFetchResultsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasMoreRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMoreRows, other.hasMoreRows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetResults()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.results, other.results); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetHasMoreRows()) { - if (!first) sb.append(", "); - sb.append("hasMoreRows:"); - sb.append(this.hasMoreRows); - first = false; - } - if (isSetResults()) { - if (!first) sb.append(", "); - sb.append("results:"); - if (this.results == null) { - sb.append("null"); - } else { - sb.append(this.results); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (results != null) { - results.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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TFetchResultsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TFetchResultsRespStandardScheme getScheme() { - return new TFetchResultsRespStandardScheme(); - } - } - - private static class TFetchResultsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsResp 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: // HAS_MORE_ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasMoreRows = iprot.readBool(); - struct.setHasMoreRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // RESULTS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.results = new TRowSet(); - struct.results.read(iprot); - struct.setResultsIsSet(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, TFetchResultsResp 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.isSetHasMoreRows()) { - oprot.writeFieldBegin(HAS_MORE_ROWS_FIELD_DESC); - oprot.writeBool(struct.hasMoreRows); - oprot.writeFieldEnd(); - } - if (struct.results != null) { - if (struct.isSetResults()) { - oprot.writeFieldBegin(RESULTS_FIELD_DESC); - struct.results.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TFetchResultsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TFetchResultsRespTupleScheme getScheme() { - return new TFetchResultsRespTupleScheme(); - } - } - - private static class TFetchResultsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetHasMoreRows()) { - optionals.set(0); - } - if (struct.isSetResults()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetHasMoreRows()) { - oprot.writeBool(struct.hasMoreRows); - } - if (struct.isSetResults()) { - struct.results.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.hasMoreRows = iprot.readBool(); - struct.setHasMoreRowsIsSet(true); - } - if (incoming.get(1)) { - struct.results = new TRowSet(); - struct.results.read(iprot); - struct.setResultsIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java deleted file mode 100644 index b1894f76dfcc..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsReq"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsReq.class, metaDataMap); - } - - public TGetCatalogsReq() { - } - - public TGetCatalogsReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetCatalogsReq(TGetCatalogsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetCatalogsReq deepCopy() { - return new TGetCatalogsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetCatalogsReq) - return this.equals((TGetCatalogsReq)that); - return false; - } - - public boolean equals(TGetCatalogsReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetCatalogsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetCatalogsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCatalogsReqStandardScheme getScheme() { - return new TGetCatalogsReqStandardScheme(); - } - } - - private static class TGetCatalogsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsReq 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; - 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, TGetCatalogsReq 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCatalogsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCatalogsReqTupleScheme getScheme() { - return new TGetCatalogsReqTupleScheme(); - } - } - - private static class TGetCatalogsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java deleted file mode 100644 index b0729bbd77d3..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCatalogsResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsResp.class, metaDataMap); - } - - public TGetCatalogsResp() { - } - - public TGetCatalogsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetCatalogsResp(TGetCatalogsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetCatalogsResp deepCopy() { - return new TGetCatalogsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetCatalogsResp) - return this.equals((TGetCatalogsResp)that); - return false; - } - - public boolean equals(TGetCatalogsResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetCatalogsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetCatalogsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCatalogsRespStandardScheme getScheme() { - return new TGetCatalogsRespStandardScheme(); - } - } - - private static class TGetCatalogsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsResp 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; - 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, TGetCatalogsResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCatalogsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCatalogsRespTupleScheme getScheme() { - return new TGetCatalogsRespTupleScheme(); - } - } - - private static class TGetCatalogsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java deleted file mode 100644 index 294e764f0099..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsReq.java +++ /dev/null @@ -1,801 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq"); - - 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetColumnsReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetColumnsReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // 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 { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"), - COLUMN_NAME((short)5, "columnName"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - case 5: // COLUMN_NAME - return COLUMN_NAME; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap); - } - - public TGetColumnsReq() { - } - - public TGetColumnsReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetColumnsReq(TGetColumnsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - if (other.isSetColumnName()) { - this.columnName = other.columnName; - } - } - - public TGetColumnsReq deepCopy() { - return new TGetColumnsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - this.columnName = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getTableName() { - return this.tableName; - } - - public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getColumnName() { - return this.columnName; - } - - public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { - this.columnName = columnName; - } - - public void unsetColumnName() { - this.columnName = null; - } - - /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnName() { - return this.columnName != null; - } - - public void setColumnNameIsSet(boolean value) { - if (!value) { - this.columnName = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((java.lang.String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((java.lang.String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((java.lang.String)value); - } - break; - - case COLUMN_NAME: - if (value == null) { - unsetColumnName(); - } else { - setColumnName((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - case COLUMN_NAME: - return getColumnName(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - case COLUMN_NAME: - return isSetColumnName(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetColumnsReq) - return this.equals((TGetColumnsReq)that); - return false; - } - - public boolean equals(TGetColumnsReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - boolean this_present_columnName = true && this.isSetColumnName(); - boolean that_present_columnName = true && that.isSetColumnName(); - if (this_present_columnName || that_present_columnName) { - if (!(this_present_columnName && that_present_columnName)) - return false; - if (!this.columnName.equals(that.columnName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); - if (isSetTableName()) - hashCode = hashCode * 8191 + tableName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); - if (isSetColumnName()) - hashCode = hashCode * 8191 + columnName.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetColumnsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - first = false; - } - if (isSetColumnName()) { - if (!first) sb.append(", "); - sb.append("columnName:"); - if (this.columnName == null) { - sb.append("null"); - } else { - sb.append(this.columnName); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetColumnsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetColumnsReqStandardScheme getScheme() { - return new TGetColumnsReqStandardScheme(); - } - } - - private static class TGetColumnsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq 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: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // COLUMN_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(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, TGetColumnsReq 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.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - if (struct.columnName != null) { - if (struct.isSetColumnName()) { - oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); - oprot.writeString(struct.columnName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetColumnsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetColumnsReqTupleScheme getScheme() { - return new TGetColumnsReqTupleScheme(); - } - } - - private static class TGetColumnsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - if (struct.isSetColumnName()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - if (struct.isSetColumnName()) { - oprot.writeString(struct.columnName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - if (incoming.get(3)) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java deleted file mode 100644 index 250fa04cc845..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetColumnsResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetColumnsRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetColumnsRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsResp.class, metaDataMap); - } - - public TGetColumnsResp() { - } - - public TGetColumnsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetColumnsResp(TGetColumnsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetColumnsResp deepCopy() { - return new TGetColumnsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetColumnsResp) - return this.equals((TGetColumnsResp)that); - return false; - } - - public boolean equals(TGetColumnsResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetColumnsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetColumnsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetColumnsRespStandardScheme getScheme() { - return new TGetColumnsRespStandardScheme(); - } - } - - private static class TGetColumnsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsResp 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; - 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, TGetColumnsResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetColumnsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetColumnsRespTupleScheme getScheme() { - return new TGetColumnsRespTupleScheme(); - } - } - - private static class TGetColumnsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java deleted file mode 100644 index bbb80b057638..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceReq.java +++ /dev/null @@ -1,1013 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetCrossReferenceReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceReq"); - - 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 PARENT_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentCatalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PARENT_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentSchemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField PARENT_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentTableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField FOREIGN_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignCatalogName", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField FOREIGN_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignSchemaName", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField FOREIGN_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignTableName", org.apache.thrift.protocol.TType.STRING, (short)7); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCrossReferenceReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCrossReferenceReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String parentTableName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String foreignTableName; // 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 { - SESSION_HANDLE((short)1, "sessionHandle"), - PARENT_CATALOG_NAME((short)2, "parentCatalogName"), - PARENT_SCHEMA_NAME((short)3, "parentSchemaName"), - PARENT_TABLE_NAME((short)4, "parentTableName"), - FOREIGN_CATALOG_NAME((short)5, "foreignCatalogName"), - FOREIGN_SCHEMA_NAME((short)6, "foreignSchemaName"), - FOREIGN_TABLE_NAME((short)7, "foreignTableName"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // PARENT_CATALOG_NAME - return PARENT_CATALOG_NAME; - case 3: // PARENT_SCHEMA_NAME - return PARENT_SCHEMA_NAME; - case 4: // PARENT_TABLE_NAME - return PARENT_TABLE_NAME; - case 5: // FOREIGN_CATALOG_NAME - return FOREIGN_CATALOG_NAME; - case 6: // FOREIGN_SCHEMA_NAME - return FOREIGN_SCHEMA_NAME; - case 7: // FOREIGN_TABLE_NAME - return FOREIGN_TABLE_NAME; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.PARENT_CATALOG_NAME,_Fields.PARENT_SCHEMA_NAME,_Fields.PARENT_TABLE_NAME,_Fields.FOREIGN_CATALOG_NAME,_Fields.FOREIGN_SCHEMA_NAME,_Fields.FOREIGN_TABLE_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.PARENT_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.PARENT_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.PARENT_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.FOREIGN_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.FOREIGN_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.FOREIGN_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceReq.class, metaDataMap); - } - - public TGetCrossReferenceReq() { - } - - public TGetCrossReferenceReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetCrossReferenceReq(TGetCrossReferenceReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetParentCatalogName()) { - this.parentCatalogName = other.parentCatalogName; - } - if (other.isSetParentSchemaName()) { - this.parentSchemaName = other.parentSchemaName; - } - if (other.isSetParentTableName()) { - this.parentTableName = other.parentTableName; - } - if (other.isSetForeignCatalogName()) { - this.foreignCatalogName = other.foreignCatalogName; - } - if (other.isSetForeignSchemaName()) { - this.foreignSchemaName = other.foreignSchemaName; - } - if (other.isSetForeignTableName()) { - this.foreignTableName = other.foreignTableName; - } - } - - public TGetCrossReferenceReq deepCopy() { - return new TGetCrossReferenceReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.parentCatalogName = null; - this.parentSchemaName = null; - this.parentTableName = null; - this.foreignCatalogName = null; - this.foreignSchemaName = null; - this.foreignTableName = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getParentCatalogName() { - return this.parentCatalogName; - } - - public void setParentCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName) { - this.parentCatalogName = parentCatalogName; - } - - public void unsetParentCatalogName() { - this.parentCatalogName = null; - } - - /** Returns true if field parentCatalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetParentCatalogName() { - return this.parentCatalogName != null; - } - - public void setParentCatalogNameIsSet(boolean value) { - if (!value) { - this.parentCatalogName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getParentSchemaName() { - return this.parentSchemaName; - } - - public void setParentSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName) { - this.parentSchemaName = parentSchemaName; - } - - public void unsetParentSchemaName() { - this.parentSchemaName = null; - } - - /** Returns true if field parentSchemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetParentSchemaName() { - return this.parentSchemaName != null; - } - - public void setParentSchemaNameIsSet(boolean value) { - if (!value) { - this.parentSchemaName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getParentTableName() { - return this.parentTableName; - } - - public void setParentTableName(@org.apache.thrift.annotation.Nullable java.lang.String parentTableName) { - this.parentTableName = parentTableName; - } - - public void unsetParentTableName() { - this.parentTableName = null; - } - - /** Returns true if field parentTableName is set (has been assigned a value) and false otherwise */ - public boolean isSetParentTableName() { - return this.parentTableName != null; - } - - public void setParentTableNameIsSet(boolean value) { - if (!value) { - this.parentTableName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getForeignCatalogName() { - return this.foreignCatalogName; - } - - public void setForeignCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName) { - this.foreignCatalogName = foreignCatalogName; - } - - public void unsetForeignCatalogName() { - this.foreignCatalogName = null; - } - - /** Returns true if field foreignCatalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetForeignCatalogName() { - return this.foreignCatalogName != null; - } - - public void setForeignCatalogNameIsSet(boolean value) { - if (!value) { - this.foreignCatalogName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getForeignSchemaName() { - return this.foreignSchemaName; - } - - public void setForeignSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName) { - this.foreignSchemaName = foreignSchemaName; - } - - public void unsetForeignSchemaName() { - this.foreignSchemaName = null; - } - - /** Returns true if field foreignSchemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetForeignSchemaName() { - return this.foreignSchemaName != null; - } - - public void setForeignSchemaNameIsSet(boolean value) { - if (!value) { - this.foreignSchemaName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getForeignTableName() { - return this.foreignTableName; - } - - public void setForeignTableName(@org.apache.thrift.annotation.Nullable java.lang.String foreignTableName) { - this.foreignTableName = foreignTableName; - } - - public void unsetForeignTableName() { - this.foreignTableName = null; - } - - /** Returns true if field foreignTableName is set (has been assigned a value) and false otherwise */ - public boolean isSetForeignTableName() { - return this.foreignTableName != null; - } - - public void setForeignTableNameIsSet(boolean value) { - if (!value) { - this.foreignTableName = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case PARENT_CATALOG_NAME: - if (value == null) { - unsetParentCatalogName(); - } else { - setParentCatalogName((java.lang.String)value); - } - break; - - case PARENT_SCHEMA_NAME: - if (value == null) { - unsetParentSchemaName(); - } else { - setParentSchemaName((java.lang.String)value); - } - break; - - case PARENT_TABLE_NAME: - if (value == null) { - unsetParentTableName(); - } else { - setParentTableName((java.lang.String)value); - } - break; - - case FOREIGN_CATALOG_NAME: - if (value == null) { - unsetForeignCatalogName(); - } else { - setForeignCatalogName((java.lang.String)value); - } - break; - - case FOREIGN_SCHEMA_NAME: - if (value == null) { - unsetForeignSchemaName(); - } else { - setForeignSchemaName((java.lang.String)value); - } - break; - - case FOREIGN_TABLE_NAME: - if (value == null) { - unsetForeignTableName(); - } else { - setForeignTableName((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case PARENT_CATALOG_NAME: - return getParentCatalogName(); - - case PARENT_SCHEMA_NAME: - return getParentSchemaName(); - - case PARENT_TABLE_NAME: - return getParentTableName(); - - case FOREIGN_CATALOG_NAME: - return getForeignCatalogName(); - - case FOREIGN_SCHEMA_NAME: - return getForeignSchemaName(); - - case FOREIGN_TABLE_NAME: - return getForeignTableName(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case PARENT_CATALOG_NAME: - return isSetParentCatalogName(); - case PARENT_SCHEMA_NAME: - return isSetParentSchemaName(); - case PARENT_TABLE_NAME: - return isSetParentTableName(); - case FOREIGN_CATALOG_NAME: - return isSetForeignCatalogName(); - case FOREIGN_SCHEMA_NAME: - return isSetForeignSchemaName(); - case FOREIGN_TABLE_NAME: - return isSetForeignTableName(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetCrossReferenceReq) - return this.equals((TGetCrossReferenceReq)that); - return false; - } - - public boolean equals(TGetCrossReferenceReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_parentCatalogName = true && this.isSetParentCatalogName(); - boolean that_present_parentCatalogName = true && that.isSetParentCatalogName(); - if (this_present_parentCatalogName || that_present_parentCatalogName) { - if (!(this_present_parentCatalogName && that_present_parentCatalogName)) - return false; - if (!this.parentCatalogName.equals(that.parentCatalogName)) - return false; - } - - boolean this_present_parentSchemaName = true && this.isSetParentSchemaName(); - boolean that_present_parentSchemaName = true && that.isSetParentSchemaName(); - if (this_present_parentSchemaName || that_present_parentSchemaName) { - if (!(this_present_parentSchemaName && that_present_parentSchemaName)) - return false; - if (!this.parentSchemaName.equals(that.parentSchemaName)) - return false; - } - - boolean this_present_parentTableName = true && this.isSetParentTableName(); - boolean that_present_parentTableName = true && that.isSetParentTableName(); - if (this_present_parentTableName || that_present_parentTableName) { - if (!(this_present_parentTableName && that_present_parentTableName)) - return false; - if (!this.parentTableName.equals(that.parentTableName)) - return false; - } - - boolean this_present_foreignCatalogName = true && this.isSetForeignCatalogName(); - boolean that_present_foreignCatalogName = true && that.isSetForeignCatalogName(); - if (this_present_foreignCatalogName || that_present_foreignCatalogName) { - if (!(this_present_foreignCatalogName && that_present_foreignCatalogName)) - return false; - if (!this.foreignCatalogName.equals(that.foreignCatalogName)) - return false; - } - - boolean this_present_foreignSchemaName = true && this.isSetForeignSchemaName(); - boolean that_present_foreignSchemaName = true && that.isSetForeignSchemaName(); - if (this_present_foreignSchemaName || that_present_foreignSchemaName) { - if (!(this_present_foreignSchemaName && that_present_foreignSchemaName)) - return false; - if (!this.foreignSchemaName.equals(that.foreignSchemaName)) - return false; - } - - boolean this_present_foreignTableName = true && this.isSetForeignTableName(); - boolean that_present_foreignTableName = true && that.isSetForeignTableName(); - if (this_present_foreignTableName || that_present_foreignTableName) { - if (!(this_present_foreignTableName && that_present_foreignTableName)) - return false; - if (!this.foreignTableName.equals(that.foreignTableName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetParentCatalogName()) ? 131071 : 524287); - if (isSetParentCatalogName()) - hashCode = hashCode * 8191 + parentCatalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetParentSchemaName()) ? 131071 : 524287); - if (isSetParentSchemaName()) - hashCode = hashCode * 8191 + parentSchemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetParentTableName()) ? 131071 : 524287); - if (isSetParentTableName()) - hashCode = hashCode * 8191 + parentTableName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetForeignCatalogName()) ? 131071 : 524287); - if (isSetForeignCatalogName()) - hashCode = hashCode * 8191 + foreignCatalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetForeignSchemaName()) ? 131071 : 524287); - if (isSetForeignSchemaName()) - hashCode = hashCode * 8191 + foreignSchemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetForeignTableName()) ? 131071 : 524287); - if (isSetForeignTableName()) - hashCode = hashCode * 8191 + foreignTableName.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetCrossReferenceReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParentCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentCatalogName, other.parentCatalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParentSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentSchemaName, other.parentSchemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParentTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentTableName, other.parentTableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetForeignCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignCatalogName, other.foreignCatalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetForeignSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignSchemaName, other.foreignSchemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetForeignTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignTableName, other.foreignTableName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetParentCatalogName()) { - if (!first) sb.append(", "); - sb.append("parentCatalogName:"); - if (this.parentCatalogName == null) { - sb.append("null"); - } else { - sb.append(this.parentCatalogName); - } - first = false; - } - if (isSetParentSchemaName()) { - if (!first) sb.append(", "); - sb.append("parentSchemaName:"); - if (this.parentSchemaName == null) { - sb.append("null"); - } else { - sb.append(this.parentSchemaName); - } - first = false; - } - if (isSetParentTableName()) { - if (!first) sb.append(", "); - sb.append("parentTableName:"); - if (this.parentTableName == null) { - sb.append("null"); - } else { - sb.append(this.parentTableName); - } - first = false; - } - if (isSetForeignCatalogName()) { - if (!first) sb.append(", "); - sb.append("foreignCatalogName:"); - if (this.foreignCatalogName == null) { - sb.append("null"); - } else { - sb.append(this.foreignCatalogName); - } - first = false; - } - if (isSetForeignSchemaName()) { - if (!first) sb.append(", "); - sb.append("foreignSchemaName:"); - if (this.foreignSchemaName == null) { - sb.append("null"); - } else { - sb.append(this.foreignSchemaName); - } - first = false; - } - if (isSetForeignTableName()) { - if (!first) sb.append(", "); - sb.append("foreignTableName:"); - if (this.foreignTableName == null) { - sb.append("null"); - } else { - sb.append(this.foreignTableName); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetCrossReferenceReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCrossReferenceReqStandardScheme getScheme() { - return new TGetCrossReferenceReqStandardScheme(); - } - } - - private static class TGetCrossReferenceReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceReq 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: // PARENT_CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.parentCatalogName = iprot.readString(); - struct.setParentCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PARENT_SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.parentSchemaName = iprot.readString(); - struct.setParentSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARENT_TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.parentTableName = iprot.readString(); - struct.setParentTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // FOREIGN_CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.foreignCatalogName = iprot.readString(); - struct.setForeignCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // FOREIGN_SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.foreignSchemaName = iprot.readString(); - struct.setForeignSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // FOREIGN_TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.foreignTableName = iprot.readString(); - struct.setForeignTableNameIsSet(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, TGetCrossReferenceReq 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.parentCatalogName != null) { - if (struct.isSetParentCatalogName()) { - oprot.writeFieldBegin(PARENT_CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.parentCatalogName); - oprot.writeFieldEnd(); - } - } - if (struct.parentSchemaName != null) { - if (struct.isSetParentSchemaName()) { - oprot.writeFieldBegin(PARENT_SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.parentSchemaName); - oprot.writeFieldEnd(); - } - } - if (struct.parentTableName != null) { - if (struct.isSetParentTableName()) { - oprot.writeFieldBegin(PARENT_TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.parentTableName); - oprot.writeFieldEnd(); - } - } - if (struct.foreignCatalogName != null) { - if (struct.isSetForeignCatalogName()) { - oprot.writeFieldBegin(FOREIGN_CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.foreignCatalogName); - oprot.writeFieldEnd(); - } - } - if (struct.foreignSchemaName != null) { - if (struct.isSetForeignSchemaName()) { - oprot.writeFieldBegin(FOREIGN_SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.foreignSchemaName); - oprot.writeFieldEnd(); - } - } - if (struct.foreignTableName != null) { - if (struct.isSetForeignTableName()) { - oprot.writeFieldBegin(FOREIGN_TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.foreignTableName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCrossReferenceReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCrossReferenceReqTupleScheme getScheme() { - return new TGetCrossReferenceReqTupleScheme(); - } - } - - private static class TGetCrossReferenceReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetParentCatalogName()) { - optionals.set(0); - } - if (struct.isSetParentSchemaName()) { - optionals.set(1); - } - if (struct.isSetParentTableName()) { - optionals.set(2); - } - if (struct.isSetForeignCatalogName()) { - optionals.set(3); - } - if (struct.isSetForeignSchemaName()) { - optionals.set(4); - } - if (struct.isSetForeignTableName()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetParentCatalogName()) { - oprot.writeString(struct.parentCatalogName); - } - if (struct.isSetParentSchemaName()) { - oprot.writeString(struct.parentSchemaName); - } - if (struct.isSetParentTableName()) { - oprot.writeString(struct.parentTableName); - } - if (struct.isSetForeignCatalogName()) { - oprot.writeString(struct.foreignCatalogName); - } - if (struct.isSetForeignSchemaName()) { - oprot.writeString(struct.foreignSchemaName); - } - if (struct.isSetForeignTableName()) { - oprot.writeString(struct.foreignTableName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.parentCatalogName = iprot.readString(); - struct.setParentCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.parentSchemaName = iprot.readString(); - struct.setParentSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.parentTableName = iprot.readString(); - struct.setParentTableNameIsSet(true); - } - if (incoming.get(3)) { - struct.foreignCatalogName = iprot.readString(); - struct.setForeignCatalogNameIsSet(true); - } - if (incoming.get(4)) { - struct.foreignSchemaName = iprot.readString(); - struct.setForeignSchemaNameIsSet(true); - } - if (incoming.get(5)) { - struct.foreignTableName = iprot.readString(); - struct.setForeignTableNameIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java deleted file mode 100644 index 1a47e3effc08..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetCrossReferenceResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetCrossReferenceResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCrossReferenceRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCrossReferenceRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceResp.class, metaDataMap); - } - - public TGetCrossReferenceResp() { - } - - public TGetCrossReferenceResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetCrossReferenceResp(TGetCrossReferenceResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetCrossReferenceResp deepCopy() { - return new TGetCrossReferenceResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetCrossReferenceResp) - return this.equals((TGetCrossReferenceResp)that); - return false; - } - - public boolean equals(TGetCrossReferenceResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetCrossReferenceResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetCrossReferenceRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCrossReferenceRespStandardScheme getScheme() { - return new TGetCrossReferenceRespStandardScheme(); - } - } - - private static class TGetCrossReferenceRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceResp 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; - 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, TGetCrossReferenceResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCrossReferenceRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetCrossReferenceRespTupleScheme getScheme() { - return new TGetCrossReferenceRespTupleScheme(); - } - } - - private static class TGetCrossReferenceRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java deleted file mode 100644 index bb1353bea247..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenReq.java +++ /dev/null @@ -1,575 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq"); - - 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 OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField RENEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("renewer", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetDelegationTokenReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetDelegationTokenReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String owner; // required - private @org.apache.thrift.annotation.Nullable java.lang.String renewer; // 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"), - OWNER((short)2, "owner"), - RENEWER((short)3, "renewer"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // OWNER - return OWNER; - case 3: // RENEWER - return RENEWER; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap); - } - - public TGetDelegationTokenReq() { - } - - public TGetDelegationTokenReq( - TSessionHandle sessionHandle, - java.lang.String owner, - java.lang.String renewer) - { - this(); - this.sessionHandle = sessionHandle; - this.owner = owner; - this.renewer = renewer; - } - - /** - * Performs a deep copy on other. - */ - public TGetDelegationTokenReq(TGetDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetOwner()) { - this.owner = other.owner; - } - if (other.isSetRenewer()) { - this.renewer = other.renewer; - } - } - - public TGetDelegationTokenReq deepCopy() { - return new TGetDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.owner = null; - this.renewer = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getOwner() { - return this.owner; - } - - public void setOwner(@org.apache.thrift.annotation.Nullable java.lang.String owner) { - this.owner = owner; - } - - public void unsetOwner() { - this.owner = null; - } - - /** Returns true if field owner is set (has been assigned a value) and false otherwise */ - public boolean isSetOwner() { - return this.owner != null; - } - - public void setOwnerIsSet(boolean value) { - if (!value) { - this.owner = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getRenewer() { - return this.renewer; - } - - public void setRenewer(@org.apache.thrift.annotation.Nullable java.lang.String renewer) { - this.renewer = renewer; - } - - public void unsetRenewer() { - this.renewer = null; - } - - /** Returns true if field renewer is set (has been assigned a value) and false otherwise */ - public boolean isSetRenewer() { - return this.renewer != null; - } - - public void setRenewerIsSet(boolean value) { - if (!value) { - this.renewer = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case OWNER: - if (value == null) { - unsetOwner(); - } else { - setOwner((java.lang.String)value); - } - break; - - case RENEWER: - if (value == null) { - unsetRenewer(); - } else { - setRenewer((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case OWNER: - return getOwner(); - - case RENEWER: - return getRenewer(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case OWNER: - return isSetOwner(); - case RENEWER: - return isSetRenewer(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetDelegationTokenReq) - return this.equals((TGetDelegationTokenReq)that); - return false; - } - - public boolean equals(TGetDelegationTokenReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_owner = true && this.isSetOwner(); - boolean that_present_owner = true && that.isSetOwner(); - if (this_present_owner || that_present_owner) { - if (!(this_present_owner && that_present_owner)) - return false; - if (!this.owner.equals(that.owner)) - return false; - } - - boolean this_present_renewer = true && this.isSetRenewer(); - boolean that_present_renewer = true && that.isSetRenewer(); - if (this_present_renewer || that_present_renewer) { - if (!(this_present_renewer && that_present_renewer)) - return false; - if (!this.renewer.equals(that.renewer)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOwner()) ? 131071 : 524287); - if (isSetOwner()) - hashCode = hashCode * 8191 + owner.hashCode(); - - hashCode = hashCode * 8191 + ((isSetRenewer()) ? 131071 : 524287); - if (isSetRenewer()) - hashCode = hashCode * 8191 + renewer.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOwner()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRenewer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.renewer, other.renewer); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenReq("); - 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("owner:"); - if (this.owner == null) { - sb.append("null"); - } else { - sb.append(this.owner); - } - first = false; - if (!first) sb.append(", "); - sb.append("renewer:"); - if (this.renewer == null) { - sb.append("null"); - } else { - sb.append(this.renewer); - } - 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 (!isSetOwner()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'owner' is unset! Struct:" + toString()); - } - - if (!isSetRenewer()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'renewer' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetDelegationTokenReqStandardScheme getScheme() { - return new TGetDelegationTokenReqStandardScheme(); - } - } - - private static class TGetDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq 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: // OWNER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.owner = iprot.readString(); - struct.setOwnerIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // RENEWER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.renewer = iprot.readString(); - struct.setRenewerIsSet(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, TGetDelegationTokenReq 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.owner != null) { - oprot.writeFieldBegin(OWNER_FIELD_DESC); - oprot.writeString(struct.owner); - oprot.writeFieldEnd(); - } - if (struct.renewer != null) { - oprot.writeFieldBegin(RENEWER_FIELD_DESC); - oprot.writeString(struct.renewer); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetDelegationTokenReqTupleScheme getScheme() { - return new TGetDelegationTokenReqTupleScheme(); - } - } - - private static class TGetDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.owner); - oprot.writeString(struct.renewer); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.owner = iprot.readString(); - struct.setOwnerIsSet(true); - struct.renewer = iprot.readString(); - struct.setRenewerIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java deleted file mode 100644 index 06b10185938c..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetDelegationTokenResp.java +++ /dev/null @@ -1,483 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenResp"); - - 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetDelegationTokenRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetDelegationTokenRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.DELEGATION_TOKEN}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenResp.class, metaDataMap); - } - - public TGetDelegationTokenResp() { - } - - public TGetDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetDelegationTokenResp(TGetDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TGetDelegationTokenResp deepCopy() { - return new TGetDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - this.delegationToken = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetDelegationTokenResp) - return this.equals((TGetDelegationTokenResp)that); - return false; - } - - public boolean equals(TGetDelegationTokenResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); - if (isSetDelegationToken()) - hashCode = hashCode * 8191 + delegationToken.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetDelegationToken()) { - if (!first) sb.append(", "); - sb.append("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetDelegationTokenRespStandardScheme getScheme() { - return new TGetDelegationTokenRespStandardScheme(); - } - } - - private static class TGetDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenResp 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: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(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, TGetDelegationTokenResp 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.delegationToken != null) { - if (struct.isSetDelegationToken()) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetDelegationTokenRespTupleScheme getScheme() { - return new TGetDelegationTokenRespTupleScheme(); - } - } - - private static class TGetDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetDelegationToken()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetDelegationToken()) { - oprot.writeString(struct.delegationToken); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java deleted file mode 100644 index 3195cf0c22ec..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsReq.java +++ /dev/null @@ -1,690 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsReq"); - - 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetFunctionsReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetFunctionsReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String functionName; // 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"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - FUNCTION_NAME((short)4, "functionName"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // FUNCTION_NAME - return FUNCTION_NAME; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsReq.class, metaDataMap); - } - - public TGetFunctionsReq() { - } - - public TGetFunctionsReq( - TSessionHandle sessionHandle, - java.lang.String functionName) - { - this(); - this.sessionHandle = sessionHandle; - this.functionName = functionName; - } - - /** - * Performs a deep copy on other. - */ - public TGetFunctionsReq(TGetFunctionsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetFunctionName()) { - this.functionName = other.functionName; - } - } - - public TGetFunctionsReq deepCopy() { - return new TGetFunctionsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.functionName = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getFunctionName() { - return this.functionName; - } - - public void setFunctionName(@org.apache.thrift.annotation.Nullable java.lang.String functionName) { - this.functionName = functionName; - } - - public void unsetFunctionName() { - this.functionName = null; - } - - /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ - public boolean isSetFunctionName() { - return this.functionName != null; - } - - public void setFunctionNameIsSet(boolean value) { - if (!value) { - this.functionName = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((java.lang.String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((java.lang.String)value); - } - break; - - case FUNCTION_NAME: - if (value == null) { - unsetFunctionName(); - } else { - setFunctionName((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case FUNCTION_NAME: - return getFunctionName(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case FUNCTION_NAME: - return isSetFunctionName(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetFunctionsReq) - return this.equals((TGetFunctionsReq)that); - return false; - } - - public boolean equals(TGetFunctionsReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_functionName = true && this.isSetFunctionName(); - boolean that_present_functionName = true && that.isSetFunctionName(); - if (this_present_functionName || that_present_functionName) { - if (!(this_present_functionName && that_present_functionName)) - return false; - if (!this.functionName.equals(that.functionName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetFunctionName()) ? 131071 : 524287); - if (isSetFunctionName()) - hashCode = hashCode * 8191 + functionName.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetFunctionsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFunctionName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, other.functionName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (!first) sb.append(", "); - sb.append("functionName:"); - if (this.functionName == null) { - sb.append("null"); - } else { - sb.append(this.functionName); - } - 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 (!isSetFunctionName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'functionName' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetFunctionsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetFunctionsReqStandardScheme getScheme() { - return new TGetFunctionsReqStandardScheme(); - } - } - - private static class TGetFunctionsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsReq 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: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // FUNCTION_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.functionName = iprot.readString(); - struct.setFunctionNameIsSet(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, TGetFunctionsReq 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.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.functionName != null) { - oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); - oprot.writeString(struct.functionName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetFunctionsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetFunctionsReqTupleScheme getScheme() { - return new TGetFunctionsReqTupleScheme(); - } - } - - private static class TGetFunctionsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.functionName); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.functionName = iprot.readString(); - struct.setFunctionNameIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java deleted file mode 100644 index 9299b81b20d6..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetFunctionsResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetFunctionsRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetFunctionsRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsResp.class, metaDataMap); - } - - public TGetFunctionsResp() { - } - - public TGetFunctionsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetFunctionsResp(TGetFunctionsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetFunctionsResp deepCopy() { - return new TGetFunctionsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetFunctionsResp) - return this.equals((TGetFunctionsResp)that); - return false; - } - - public boolean equals(TGetFunctionsResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetFunctionsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetFunctionsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetFunctionsRespStandardScheme getScheme() { - return new TGetFunctionsRespStandardScheme(); - } - } - - private static class TGetFunctionsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsResp 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; - 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, TGetFunctionsResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetFunctionsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetFunctionsRespTupleScheme getScheme() { - return new TGetFunctionsRespTupleScheme(); - } - } - - private static class TGetFunctionsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java deleted file mode 100644 index f9a6a5a88c24..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoReq.java +++ /dev/null @@ -1,486 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoReq"); - - 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 INFO_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoType", org.apache.thrift.protocol.TType.I32, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable TGetInfoType infoType; // 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"), - /** - * - * @see TGetInfoType - */ - INFO_TYPE((short)2, "infoType"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // INFO_TYPE - return INFO_TYPE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.INFO_TYPE, new org.apache.thrift.meta_data.FieldMetaData("infoType", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGetInfoType.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoReq.class, metaDataMap); - } - - public TGetInfoReq() { - } - - public TGetInfoReq( - TSessionHandle sessionHandle, - TGetInfoType infoType) - { - this(); - this.sessionHandle = sessionHandle; - this.infoType = infoType; - } - - /** - * Performs a deep copy on other. - */ - public TGetInfoReq(TGetInfoReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetInfoType()) { - this.infoType = other.infoType; - } - } - - public TGetInfoReq deepCopy() { - return new TGetInfoReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.infoType = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - /** - * - * @see TGetInfoType - */ - @org.apache.thrift.annotation.Nullable - public TGetInfoType getInfoType() { - return this.infoType; - } - - /** - * - * @see TGetInfoType - */ - public void setInfoType(@org.apache.thrift.annotation.Nullable TGetInfoType infoType) { - this.infoType = infoType; - } - - public void unsetInfoType() { - this.infoType = null; - } - - /** Returns true if field infoType is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoType() { - return this.infoType != null; - } - - public void setInfoTypeIsSet(boolean value) { - if (!value) { - this.infoType = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case INFO_TYPE: - if (value == null) { - unsetInfoType(); - } else { - setInfoType((TGetInfoType)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case INFO_TYPE: - return getInfoType(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case INFO_TYPE: - return isSetInfoType(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetInfoReq) - return this.equals((TGetInfoReq)that); - return false; - } - - public boolean equals(TGetInfoReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_infoType = true && this.isSetInfoType(); - boolean that_present_infoType = true && that.isSetInfoType(); - if (this_present_infoType || that_present_infoType) { - if (!(this_present_infoType && that_present_infoType)) - return false; - if (!this.infoType.equals(that.infoType)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetInfoType()) ? 131071 : 524287); - if (isSetInfoType()) - hashCode = hashCode * 8191 + infoType.getValue(); - - return hashCode; - } - - @Override - public int compareTo(TGetInfoReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoType, other.infoType); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoReq("); - 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("infoType:"); - if (this.infoType == null) { - sb.append("null"); - } else { - sb.append(this.infoType); - } - 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 (!isSetInfoType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoType' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetInfoReqStandardScheme getScheme() { - return new TGetInfoReqStandardScheme(); - } - } - - private static class TGetInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq 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: // INFO_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.infoType = org.apache.spark.service.rpc.thrift.TGetInfoType.findByValue(iprot.readI32()); - struct.setInfoTypeIsSet(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, TGetInfoReq 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.infoType != null) { - oprot.writeFieldBegin(INFO_TYPE_FIELD_DESC); - oprot.writeI32(struct.infoType.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetInfoReqTupleScheme getScheme() { - return new TGetInfoReqTupleScheme(); - } - } - - private static class TGetInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeI32(struct.infoType.getValue()); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.infoType = org.apache.spark.service.rpc.thrift.TGetInfoType.findByValue(iprot.readI32()); - struct.setInfoTypeIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java deleted file mode 100644 index 3ef40fba7e91..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoResp.java +++ /dev/null @@ -1,476 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp"); - - 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 INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TGetInfoValue infoValue; // 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 { - STATUS((short)1, "status"), - INFO_VALUE((short)2, "infoValue"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // INFO_VALUE - return INFO_VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap); - } - - public TGetInfoResp() { - } - - public TGetInfoResp( - TStatus status, - TGetInfoValue infoValue) - { - this(); - this.status = status; - this.infoValue = infoValue; - } - - /** - * Performs a deep copy on other. - */ - public TGetInfoResp(TGetInfoResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetInfoValue()) { - this.infoValue = new TGetInfoValue(other.infoValue); - } - } - - public TGetInfoResp deepCopy() { - return new TGetInfoResp(this); - } - - @Override - public void clear() { - this.status = null; - this.infoValue = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TGetInfoValue getInfoValue() { - return this.infoValue; - } - - public void setInfoValue(@org.apache.thrift.annotation.Nullable TGetInfoValue infoValue) { - this.infoValue = infoValue; - } - - public void unsetInfoValue() { - this.infoValue = null; - } - - /** Returns true if field infoValue is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoValue() { - return this.infoValue != null; - } - - public void setInfoValueIsSet(boolean value) { - if (!value) { - this.infoValue = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case INFO_VALUE: - if (value == null) { - unsetInfoValue(); - } else { - setInfoValue((TGetInfoValue)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case INFO_VALUE: - return getInfoValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case INFO_VALUE: - return isSetInfoValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetInfoResp) - return this.equals((TGetInfoResp)that); - return false; - } - - public boolean equals(TGetInfoResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_infoValue = true && this.isSetInfoValue(); - boolean that_present_infoValue = true && that.isSetInfoValue(); - if (this_present_infoValue || that_present_infoValue) { - if (!(this_present_infoValue && that_present_infoValue)) - return false; - if (!this.infoValue.equals(that.infoValue)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetInfoValue()) ? 131071 : 524287); - if (isSetInfoValue()) - hashCode = hashCode * 8191 + infoValue.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetInfoResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoValue, other.infoValue); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoResp("); - 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("infoValue:"); - if (this.infoValue == null) { - sb.append("null"); - } else { - sb.append(this.infoValue); - } - 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 (!isSetInfoValue()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoValue' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetInfoRespStandardScheme getScheme() { - return new TGetInfoRespStandardScheme(); - } - } - - private static class TGetInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp 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: // INFO_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.infoValue = new TGetInfoValue(); - struct.infoValue.read(iprot); - struct.setInfoValueIsSet(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, TGetInfoResp 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.infoValue != null) { - oprot.writeFieldBegin(INFO_VALUE_FIELD_DESC); - struct.infoValue.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetInfoRespTupleScheme getScheme() { - return new TGetInfoRespTupleScheme(); - } - } - - private static class TGetInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - struct.infoValue.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - struct.infoValue = new TGetInfoValue(); - struct.infoValue.read(iprot); - struct.setInfoValueIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java deleted file mode 100644 index a09d0b1fa15c..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoType.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TGetInfoType implements org.apache.thrift.TEnum { - CLI_MAX_DRIVER_CONNECTIONS(0), - CLI_MAX_CONCURRENT_ACTIVITIES(1), - CLI_DATA_SOURCE_NAME(2), - CLI_FETCH_DIRECTION(8), - CLI_SERVER_NAME(13), - CLI_SEARCH_PATTERN_ESCAPE(14), - CLI_DBMS_NAME(17), - CLI_DBMS_VER(18), - CLI_ACCESSIBLE_TABLES(19), - CLI_ACCESSIBLE_PROCEDURES(20), - CLI_CURSOR_COMMIT_BEHAVIOR(23), - CLI_DATA_SOURCE_READ_ONLY(25), - CLI_DEFAULT_TXN_ISOLATION(26), - CLI_IDENTIFIER_CASE(28), - CLI_IDENTIFIER_QUOTE_CHAR(29), - CLI_MAX_COLUMN_NAME_LEN(30), - CLI_MAX_CURSOR_NAME_LEN(31), - CLI_MAX_SCHEMA_NAME_LEN(32), - CLI_MAX_CATALOG_NAME_LEN(34), - CLI_MAX_TABLE_NAME_LEN(35), - CLI_SCROLL_CONCURRENCY(43), - CLI_TXN_CAPABLE(46), - CLI_USER_NAME(47), - CLI_TXN_ISOLATION_OPTION(72), - CLI_INTEGRITY(73), - CLI_GETDATA_EXTENSIONS(81), - CLI_NULL_COLLATION(85), - CLI_ALTER_TABLE(86), - CLI_ORDER_BY_COLUMNS_IN_SELECT(90), - CLI_SPECIAL_CHARACTERS(94), - CLI_MAX_COLUMNS_IN_GROUP_BY(97), - CLI_MAX_COLUMNS_IN_INDEX(98), - CLI_MAX_COLUMNS_IN_ORDER_BY(99), - CLI_MAX_COLUMNS_IN_SELECT(100), - CLI_MAX_COLUMNS_IN_TABLE(101), - CLI_MAX_INDEX_SIZE(102), - CLI_MAX_ROW_SIZE(104), - CLI_MAX_STATEMENT_LEN(105), - CLI_MAX_TABLES_IN_SELECT(106), - CLI_MAX_USER_NAME_LEN(107), - CLI_OJ_CAPABILITIES(115), - CLI_XOPEN_CLI_YEAR(10000), - CLI_CURSOR_SENSITIVITY(10001), - CLI_DESCRIBE_PARAMETER(10002), - CLI_CATALOG_NAME(10003), - CLI_COLLATION_SEQ(10004), - CLI_MAX_IDENTIFIER_LEN(10005), - CLI_ODBC_KEYWORDS(10006); - - private final int value; - - private TGetInfoType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TGetInfoType findByValue(int value) { - switch (value) { - case 0: - return CLI_MAX_DRIVER_CONNECTIONS; - case 1: - return CLI_MAX_CONCURRENT_ACTIVITIES; - case 2: - return CLI_DATA_SOURCE_NAME; - case 8: - return CLI_FETCH_DIRECTION; - case 13: - return CLI_SERVER_NAME; - case 14: - return CLI_SEARCH_PATTERN_ESCAPE; - case 17: - return CLI_DBMS_NAME; - case 18: - return CLI_DBMS_VER; - case 19: - return CLI_ACCESSIBLE_TABLES; - case 20: - return CLI_ACCESSIBLE_PROCEDURES; - case 23: - return CLI_CURSOR_COMMIT_BEHAVIOR; - case 25: - return CLI_DATA_SOURCE_READ_ONLY; - case 26: - return CLI_DEFAULT_TXN_ISOLATION; - case 28: - return CLI_IDENTIFIER_CASE; - case 29: - return CLI_IDENTIFIER_QUOTE_CHAR; - case 30: - return CLI_MAX_COLUMN_NAME_LEN; - case 31: - return CLI_MAX_CURSOR_NAME_LEN; - case 32: - return CLI_MAX_SCHEMA_NAME_LEN; - case 34: - return CLI_MAX_CATALOG_NAME_LEN; - case 35: - return CLI_MAX_TABLE_NAME_LEN; - case 43: - return CLI_SCROLL_CONCURRENCY; - case 46: - return CLI_TXN_CAPABLE; - case 47: - return CLI_USER_NAME; - case 72: - return CLI_TXN_ISOLATION_OPTION; - case 73: - return CLI_INTEGRITY; - case 81: - return CLI_GETDATA_EXTENSIONS; - case 85: - return CLI_NULL_COLLATION; - case 86: - return CLI_ALTER_TABLE; - case 90: - return CLI_ORDER_BY_COLUMNS_IN_SELECT; - case 94: - return CLI_SPECIAL_CHARACTERS; - case 97: - return CLI_MAX_COLUMNS_IN_GROUP_BY; - case 98: - return CLI_MAX_COLUMNS_IN_INDEX; - case 99: - return CLI_MAX_COLUMNS_IN_ORDER_BY; - case 100: - return CLI_MAX_COLUMNS_IN_SELECT; - case 101: - return CLI_MAX_COLUMNS_IN_TABLE; - case 102: - return CLI_MAX_INDEX_SIZE; - case 104: - return CLI_MAX_ROW_SIZE; - case 105: - return CLI_MAX_STATEMENT_LEN; - case 106: - return CLI_MAX_TABLES_IN_SELECT; - case 107: - return CLI_MAX_USER_NAME_LEN; - case 115: - return CLI_OJ_CAPABILITIES; - case 10000: - return CLI_XOPEN_CLI_YEAR; - case 10001: - return CLI_CURSOR_SENSITIVITY; - case 10002: - return CLI_DESCRIBE_PARAMETER; - case 10003: - return CLI_CATALOG_NAME; - case 10004: - return CLI_COLLATION_SEQ; - case 10005: - return CLI_MAX_IDENTIFIER_LEN; - case 10006: - return CLI_ODBC_KEYWORDS; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java deleted file mode 100644 index 602d0d8dfc43..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetInfoValue.java +++ /dev/null @@ -1,574 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetInfoValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoValue"); - private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SMALL_INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("smallIntValue", org.apache.thrift.protocol.TType.I16, (short)2); - private static final org.apache.thrift.protocol.TField INTEGER_BITMASK_FIELD_DESC = new org.apache.thrift.protocol.TField("integerBitmask", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField INTEGER_FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("integerFlag", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField BINARY_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryValue", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField LEN_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("lenValue", org.apache.thrift.protocol.TType.I64, (short)6); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STRING_VALUE((short)1, "stringValue"), - SMALL_INT_VALUE((short)2, "smallIntValue"), - INTEGER_BITMASK((short)3, "integerBitmask"), - INTEGER_FLAG((short)4, "integerFlag"), - BINARY_VALUE((short)5, "binaryValue"), - LEN_VALUE((short)6, "lenValue"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STRING_VALUE - return STRING_VALUE; - case 2: // SMALL_INT_VALUE - return SMALL_INT_VALUE; - case 3: // INTEGER_BITMASK - return INTEGER_BITMASK; - case 4: // INTEGER_FLAG - return INTEGER_FLAG; - case 5: // BINARY_VALUE - return BINARY_VALUE; - case 6: // LEN_VALUE - return LEN_VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoValue.class, metaDataMap); - } - - public TGetInfoValue() { - super(); - } - - public TGetInfoValue(_Fields setField, java.lang.Object value) { - super(setField, value); - } - - public TGetInfoValue(TGetInfoValue other) { - super(other); - } - public TGetInfoValue deepCopy() { - return new TGetInfoValue(this); - } - - public static TGetInfoValue stringValue(java.lang.String value) { - TGetInfoValue x = new TGetInfoValue(); - x.setStringValue(value); - return x; - } - - public static TGetInfoValue smallIntValue(short value) { - TGetInfoValue x = new TGetInfoValue(); - x.setSmallIntValue(value); - return x; - } - - public static TGetInfoValue integerBitmask(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setIntegerBitmask(value); - return x; - } - - public static TGetInfoValue integerFlag(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setIntegerFlag(value); - return x; - } - - public static TGetInfoValue binaryValue(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setBinaryValue(value); - return x; - } - - public static TGetInfoValue lenValue(long value) { - TGetInfoValue x = new TGetInfoValue(); - x.setLenValue(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { - switch (setField) { - case STRING_VALUE: - if (value instanceof java.lang.String) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); - case SMALL_INT_VALUE: - if (value instanceof java.lang.Short) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); - case INTEGER_BITMASK: - if (value instanceof java.lang.Integer) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); - case INTEGER_FLAG: - if (value instanceof java.lang.Integer) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); - case BINARY_VALUE: - if (value instanceof java.lang.Integer) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); - case LEN_VALUE: - if (value instanceof java.lang.Long) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Long for field 'lenValue', but got " + value.getClass().getSimpleName()); - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case STRING_VALUE: - if (field.type == STRING_VALUE_FIELD_DESC.type) { - java.lang.String stringValue; - stringValue = iprot.readString(); - return stringValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case SMALL_INT_VALUE: - if (field.type == SMALL_INT_VALUE_FIELD_DESC.type) { - java.lang.Short smallIntValue; - smallIntValue = iprot.readI16(); - return smallIntValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case INTEGER_BITMASK: - if (field.type == INTEGER_BITMASK_FIELD_DESC.type) { - java.lang.Integer integerBitmask; - integerBitmask = iprot.readI32(); - return integerBitmask; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case INTEGER_FLAG: - if (field.type == INTEGER_FLAG_FIELD_DESC.type) { - java.lang.Integer integerFlag; - integerFlag = iprot.readI32(); - return integerFlag; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BINARY_VALUE: - if (field.type == BINARY_VALUE_FIELD_DESC.type) { - java.lang.Integer binaryValue; - binaryValue = iprot.readI32(); - return binaryValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case LEN_VALUE: - if (field.type == LEN_VALUE_FIELD_DESC.type) { - java.lang.Long lenValue; - lenValue = iprot.readI64(); - return lenValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; - oprot.writeString(stringValue); - return; - case SMALL_INT_VALUE: - java.lang.Short smallIntValue = (java.lang.Short)value_; - oprot.writeI16(smallIntValue); - return; - case INTEGER_BITMASK: - java.lang.Integer integerBitmask = (java.lang.Integer)value_; - oprot.writeI32(integerBitmask); - return; - case INTEGER_FLAG: - java.lang.Integer integerFlag = (java.lang.Integer)value_; - oprot.writeI32(integerFlag); - return; - case BINARY_VALUE: - java.lang.Integer binaryValue = (java.lang.Integer)value_; - oprot.writeI32(binaryValue); - return; - case LEN_VALUE: - java.lang.Long lenValue = (java.lang.Long)value_; - oprot.writeI64(lenValue); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case STRING_VALUE: - java.lang.String stringValue; - stringValue = iprot.readString(); - return stringValue; - case SMALL_INT_VALUE: - java.lang.Short smallIntValue; - smallIntValue = iprot.readI16(); - return smallIntValue; - case INTEGER_BITMASK: - java.lang.Integer integerBitmask; - integerBitmask = iprot.readI32(); - return integerBitmask; - case INTEGER_FLAG: - java.lang.Integer integerFlag; - integerFlag = iprot.readI32(); - return integerFlag; - case BINARY_VALUE: - java.lang.Integer binaryValue; - binaryValue = iprot.readI32(); - return binaryValue; - case LEN_VALUE: - java.lang.Long lenValue; - lenValue = iprot.readI64(); - return lenValue; - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; - oprot.writeString(stringValue); - return; - case SMALL_INT_VALUE: - java.lang.Short smallIntValue = (java.lang.Short)value_; - oprot.writeI16(smallIntValue); - return; - case INTEGER_BITMASK: - java.lang.Integer integerBitmask = (java.lang.Integer)value_; - oprot.writeI32(integerBitmask); - return; - case INTEGER_FLAG: - java.lang.Integer integerFlag = (java.lang.Integer)value_; - oprot.writeI32(integerFlag); - return; - case BINARY_VALUE: - java.lang.Integer binaryValue = (java.lang.Integer)value_; - oprot.writeI32(binaryValue); - return; - case LEN_VALUE: - java.lang.Long lenValue = (java.lang.Long)value_; - oprot.writeI64(lenValue); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case STRING_VALUE: - return STRING_VALUE_FIELD_DESC; - case SMALL_INT_VALUE: - return SMALL_INT_VALUE_FIELD_DESC; - case INTEGER_BITMASK: - return INTEGER_BITMASK_FIELD_DESC; - case INTEGER_FLAG: - return INTEGER_FLAG_FIELD_DESC; - case BINARY_VALUE: - return BINARY_VALUE_FIELD_DESC; - case LEN_VALUE: - return LEN_VALUE_FIELD_DESC; - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public java.lang.String getStringValue() { - if (getSetField() == _Fields.STRING_VALUE) { - return (java.lang.String)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringValue(java.lang.String value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.STRING_VALUE; - value_ = value; - } - - public short getSmallIntValue() { - if (getSetField() == _Fields.SMALL_INT_VALUE) { - return (java.lang.Short)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setSmallIntValue(short value) { - setField_ = _Fields.SMALL_INT_VALUE; - value_ = value; - } - - public int getIntegerBitmask() { - if (getSetField() == _Fields.INTEGER_BITMASK) { - return (java.lang.Integer)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setIntegerBitmask(int value) { - setField_ = _Fields.INTEGER_BITMASK; - value_ = value; - } - - public int getIntegerFlag() { - if (getSetField() == _Fields.INTEGER_FLAG) { - return (java.lang.Integer)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setIntegerFlag(int value) { - setField_ = _Fields.INTEGER_FLAG; - value_ = value; - } - - public int getBinaryValue() { - if (getSetField() == _Fields.BINARY_VALUE) { - return (java.lang.Integer)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBinaryValue(int value) { - setField_ = _Fields.BINARY_VALUE; - value_ = value; - } - - public long getLenValue() { - if (getSetField() == _Fields.LEN_VALUE) { - return (java.lang.Long)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setLenValue(long value) { - setField_ = _Fields.LEN_VALUE; - value_ = value; - } - - public boolean isSetStringValue() { - return setField_ == _Fields.STRING_VALUE; - } - - - public boolean isSetSmallIntValue() { - return setField_ == _Fields.SMALL_INT_VALUE; - } - - - public boolean isSetIntegerBitmask() { - return setField_ == _Fields.INTEGER_BITMASK; - } - - - public boolean isSetIntegerFlag() { - return setField_ == _Fields.INTEGER_FLAG; - } - - - public boolean isSetBinaryValue() { - return setField_ == _Fields.BINARY_VALUE; - } - - - public boolean isSetLenValue() { - return setField_ == _Fields.LEN_VALUE; - } - - - public boolean equals(java.lang.Object other) { - if (other instanceof TGetInfoValue) { - return equals((TGetInfoValue)other); - } else { - return false; - } - } - - public boolean equals(TGetInfoValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TGetInfoValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - java.util.List list = new java.util.ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - 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, java.lang.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); - } - } - - -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java deleted file mode 100644 index f66d30b0d367..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusReq.java +++ /dev/null @@ -1,479 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusReq"); - - 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)1); - private static final org.apache.thrift.protocol.TField GET_PROGRESS_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("getProgressUpdate", org.apache.thrift.protocol.TType.BOOL, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetOperationStatusReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetOperationStatusReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required - private boolean getProgressUpdate; // 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 { - OPERATION_HANDLE((short)1, "operationHandle"), - GET_PROGRESS_UPDATE((short)2, "getProgressUpdate"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - case 2: // GET_PROGRESS_UPDATE - return GET_PROGRESS_UPDATE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __GETPROGRESSUPDATE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.GET_PROGRESS_UPDATE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.GET_PROGRESS_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("getProgressUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusReq.class, metaDataMap); - } - - public TGetOperationStatusReq() { - } - - public TGetOperationStatusReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetOperationStatusReq(TGetOperationStatusReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - this.getProgressUpdate = other.getProgressUpdate; - } - - public TGetOperationStatusReq deepCopy() { - return new TGetOperationStatusReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - setGetProgressUpdateIsSet(false); - this.getProgressUpdate = false; - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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 boolean isGetProgressUpdate() { - return this.getProgressUpdate; - } - - public void setGetProgressUpdate(boolean getProgressUpdate) { - this.getProgressUpdate = getProgressUpdate; - setGetProgressUpdateIsSet(true); - } - - public void unsetGetProgressUpdate() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); - } - - /** Returns true if field getProgressUpdate is set (has been assigned a value) and false otherwise */ - public boolean isSetGetProgressUpdate() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); - } - - public void setGetProgressUpdateIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - case GET_PROGRESS_UPDATE: - if (value == null) { - unsetGetProgressUpdate(); - } else { - setGetProgressUpdate((java.lang.Boolean)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - case GET_PROGRESS_UPDATE: - return isGetProgressUpdate(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - case GET_PROGRESS_UPDATE: - return isSetGetProgressUpdate(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetOperationStatusReq) - return this.equals((TGetOperationStatusReq)that); - return false; - } - - public boolean equals(TGetOperationStatusReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_getProgressUpdate = true && this.isSetGetProgressUpdate(); - boolean that_present_getProgressUpdate = true && that.isSetGetProgressUpdate(); - if (this_present_getProgressUpdate || that_present_getProgressUpdate) { - if (!(this_present_getProgressUpdate && that_present_getProgressUpdate)) - return false; - if (this.getProgressUpdate != that.getProgressUpdate) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetGetProgressUpdate()) ? 131071 : 524287); - if (isSetGetProgressUpdate()) - hashCode = hashCode * 8191 + ((getProgressUpdate) ? 131071 : 524287); - - return hashCode; - } - - @Override - public int compareTo(TGetOperationStatusReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGetProgressUpdate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.getProgressUpdate, other.getProgressUpdate); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - if (isSetGetProgressUpdate()) { - if (!first) sb.append(", "); - sb.append("getProgressUpdate:"); - sb.append(this.getProgressUpdate); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TGetOperationStatusReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetOperationStatusReqStandardScheme getScheme() { - return new TGetOperationStatusReqStandardScheme(); - } - } - - private static class TGetOperationStatusReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusReq 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: // 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 2: // GET_PROGRESS_UPDATE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.getProgressUpdate = iprot.readBool(); - struct.setGetProgressUpdateIsSet(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, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.isSetGetProgressUpdate()) { - oprot.writeFieldBegin(GET_PROGRESS_UPDATE_FIELD_DESC); - oprot.writeBool(struct.getProgressUpdate); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetOperationStatusReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetOperationStatusReqTupleScheme getScheme() { - return new TGetOperationStatusReqTupleScheme(); - } - } - - private static class TGetOperationStatusReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetGetProgressUpdate()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetGetProgressUpdate()) { - oprot.writeBool(struct.getProgressUpdate); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.getProgressUpdate = iprot.readBool(); - struct.setGetProgressUpdateIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java deleted file mode 100644 index 75694a786dc9..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetOperationStatusResp.java +++ /dev/null @@ -1,1317 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusResp"); - - 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_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationState", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField TASK_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStatus", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField OPERATION_STARTED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationStarted", org.apache.thrift.protocol.TType.I64, (short)7); - private static final org.apache.thrift.protocol.TField OPERATION_COMPLETED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationCompleted", org.apache.thrift.protocol.TType.I64, (short)8); - private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)9); - private static final org.apache.thrift.protocol.TField PROGRESS_UPDATE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressUpdateResponse", org.apache.thrift.protocol.TType.STRUCT, (short)10); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetOperationStatusRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetOperationStatusRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationState operationState; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional - private int errorCode; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String taskStatus; // optional - private long operationStarted; // optional - private long operationCompleted; // optional - private boolean hasResultSet; // optional - private @org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse; // 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"), - /** - * - * @see TOperationState - */ - OPERATION_STATE((short)2, "operationState"), - SQL_STATE((short)3, "sqlState"), - ERROR_CODE((short)4, "errorCode"), - ERROR_MESSAGE((short)5, "errorMessage"), - TASK_STATUS((short)6, "taskStatus"), - OPERATION_STARTED((short)7, "operationStarted"), - OPERATION_COMPLETED((short)8, "operationCompleted"), - HAS_RESULT_SET((short)9, "hasResultSet"), - PROGRESS_UPDATE_RESPONSE((short)10, "progressUpdateResponse"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_STATE - return OPERATION_STATE; - case 3: // SQL_STATE - return SQL_STATE; - case 4: // ERROR_CODE - return ERROR_CODE; - case 5: // ERROR_MESSAGE - return ERROR_MESSAGE; - case 6: // TASK_STATUS - return TASK_STATUS; - case 7: // OPERATION_STARTED - return OPERATION_STARTED; - case 8: // OPERATION_COMPLETED - return OPERATION_COMPLETED; - case 9: // HAS_RESULT_SET - return HAS_RESULT_SET; - case 10: // PROGRESS_UPDATE_RESPONSE - return PROGRESS_UPDATE_RESPONSE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERRORCODE_ISSET_ID = 0; - private static final int __OPERATIONSTARTED_ISSET_ID = 1; - private static final int __OPERATIONCOMPLETED_ISSET_ID = 2; - private static final int __HASRESULTSET_ISSET_ID = 3; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET,_Fields.PROGRESS_UPDATE_RESPONSE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationState.class))); - tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TASK_STATUS, new org.apache.thrift.meta_data.FieldMetaData("taskStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OPERATION_STARTED, new org.apache.thrift.meta_data.FieldMetaData("operationStarted", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.OPERATION_COMPLETED, new org.apache.thrift.meta_data.FieldMetaData("operationCompleted", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.PROGRESS_UPDATE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("progressUpdateResponse", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TProgressUpdateResp"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap); - } - - public TGetOperationStatusResp() { - } - - public TGetOperationStatusResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetOperationStatusResp(TGetOperationStatusResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationState()) { - this.operationState = other.operationState; - } - if (other.isSetSqlState()) { - this.sqlState = other.sqlState; - } - this.errorCode = other.errorCode; - if (other.isSetErrorMessage()) { - this.errorMessage = other.errorMessage; - } - if (other.isSetTaskStatus()) { - this.taskStatus = other.taskStatus; - } - this.operationStarted = other.operationStarted; - this.operationCompleted = other.operationCompleted; - this.hasResultSet = other.hasResultSet; - if (other.isSetProgressUpdateResponse()) { - this.progressUpdateResponse = new TProgressUpdateResp(other.progressUpdateResponse); - } - } - - public TGetOperationStatusResp deepCopy() { - return new TGetOperationStatusResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationState = null; - this.sqlState = null; - setErrorCodeIsSet(false); - this.errorCode = 0; - this.errorMessage = null; - this.taskStatus = null; - setOperationStartedIsSet(false); - this.operationStarted = 0; - setOperationCompletedIsSet(false); - this.operationCompleted = 0; - setHasResultSetIsSet(false); - this.hasResultSet = false; - this.progressUpdateResponse = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - /** - * - * @see TOperationState - */ - @org.apache.thrift.annotation.Nullable - public TOperationState getOperationState() { - return this.operationState; - } - - /** - * - * @see TOperationState - */ - public void setOperationState(@org.apache.thrift.annotation.Nullable TOperationState operationState) { - this.operationState = operationState; - } - - public void unsetOperationState() { - this.operationState = null; - } - - /** Returns true if field operationState is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationState() { - return this.operationState != null; - } - - public void setOperationStateIsSet(boolean value) { - if (!value) { - this.operationState = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getSqlState() { - return this.sqlState; - } - - public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { - this.sqlState = sqlState; - } - - public void unsetSqlState() { - this.sqlState = null; - } - - /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ - public boolean isSetSqlState() { - return this.sqlState != null; - } - - public void setSqlStateIsSet(boolean value) { - if (!value) { - this.sqlState = null; - } - } - - public int getErrorCode() { - return this.errorCode; - } - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - setErrorCodeIsSet(true); - } - - public void unsetErrorCode() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorCode() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getErrorMessage() { - return this.errorMessage; - } - - public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { - this.errorMessage = errorMessage; - } - - public void unsetErrorMessage() { - this.errorMessage = null; - } - - /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorMessage() { - return this.errorMessage != null; - } - - public void setErrorMessageIsSet(boolean value) { - if (!value) { - this.errorMessage = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getTaskStatus() { - return this.taskStatus; - } - - public void setTaskStatus(@org.apache.thrift.annotation.Nullable java.lang.String taskStatus) { - this.taskStatus = taskStatus; - } - - public void unsetTaskStatus() { - this.taskStatus = null; - } - - /** Returns true if field taskStatus is set (has been assigned a value) and false otherwise */ - public boolean isSetTaskStatus() { - return this.taskStatus != null; - } - - public void setTaskStatusIsSet(boolean value) { - if (!value) { - this.taskStatus = null; - } - } - - public long getOperationStarted() { - return this.operationStarted; - } - - public void setOperationStarted(long operationStarted) { - this.operationStarted = operationStarted; - setOperationStartedIsSet(true); - } - - public void unsetOperationStarted() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); - } - - /** Returns true if field operationStarted is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationStarted() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); - } - - public void setOperationStartedIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); - } - - public long getOperationCompleted() { - return this.operationCompleted; - } - - public void setOperationCompleted(long operationCompleted) { - this.operationCompleted = operationCompleted; - setOperationCompletedIsSet(true); - } - - public void unsetOperationCompleted() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); - } - - /** Returns true if field operationCompleted is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationCompleted() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); - } - - public void setOperationCompletedIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); - } - - public boolean isHasResultSet() { - return this.hasResultSet; - } - - public void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - public void unsetHasResultSet() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ - public boolean isSetHasResultSet() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); - } - - @org.apache.thrift.annotation.Nullable - public TProgressUpdateResp getProgressUpdateResponse() { - return this.progressUpdateResponse; - } - - public void setProgressUpdateResponse(@org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse) { - this.progressUpdateResponse = progressUpdateResponse; - } - - public void unsetProgressUpdateResponse() { - this.progressUpdateResponse = null; - } - - /** Returns true if field progressUpdateResponse is set (has been assigned a value) and false otherwise */ - public boolean isSetProgressUpdateResponse() { - return this.progressUpdateResponse != null; - } - - public void setProgressUpdateResponseIsSet(boolean value) { - if (!value) { - this.progressUpdateResponse = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_STATE: - if (value == null) { - unsetOperationState(); - } else { - setOperationState((TOperationState)value); - } - break; - - case SQL_STATE: - if (value == null) { - unsetSqlState(); - } else { - setSqlState((java.lang.String)value); - } - break; - - case ERROR_CODE: - if (value == null) { - unsetErrorCode(); - } else { - setErrorCode((java.lang.Integer)value); - } - break; - - case ERROR_MESSAGE: - if (value == null) { - unsetErrorMessage(); - } else { - setErrorMessage((java.lang.String)value); - } - break; - - case TASK_STATUS: - if (value == null) { - unsetTaskStatus(); - } else { - setTaskStatus((java.lang.String)value); - } - break; - - case OPERATION_STARTED: - if (value == null) { - unsetOperationStarted(); - } else { - setOperationStarted((java.lang.Long)value); - } - break; - - case OPERATION_COMPLETED: - if (value == null) { - unsetOperationCompleted(); - } else { - setOperationCompleted((java.lang.Long)value); - } - break; - - case HAS_RESULT_SET: - if (value == null) { - unsetHasResultSet(); - } else { - setHasResultSet((java.lang.Boolean)value); - } - break; - - case PROGRESS_UPDATE_RESPONSE: - if (value == null) { - unsetProgressUpdateResponse(); - } else { - setProgressUpdateResponse((TProgressUpdateResp)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_STATE: - return getOperationState(); - - case SQL_STATE: - return getSqlState(); - - case ERROR_CODE: - return getErrorCode(); - - case ERROR_MESSAGE: - return getErrorMessage(); - - case TASK_STATUS: - return getTaskStatus(); - - case OPERATION_STARTED: - return getOperationStarted(); - - case OPERATION_COMPLETED: - return getOperationCompleted(); - - case HAS_RESULT_SET: - return isHasResultSet(); - - case PROGRESS_UPDATE_RESPONSE: - return getProgressUpdateResponse(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_STATE: - return isSetOperationState(); - case SQL_STATE: - return isSetSqlState(); - case ERROR_CODE: - return isSetErrorCode(); - case ERROR_MESSAGE: - return isSetErrorMessage(); - case TASK_STATUS: - return isSetTaskStatus(); - case OPERATION_STARTED: - return isSetOperationStarted(); - case OPERATION_COMPLETED: - return isSetOperationCompleted(); - case HAS_RESULT_SET: - return isSetHasResultSet(); - case PROGRESS_UPDATE_RESPONSE: - return isSetProgressUpdateResponse(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetOperationStatusResp) - return this.equals((TGetOperationStatusResp)that); - return false; - } - - public boolean equals(TGetOperationStatusResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_operationState = true && this.isSetOperationState(); - boolean that_present_operationState = true && that.isSetOperationState(); - if (this_present_operationState || that_present_operationState) { - if (!(this_present_operationState && that_present_operationState)) - return false; - if (!this.operationState.equals(that.operationState)) - return false; - } - - boolean this_present_sqlState = true && this.isSetSqlState(); - boolean that_present_sqlState = true && that.isSetSqlState(); - if (this_present_sqlState || that_present_sqlState) { - if (!(this_present_sqlState && that_present_sqlState)) - return false; - if (!this.sqlState.equals(that.sqlState)) - return false; - } - - boolean this_present_errorCode = true && this.isSetErrorCode(); - boolean that_present_errorCode = true && that.isSetErrorCode(); - if (this_present_errorCode || that_present_errorCode) { - if (!(this_present_errorCode && that_present_errorCode)) - return false; - if (this.errorCode != that.errorCode) - return false; - } - - boolean this_present_errorMessage = true && this.isSetErrorMessage(); - boolean that_present_errorMessage = true && that.isSetErrorMessage(); - if (this_present_errorMessage || that_present_errorMessage) { - if (!(this_present_errorMessage && that_present_errorMessage)) - return false; - if (!this.errorMessage.equals(that.errorMessage)) - return false; - } - - boolean this_present_taskStatus = true && this.isSetTaskStatus(); - boolean that_present_taskStatus = true && that.isSetTaskStatus(); - if (this_present_taskStatus || that_present_taskStatus) { - if (!(this_present_taskStatus && that_present_taskStatus)) - return false; - if (!this.taskStatus.equals(that.taskStatus)) - return false; - } - - boolean this_present_operationStarted = true && this.isSetOperationStarted(); - boolean that_present_operationStarted = true && that.isSetOperationStarted(); - if (this_present_operationStarted || that_present_operationStarted) { - if (!(this_present_operationStarted && that_present_operationStarted)) - return false; - if (this.operationStarted != that.operationStarted) - return false; - } - - boolean this_present_operationCompleted = true && this.isSetOperationCompleted(); - boolean that_present_operationCompleted = true && that.isSetOperationCompleted(); - if (this_present_operationCompleted || that_present_operationCompleted) { - if (!(this_present_operationCompleted && that_present_operationCompleted)) - return false; - if (this.operationCompleted != that.operationCompleted) - return false; - } - - boolean this_present_hasResultSet = true && this.isSetHasResultSet(); - boolean that_present_hasResultSet = true && that.isSetHasResultSet(); - if (this_present_hasResultSet || that_present_hasResultSet) { - if (!(this_present_hasResultSet && that_present_hasResultSet)) - return false; - if (this.hasResultSet != that.hasResultSet) - return false; - } - - boolean this_present_progressUpdateResponse = true && this.isSetProgressUpdateResponse(); - boolean that_present_progressUpdateResponse = true && that.isSetProgressUpdateResponse(); - if (this_present_progressUpdateResponse || that_present_progressUpdateResponse) { - if (!(this_present_progressUpdateResponse && that_present_progressUpdateResponse)) - return false; - if (!this.progressUpdateResponse.equals(that.progressUpdateResponse)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationState()) ? 131071 : 524287); - if (isSetOperationState()) - hashCode = hashCode * 8191 + operationState.getValue(); - - hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); - if (isSetSqlState()) - hashCode = hashCode * 8191 + sqlState.hashCode(); - - hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); - if (isSetErrorCode()) - hashCode = hashCode * 8191 + errorCode; - - hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); - if (isSetErrorMessage()) - hashCode = hashCode * 8191 + errorMessage.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTaskStatus()) ? 131071 : 524287); - if (isSetTaskStatus()) - hashCode = hashCode * 8191 + taskStatus.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationStarted()) ? 131071 : 524287); - if (isSetOperationStarted()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationStarted); - - hashCode = hashCode * 8191 + ((isSetOperationCompleted()) ? 131071 : 524287); - if (isSetOperationCompleted()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationCompleted); - - hashCode = hashCode * 8191 + ((isSetHasResultSet()) ? 131071 : 524287); - if (isSetHasResultSet()) - hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetProgressUpdateResponse()) ? 131071 : 524287); - if (isSetProgressUpdateResponse()) - hashCode = hashCode * 8191 + progressUpdateResponse.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetOperationStatusResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationState, other.operationState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSqlState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTaskStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStatus, other.taskStatus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationStarted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationStarted, other.operationStarted); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationCompleted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationCompleted, other.operationCompleted); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasResultSet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProgressUpdateResponse()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressUpdateResponse, other.progressUpdateResponse); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationState()) { - if (!first) sb.append(", "); - sb.append("operationState:"); - if (this.operationState == null) { - sb.append("null"); - } else { - sb.append(this.operationState); - } - first = false; - } - if (isSetSqlState()) { - if (!first) sb.append(", "); - sb.append("sqlState:"); - if (this.sqlState == null) { - sb.append("null"); - } else { - sb.append(this.sqlState); - } - first = false; - } - if (isSetErrorCode()) { - if (!first) sb.append(", "); - sb.append("errorCode:"); - sb.append(this.errorCode); - first = false; - } - if (isSetErrorMessage()) { - if (!first) sb.append(", "); - sb.append("errorMessage:"); - if (this.errorMessage == null) { - sb.append("null"); - } else { - sb.append(this.errorMessage); - } - first = false; - } - if (isSetTaskStatus()) { - if (!first) sb.append(", "); - sb.append("taskStatus:"); - if (this.taskStatus == null) { - sb.append("null"); - } else { - sb.append(this.taskStatus); - } - first = false; - } - if (isSetOperationStarted()) { - if (!first) sb.append(", "); - sb.append("operationStarted:"); - sb.append(this.operationStarted); - first = false; - } - if (isSetOperationCompleted()) { - if (!first) sb.append(", "); - sb.append("operationCompleted:"); - sb.append(this.operationCompleted); - first = false; - } - if (isSetHasResultSet()) { - if (!first) sb.append(", "); - sb.append("hasResultSet:"); - sb.append(this.hasResultSet); - first = false; - } - if (isSetProgressUpdateResponse()) { - if (!first) sb.append(", "); - sb.append("progressUpdateResponse:"); - if (this.progressUpdateResponse == null) { - sb.append("null"); - } else { - sb.append(this.progressUpdateResponse); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TGetOperationStatusRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetOperationStatusRespStandardScheme getScheme() { - return new TGetOperationStatusRespStandardScheme(); - } - } - - private static class TGetOperationStatusRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusResp 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_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationState = org.apache.spark.service.rpc.thrift.TOperationState.findByValue(iprot.readI32()); - struct.setOperationStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SQL_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // ERROR_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // ERROR_MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // TASK_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.taskStatus = iprot.readString(); - struct.setTaskStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // OPERATION_STARTED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.operationStarted = iprot.readI64(); - struct.setOperationStartedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // OPERATION_COMPLETED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.operationCompleted = iprot.readI64(); - struct.setOperationCompletedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // HAS_RESULT_SET - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // PROGRESS_UPDATE_RESPONSE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.progressUpdateResponse = new TProgressUpdateResp(); - struct.progressUpdateResponse.read(iprot); - struct.setProgressUpdateResponseIsSet(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, TGetOperationStatusResp 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.operationState != null) { - if (struct.isSetOperationState()) { - oprot.writeFieldBegin(OPERATION_STATE_FIELD_DESC); - oprot.writeI32(struct.operationState.getValue()); - oprot.writeFieldEnd(); - } - } - if (struct.sqlState != null) { - if (struct.isSetSqlState()) { - oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); - oprot.writeString(struct.sqlState); - oprot.writeFieldEnd(); - } - } - if (struct.isSetErrorCode()) { - oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); - oprot.writeI32(struct.errorCode); - oprot.writeFieldEnd(); - } - if (struct.errorMessage != null) { - if (struct.isSetErrorMessage()) { - oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); - oprot.writeString(struct.errorMessage); - oprot.writeFieldEnd(); - } - } - if (struct.taskStatus != null) { - if (struct.isSetTaskStatus()) { - oprot.writeFieldBegin(TASK_STATUS_FIELD_DESC); - oprot.writeString(struct.taskStatus); - oprot.writeFieldEnd(); - } - } - if (struct.isSetOperationStarted()) { - oprot.writeFieldBegin(OPERATION_STARTED_FIELD_DESC); - oprot.writeI64(struct.operationStarted); - oprot.writeFieldEnd(); - } - if (struct.isSetOperationCompleted()) { - oprot.writeFieldBegin(OPERATION_COMPLETED_FIELD_DESC); - oprot.writeI64(struct.operationCompleted); - oprot.writeFieldEnd(); - } - if (struct.isSetHasResultSet()) { - oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); - oprot.writeBool(struct.hasResultSet); - oprot.writeFieldEnd(); - } - if (struct.progressUpdateResponse != null) { - if (struct.isSetProgressUpdateResponse()) { - oprot.writeFieldBegin(PROGRESS_UPDATE_RESPONSE_FIELD_DESC); - struct.progressUpdateResponse.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetOperationStatusRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetOperationStatusRespTupleScheme getScheme() { - return new TGetOperationStatusRespTupleScheme(); - } - } - - private static class TGetOperationStatusRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationState()) { - optionals.set(0); - } - if (struct.isSetSqlState()) { - optionals.set(1); - } - if (struct.isSetErrorCode()) { - optionals.set(2); - } - if (struct.isSetErrorMessage()) { - optionals.set(3); - } - if (struct.isSetTaskStatus()) { - optionals.set(4); - } - if (struct.isSetOperationStarted()) { - optionals.set(5); - } - if (struct.isSetOperationCompleted()) { - optionals.set(6); - } - if (struct.isSetHasResultSet()) { - optionals.set(7); - } - if (struct.isSetProgressUpdateResponse()) { - optionals.set(8); - } - oprot.writeBitSet(optionals, 9); - if (struct.isSetOperationState()) { - oprot.writeI32(struct.operationState.getValue()); - } - if (struct.isSetSqlState()) { - oprot.writeString(struct.sqlState); - } - if (struct.isSetErrorCode()) { - oprot.writeI32(struct.errorCode); - } - if (struct.isSetErrorMessage()) { - oprot.writeString(struct.errorMessage); - } - if (struct.isSetTaskStatus()) { - oprot.writeString(struct.taskStatus); - } - if (struct.isSetOperationStarted()) { - oprot.writeI64(struct.operationStarted); - } - if (struct.isSetOperationCompleted()) { - oprot.writeI64(struct.operationCompleted); - } - if (struct.isSetHasResultSet()) { - oprot.writeBool(struct.hasResultSet); - } - if (struct.isSetProgressUpdateResponse()) { - struct.progressUpdateResponse.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(9); - if (incoming.get(0)) { - struct.operationState = org.apache.spark.service.rpc.thrift.TOperationState.findByValue(iprot.readI32()); - struct.setOperationStateIsSet(true); - } - if (incoming.get(1)) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } - if (incoming.get(2)) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } - if (incoming.get(3)) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } - if (incoming.get(4)) { - struct.taskStatus = iprot.readString(); - struct.setTaskStatusIsSet(true); - } - if (incoming.get(5)) { - struct.operationStarted = iprot.readI64(); - struct.setOperationStartedIsSet(true); - } - if (incoming.get(6)) { - struct.operationCompleted = iprot.readI64(); - struct.setOperationCompletedIsSet(true); - } - if (incoming.get(7)) { - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - } - if (incoming.get(8)) { - struct.progressUpdateResponse = new TProgressUpdateResp(); - struct.progressUpdateResponse.read(iprot); - struct.setProgressUpdateResponseIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java deleted file mode 100644 index 460f88bfe2e3..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysReq.java +++ /dev/null @@ -1,695 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysReq"); - - 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetPrimaryKeysReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetPrimaryKeysReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // 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 { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysReq.class, metaDataMap); - } - - public TGetPrimaryKeysReq() { - } - - public TGetPrimaryKeysReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetPrimaryKeysReq(TGetPrimaryKeysReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - } - - public TGetPrimaryKeysReq deepCopy() { - return new TGetPrimaryKeysReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getTableName() { - return this.tableName; - } - - public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((java.lang.String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((java.lang.String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetPrimaryKeysReq) - return this.equals((TGetPrimaryKeysReq)that); - return false; - } - - public boolean equals(TGetPrimaryKeysReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); - if (isSetTableName()) - hashCode = hashCode * 8191 + tableName.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetPrimaryKeysReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetPrimaryKeysReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetPrimaryKeysReqStandardScheme getScheme() { - return new TGetPrimaryKeysReqStandardScheme(); - } - } - - private static class TGetPrimaryKeysReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysReq 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: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(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, TGetPrimaryKeysReq 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.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetPrimaryKeysReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetPrimaryKeysReqTupleScheme getScheme() { - return new TGetPrimaryKeysReqTupleScheme(); - } - } - - private static class TGetPrimaryKeysReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java deleted file mode 100644 index 9295f403d325..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetPrimaryKeysResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetPrimaryKeysResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetPrimaryKeysRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetPrimaryKeysRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysResp.class, metaDataMap); - } - - public TGetPrimaryKeysResp() { - } - - public TGetPrimaryKeysResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetPrimaryKeysResp(TGetPrimaryKeysResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetPrimaryKeysResp deepCopy() { - return new TGetPrimaryKeysResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetPrimaryKeysResp) - return this.equals((TGetPrimaryKeysResp)that); - return false; - } - - public boolean equals(TGetPrimaryKeysResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetPrimaryKeysResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetPrimaryKeysRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetPrimaryKeysRespStandardScheme getScheme() { - return new TGetPrimaryKeysRespStandardScheme(); - } - } - - private static class TGetPrimaryKeysRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysResp 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; - 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, TGetPrimaryKeysResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetPrimaryKeysRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetPrimaryKeysRespTupleScheme getScheme() { - return new TGetPrimaryKeysRespTupleScheme(); - } - } - - private static class TGetPrimaryKeysRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java deleted file mode 100644 index 59ca55e89684..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetQueryIdReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdReq"); - - 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)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable 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 { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdReq.class, metaDataMap); - } - - public TGetQueryIdReq() { - } - - public TGetQueryIdReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetQueryIdReq(TGetQueryIdReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetQueryIdReq deepCopy() { - return new TGetQueryIdReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetQueryIdReq) - return this.equals((TGetQueryIdReq)that); - return false; - } - - public boolean equals(TGetQueryIdReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetQueryIdReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdReq("); - boolean first = true; - - 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 (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - 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, java.lang.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 TGetQueryIdReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetQueryIdReqStandardScheme getScheme() { - return new TGetQueryIdReqStandardScheme(); - } - } - - private static class TGetQueryIdReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdReq 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: // 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, TGetQueryIdReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetQueryIdReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetQueryIdReqTupleScheme getScheme() { - return new TGetQueryIdReqTupleScheme(); - } - } - - private static class TGetQueryIdReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java deleted file mode 100644 index 72066ba4e4a1..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetQueryIdResp.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetQueryIdResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdResp"); - - private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.lang.String queryId; // 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 { - QUERY_ID((short)1, "queryId"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // QUERY_ID - return QUERY_ID; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdResp.class, metaDataMap); - } - - public TGetQueryIdResp() { - } - - public TGetQueryIdResp( - java.lang.String queryId) - { - this(); - this.queryId = queryId; - } - - /** - * Performs a deep copy on other. - */ - public TGetQueryIdResp(TGetQueryIdResp other) { - if (other.isSetQueryId()) { - this.queryId = other.queryId; - } - } - - public TGetQueryIdResp deepCopy() { - return new TGetQueryIdResp(this); - } - - @Override - public void clear() { - this.queryId = null; - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getQueryId() { - return this.queryId; - } - - public void setQueryId(@org.apache.thrift.annotation.Nullable java.lang.String queryId) { - this.queryId = queryId; - } - - public void unsetQueryId() { - this.queryId = null; - } - - /** Returns true if field queryId is set (has been assigned a value) and false otherwise */ - public boolean isSetQueryId() { - return this.queryId != null; - } - - public void setQueryIdIsSet(boolean value) { - if (!value) { - this.queryId = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case QUERY_ID: - if (value == null) { - unsetQueryId(); - } else { - setQueryId((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case QUERY_ID: - return getQueryId(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case QUERY_ID: - return isSetQueryId(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetQueryIdResp) - return this.equals((TGetQueryIdResp)that); - return false; - } - - public boolean equals(TGetQueryIdResp that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_queryId = true && this.isSetQueryId(); - boolean that_present_queryId = true && that.isSetQueryId(); - if (this_present_queryId || that_present_queryId) { - if (!(this_present_queryId && that_present_queryId)) - return false; - if (!this.queryId.equals(that.queryId)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetQueryId()) ? 131071 : 524287); - if (isSetQueryId()) - hashCode = hashCode * 8191 + queryId.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetQueryIdResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetQueryId()).compareTo(other.isSetQueryId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQueryId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryId, other.queryId); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdResp("); - boolean first = true; - - sb.append("queryId:"); - if (this.queryId == null) { - sb.append("null"); - } else { - sb.append(this.queryId); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetQueryId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'queryId' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TGetQueryIdRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetQueryIdRespStandardScheme getScheme() { - return new TGetQueryIdRespStandardScheme(); - } - } - - private static class TGetQueryIdRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdResp 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: // QUERY_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.queryId = iprot.readString(); - struct.setQueryIdIsSet(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, TGetQueryIdResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.queryId != null) { - oprot.writeFieldBegin(QUERY_ID_FIELD_DESC); - oprot.writeString(struct.queryId); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetQueryIdRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetQueryIdRespTupleScheme getScheme() { - return new TGetQueryIdRespTupleScheme(); - } - } - - private static class TGetQueryIdRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeString(struct.queryId); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.queryId = iprot.readString(); - struct.setQueryIdIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java deleted file mode 100644 index d9958dccb5eb..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataReq"); - - 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)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable 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 { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataReq.class, metaDataMap); - } - - public TGetResultSetMetadataReq() { - } - - public TGetResultSetMetadataReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetResultSetMetadataReq(TGetResultSetMetadataReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetResultSetMetadataReq deepCopy() { - return new TGetResultSetMetadataReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetResultSetMetadataReq) - return this.equals((TGetResultSetMetadataReq)that); - return false; - } - - public boolean equals(TGetResultSetMetadataReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetResultSetMetadataReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataReq("); - boolean first = true; - - 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 (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - 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, java.lang.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 TGetResultSetMetadataReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetResultSetMetadataReqStandardScheme getScheme() { - return new TGetResultSetMetadataReqStandardScheme(); - } - } - - private static class TGetResultSetMetadataReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataReq 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: // 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, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetResultSetMetadataReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetResultSetMetadataReqTupleScheme getScheme() { - return new TGetResultSetMetadataReqTupleScheme(); - } - } - - private static class TGetResultSetMetadataReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java deleted file mode 100644 index fdd15e6df392..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetResultSetMetadataResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataResp"); - - 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 SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TTableSchema schema; // 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"), - SCHEMA((short)2, "schema"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // SCHEMA - return SCHEMA; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.SCHEMA}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableSchema.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataResp.class, metaDataMap); - } - - public TGetResultSetMetadataResp() { - } - - public TGetResultSetMetadataResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetResultSetMetadataResp(TGetResultSetMetadataResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetSchema()) { - this.schema = new TTableSchema(other.schema); - } - } - - public TGetResultSetMetadataResp deepCopy() { - return new TGetResultSetMetadataResp(this); - } - - @Override - public void clear() { - this.status = null; - this.schema = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TTableSchema getSchema() { - return this.schema; - } - - public void setSchema(@org.apache.thrift.annotation.Nullable TTableSchema schema) { - this.schema = schema; - } - - public void unsetSchema() { - this.schema = null; - } - - /** Returns true if field schema is set (has been assigned a value) and false otherwise */ - public boolean isSetSchema() { - return this.schema != null; - } - - public void setSchemaIsSet(boolean value) { - if (!value) { - this.schema = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case SCHEMA: - if (value == null) { - unsetSchema(); - } else { - setSchema((TTableSchema)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case SCHEMA: - return getSchema(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case SCHEMA: - return isSetSchema(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetResultSetMetadataResp) - return this.equals((TGetResultSetMetadataResp)that); - return false; - } - - public boolean equals(TGetResultSetMetadataResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_schema = true && this.isSetSchema(); - boolean that_present_schema = true && that.isSetSchema(); - if (this_present_schema || that_present_schema) { - if (!(this_present_schema && that_present_schema)) - return false; - if (!this.schema.equals(that.schema)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSchema()) ? 131071 : 524287); - if (isSetSchema()) - hashCode = hashCode * 8191 + schema.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetResultSetMetadataResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchema()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, other.schema); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetSchema()) { - if (!first) sb.append(", "); - sb.append("schema:"); - if (this.schema == null) { - sb.append("null"); - } else { - sb.append(this.schema); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (schema != null) { - schema.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, java.lang.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 TGetResultSetMetadataRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetResultSetMetadataRespStandardScheme getScheme() { - return new TGetResultSetMetadataRespStandardScheme(); - } - } - - private static class TGetResultSetMetadataRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataResp 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: // SCHEMA - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.schema = new TTableSchema(); - struct.schema.read(iprot); - struct.setSchemaIsSet(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, TGetResultSetMetadataResp 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.schema != null) { - if (struct.isSetSchema()) { - oprot.writeFieldBegin(SCHEMA_FIELD_DESC); - struct.schema.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetResultSetMetadataRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetResultSetMetadataRespTupleScheme getScheme() { - return new TGetResultSetMetadataRespTupleScheme(); - } - } - - private static class TGetResultSetMetadataRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSchema()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSchema()) { - struct.schema.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.schema = new TTableSchema(); - struct.schema.read(iprot); - struct.setSchemaIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java deleted file mode 100644 index dd59d0e8c463..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasReq.java +++ /dev/null @@ -1,589 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasReq"); - - 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetSchemasReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetSchemasReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // 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 { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasReq.class, metaDataMap); - } - - public TGetSchemasReq() { - } - - public TGetSchemasReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetSchemasReq(TGetSchemasReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - } - - public TGetSchemasReq deepCopy() { - return new TGetSchemasReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((java.lang.String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetSchemasReq) - return this.equals((TGetSchemasReq)that); - return false; - } - - public boolean equals(TGetSchemasReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetSchemasReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetSchemasReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetSchemasReqStandardScheme getScheme() { - return new TGetSchemasReqStandardScheme(); - } - } - - private static class TGetSchemasReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasReq 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: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(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, TGetSchemasReq 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.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetSchemasReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetSchemasReqTupleScheme getScheme() { - return new TGetSchemasReqTupleScheme(); - } - } - - private static class TGetSchemasReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java deleted file mode 100644 index 235767910058..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetSchemasResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetSchemasRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetSchemasRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasResp.class, metaDataMap); - } - - public TGetSchemasResp() { - } - - public TGetSchemasResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetSchemasResp(TGetSchemasResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetSchemasResp deepCopy() { - return new TGetSchemasResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetSchemasResp) - return this.equals((TGetSchemasResp)that); - return false; - } - - public boolean equals(TGetSchemasResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetSchemasResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetSchemasRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetSchemasRespStandardScheme getScheme() { - return new TGetSchemasRespStandardScheme(); - } - } - - private static class TGetSchemasRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasResp 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; - 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, TGetSchemasResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetSchemasRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetSchemasRespTupleScheme getScheme() { - return new TGetSchemasRespTupleScheme(); - } - } - - private static class TGetSchemasRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java deleted file mode 100644 index e65143d4d057..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesReq"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesReq.class, metaDataMap); - } - - public TGetTableTypesReq() { - } - - public TGetTableTypesReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTableTypesReq(TGetTableTypesReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetTableTypesReq deepCopy() { - return new TGetTableTypesReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetTableTypesReq) - return this.equals((TGetTableTypesReq)that); - return false; - } - - public boolean equals(TGetTableTypesReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetTableTypesReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetTableTypesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTableTypesReqStandardScheme getScheme() { - return new TGetTableTypesReqStandardScheme(); - } - } - - private static class TGetTableTypesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesReq 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; - 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, TGetTableTypesReq 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTableTypesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTableTypesReqTupleScheme getScheme() { - return new TGetTableTypesReqTupleScheme(); - } - } - - private static class TGetTableTypesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java deleted file mode 100644 index b945e1cb54fe..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTableTypesResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesResp.class, metaDataMap); - } - - public TGetTableTypesResp() { - } - - public TGetTableTypesResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTableTypesResp(TGetTableTypesResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTableTypesResp deepCopy() { - return new TGetTableTypesResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetTableTypesResp) - return this.equals((TGetTableTypesResp)that); - return false; - } - - public boolean equals(TGetTableTypesResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetTableTypesResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetTableTypesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTableTypesRespStandardScheme getScheme() { - return new TGetTableTypesRespStandardScheme(); - } - } - - private static class TGetTableTypesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesResp 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; - 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, TGetTableTypesResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTableTypesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTableTypesRespTupleScheme getScheme() { - return new TGetTableTypesRespTupleScheme(); - } - } - - private static class TGetTableTypesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java deleted file mode 100644 index d8d5ad982252..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesReq.java +++ /dev/null @@ -1,851 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq"); - - 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField TABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("tableTypes", org.apache.thrift.protocol.TType.LIST, (short)5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTablesReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTablesReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional - private @org.apache.thrift.annotation.Nullable java.util.List tableTypes; // 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 { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"), - TABLE_TYPES((short)5, "tableTypes"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - case 5: // TABLE_TYPES - return TABLE_TYPES; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.TABLE_TYPES}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap); - } - - public TGetTablesReq() { - } - - public TGetTablesReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTablesReq(TGetTablesReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - if (other.isSetTableTypes()) { - java.util.List __this__tableTypes = new java.util.ArrayList(other.tableTypes); - this.tableTypes = __this__tableTypes; - } - } - - public TGetTablesReq deepCopy() { - return new TGetTablesReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - this.tableTypes = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getTableName() { - return this.tableName; - } - - public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - public int getTableTypesSize() { - return (this.tableTypes == null) ? 0 : this.tableTypes.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getTableTypesIterator() { - return (this.tableTypes == null) ? null : this.tableTypes.iterator(); - } - - public void addToTableTypes(java.lang.String elem) { - if (this.tableTypes == null) { - this.tableTypes = new java.util.ArrayList(); - } - this.tableTypes.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getTableTypes() { - return this.tableTypes; - } - - public void setTableTypes(@org.apache.thrift.annotation.Nullable java.util.List tableTypes) { - this.tableTypes = tableTypes; - } - - public void unsetTableTypes() { - this.tableTypes = null; - } - - /** Returns true if field tableTypes is set (has been assigned a value) and false otherwise */ - public boolean isSetTableTypes() { - return this.tableTypes != null; - } - - public void setTableTypesIsSet(boolean value) { - if (!value) { - this.tableTypes = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((java.lang.String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((java.lang.String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((java.lang.String)value); - } - break; - - case TABLE_TYPES: - if (value == null) { - unsetTableTypes(); - } else { - setTableTypes((java.util.List)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - case TABLE_TYPES: - return getTableTypes(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - case TABLE_TYPES: - return isSetTableTypes(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetTablesReq) - return this.equals((TGetTablesReq)that); - return false; - } - - public boolean equals(TGetTablesReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - boolean this_present_tableTypes = true && this.isSetTableTypes(); - boolean that_present_tableTypes = true && that.isSetTableTypes(); - if (this_present_tableTypes || that_present_tableTypes) { - if (!(this_present_tableTypes && that_present_tableTypes)) - return false; - if (!this.tableTypes.equals(that.tableTypes)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); - if (isSetTableName()) - hashCode = hashCode * 8191 + tableName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetTableTypes()) ? 131071 : 524287); - if (isSetTableTypes()) - hashCode = hashCode * 8191 + tableTypes.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetTablesReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableTypes()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableTypes, other.tableTypes); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - first = false; - } - if (isSetTableTypes()) { - if (!first) sb.append(", "); - sb.append("tableTypes:"); - if (this.tableTypes == null) { - sb.append("null"); - } else { - sb.append(this.tableTypes); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetTablesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTablesReqStandardScheme getScheme() { - return new TGetTablesReqStandardScheme(); - } - } - - private static class TGetTablesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq 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: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // TABLE_TYPES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(); - struct.tableTypes = new java.util.ArrayList(_list182.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem183; - for (int _i184 = 0; _i184 < _list182.size; ++_i184) - { - _elem183 = iprot.readString(); - struct.tableTypes.add(_elem183); - } - iprot.readListEnd(); - } - struct.setTableTypesIsSet(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, TGetTablesReq 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.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - if (struct.tableTypes != null) { - if (struct.isSetTableTypes()) { - oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (java.lang.String _iter185 : struct.tableTypes) - { - oprot.writeString(_iter185); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTablesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTablesReqTupleScheme getScheme() { - return new TGetTablesReqTupleScheme(); - } - } - - private static class TGetTablesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - if (struct.isSetTableTypes()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - if (struct.isSetTableTypes()) { - { - oprot.writeI32(struct.tableTypes.size()); - for (java.lang.String _iter186 : struct.tableTypes) - { - oprot.writeString(_iter186); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new java.util.ArrayList(_list187.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem188; - for (int _i189 = 0; _i189 < _list187.size; ++_i189) - { - _elem188 = iprot.readString(); - struct.tableTypes.add(_elem188); - } - } - struct.setTableTypesIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java deleted file mode 100644 index a9d9c4b17674..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTablesResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTablesRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTablesRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesResp.class, metaDataMap); - } - - public TGetTablesResp() { - } - - public TGetTablesResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTablesResp(TGetTablesResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTablesResp deepCopy() { - return new TGetTablesResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetTablesResp) - return this.equals((TGetTablesResp)that); - return false; - } - - public boolean equals(TGetTablesResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetTablesResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetTablesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTablesRespStandardScheme getScheme() { - return new TGetTablesRespStandardScheme(); - } - } - - private static class TGetTablesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesResp 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; - 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, TGetTablesResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTablesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTablesRespTupleScheme getScheme() { - return new TGetTablesRespTupleScheme(); - } - } - - private static class TGetTablesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java deleted file mode 100644 index 7ea7ad5da861..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoReq.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoReq"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoReq.class, metaDataMap); - } - - public TGetTypeInfoReq() { - } - - public TGetTypeInfoReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTypeInfoReq(TGetTypeInfoReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetTypeInfoReq deepCopy() { - return new TGetTypeInfoReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetTypeInfoReq) - return this.equals((TGetTypeInfoReq)that); - return false; - } - - public boolean equals(TGetTypeInfoReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetTypeInfoReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TGetTypeInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTypeInfoReqStandardScheme getScheme() { - return new TGetTypeInfoReqStandardScheme(); - } - } - - private static class TGetTypeInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoReq 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; - 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, TGetTypeInfoReq 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTypeInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTypeInfoReqTupleScheme getScheme() { - return new TGetTypeInfoReqTupleScheme(); - } - } - - private static class TGetTypeInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java deleted file mode 100644 index 12e4a53a81c7..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TGetTypeInfoResp.java +++ /dev/null @@ -1,488 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoResp.class, metaDataMap); - } - - public TGetTypeInfoResp() { - } - - public TGetTypeInfoResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTypeInfoResp(TGetTypeInfoResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTypeInfoResp deepCopy() { - return new TGetTypeInfoResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TGetTypeInfoResp) - return this.equals((TGetTypeInfoResp)that); - return false; - } - - public boolean equals(TGetTypeInfoResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TGetTypeInfoResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - 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 (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TGetTypeInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTypeInfoRespStandardScheme getScheme() { - return new TGetTypeInfoRespStandardScheme(); - } - } - - private static class TGetTypeInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoResp 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; - 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, TGetTypeInfoResp 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) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTypeInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TGetTypeInfoRespTupleScheme getScheme() { - return new TGetTypeInfoRespTupleScheme(); - } - } - - private static class TGetTypeInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java deleted file mode 100644 index 2635e6927477..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/THandleIdentifier.java +++ /dev/null @@ -1,493 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THandleIdentifier"); - - private static final org.apache.thrift.protocol.TField GUID_FIELD_DESC = new org.apache.thrift.protocol.TField("guid", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("secret", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new THandleIdentifierStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new THandleIdentifierTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret; // 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 { - GUID((short)1, "guid"), - SECRET((short)2, "secret"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // GUID - return GUID; - case 2: // SECRET - return SECRET; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.GUID, new org.apache.thrift.meta_data.FieldMetaData("guid", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THandleIdentifier.class, metaDataMap); - } - - public THandleIdentifier() { - } - - public THandleIdentifier( - java.nio.ByteBuffer guid, - java.nio.ByteBuffer secret) - { - this(); - this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); - this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); - } - - /** - * Performs a deep copy on other. - */ - public THandleIdentifier(THandleIdentifier other) { - if (other.isSetGuid()) { - this.guid = org.apache.thrift.TBaseHelper.copyBinary(other.guid); - } - if (other.isSetSecret()) { - this.secret = org.apache.thrift.TBaseHelper.copyBinary(other.secret); - } - } - - public THandleIdentifier deepCopy() { - return new THandleIdentifier(this); - } - - @Override - public void clear() { - this.guid = null; - this.secret = null; - } - - public byte[] getGuid() { - setGuid(org.apache.thrift.TBaseHelper.rightSize(guid)); - return guid == null ? null : guid.array(); - } - - public java.nio.ByteBuffer bufferForGuid() { - return org.apache.thrift.TBaseHelper.copyBinary(guid); - } - - public void setGuid(byte[] guid) { - this.guid = guid == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(guid.clone()); - } - - public void setGuid(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid) { - this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); - } - - public void unsetGuid() { - this.guid = null; - } - - /** Returns true if field guid is set (has been assigned a value) and false otherwise */ - public boolean isSetGuid() { - return this.guid != null; - } - - public void setGuidIsSet(boolean value) { - if (!value) { - this.guid = null; - } - } - - public byte[] getSecret() { - setSecret(org.apache.thrift.TBaseHelper.rightSize(secret)); - return secret == null ? null : secret.array(); - } - - public java.nio.ByteBuffer bufferForSecret() { - return org.apache.thrift.TBaseHelper.copyBinary(secret); - } - - public void setSecret(byte[] secret) { - this.secret = secret == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(secret.clone()); - } - - public void setSecret(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret) { - this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); - } - - public void unsetSecret() { - this.secret = null; - } - - /** Returns true if field secret is set (has been assigned a value) and false otherwise */ - public boolean isSetSecret() { - return this.secret != null; - } - - public void setSecretIsSet(boolean value) { - if (!value) { - this.secret = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case GUID: - if (value == null) { - unsetGuid(); - } else { - if (value instanceof byte[]) { - setGuid((byte[])value); - } else { - setGuid((java.nio.ByteBuffer)value); - } - } - break; - - case SECRET: - if (value == null) { - unsetSecret(); - } else { - if (value instanceof byte[]) { - setSecret((byte[])value); - } else { - setSecret((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case GUID: - return getGuid(); - - case SECRET: - return getSecret(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case GUID: - return isSetGuid(); - case SECRET: - return isSetSecret(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof THandleIdentifier) - return this.equals((THandleIdentifier)that); - return false; - } - - public boolean equals(THandleIdentifier that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_guid = true && this.isSetGuid(); - boolean that_present_guid = true && that.isSetGuid(); - if (this_present_guid || that_present_guid) { - if (!(this_present_guid && that_present_guid)) - return false; - if (!this.guid.equals(that.guid)) - return false; - } - - boolean this_present_secret = true && this.isSetSecret(); - boolean that_present_secret = true && that.isSetSecret(); - if (this_present_secret || that_present_secret) { - if (!(this_present_secret && that_present_secret)) - return false; - if (!this.secret.equals(that.secret)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetGuid()) ? 131071 : 524287); - if (isSetGuid()) - hashCode = hashCode * 8191 + guid.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSecret()) ? 131071 : 524287); - if (isSetSecret()) - hashCode = hashCode * 8191 + secret.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(THandleIdentifier other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGuid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.guid, other.guid); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSecret()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secret, other.secret); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("THandleIdentifier("); - boolean first = true; - - sb.append("guid:"); - if (this.guid == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.guid, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("secret:"); - if (this.secret == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.secret, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetGuid()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'guid' is unset! Struct:" + toString()); - } - - if (!isSetSecret()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'secret' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 THandleIdentifierStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public THandleIdentifierStandardScheme getScheme() { - return new THandleIdentifierStandardScheme(); - } - } - - private static class THandleIdentifierStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, THandleIdentifier 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: // GUID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.guid = iprot.readBinary(); - struct.setGuidIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SECRET - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.secret = iprot.readBinary(); - struct.setSecretIsSet(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, THandleIdentifier struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.guid != null) { - oprot.writeFieldBegin(GUID_FIELD_DESC); - oprot.writeBinary(struct.guid); - oprot.writeFieldEnd(); - } - if (struct.secret != null) { - oprot.writeFieldBegin(SECRET_FIELD_DESC); - oprot.writeBinary(struct.secret); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class THandleIdentifierTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public THandleIdentifierTupleScheme getScheme() { - return new THandleIdentifierTupleScheme(); - } - } - - private static class THandleIdentifierTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeBinary(struct.guid); - oprot.writeBinary(struct.secret); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.guid = iprot.readBinary(); - struct.setGuidIsSet(true); - struct.secret = iprot.readBinary(); - struct.setSecretIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java deleted file mode 100644 index d705cdd5dd06..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Column.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Column.class, metaDataMap); - } - - public TI16Column() { - } - - public TI16Column( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TI16Column(TI16Column other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TI16Column deepCopy() { - return new TI16Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(short elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TI16Column) - return this.equals((TI16Column)that); - return false; - } - - public boolean equals(TI16Column that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TI16Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TI16ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI16ColumnStandardScheme getScheme() { - return new TI16ColumnStandardScheme(); - } - } - - private static class TI16ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list70.size); - short _elem71; - for (int _i72 = 0; _i72 < _list70.size; ++_i72) - { - _elem71 = iprot.readI16(); - struct.values.add(_elem71); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TI16Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.values.size())); - for (short _iter73 : struct.values) - { - oprot.writeI16(_iter73); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI16ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI16ColumnTupleScheme getScheme() { - return new TI16ColumnTupleScheme(); - } - } - - private static class TI16ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (short _iter74 : struct.values) - { - oprot.writeI16(_iter74); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); - struct.values = new java.util.ArrayList(_list75.size); - short _elem76; - for (int _i77 = 0; _i77 < _list75.size; ++_i77) - { - _elem76 = iprot.readI16(); - struct.values.add(_elem76); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java deleted file mode 100644 index 05448ba0acfd..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI16Value.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ValueTupleSchemeFactory(); - - private short value; // 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 { - VALUE((short)1, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Value.class, metaDataMap); - } - - public TI16Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI16Value(TI16Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI16Value deepCopy() { - return new TI16Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public short getValue() { - return this.value; - } - - public void setValue(short value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((java.lang.Short)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TI16Value) - return this.equals((TI16Value)that); - return false; - } - - public boolean equals(TI16Value that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + value; - - return hashCode; - } - - @Override - public int compareTo(TI16Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TI16ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI16ValueStandardScheme getScheme() { - return new TI16ValueStandardScheme(); - } - } - - private static class TI16ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value 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: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.value = iprot.readI16(); - struct.setValueIsSet(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, TI16Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI16(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI16ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI16ValueTupleScheme getScheme() { - return new TI16ValueTupleScheme(); - } - } - - private static class TI16ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI16(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI16(); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java deleted file mode 100644 index 6e2784beefa8..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Column.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Column.class, metaDataMap); - } - - public TI32Column() { - } - - public TI32Column( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TI32Column(TI32Column other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TI32Column deepCopy() { - return new TI32Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(int elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TI32Column) - return this.equals((TI32Column)that); - return false; - } - - public boolean equals(TI32Column that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TI32Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TI32ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI32ColumnStandardScheme getScheme() { - return new TI32ColumnStandardScheme(); - } - } - - private static class TI32ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list78.size); - int _elem79; - for (int _i80 = 0; _i80 < _list78.size; ++_i80) - { - _elem79 = iprot.readI32(); - struct.values.add(_elem79); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TI32Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.values.size())); - for (int _iter81 : struct.values) - { - oprot.writeI32(_iter81); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI32ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI32ColumnTupleScheme getScheme() { - return new TI32ColumnTupleScheme(); - } - } - - private static class TI32ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (int _iter82 : struct.values) - { - oprot.writeI32(_iter82); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.values = new java.util.ArrayList(_list83.size); - int _elem84; - for (int _i85 = 0; _i85 < _list83.size; ++_i85) - { - _elem84 = iprot.readI32(); - struct.values.add(_elem84); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java deleted file mode 100644 index dfc3ef6f1496..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI32Value.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ValueTupleSchemeFactory(); - - private int value; // 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 { - VALUE((short)1, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Value.class, metaDataMap); - } - - public TI32Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI32Value(TI32Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI32Value deepCopy() { - return new TI32Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public int getValue() { - return this.value; - } - - public void setValue(int value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((java.lang.Integer)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TI32Value) - return this.equals((TI32Value)that); - return false; - } - - public boolean equals(TI32Value that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + value; - - return hashCode; - } - - @Override - public int compareTo(TI32Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TI32ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI32ValueStandardScheme getScheme() { - return new TI32ValueStandardScheme(); - } - } - - private static class TI32ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value 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: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.value = iprot.readI32(); - struct.setValueIsSet(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, TI32Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI32(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI32ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI32ValueTupleScheme getScheme() { - return new TI32ValueTupleScheme(); - } - } - - private static class TI32ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI32(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI32(); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java deleted file mode 100644 index 78cafb40653d..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Column.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Column.class, metaDataMap); - } - - public TI64Column() { - } - - public TI64Column( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TI64Column(TI64Column other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TI64Column deepCopy() { - return new TI64Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(long elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TI64Column) - return this.equals((TI64Column)that); - return false; - } - - public boolean equals(TI64Column that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TI64Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TI64ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI64ColumnStandardScheme getScheme() { - return new TI64ColumnStandardScheme(); - } - } - - private static class TI64ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list86.size); - long _elem87; - for (int _i88 = 0; _i88 < _list86.size; ++_i88) - { - _elem87 = iprot.readI64(); - struct.values.add(_elem87); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TI64Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.values.size())); - for (long _iter89 : struct.values) - { - oprot.writeI64(_iter89); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI64ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI64ColumnTupleScheme getScheme() { - return new TI64ColumnTupleScheme(); - } - } - - private static class TI64ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (long _iter90 : struct.values) - { - oprot.writeI64(_iter90); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - struct.values = new java.util.ArrayList(_list91.size); - long _elem92; - for (int _i93 = 0; _i93 < _list91.size; ++_i93) - { - _elem92 = iprot.readI64(); - struct.values.add(_elem92); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java deleted file mode 100644 index 06a4a09d453b..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TI64Value.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ValueTupleSchemeFactory(); - - private long value; // 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 { - VALUE((short)1, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Value.class, metaDataMap); - } - - public TI64Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI64Value(TI64Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI64Value deepCopy() { - return new TI64Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public long getValue() { - return this.value; - } - - public void setValue(long value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((java.lang.Long)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TI64Value) - return this.equals((TI64Value)that); - return false; - } - - public boolean equals(TI64Value that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); - - return hashCode; - } - - @Override - public int compareTo(TI64Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TI64ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI64ValueStandardScheme getScheme() { - return new TI64ValueStandardScheme(); - } - } - - private static class TI64ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value 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: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.value = iprot.readI64(); - struct.setValueIsSet(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, TI64Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI64(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI64ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TI64ValueTupleScheme getScheme() { - return new TI64ValueTupleScheme(); - } - } - - private static class TI64ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI64(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI64(); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java deleted file mode 100644 index e8d7305ca228..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TJobExecutionStatus.java +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TJobExecutionStatus implements org.apache.thrift.TEnum { - IN_PROGRESS(0), - COMPLETE(1), - NOT_AVAILABLE(2); - - private final int value; - - private TJobExecutionStatus(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TJobExecutionStatus findByValue(int value) { - switch (value) { - case 0: - return IN_PROGRESS; - case 1: - return COMPLETE; - case 2: - return NOT_AVAILABLE; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java deleted file mode 100644 index 28dfe72936ec..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TMapTypeEntry.java +++ /dev/null @@ -1,455 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapTypeEntry"); - - private static final org.apache.thrift.protocol.TField KEY_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("keyTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField VALUE_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypePtr", org.apache.thrift.protocol.TType.I32, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TMapTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TMapTypeEntryTupleSchemeFactory(); - - private int keyTypePtr; // required - private int valueTypePtr; // 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 { - KEY_TYPE_PTR((short)1, "keyTypePtr"), - VALUE_TYPE_PTR((short)2, "valueTypePtr"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEY_TYPE_PTR - return KEY_TYPE_PTR; - case 2: // VALUE_TYPE_PTR - return VALUE_TYPE_PTR; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __KEYTYPEPTR_ISSET_ID = 0; - private static final int __VALUETYPEPTR_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEY_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("keyTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - tmpMap.put(_Fields.VALUE_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("valueTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapTypeEntry.class, metaDataMap); - } - - public TMapTypeEntry() { - } - - public TMapTypeEntry( - int keyTypePtr, - int valueTypePtr) - { - this(); - this.keyTypePtr = keyTypePtr; - setKeyTypePtrIsSet(true); - this.valueTypePtr = valueTypePtr; - setValueTypePtrIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TMapTypeEntry(TMapTypeEntry other) { - __isset_bitfield = other.__isset_bitfield; - this.keyTypePtr = other.keyTypePtr; - this.valueTypePtr = other.valueTypePtr; - } - - public TMapTypeEntry deepCopy() { - return new TMapTypeEntry(this); - } - - @Override - public void clear() { - setKeyTypePtrIsSet(false); - this.keyTypePtr = 0; - setValueTypePtrIsSet(false); - this.valueTypePtr = 0; - } - - public int getKeyTypePtr() { - return this.keyTypePtr; - } - - public void setKeyTypePtr(int keyTypePtr) { - this.keyTypePtr = keyTypePtr; - setKeyTypePtrIsSet(true); - } - - public void unsetKeyTypePtr() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); - } - - /** Returns true if field keyTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetKeyTypePtr() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); - } - - public void setKeyTypePtrIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); - } - - public int getValueTypePtr() { - return this.valueTypePtr; - } - - public void setValueTypePtr(int valueTypePtr) { - this.valueTypePtr = valueTypePtr; - setValueTypePtrIsSet(true); - } - - public void unsetValueTypePtr() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); - } - - /** Returns true if field valueTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetValueTypePtr() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); - } - - public void setValueTypePtrIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case KEY_TYPE_PTR: - if (value == null) { - unsetKeyTypePtr(); - } else { - setKeyTypePtr((java.lang.Integer)value); - } - break; - - case VALUE_TYPE_PTR: - if (value == null) { - unsetValueTypePtr(); - } else { - setValueTypePtr((java.lang.Integer)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case KEY_TYPE_PTR: - return getKeyTypePtr(); - - case VALUE_TYPE_PTR: - return getValueTypePtr(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case KEY_TYPE_PTR: - return isSetKeyTypePtr(); - case VALUE_TYPE_PTR: - return isSetValueTypePtr(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TMapTypeEntry) - return this.equals((TMapTypeEntry)that); - return false; - } - - public boolean equals(TMapTypeEntry that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_keyTypePtr = true; - boolean that_present_keyTypePtr = true; - if (this_present_keyTypePtr || that_present_keyTypePtr) { - if (!(this_present_keyTypePtr && that_present_keyTypePtr)) - return false; - if (this.keyTypePtr != that.keyTypePtr) - return false; - } - - boolean this_present_valueTypePtr = true; - boolean that_present_valueTypePtr = true; - if (this_present_valueTypePtr || that_present_valueTypePtr) { - if (!(this_present_valueTypePtr && that_present_valueTypePtr)) - return false; - if (this.valueTypePtr != that.valueTypePtr) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + keyTypePtr; - - hashCode = hashCode * 8191 + valueTypePtr; - - return hashCode; - } - - @Override - public int compareTo(TMapTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKeyTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyTypePtr, other.keyTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValueTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueTypePtr, other.valueTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TMapTypeEntry("); - boolean first = true; - - sb.append("keyTypePtr:"); - sb.append(this.keyTypePtr); - first = false; - if (!first) sb.append(", "); - sb.append("valueTypePtr:"); - sb.append(this.valueTypePtr); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetKeyTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyTypePtr' is unset! Struct:" + toString()); - } - - if (!isSetValueTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'valueTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TMapTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TMapTypeEntryStandardScheme getScheme() { - return new TMapTypeEntryStandardScheme(); - } - } - - private static class TMapTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TMapTypeEntry 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: // KEY_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.keyTypePtr = iprot.readI32(); - struct.setKeyTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.valueTypePtr = iprot.readI32(); - struct.setValueTypePtrIsSet(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, TMapTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(KEY_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.keyTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(VALUE_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.valueTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TMapTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TMapTypeEntryTupleScheme getScheme() { - return new TMapTypeEntryTupleScheme(); - } - } - - private static class TMapTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeI32(struct.keyTypePtr); - oprot.writeI32(struct.valueTypePtr); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.keyTypePtr = iprot.readI32(); - struct.setKeyTypePtrIsSet(true); - struct.valueTypePtr = iprot.readI32(); - struct.setValueTypePtrIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java deleted file mode 100644 index 48d41c3ff0fc..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionReq.java +++ /dev/null @@ -1,757 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq"); - - private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOpenSessionReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOpenSessionReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol; // required - private @org.apache.thrift.annotation.Nullable java.lang.String username; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String password; // optional - private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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 { - /** - * - * @see TProtocolVersion - */ - CLIENT_PROTOCOL((short)1, "client_protocol"), - USERNAME((short)2, "username"), - PASSWORD((short)3, "password"), - CONFIGURATION((short)4, "configuration"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // CLIENT_PROTOCOL - return CLIENT_PROTOCOL; - case 2: // USERNAME - return USERNAME; - case 3: // PASSWORD - return PASSWORD; - case 4: // CONFIGURATION - return CONFIGURATION; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap); - } - - public TOpenSessionReq() { - this.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - } - - public TOpenSessionReq( - TProtocolVersion client_protocol) - { - this(); - this.client_protocol = client_protocol; - } - - /** - * Performs a deep copy on other. - */ - public TOpenSessionReq(TOpenSessionReq other) { - if (other.isSetClient_protocol()) { - this.client_protocol = other.client_protocol; - } - if (other.isSetUsername()) { - this.username = other.username; - } - if (other.isSetPassword()) { - this.password = other.password; - } - if (other.isSetConfiguration()) { - java.util.Map __this__configuration = new java.util.HashMap(other.configuration); - this.configuration = __this__configuration; - } - } - - public TOpenSessionReq deepCopy() { - return new TOpenSessionReq(this); - } - - @Override - public void clear() { - this.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - this.username = null; - this.password = null; - this.configuration = null; - } - - /** - * - * @see TProtocolVersion - */ - @org.apache.thrift.annotation.Nullable - public TProtocolVersion getClient_protocol() { - return this.client_protocol; - } - - /** - * - * @see TProtocolVersion - */ - public void setClient_protocol(@org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol) { - this.client_protocol = client_protocol; - } - - public void unsetClient_protocol() { - this.client_protocol = null; - } - - /** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */ - public boolean isSetClient_protocol() { - return this.client_protocol != null; - } - - public void setClient_protocolIsSet(boolean value) { - if (!value) { - this.client_protocol = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getUsername() { - return this.username; - } - - public void setUsername(@org.apache.thrift.annotation.Nullable java.lang.String username) { - this.username = username; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getPassword() { - return this.password; - } - - public void setPassword(@org.apache.thrift.annotation.Nullable java.lang.String password) { - this.password = password; - } - - public void unsetPassword() { - this.password = null; - } - - /** Returns true if field password is set (has been assigned a value) and false otherwise */ - public boolean isSetPassword() { - return this.password != null; - } - - public void setPasswordIsSet(boolean value) { - if (!value) { - this.password = null; - } - } - - public int getConfigurationSize() { - return (this.configuration == null) ? 0 : this.configuration.size(); - } - - public void putToConfiguration(java.lang.String key, java.lang.String val) { - if (this.configuration == null) { - this.configuration = new java.util.HashMap(); - } - this.configuration.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfiguration() { - return this.configuration; - } - - public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { - this.configuration = configuration; - } - - public void unsetConfiguration() { - this.configuration = null; - } - - /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ - public boolean isSetConfiguration() { - return this.configuration != null; - } - - public void setConfigurationIsSet(boolean value) { - if (!value) { - this.configuration = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case CLIENT_PROTOCOL: - if (value == null) { - unsetClient_protocol(); - } else { - setClient_protocol((TProtocolVersion)value); - } - break; - - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((java.lang.String)value); - } - break; - - case PASSWORD: - if (value == null) { - unsetPassword(); - } else { - setPassword((java.lang.String)value); - } - break; - - case CONFIGURATION: - if (value == null) { - unsetConfiguration(); - } else { - setConfiguration((java.util.Map)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case CLIENT_PROTOCOL: - return getClient_protocol(); - - case USERNAME: - return getUsername(); - - case PASSWORD: - return getPassword(); - - case CONFIGURATION: - return getConfiguration(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case CLIENT_PROTOCOL: - return isSetClient_protocol(); - case USERNAME: - return isSetUsername(); - case PASSWORD: - return isSetPassword(); - case CONFIGURATION: - return isSetConfiguration(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TOpenSessionReq) - return this.equals((TOpenSessionReq)that); - return false; - } - - public boolean equals(TOpenSessionReq that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_client_protocol = true && this.isSetClient_protocol(); - boolean that_present_client_protocol = true && that.isSetClient_protocol(); - if (this_present_client_protocol || that_present_client_protocol) { - if (!(this_present_client_protocol && that_present_client_protocol)) - return false; - if (!this.client_protocol.equals(that.client_protocol)) - return false; - } - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - boolean this_present_password = true && this.isSetPassword(); - boolean that_present_password = true && that.isSetPassword(); - if (this_present_password || that_present_password) { - if (!(this_present_password && that_present_password)) - return false; - if (!this.password.equals(that.password)) - return false; - } - - boolean this_present_configuration = true && this.isSetConfiguration(); - boolean that_present_configuration = true && that.isSetConfiguration(); - if (this_present_configuration || that_present_configuration) { - if (!(this_present_configuration && that_present_configuration)) - return false; - if (!this.configuration.equals(that.configuration)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetClient_protocol()) ? 131071 : 524287); - if (isSetClient_protocol()) - hashCode = hashCode * 8191 + client_protocol.getValue(); - - hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287); - if (isSetUsername()) - hashCode = hashCode * 8191 + username.hashCode(); - - hashCode = hashCode * 8191 + ((isSetPassword()) ? 131071 : 524287); - if (isSetPassword()) - hashCode = hashCode * 8191 + password.hashCode(); - - hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); - if (isSetConfiguration()) - hashCode = hashCode * 8191 + configuration.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TOpenSessionReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClient_protocol()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, other.client_protocol); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPassword()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfiguration()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionReq("); - boolean first = true; - - sb.append("client_protocol:"); - if (this.client_protocol == null) { - sb.append("null"); - } else { - sb.append(this.client_protocol); - } - first = false; - if (isSetUsername()) { - if (!first) sb.append(", "); - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - } - if (isSetPassword()) { - if (!first) sb.append(", "); - sb.append("password:"); - if (this.password == null) { - sb.append("null"); - } else { - sb.append(this.password); - } - first = false; - } - if (isSetConfiguration()) { - if (!first) sb.append(", "); - sb.append("configuration:"); - if (this.configuration == null) { - sb.append("null"); - } else { - sb.append(this.configuration); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetClient_protocol()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TOpenSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TOpenSessionReqStandardScheme getScheme() { - return new TOpenSessionReqStandardScheme(); - } - } - - private static class TOpenSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq 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: // CLIENT_PROTOCOL - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setClient_protocolIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PASSWORD - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CONFIGURATION - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); - struct.configuration = new java.util.HashMap(2*_map142.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key143; - @org.apache.thrift.annotation.Nullable java.lang.String _val144; - for (int _i145 = 0; _i145 < _map142.size; ++_i145) - { - _key143 = iprot.readString(); - _val144 = iprot.readString(); - struct.configuration.put(_key143, _val144); - } - iprot.readMapEnd(); - } - struct.setConfigurationIsSet(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, TOpenSessionReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.client_protocol != null) { - oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC); - oprot.writeI32(struct.client_protocol.getValue()); - oprot.writeFieldEnd(); - } - if (struct.username != null) { - if (struct.isSetUsername()) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - } - if (struct.password != null) { - if (struct.isSetPassword()) { - oprot.writeFieldBegin(PASSWORD_FIELD_DESC); - oprot.writeString(struct.password); - oprot.writeFieldEnd(); - } - } - if (struct.configuration != null) { - if (struct.isSetConfiguration()) { - oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (java.util.Map.Entry _iter146 : struct.configuration.entrySet()) - { - oprot.writeString(_iter146.getKey()); - oprot.writeString(_iter146.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOpenSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TOpenSessionReqTupleScheme getScheme() { - return new TOpenSessionReqTupleScheme(); - } - } - - private static class TOpenSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeI32(struct.client_protocol.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetUsername()) { - optionals.set(0); - } - if (struct.isSetPassword()) { - optionals.set(1); - } - if (struct.isSetConfiguration()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetUsername()) { - oprot.writeString(struct.username); - } - if (struct.isSetPassword()) { - oprot.writeString(struct.password); - } - if (struct.isSetConfiguration()) { - { - oprot.writeI32(struct.configuration.size()); - for (java.util.Map.Entry _iter147 : struct.configuration.entrySet()) - { - oprot.writeString(_iter147.getKey()); - oprot.writeString(_iter147.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.client_protocol = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setClient_protocolIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } - if (incoming.get(1)) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } - if (incoming.get(2)) { - { - org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new java.util.HashMap(2*_map148.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key149; - @org.apache.thrift.annotation.Nullable java.lang.String _val150; - for (int _i151 = 0; _i151 < _map148.size; ++_i151) - { - _key149 = iprot.readString(); - _val150 = iprot.readString(); - struct.configuration.put(_key149, _val150); - } - } - struct.setConfigurationIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java deleted file mode 100644 index fb3a4225af3b..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOpenSessionResp.java +++ /dev/null @@ -1,762 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp"); - - 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 SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2); - 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)3); - private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOpenSessionRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOpenSessionRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion; // required - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // optional - private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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"), - /** - * - * @see TProtocolVersion - */ - SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"), - SESSION_HANDLE((short)3, "sessionHandle"), - CONFIGURATION((short)4, "configuration"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // SERVER_PROTOCOL_VERSION - return SERVER_PROTOCOL_VERSION; - case 3: // SESSION_HANDLE - return SESSION_HANDLE; - case 4: // CONFIGURATION - return CONFIGURATION; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap); - } - - public TOpenSessionResp() { - this.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - } - - public TOpenSessionResp( - TStatus status, - TProtocolVersion serverProtocolVersion) - { - this(); - this.status = status; - this.serverProtocolVersion = serverProtocolVersion; - } - - /** - * Performs a deep copy on other. - */ - public TOpenSessionResp(TOpenSessionResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetServerProtocolVersion()) { - this.serverProtocolVersion = other.serverProtocolVersion; - } - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetConfiguration()) { - java.util.Map __this__configuration = new java.util.HashMap(other.configuration); - this.configuration = __this__configuration; - } - } - - public TOpenSessionResp deepCopy() { - return new TOpenSessionResp(this); - } - - @Override - public void clear() { - this.status = null; - this.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - this.sessionHandle = null; - this.configuration = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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; - } - } - - /** - * - * @see TProtocolVersion - */ - @org.apache.thrift.annotation.Nullable - public TProtocolVersion getServerProtocolVersion() { - return this.serverProtocolVersion; - } - - /** - * - * @see TProtocolVersion - */ - public void setServerProtocolVersion(@org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion) { - this.serverProtocolVersion = serverProtocolVersion; - } - - public void unsetServerProtocolVersion() { - this.serverProtocolVersion = null; - } - - /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */ - public boolean isSetServerProtocolVersion() { - return this.serverProtocolVersion != null; - } - - public void setServerProtocolVersionIsSet(boolean value) { - if (!value) { - this.serverProtocolVersion = null; - } - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 int getConfigurationSize() { - return (this.configuration == null) ? 0 : this.configuration.size(); - } - - public void putToConfiguration(java.lang.String key, java.lang.String val) { - if (this.configuration == null) { - this.configuration = new java.util.HashMap(); - } - this.configuration.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfiguration() { - return this.configuration; - } - - public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { - this.configuration = configuration; - } - - public void unsetConfiguration() { - this.configuration = null; - } - - /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ - public boolean isSetConfiguration() { - return this.configuration != null; - } - - public void setConfigurationIsSet(boolean value) { - if (!value) { - this.configuration = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case SERVER_PROTOCOL_VERSION: - if (value == null) { - unsetServerProtocolVersion(); - } else { - setServerProtocolVersion((TProtocolVersion)value); - } - break; - - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CONFIGURATION: - if (value == null) { - unsetConfiguration(); - } else { - setConfiguration((java.util.Map)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case SERVER_PROTOCOL_VERSION: - return getServerProtocolVersion(); - - case SESSION_HANDLE: - return getSessionHandle(); - - case CONFIGURATION: - return getConfiguration(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case SERVER_PROTOCOL_VERSION: - return isSetServerProtocolVersion(); - case SESSION_HANDLE: - return isSetSessionHandle(); - case CONFIGURATION: - return isSetConfiguration(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TOpenSessionResp) - return this.equals((TOpenSessionResp)that); - return false; - } - - public boolean equals(TOpenSessionResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_serverProtocolVersion = true && this.isSetServerProtocolVersion(); - boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion(); - if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) { - if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion)) - return false; - if (!this.serverProtocolVersion.equals(that.serverProtocolVersion)) - 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_configuration = true && this.isSetConfiguration(); - boolean that_present_configuration = true && that.isSetConfiguration(); - if (this_present_configuration || that_present_configuration) { - if (!(this_present_configuration && that_present_configuration)) - return false; - if (!this.configuration.equals(that.configuration)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - hashCode = hashCode * 8191 + ((isSetServerProtocolVersion()) ? 131071 : 524287); - if (isSetServerProtocolVersion()) - hashCode = hashCode * 8191 + serverProtocolVersion.getValue(); - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); - if (isSetConfiguration()) - hashCode = hashCode * 8191 + configuration.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TOpenSessionResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServerProtocolVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, other.serverProtocolVersion); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfiguration()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionResp("); - 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("serverProtocolVersion:"); - if (this.serverProtocolVersion == null) { - sb.append("null"); - } else { - sb.append(this.serverProtocolVersion); - } - first = false; - if (isSetSessionHandle()) { - if (!first) sb.append(", "); - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - } - if (isSetConfiguration()) { - if (!first) sb.append(", "); - sb.append("configuration:"); - if (this.configuration == null) { - sb.append("null"); - } else { - sb.append(this.configuration); - } - 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 (!isSetServerProtocolVersion()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TOpenSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TOpenSessionRespStandardScheme getScheme() { - return new TOpenSessionRespStandardScheme(); - } - } - - private static class TOpenSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp 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: // SERVER_PROTOCOL_VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setServerProtocolVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // 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 4: // CONFIGURATION - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); - struct.configuration = new java.util.HashMap(2*_map152.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key153; - @org.apache.thrift.annotation.Nullable java.lang.String _val154; - for (int _i155 = 0; _i155 < _map152.size; ++_i155) - { - _key153 = iprot.readString(); - _val154 = iprot.readString(); - struct.configuration.put(_key153, _val154); - } - iprot.readMapEnd(); - } - struct.setConfigurationIsSet(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, TOpenSessionResp 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.serverProtocolVersion != null) { - oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC); - oprot.writeI32(struct.serverProtocolVersion.getValue()); - oprot.writeFieldEnd(); - } - if (struct.sessionHandle != null) { - if (struct.isSetSessionHandle()) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - if (struct.configuration != null) { - if (struct.isSetConfiguration()) { - oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (java.util.Map.Entry _iter156 : struct.configuration.entrySet()) - { - oprot.writeString(_iter156.getKey()); - oprot.writeString(_iter156.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOpenSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TOpenSessionRespTupleScheme getScheme() { - return new TOpenSessionRespTupleScheme(); - } - } - - private static class TOpenSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - oprot.writeI32(struct.serverProtocolVersion.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetSessionHandle()) { - optionals.set(0); - } - if (struct.isSetConfiguration()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetSessionHandle()) { - struct.sessionHandle.write(oprot); - } - if (struct.isSetConfiguration()) { - { - oprot.writeI32(struct.configuration.size()); - for (java.util.Map.Entry _iter157 : struct.configuration.entrySet()) - { - oprot.writeString(_iter157.getKey()); - oprot.writeString(_iter157.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - struct.serverProtocolVersion = org.apache.spark.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setServerProtocolVersionIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new java.util.HashMap(2*_map158.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key159; - @org.apache.thrift.annotation.Nullable java.lang.String _val160; - for (int _i161 = 0; _i161 < _map158.size; ++_i161) - { - _key159 = iprot.readString(); - _val160 = iprot.readString(); - struct.configuration.put(_key159, _val160); - } - } - struct.setConfigurationIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java deleted file mode 100644 index 2930a956e703..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationHandle.java +++ /dev/null @@ -1,684 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle"); - - private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3); - private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (short)4); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOperationHandleStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOperationHandleTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable THandleIdentifier operationId; // required - private @org.apache.thrift.annotation.Nullable TOperationType operationType; // required - private boolean hasResultSet; // required - private double modifiedRowCount; // 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 { - OPERATION_ID((short)1, "operationId"), - /** - * - * @see TOperationType - */ - OPERATION_TYPE((short)2, "operationType"), - HAS_RESULT_SET((short)3, "hasResultSet"), - MODIFIED_ROW_COUNT((short)4, "modifiedRowCount"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_ID - return OPERATION_ID; - case 2: // OPERATION_TYPE - return OPERATION_TYPE; - case 3: // HAS_RESULT_SET - return HAS_RESULT_SET; - case 4: // MODIFIED_ROW_COUNT - return MODIFIED_ROW_COUNT; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __HASRESULTSET_ISSET_ID = 0; - private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationType.class))); - tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap); - } - - public TOperationHandle() { - } - - public TOperationHandle( - THandleIdentifier operationId, - TOperationType operationType, - boolean hasResultSet) - { - this(); - this.operationId = operationId; - this.operationType = operationType; - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TOperationHandle(TOperationHandle other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationId()) { - this.operationId = new THandleIdentifier(other.operationId); - } - if (other.isSetOperationType()) { - this.operationType = other.operationType; - } - this.hasResultSet = other.hasResultSet; - this.modifiedRowCount = other.modifiedRowCount; - } - - public TOperationHandle deepCopy() { - return new TOperationHandle(this); - } - - @Override - public void clear() { - this.operationId = null; - this.operationType = null; - setHasResultSetIsSet(false); - this.hasResultSet = false; - setModifiedRowCountIsSet(false); - this.modifiedRowCount = 0.0; - } - - @org.apache.thrift.annotation.Nullable - public THandleIdentifier getOperationId() { - return this.operationId; - } - - public void setOperationId(@org.apache.thrift.annotation.Nullable THandleIdentifier operationId) { - this.operationId = operationId; - } - - public void unsetOperationId() { - this.operationId = null; - } - - /** Returns true if field operationId is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationId() { - return this.operationId != null; - } - - public void setOperationIdIsSet(boolean value) { - if (!value) { - this.operationId = null; - } - } - - /** - * - * @see TOperationType - */ - @org.apache.thrift.annotation.Nullable - public TOperationType getOperationType() { - return this.operationType; - } - - /** - * - * @see TOperationType - */ - public void setOperationType(@org.apache.thrift.annotation.Nullable TOperationType operationType) { - this.operationType = operationType; - } - - public void unsetOperationType() { - this.operationType = null; - } - - /** Returns true if field operationType is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationType() { - return this.operationType != null; - } - - public void setOperationTypeIsSet(boolean value) { - if (!value) { - this.operationType = null; - } - } - - public boolean isHasResultSet() { - return this.hasResultSet; - } - - public void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - public void unsetHasResultSet() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ - public boolean isSetHasResultSet() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); - } - - public double getModifiedRowCount() { - return this.modifiedRowCount; - } - - public void setModifiedRowCount(double modifiedRowCount) { - this.modifiedRowCount = modifiedRowCount; - setModifiedRowCountIsSet(true); - } - - public void unsetModifiedRowCount() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); - } - - /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */ - public boolean isSetModifiedRowCount() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); - } - - public void setModifiedRowCountIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case OPERATION_ID: - if (value == null) { - unsetOperationId(); - } else { - setOperationId((THandleIdentifier)value); - } - break; - - case OPERATION_TYPE: - if (value == null) { - unsetOperationType(); - } else { - setOperationType((TOperationType)value); - } - break; - - case HAS_RESULT_SET: - if (value == null) { - unsetHasResultSet(); - } else { - setHasResultSet((java.lang.Boolean)value); - } - break; - - case MODIFIED_ROW_COUNT: - if (value == null) { - unsetModifiedRowCount(); - } else { - setModifiedRowCount((java.lang.Double)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_ID: - return getOperationId(); - - case OPERATION_TYPE: - return getOperationType(); - - case HAS_RESULT_SET: - return isHasResultSet(); - - case MODIFIED_ROW_COUNT: - return getModifiedRowCount(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case OPERATION_ID: - return isSetOperationId(); - case OPERATION_TYPE: - return isSetOperationType(); - case HAS_RESULT_SET: - return isSetHasResultSet(); - case MODIFIED_ROW_COUNT: - return isSetModifiedRowCount(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TOperationHandle) - return this.equals((TOperationHandle)that); - return false; - } - - public boolean equals(TOperationHandle that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_operationId = true && this.isSetOperationId(); - boolean that_present_operationId = true && that.isSetOperationId(); - if (this_present_operationId || that_present_operationId) { - if (!(this_present_operationId && that_present_operationId)) - return false; - if (!this.operationId.equals(that.operationId)) - return false; - } - - boolean this_present_operationType = true && this.isSetOperationType(); - boolean that_present_operationType = true && that.isSetOperationType(); - if (this_present_operationType || that_present_operationType) { - if (!(this_present_operationType && that_present_operationType)) - return false; - if (!this.operationType.equals(that.operationType)) - return false; - } - - boolean this_present_hasResultSet = true; - boolean that_present_hasResultSet = true; - if (this_present_hasResultSet || that_present_hasResultSet) { - if (!(this_present_hasResultSet && that_present_hasResultSet)) - return false; - if (this.hasResultSet != that.hasResultSet) - return false; - } - - boolean this_present_modifiedRowCount = true && this.isSetModifiedRowCount(); - boolean that_present_modifiedRowCount = true && that.isSetModifiedRowCount(); - if (this_present_modifiedRowCount || that_present_modifiedRowCount) { - if (!(this_present_modifiedRowCount && that_present_modifiedRowCount)) - return false; - if (this.modifiedRowCount != that.modifiedRowCount) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetOperationId()) ? 131071 : 524287); - if (isSetOperationId()) - hashCode = hashCode * 8191 + operationId.hashCode(); - - hashCode = hashCode * 8191 + ((isSetOperationType()) ? 131071 : 524287); - if (isSetOperationType()) - hashCode = hashCode * 8191 + operationType.getValue(); - - hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); - - hashCode = hashCode * 8191 + ((isSetModifiedRowCount()) ? 131071 : 524287); - if (isSetModifiedRowCount()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(modifiedRowCount); - - return hashCode; - } - - @Override - public int compareTo(TOperationHandle other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationId, other.operationId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationType, other.operationType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasResultSet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetModifiedRowCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modifiedRowCount, other.modifiedRowCount); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TOperationHandle("); - boolean first = true; - - sb.append("operationId:"); - if (this.operationId == null) { - sb.append("null"); - } else { - sb.append(this.operationId); - } - first = false; - if (!first) sb.append(", "); - sb.append("operationType:"); - if (this.operationType == null) { - sb.append("null"); - } else { - sb.append(this.operationType); - } - first = false; - if (!first) sb.append(", "); - sb.append("hasResultSet:"); - sb.append(this.hasResultSet); - first = false; - if (isSetModifiedRowCount()) { - if (!first) sb.append(", "); - sb.append("modifiedRowCount:"); - sb.append(this.modifiedRowCount); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' is unset! Struct:" + toString()); - } - - if (!isSetOperationType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationType' is unset! Struct:" + toString()); - } - - if (!isSetHasResultSet()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationId != null) { - operationId.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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TOperationHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TOperationHandleStandardScheme getScheme() { - return new TOperationHandleStandardScheme(); - } - } - - private static class TOperationHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle 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: // OPERATION_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationId = new THandleIdentifier(); - struct.operationId.read(iprot); - struct.setOperationIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationType = org.apache.spark.service.rpc.thrift.TOperationType.findByValue(iprot.readI32()); - struct.setOperationTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // HAS_RESULT_SET - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // MODIFIED_ROW_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.modifiedRowCount = iprot.readDouble(); - struct.setModifiedRowCountIsSet(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, TOperationHandle struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationId != null) { - oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC); - struct.operationId.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationType != null) { - oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC); - oprot.writeI32(struct.operationType.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); - oprot.writeBool(struct.hasResultSet); - oprot.writeFieldEnd(); - if (struct.isSetModifiedRowCount()) { - oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC); - oprot.writeDouble(struct.modifiedRowCount); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOperationHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TOperationHandleTupleScheme getScheme() { - return new TOperationHandleTupleScheme(); - } - } - - private static class TOperationHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationId.write(oprot); - oprot.writeI32(struct.operationType.getValue()); - oprot.writeBool(struct.hasResultSet); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetModifiedRowCount()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetModifiedRowCount()) { - oprot.writeDouble(struct.modifiedRowCount); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.operationId = new THandleIdentifier(); - struct.operationId.read(iprot); - struct.setOperationIdIsSet(true); - struct.operationType = org.apache.spark.service.rpc.thrift.TOperationType.findByValue(iprot.readI32()); - struct.setOperationTypeIsSet(true); - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.modifiedRowCount = iprot.readDouble(); - struct.setModifiedRowCountIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java deleted file mode 100644 index 68aed9d87b52..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationState.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TOperationState implements org.apache.thrift.TEnum { - INITIALIZED_STATE(0), - RUNNING_STATE(1), - FINISHED_STATE(2), - CANCELED_STATE(3), - CLOSED_STATE(4), - ERROR_STATE(5), - UKNOWN_STATE(6), - PENDING_STATE(7), - TIMEDOUT_STATE(8); - - private final int value; - - private TOperationState(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TOperationState findByValue(int value) { - switch (value) { - case 0: - return INITIALIZED_STATE; - case 1: - return RUNNING_STATE; - case 2: - return FINISHED_STATE; - case 3: - return CANCELED_STATE; - case 4: - return CLOSED_STATE; - case 5: - return ERROR_STATE; - case 6: - return UKNOWN_STATE; - case 7: - return PENDING_STATE; - case 8: - return TIMEDOUT_STATE; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java deleted file mode 100644 index b9769310ea82..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TOperationType.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TOperationType implements org.apache.thrift.TEnum { - EXECUTE_STATEMENT(0), - GET_TYPE_INFO(1), - GET_CATALOGS(2), - GET_SCHEMAS(3), - GET_TABLES(4), - GET_TABLE_TYPES(5), - GET_COLUMNS(6), - GET_FUNCTIONS(7), - UNKNOWN(8); - - private final int value; - - private TOperationType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TOperationType findByValue(int value) { - switch (value) { - case 0: - return EXECUTE_STATEMENT; - case 1: - return GET_TYPE_INFO; - case 2: - return GET_CATALOGS; - case 3: - return GET_SCHEMAS; - case 4: - return GET_TABLES; - case 5: - return GET_TABLE_TYPES; - case 6: - return GET_COLUMNS; - case 7: - return GET_FUNCTIONS; - case 8: - return UNKNOWN; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java deleted file mode 100644 index 7145eaa44aa6..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TPrimitiveTypeEntry.java +++ /dev/null @@ -1,495 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry"); - - private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPrimitiveTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPrimitiveTypeEntryTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TTypeId type; // required - private @org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers; // 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 { - /** - * - * @see TTypeId - */ - TYPE((short)1, "type"), - TYPE_QUALIFIERS((short)2, "typeQualifiers"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPE - return TYPE; - case 2: // TYPE_QUALIFIERS - return TYPE_QUALIFIERS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.TYPE_QUALIFIERS}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class))); - tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap); - } - - public TPrimitiveTypeEntry() { - } - - public TPrimitiveTypeEntry( - TTypeId type) - { - this(); - this.type = type; - } - - /** - * Performs a deep copy on other. - */ - public TPrimitiveTypeEntry(TPrimitiveTypeEntry other) { - if (other.isSetType()) { - this.type = other.type; - } - if (other.isSetTypeQualifiers()) { - this.typeQualifiers = new TTypeQualifiers(other.typeQualifiers); - } - } - - public TPrimitiveTypeEntry deepCopy() { - return new TPrimitiveTypeEntry(this); - } - - @Override - public void clear() { - this.type = null; - this.typeQualifiers = null; - } - - /** - * - * @see TTypeId - */ - @org.apache.thrift.annotation.Nullable - public TTypeId getType() { - return this.type; - } - - /** - * - * @see TTypeId - */ - public void setType(@org.apache.thrift.annotation.Nullable TTypeId type) { - this.type = type; - } - - public void unsetType() { - this.type = null; - } - - /** Returns true if field type is set (has been assigned a value) and false otherwise */ - public boolean isSetType() { - return this.type != null; - } - - public void setTypeIsSet(boolean value) { - if (!value) { - this.type = null; - } - } - - @org.apache.thrift.annotation.Nullable - public TTypeQualifiers getTypeQualifiers() { - return this.typeQualifiers; - } - - public void setTypeQualifiers(@org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers) { - this.typeQualifiers = typeQualifiers; - } - - public void unsetTypeQualifiers() { - this.typeQualifiers = null; - } - - /** Returns true if field typeQualifiers is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeQualifiers() { - return this.typeQualifiers != null; - } - - public void setTypeQualifiersIsSet(boolean value) { - if (!value) { - this.typeQualifiers = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case TYPE: - if (value == null) { - unsetType(); - } else { - setType((TTypeId)value); - } - break; - - case TYPE_QUALIFIERS: - if (value == null) { - unsetTypeQualifiers(); - } else { - setTypeQualifiers((TTypeQualifiers)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case TYPE: - return getType(); - - case TYPE_QUALIFIERS: - return getTypeQualifiers(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case TYPE: - return isSetType(); - case TYPE_QUALIFIERS: - return isSetTypeQualifiers(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TPrimitiveTypeEntry) - return this.equals((TPrimitiveTypeEntry)that); - return false; - } - - public boolean equals(TPrimitiveTypeEntry that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_type = true && this.isSetType(); - boolean that_present_type = true && that.isSetType(); - if (this_present_type || that_present_type) { - if (!(this_present_type && that_present_type)) - return false; - if (!this.type.equals(that.type)) - return false; - } - - boolean this_present_typeQualifiers = true && this.isSetTypeQualifiers(); - boolean that_present_typeQualifiers = true && that.isSetTypeQualifiers(); - if (this_present_typeQualifiers || that_present_typeQualifiers) { - if (!(this_present_typeQualifiers && that_present_typeQualifiers)) - return false; - if (!this.typeQualifiers.equals(that.typeQualifiers)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); - if (isSetType()) - hashCode = hashCode * 8191 + type.getValue(); - - hashCode = hashCode * 8191 + ((isSetTypeQualifiers()) ? 131071 : 524287); - if (isSetTypeQualifiers()) - hashCode = hashCode * 8191 + typeQualifiers.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TPrimitiveTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetType()).compareTo(other.isSetType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeQualifiers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeQualifiers, other.typeQualifiers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TPrimitiveTypeEntry("); - boolean first = true; - - sb.append("type:"); - if (this.type == null) { - sb.append("null"); - } else { - sb.append(this.type); - } - first = false; - if (isSetTypeQualifiers()) { - if (!first) sb.append(", "); - sb.append("typeQualifiers:"); - if (this.typeQualifiers == null) { - sb.append("null"); - } else { - sb.append(this.typeQualifiers); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (typeQualifiers != null) { - typeQualifiers.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, java.lang.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 TPrimitiveTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TPrimitiveTypeEntryStandardScheme getScheme() { - return new TPrimitiveTypeEntryStandardScheme(); - } - } - - private static class TPrimitiveTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry 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: // TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.type = org.apache.spark.service.rpc.thrift.TTypeId.findByValue(iprot.readI32()); - struct.setTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TYPE_QUALIFIERS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.typeQualifiers = new TTypeQualifiers(); - struct.typeQualifiers.read(iprot); - struct.setTypeQualifiersIsSet(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, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.type != null) { - oprot.writeFieldBegin(TYPE_FIELD_DESC); - oprot.writeI32(struct.type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.typeQualifiers != null) { - if (struct.isSetTypeQualifiers()) { - oprot.writeFieldBegin(TYPE_QUALIFIERS_FIELD_DESC); - struct.typeQualifiers.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TPrimitiveTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TPrimitiveTypeEntryTupleScheme getScheme() { - return new TPrimitiveTypeEntryTupleScheme(); - } - } - - private static class TPrimitiveTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeI32(struct.type.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetTypeQualifiers()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetTypeQualifiers()) { - struct.typeQualifiers.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.type = org.apache.spark.service.rpc.thrift.TTypeId.findByValue(iprot.readI32()); - struct.setTypeIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.typeQualifiers = new TTypeQualifiers(); - struct.typeQualifiers.read(iprot); - struct.setTypeQualifiersIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java deleted file mode 100644 index 852f944a10fd..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProgressUpdateResp.java +++ /dev/null @@ -1,1008 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TProgressUpdateResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TProgressUpdateResp"); - - private static final org.apache.thrift.protocol.TField HEADER_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("headerNames", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField PROGRESSED_PERCENTAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressedPercentage", org.apache.thrift.protocol.TType.DOUBLE, (short)3); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField FOOTER_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("footerSummary", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)6); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TProgressUpdateRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TProgressUpdateRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List headerNames; // required - private @org.apache.thrift.annotation.Nullable java.util.List> rows; // required - private double progressedPercentage; // required - private @org.apache.thrift.annotation.Nullable TJobExecutionStatus status; // required - private @org.apache.thrift.annotation.Nullable java.lang.String footerSummary; // required - private long startTime; // 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 { - HEADER_NAMES((short)1, "headerNames"), - ROWS((short)2, "rows"), - PROGRESSED_PERCENTAGE((short)3, "progressedPercentage"), - /** - * - * @see TJobExecutionStatus - */ - STATUS((short)4, "status"), - FOOTER_SUMMARY((short)5, "footerSummary"), - START_TIME((short)6, "startTime"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // HEADER_NAMES - return HEADER_NAMES; - case 2: // ROWS - return ROWS; - case 3: // PROGRESSED_PERCENTAGE - return PROGRESSED_PERCENTAGE; - case 4: // STATUS - return STATUS; - case 5: // FOOTER_SUMMARY - return FOOTER_SUMMARY; - case 6: // START_TIME - return START_TIME; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __PROGRESSEDPERCENTAGE_ISSET_ID = 0; - private static final int __STARTTIME_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.HEADER_NAMES, new org.apache.thrift.meta_data.FieldMetaData("headerNames", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); - tmpMap.put(_Fields.PROGRESSED_PERCENTAGE, new org.apache.thrift.meta_data.FieldMetaData("progressedPercentage", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TJobExecutionStatus.class))); - tmpMap.put(_Fields.FOOTER_SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("footerSummary", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TProgressUpdateResp.class, metaDataMap); - } - - public TProgressUpdateResp() { - } - - public TProgressUpdateResp( - java.util.List headerNames, - java.util.List> rows, - double progressedPercentage, - TJobExecutionStatus status, - java.lang.String footerSummary, - long startTime) - { - this(); - this.headerNames = headerNames; - this.rows = rows; - this.progressedPercentage = progressedPercentage; - setProgressedPercentageIsSet(true); - this.status = status; - this.footerSummary = footerSummary; - this.startTime = startTime; - setStartTimeIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TProgressUpdateResp(TProgressUpdateResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHeaderNames()) { - java.util.List __this__headerNames = new java.util.ArrayList(other.headerNames); - this.headerNames = __this__headerNames; - } - if (other.isSetRows()) { - java.util.List> __this__rows = new java.util.ArrayList>(other.rows.size()); - for (java.util.List other_element : other.rows) { - java.util.List __this__rows_copy = new java.util.ArrayList(other_element); - __this__rows.add(__this__rows_copy); - } - this.rows = __this__rows; - } - this.progressedPercentage = other.progressedPercentage; - if (other.isSetStatus()) { - this.status = other.status; - } - if (other.isSetFooterSummary()) { - this.footerSummary = other.footerSummary; - } - this.startTime = other.startTime; - } - - public TProgressUpdateResp deepCopy() { - return new TProgressUpdateResp(this); - } - - @Override - public void clear() { - this.headerNames = null; - this.rows = null; - setProgressedPercentageIsSet(false); - this.progressedPercentage = 0.0; - this.status = null; - this.footerSummary = null; - setStartTimeIsSet(false); - this.startTime = 0; - } - - public int getHeaderNamesSize() { - return (this.headerNames == null) ? 0 : this.headerNames.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getHeaderNamesIterator() { - return (this.headerNames == null) ? null : this.headerNames.iterator(); - } - - public void addToHeaderNames(java.lang.String elem) { - if (this.headerNames == null) { - this.headerNames = new java.util.ArrayList(); - } - this.headerNames.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getHeaderNames() { - return this.headerNames; - } - - public void setHeaderNames(@org.apache.thrift.annotation.Nullable java.util.List headerNames) { - this.headerNames = headerNames; - } - - public void unsetHeaderNames() { - this.headerNames = null; - } - - /** Returns true if field headerNames is set (has been assigned a value) and false otherwise */ - public boolean isSetHeaderNames() { - return this.headerNames != null; - } - - public void setHeaderNamesIsSet(boolean value) { - if (!value) { - this.headerNames = null; - } - } - - public int getRowsSize() { - return (this.rows == null) ? 0 : this.rows.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator> getRowsIterator() { - return (this.rows == null) ? null : this.rows.iterator(); - } - - public void addToRows(java.util.List elem) { - if (this.rows == null) { - this.rows = new java.util.ArrayList>(); - } - this.rows.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List> getRows() { - return this.rows; - } - - public void setRows(@org.apache.thrift.annotation.Nullable java.util.List> rows) { - this.rows = rows; - } - - public void unsetRows() { - this.rows = null; - } - - /** Returns true if field rows is set (has been assigned a value) and false otherwise */ - public boolean isSetRows() { - return this.rows != null; - } - - public void setRowsIsSet(boolean value) { - if (!value) { - this.rows = null; - } - } - - public double getProgressedPercentage() { - return this.progressedPercentage; - } - - public void setProgressedPercentage(double progressedPercentage) { - this.progressedPercentage = progressedPercentage; - setProgressedPercentageIsSet(true); - } - - public void unsetProgressedPercentage() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); - } - - /** Returns true if field progressedPercentage is set (has been assigned a value) and false otherwise */ - public boolean isSetProgressedPercentage() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); - } - - public void setProgressedPercentageIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); - } - - /** - * - * @see TJobExecutionStatus - */ - @org.apache.thrift.annotation.Nullable - public TJobExecutionStatus getStatus() { - return this.status; - } - - /** - * - * @see TJobExecutionStatus - */ - public void setStatus(@org.apache.thrift.annotation.Nullable TJobExecutionStatus 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getFooterSummary() { - return this.footerSummary; - } - - public void setFooterSummary(@org.apache.thrift.annotation.Nullable java.lang.String footerSummary) { - this.footerSummary = footerSummary; - } - - public void unsetFooterSummary() { - this.footerSummary = null; - } - - /** Returns true if field footerSummary is set (has been assigned a value) and false otherwise */ - public boolean isSetFooterSummary() { - return this.footerSummary != null; - } - - public void setFooterSummaryIsSet(boolean value) { - if (!value) { - this.footerSummary = null; - } - } - - public long getStartTime() { - return this.startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - setStartTimeIsSet(true); - } - - public void unsetStartTime() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); - } - - /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ - public boolean isSetStartTime() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); - } - - public void setStartTimeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case HEADER_NAMES: - if (value == null) { - unsetHeaderNames(); - } else { - setHeaderNames((java.util.List)value); - } - break; - - case ROWS: - if (value == null) { - unsetRows(); - } else { - setRows((java.util.List>)value); - } - break; - - case PROGRESSED_PERCENTAGE: - if (value == null) { - unsetProgressedPercentage(); - } else { - setProgressedPercentage((java.lang.Double)value); - } - break; - - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TJobExecutionStatus)value); - } - break; - - case FOOTER_SUMMARY: - if (value == null) { - unsetFooterSummary(); - } else { - setFooterSummary((java.lang.String)value); - } - break; - - case START_TIME: - if (value == null) { - unsetStartTime(); - } else { - setStartTime((java.lang.Long)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case HEADER_NAMES: - return getHeaderNames(); - - case ROWS: - return getRows(); - - case PROGRESSED_PERCENTAGE: - return getProgressedPercentage(); - - case STATUS: - return getStatus(); - - case FOOTER_SUMMARY: - return getFooterSummary(); - - case START_TIME: - return getStartTime(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case HEADER_NAMES: - return isSetHeaderNames(); - case ROWS: - return isSetRows(); - case PROGRESSED_PERCENTAGE: - return isSetProgressedPercentage(); - case STATUS: - return isSetStatus(); - case FOOTER_SUMMARY: - return isSetFooterSummary(); - case START_TIME: - return isSetStartTime(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TProgressUpdateResp) - return this.equals((TProgressUpdateResp)that); - return false; - } - - public boolean equals(TProgressUpdateResp that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_headerNames = true && this.isSetHeaderNames(); - boolean that_present_headerNames = true && that.isSetHeaderNames(); - if (this_present_headerNames || that_present_headerNames) { - if (!(this_present_headerNames && that_present_headerNames)) - return false; - if (!this.headerNames.equals(that.headerNames)) - return false; - } - - boolean this_present_rows = true && this.isSetRows(); - boolean that_present_rows = true && that.isSetRows(); - if (this_present_rows || that_present_rows) { - if (!(this_present_rows && that_present_rows)) - return false; - if (!this.rows.equals(that.rows)) - return false; - } - - boolean this_present_progressedPercentage = true; - boolean that_present_progressedPercentage = true; - if (this_present_progressedPercentage || that_present_progressedPercentage) { - if (!(this_present_progressedPercentage && that_present_progressedPercentage)) - return false; - if (this.progressedPercentage != that.progressedPercentage) - 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_footerSummary = true && this.isSetFooterSummary(); - boolean that_present_footerSummary = true && that.isSetFooterSummary(); - if (this_present_footerSummary || that_present_footerSummary) { - if (!(this_present_footerSummary && that_present_footerSummary)) - return false; - if (!this.footerSummary.equals(that.footerSummary)) - return false; - } - - boolean this_present_startTime = true; - boolean that_present_startTime = true; - if (this_present_startTime || that_present_startTime) { - if (!(this_present_startTime && that_present_startTime)) - return false; - if (this.startTime != that.startTime) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHeaderNames()) ? 131071 : 524287); - if (isSetHeaderNames()) - hashCode = hashCode * 8191 + headerNames.hashCode(); - - hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); - if (isSetRows()) - hashCode = hashCode * 8191 + rows.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(progressedPercentage); - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.getValue(); - - hashCode = hashCode * 8191 + ((isSetFooterSummary()) ? 131071 : 524287); - if (isSetFooterSummary()) - hashCode = hashCode * 8191 + footerSummary.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTime); - - return hashCode; - } - - @Override - public int compareTo(TProgressUpdateResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHeaderNames()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.headerNames, other.headerNames); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProgressedPercentage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressedPercentage, other.progressedPercentage); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFooterSummary()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.footerSummary, other.footerSummary); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TProgressUpdateResp("); - boolean first = true; - - sb.append("headerNames:"); - if (this.headerNames == null) { - sb.append("null"); - } else { - sb.append(this.headerNames); - } - first = false; - if (!first) sb.append(", "); - sb.append("rows:"); - if (this.rows == null) { - sb.append("null"); - } else { - sb.append(this.rows); - } - first = false; - if (!first) sb.append(", "); - sb.append("progressedPercentage:"); - sb.append(this.progressedPercentage); - first = false; - if (!first) sb.append(", "); - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("footerSummary:"); - if (this.footerSummary == null) { - sb.append("null"); - } else { - sb.append(this.footerSummary); - } - first = false; - if (!first) sb.append(", "); - sb.append("startTime:"); - sb.append(this.startTime); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetHeaderNames()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'headerNames' is unset! Struct:" + toString()); - } - - if (!isSetRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); - } - - if (!isSetProgressedPercentage()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'progressedPercentage' is unset! Struct:" + toString()); - } - - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - if (!isSetFooterSummary()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'footerSummary' is unset! Struct:" + toString()); - } - - if (!isSetStartTime()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'startTime' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TProgressUpdateRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TProgressUpdateRespStandardScheme getScheme() { - return new TProgressUpdateRespStandardScheme(); - } - } - - private static class TProgressUpdateRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp 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: // HEADER_NAMES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(); - struct.headerNames = new java.util.ArrayList(_list190.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem191; - for (int _i192 = 0; _i192 < _list190.size; ++_i192) - { - _elem191 = iprot.readString(); - struct.headerNames.add(_elem191); - } - iprot.readListEnd(); - } - struct.setHeaderNamesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list193 = iprot.readListBegin(); - struct.rows = new java.util.ArrayList>(_list193.size); - @org.apache.thrift.annotation.Nullable java.util.List _elem194; - for (int _i195 = 0; _i195 < _list193.size; ++_i195) - { - { - org.apache.thrift.protocol.TList _list196 = iprot.readListBegin(); - _elem194 = new java.util.ArrayList(_list196.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem197; - for (int _i198 = 0; _i198 < _list196.size; ++_i198) - { - _elem197 = iprot.readString(); - _elem194.add(_elem197); - } - iprot.readListEnd(); - } - struct.rows.add(_elem194); - } - iprot.readListEnd(); - } - struct.setRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PROGRESSED_PERCENTAGE - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.progressedPercentage = iprot.readDouble(); - struct.setProgressedPercentageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.status = org.apache.spark.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // FOOTER_SUMMARY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.footerSummary = iprot.readString(); - struct.setFooterSummaryIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // START_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(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, TProgressUpdateResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.headerNames != null) { - oprot.writeFieldBegin(HEADER_NAMES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.headerNames.size())); - for (java.lang.String _iter199 : struct.headerNames) - { - oprot.writeString(_iter199); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.rows != null) { - oprot.writeFieldBegin(ROWS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.rows.size())); - for (java.util.List _iter200 : struct.rows) - { - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter200.size())); - for (java.lang.String _iter201 : _iter200) - { - oprot.writeString(_iter201); - } - oprot.writeListEnd(); - } - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(PROGRESSED_PERCENTAGE_FIELD_DESC); - oprot.writeDouble(struct.progressedPercentage); - oprot.writeFieldEnd(); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - oprot.writeI32(struct.status.getValue()); - oprot.writeFieldEnd(); - } - if (struct.footerSummary != null) { - oprot.writeFieldBegin(FOOTER_SUMMARY_FIELD_DESC); - oprot.writeString(struct.footerSummary); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(START_TIME_FIELD_DESC); - oprot.writeI64(struct.startTime); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TProgressUpdateRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TProgressUpdateRespTupleScheme getScheme() { - return new TProgressUpdateRespTupleScheme(); - } - } - - private static class TProgressUpdateRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.headerNames.size()); - for (java.lang.String _iter202 : struct.headerNames) - { - oprot.writeString(_iter202); - } - } - { - oprot.writeI32(struct.rows.size()); - for (java.util.List _iter203 : struct.rows) - { - { - oprot.writeI32(_iter203.size()); - for (java.lang.String _iter204 : _iter203) - { - oprot.writeString(_iter204); - } - } - } - } - oprot.writeDouble(struct.progressedPercentage); - oprot.writeI32(struct.status.getValue()); - oprot.writeString(struct.footerSummary); - oprot.writeI64(struct.startTime); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list205 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.headerNames = new java.util.ArrayList(_list205.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem206; - for (int _i207 = 0; _i207 < _list205.size; ++_i207) - { - _elem206 = iprot.readString(); - struct.headerNames.add(_elem206); - } - } - struct.setHeaderNamesIsSet(true); - { - org.apache.thrift.protocol.TList _list208 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); - struct.rows = new java.util.ArrayList>(_list208.size); - @org.apache.thrift.annotation.Nullable java.util.List _elem209; - for (int _i210 = 0; _i210 < _list208.size; ++_i210) - { - { - org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - _elem209 = new java.util.ArrayList(_list211.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem212; - for (int _i213 = 0; _i213 < _list211.size; ++_i213) - { - _elem212 = iprot.readString(); - _elem209.add(_elem212); - } - } - struct.rows.add(_elem209); - } - } - struct.setRowsIsSet(true); - struct.progressedPercentage = iprot.readDouble(); - struct.setProgressedPercentageIsSet(true); - struct.status = org.apache.spark.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - struct.footerSummary = iprot.readString(); - struct.setFooterSummaryIsSet(true); - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java deleted file mode 100644 index 9ac17f4ad40e..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TProtocolVersion.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TProtocolVersion implements org.apache.thrift.TEnum { - HIVE_CLI_SERVICE_PROTOCOL_V1(0), - HIVE_CLI_SERVICE_PROTOCOL_V2(1), - HIVE_CLI_SERVICE_PROTOCOL_V3(2), - HIVE_CLI_SERVICE_PROTOCOL_V4(3), - HIVE_CLI_SERVICE_PROTOCOL_V5(4), - HIVE_CLI_SERVICE_PROTOCOL_V6(5), - HIVE_CLI_SERVICE_PROTOCOL_V7(6), - HIVE_CLI_SERVICE_PROTOCOL_V8(7), - HIVE_CLI_SERVICE_PROTOCOL_V9(8), - HIVE_CLI_SERVICE_PROTOCOL_V10(9), - HIVE_CLI_SERVICE_PROTOCOL_V11(10); - - private final int value; - - private TProtocolVersion(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TProtocolVersion findByValue(int value) { - switch (value) { - case 0: - return HIVE_CLI_SERVICE_PROTOCOL_V1; - case 1: - return HIVE_CLI_SERVICE_PROTOCOL_V2; - case 2: - return HIVE_CLI_SERVICE_PROTOCOL_V3; - case 3: - return HIVE_CLI_SERVICE_PROTOCOL_V4; - case 4: - return HIVE_CLI_SERVICE_PROTOCOL_V5; - case 5: - return HIVE_CLI_SERVICE_PROTOCOL_V6; - case 6: - return HIVE_CLI_SERVICE_PROTOCOL_V7; - case 7: - return HIVE_CLI_SERVICE_PROTOCOL_V8; - case 8: - return HIVE_CLI_SERVICE_PROTOCOL_V9; - case 9: - return HIVE_CLI_SERVICE_PROTOCOL_V10; - case 10: - return HIVE_CLI_SERVICE_PROTOCOL_V11; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java deleted file mode 100644 index 3897e68b5e33..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenReq.java +++ /dev/null @@ -1,474 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenReq"); - - 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenReq.class, metaDataMap); - } - - public TRenewDelegationTokenReq() { - } - - public TRenewDelegationTokenReq( - TSessionHandle sessionHandle, - java.lang.String delegationToken) - { - this(); - this.sessionHandle = sessionHandle; - this.delegationToken = delegationToken; - } - - /** - * Performs a deep copy on other. - */ - public TRenewDelegationTokenReq(TRenewDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TRenewDelegationTokenReq deepCopy() { - return new TRenewDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.delegationToken = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TRenewDelegationTokenReq) - return this.equals((TRenewDelegationTokenReq)that); - return false; - } - - public boolean equals(TRenewDelegationTokenReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); - if (isSetDelegationToken()) - hashCode = hashCode * 8191 + delegationToken.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TRenewDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenReq("); - 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("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - 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 (!isSetDelegationToken()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TRenewDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRenewDelegationTokenReqStandardScheme getScheme() { - return new TRenewDelegationTokenReqStandardScheme(); - } - } - - private static class TRenewDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenReq 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: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(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, TRenewDelegationTokenReq 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.delegationToken != null) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRenewDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRenewDelegationTokenReqTupleScheme getScheme() { - return new TRenewDelegationTokenReqTupleScheme(); - } - } - - private static class TRenewDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.delegationToken); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java deleted file mode 100644 index 211e75153a0b..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRenewDelegationTokenResp.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { - STATUS((short)1, "status"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenResp.class, metaDataMap); - } - - public TRenewDelegationTokenResp() { - } - - public TRenewDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TRenewDelegationTokenResp(TRenewDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TRenewDelegationTokenResp deepCopy() { - return new TRenewDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TRenewDelegationTokenResp) - return this.equals((TRenewDelegationTokenResp)that); - return false; - } - - public boolean equals(TRenewDelegationTokenResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TRenewDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TRenewDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRenewDelegationTokenRespStandardScheme getScheme() { - return new TRenewDelegationTokenRespStandardScheme(); - } - } - - private static class TRenewDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenResp 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; - 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, TRenewDelegationTokenResp 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRenewDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRenewDelegationTokenRespTupleScheme getScheme() { - return new TRenewDelegationTokenRespTupleScheme(); - } - } - - private static class TRenewDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java deleted file mode 100644 index f34069538d4b..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRow.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); - - private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List colVals; // 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 { - COL_VALS((short)1, "colVals"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COL_VALS - return COL_VALS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); - } - - public TRow() { - } - - public TRow( - java.util.List colVals) - { - this(); - this.colVals = colVals; - } - - /** - * Performs a deep copy on other. - */ - public TRow(TRow other) { - if (other.isSetColVals()) { - java.util.List __this__colVals = new java.util.ArrayList(other.colVals.size()); - for (TColumnValue other_element : other.colVals) { - __this__colVals.add(new TColumnValue(other_element)); - } - this.colVals = __this__colVals; - } - } - - public TRow deepCopy() { - return new TRow(this); - } - - @Override - public void clear() { - this.colVals = null; - } - - public int getColValsSize() { - return (this.colVals == null) ? 0 : this.colVals.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getColValsIterator() { - return (this.colVals == null) ? null : this.colVals.iterator(); - } - - public void addToColVals(TColumnValue elem) { - if (this.colVals == null) { - this.colVals = new java.util.ArrayList(); - } - this.colVals.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getColVals() { - return this.colVals; - } - - public void setColVals(@org.apache.thrift.annotation.Nullable java.util.List colVals) { - this.colVals = colVals; - } - - public void unsetColVals() { - this.colVals = null; - } - - /** Returns true if field colVals is set (has been assigned a value) and false otherwise */ - public boolean isSetColVals() { - return this.colVals != null; - } - - public void setColValsIsSet(boolean value) { - if (!value) { - this.colVals = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case COL_VALS: - if (value == null) { - unsetColVals(); - } else { - setColVals((java.util.List)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case COL_VALS: - return getColVals(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case COL_VALS: - return isSetColVals(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TRow) - return this.equals((TRow)that); - return false; - } - - public boolean equals(TRow that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_colVals = true && this.isSetColVals(); - boolean that_present_colVals = true && that.isSetColVals(); - if (this_present_colVals || that_present_colVals) { - if (!(this_present_colVals && that_present_colVals)) - return false; - if (!this.colVals.equals(that.colVals)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetColVals()) ? 131071 : 524287); - if (isSetColVals()) - hashCode = hashCode * 8191 + colVals.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TRow other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColVals()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVals, other.colVals); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRow("); - boolean first = true; - - sb.append("colVals:"); - if (this.colVals == null) { - sb.append("null"); - } else { - sb.append(this.colVals); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColVals()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'colVals' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TRowStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRowStandardScheme getScheme() { - return new TRowStandardScheme(); - } - } - - private static class TRowStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRow 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: // COL_VALS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); - struct.colVals = new java.util.ArrayList(_list46.size); - @org.apache.thrift.annotation.Nullable TColumnValue _elem47; - for (int _i48 = 0; _i48 < _list46.size; ++_i48) - { - _elem47 = new TColumnValue(); - _elem47.read(iprot); - struct.colVals.add(_elem47); - } - iprot.readListEnd(); - } - struct.setColValsIsSet(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, TRow struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.colVals != null) { - oprot.writeFieldBegin(COL_VALS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.colVals.size())); - for (TColumnValue _iter49 : struct.colVals) - { - _iter49.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRowTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRowTupleScheme getScheme() { - return new TRowTupleScheme(); - } - } - - private static class TRowTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.colVals.size()); - for (TColumnValue _iter50 : struct.colVals) - { - _iter50.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.colVals = new java.util.ArrayList(_list51.size); - @org.apache.thrift.annotation.Nullable TColumnValue _elem52; - for (int _i53 = 0; _i53 < _list51.size; ++_i53) - { - _elem52 = new TColumnValue(); - _elem52.read(iprot); - struct.colVals.add(_elem52); - } - } - struct.setColValsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java deleted file mode 100644 index 678de927cdca..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TRowSet.java +++ /dev/null @@ -1,900 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); - - private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField BINARY_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumns", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField COLUMN_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("columnCount", org.apache.thrift.protocol.TType.I32, (short)5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowSetStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowSetTupleSchemeFactory(); - - private long startRowOffset; // required - private @org.apache.thrift.annotation.Nullable java.util.List rows; // required - private @org.apache.thrift.annotation.Nullable java.util.List columns; // optional - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns; // optional - private int columnCount; // 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 { - START_ROW_OFFSET((short)1, "startRowOffset"), - ROWS((short)2, "rows"), - COLUMNS((short)3, "columns"), - BINARY_COLUMNS((short)4, "binaryColumns"), - COLUMN_COUNT((short)5, "columnCount"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // START_ROW_OFFSET - return START_ROW_OFFSET; - case 2: // ROWS - return ROWS; - case 3: // COLUMNS - return COLUMNS; - case 4: // BINARY_COLUMNS - return BINARY_COLUMNS; - case 5: // COLUMN_COUNT - return COLUMN_COUNT; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __STARTROWOFFSET_ISSET_ID = 0; - private static final int __COLUMNCOUNT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.BINARY_COLUMNS,_Fields.COLUMN_COUNT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRow.class)))); - tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class)))); - tmpMap.put(_Fields.BINARY_COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("binaryColumns", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.COLUMN_COUNT, new org.apache.thrift.meta_data.FieldMetaData("columnCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); - } - - public TRowSet() { - } - - public TRowSet( - long startRowOffset, - java.util.List rows) - { - this(); - this.startRowOffset = startRowOffset; - setStartRowOffsetIsSet(true); - this.rows = rows; - } - - /** - * Performs a deep copy on other. - */ - public TRowSet(TRowSet other) { - __isset_bitfield = other.__isset_bitfield; - this.startRowOffset = other.startRowOffset; - if (other.isSetRows()) { - java.util.List __this__rows = new java.util.ArrayList(other.rows.size()); - for (TRow other_element : other.rows) { - __this__rows.add(new TRow(other_element)); - } - this.rows = __this__rows; - } - if (other.isSetColumns()) { - java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); - for (TColumn other_element : other.columns) { - __this__columns.add(new TColumn(other_element)); - } - this.columns = __this__columns; - } - if (other.isSetBinaryColumns()) { - this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(other.binaryColumns); - } - this.columnCount = other.columnCount; - } - - public TRowSet deepCopy() { - return new TRowSet(this); - } - - @Override - public void clear() { - setStartRowOffsetIsSet(false); - this.startRowOffset = 0; - this.rows = null; - this.columns = null; - this.binaryColumns = null; - setColumnCountIsSet(false); - this.columnCount = 0; - } - - public long getStartRowOffset() { - return this.startRowOffset; - } - - public void setStartRowOffset(long startRowOffset) { - this.startRowOffset = startRowOffset; - setStartRowOffsetIsSet(true); - } - - public void unsetStartRowOffset() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); - } - - /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */ - public boolean isSetStartRowOffset() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); - } - - public void setStartRowOffsetIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); - } - - public int getRowsSize() { - return (this.rows == null) ? 0 : this.rows.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getRowsIterator() { - return (this.rows == null) ? null : this.rows.iterator(); - } - - public void addToRows(TRow elem) { - if (this.rows == null) { - this.rows = new java.util.ArrayList(); - } - this.rows.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getRows() { - return this.rows; - } - - public void setRows(@org.apache.thrift.annotation.Nullable java.util.List rows) { - this.rows = rows; - } - - public void unsetRows() { - this.rows = null; - } - - /** Returns true if field rows is set (has been assigned a value) and false otherwise */ - public boolean isSetRows() { - return this.rows != null; - } - - public void setRowsIsSet(boolean value) { - if (!value) { - this.rows = null; - } - } - - public int getColumnsSize() { - return (this.columns == null) ? 0 : this.columns.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getColumnsIterator() { - return (this.columns == null) ? null : this.columns.iterator(); - } - - public void addToColumns(TColumn elem) { - if (this.columns == null) { - this.columns = new java.util.ArrayList(); - } - this.columns.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getColumns() { - return this.columns; - } - - public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { - this.columns = columns; - } - - public void unsetColumns() { - this.columns = null; - } - - /** Returns true if field columns is set (has been assigned a value) and false otherwise */ - public boolean isSetColumns() { - return this.columns != null; - } - - public void setColumnsIsSet(boolean value) { - if (!value) { - this.columns = null; - } - } - - public byte[] getBinaryColumns() { - setBinaryColumns(org.apache.thrift.TBaseHelper.rightSize(binaryColumns)); - return binaryColumns == null ? null : binaryColumns.array(); - } - - public java.nio.ByteBuffer bufferForBinaryColumns() { - return org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); - } - - public void setBinaryColumns(byte[] binaryColumns) { - this.binaryColumns = binaryColumns == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(binaryColumns.clone()); - } - - public void setBinaryColumns(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns) { - this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); - } - - public void unsetBinaryColumns() { - this.binaryColumns = null; - } - - /** Returns true if field binaryColumns is set (has been assigned a value) and false otherwise */ - public boolean isSetBinaryColumns() { - return this.binaryColumns != null; - } - - public void setBinaryColumnsIsSet(boolean value) { - if (!value) { - this.binaryColumns = null; - } - } - - public int getColumnCount() { - return this.columnCount; - } - - public void setColumnCount(int columnCount) { - this.columnCount = columnCount; - setColumnCountIsSet(true); - } - - public void unsetColumnCount() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); - } - - /** Returns true if field columnCount is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnCount() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); - } - - public void setColumnCountIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case START_ROW_OFFSET: - if (value == null) { - unsetStartRowOffset(); - } else { - setStartRowOffset((java.lang.Long)value); - } - break; - - case ROWS: - if (value == null) { - unsetRows(); - } else { - setRows((java.util.List)value); - } - break; - - case COLUMNS: - if (value == null) { - unsetColumns(); - } else { - setColumns((java.util.List)value); - } - break; - - case BINARY_COLUMNS: - if (value == null) { - unsetBinaryColumns(); - } else { - if (value instanceof byte[]) { - setBinaryColumns((byte[])value); - } else { - setBinaryColumns((java.nio.ByteBuffer)value); - } - } - break; - - case COLUMN_COUNT: - if (value == null) { - unsetColumnCount(); - } else { - setColumnCount((java.lang.Integer)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case START_ROW_OFFSET: - return getStartRowOffset(); - - case ROWS: - return getRows(); - - case COLUMNS: - return getColumns(); - - case BINARY_COLUMNS: - return getBinaryColumns(); - - case COLUMN_COUNT: - return getColumnCount(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case START_ROW_OFFSET: - return isSetStartRowOffset(); - case ROWS: - return isSetRows(); - case COLUMNS: - return isSetColumns(); - case BINARY_COLUMNS: - return isSetBinaryColumns(); - case COLUMN_COUNT: - return isSetColumnCount(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TRowSet) - return this.equals((TRowSet)that); - return false; - } - - public boolean equals(TRowSet that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_startRowOffset = true; - boolean that_present_startRowOffset = true; - if (this_present_startRowOffset || that_present_startRowOffset) { - if (!(this_present_startRowOffset && that_present_startRowOffset)) - return false; - if (this.startRowOffset != that.startRowOffset) - return false; - } - - boolean this_present_rows = true && this.isSetRows(); - boolean that_present_rows = true && that.isSetRows(); - if (this_present_rows || that_present_rows) { - if (!(this_present_rows && that_present_rows)) - return false; - if (!this.rows.equals(that.rows)) - return false; - } - - boolean this_present_columns = true && this.isSetColumns(); - boolean that_present_columns = true && that.isSetColumns(); - if (this_present_columns || that_present_columns) { - if (!(this_present_columns && that_present_columns)) - return false; - if (!this.columns.equals(that.columns)) - return false; - } - - boolean this_present_binaryColumns = true && this.isSetBinaryColumns(); - boolean that_present_binaryColumns = true && that.isSetBinaryColumns(); - if (this_present_binaryColumns || that_present_binaryColumns) { - if (!(this_present_binaryColumns && that_present_binaryColumns)) - return false; - if (!this.binaryColumns.equals(that.binaryColumns)) - return false; - } - - boolean this_present_columnCount = true && this.isSetColumnCount(); - boolean that_present_columnCount = true && that.isSetColumnCount(); - if (this_present_columnCount || that_present_columnCount) { - if (!(this_present_columnCount && that_present_columnCount)) - return false; - if (this.columnCount != that.columnCount) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startRowOffset); - - hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); - if (isSetRows()) - hashCode = hashCode * 8191 + rows.hashCode(); - - hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); - if (isSetColumns()) - hashCode = hashCode * 8191 + columns.hashCode(); - - hashCode = hashCode * 8191 + ((isSetBinaryColumns()) ? 131071 : 524287); - if (isSetBinaryColumns()) - hashCode = hashCode * 8191 + binaryColumns.hashCode(); - - hashCode = hashCode * 8191 + ((isSetColumnCount()) ? 131071 : 524287); - if (isSetColumnCount()) - hashCode = hashCode * 8191 + columnCount; - - return hashCode; - } - - @Override - public int compareTo(TRowSet other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartRowOffset()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, other.startRowOffset); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetBinaryColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryColumns, other.binaryColumns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnCount, other.columnCount); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRowSet("); - boolean first = true; - - sb.append("startRowOffset:"); - sb.append(this.startRowOffset); - first = false; - if (!first) sb.append(", "); - sb.append("rows:"); - if (this.rows == null) { - sb.append("null"); - } else { - sb.append(this.rows); - } - first = false; - if (isSetColumns()) { - if (!first) sb.append(", "); - sb.append("columns:"); - if (this.columns == null) { - sb.append("null"); - } else { - sb.append(this.columns); - } - first = false; - } - if (isSetBinaryColumns()) { - if (!first) sb.append(", "); - sb.append("binaryColumns:"); - if (this.binaryColumns == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.binaryColumns, sb); - } - first = false; - } - if (isSetColumnCount()) { - if (!first) sb.append(", "); - sb.append("columnCount:"); - sb.append(this.columnCount); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStartRowOffset()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'startRowOffset' is unset! Struct:" + toString()); - } - - if (!isSetRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TRowSetStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRowSetStandardScheme getScheme() { - return new TRowSetStandardScheme(); - } - } - - private static class TRowSetStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet 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: // START_ROW_OFFSET - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startRowOffset = iprot.readI64(); - struct.setStartRowOffsetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); - struct.rows = new java.util.ArrayList(_list118.size); - @org.apache.thrift.annotation.Nullable TRow _elem119; - for (int _i120 = 0; _i120 < _list118.size; ++_i120) - { - _elem119 = new TRow(); - _elem119.read(iprot); - struct.rows.add(_elem119); - } - iprot.readListEnd(); - } - struct.setRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); - struct.columns = new java.util.ArrayList(_list121.size); - @org.apache.thrift.annotation.Nullable TColumn _elem122; - for (int _i123 = 0; _i123 < _list121.size; ++_i123) - { - _elem122 = new TColumn(); - _elem122.read(iprot); - struct.columns.add(_elem122); - } - iprot.readListEnd(); - } - struct.setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // BINARY_COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.binaryColumns = iprot.readBinary(); - struct.setBinaryColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // COLUMN_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.columnCount = iprot.readI32(); - struct.setColumnCountIsSet(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, TRowSet struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC); - oprot.writeI64(struct.startRowOffset); - oprot.writeFieldEnd(); - if (struct.rows != null) { - oprot.writeFieldBegin(ROWS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); - for (TRow _iter124 : struct.rows) - { - _iter124.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.columns != null) { - if (struct.isSetColumns()) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); - for (TColumn _iter125 : struct.columns) - { - _iter125.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.binaryColumns != null) { - if (struct.isSetBinaryColumns()) { - oprot.writeFieldBegin(BINARY_COLUMNS_FIELD_DESC); - oprot.writeBinary(struct.binaryColumns); - oprot.writeFieldEnd(); - } - } - if (struct.isSetColumnCount()) { - oprot.writeFieldBegin(COLUMN_COUNT_FIELD_DESC); - oprot.writeI32(struct.columnCount); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRowSetTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TRowSetTupleScheme getScheme() { - return new TRowSetTupleScheme(); - } - } - - private static class TRowSetTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeI64(struct.startRowOffset); - { - oprot.writeI32(struct.rows.size()); - for (TRow _iter126 : struct.rows) - { - _iter126.write(oprot); - } - } - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetColumns()) { - optionals.set(0); - } - if (struct.isSetBinaryColumns()) { - optionals.set(1); - } - if (struct.isSetColumnCount()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetColumns()) { - { - oprot.writeI32(struct.columns.size()); - for (TColumn _iter127 : struct.columns) - { - _iter127.write(oprot); - } - } - } - if (struct.isSetBinaryColumns()) { - oprot.writeBinary(struct.binaryColumns); - } - if (struct.isSetColumnCount()) { - oprot.writeI32(struct.columnCount); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.startRowOffset = iprot.readI64(); - struct.setStartRowOffsetIsSet(true); - { - org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.rows = new java.util.ArrayList(_list128.size); - @org.apache.thrift.annotation.Nullable TRow _elem129; - for (int _i130 = 0; _i130 < _list128.size; ++_i130) - { - _elem129 = new TRow(); - _elem129.read(iprot); - struct.rows.add(_elem129); - } - } - struct.setRowsIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new java.util.ArrayList(_list131.size); - @org.apache.thrift.annotation.Nullable TColumn _elem132; - for (int _i133 = 0; _i133 < _list131.size; ++_i133) - { - _elem132 = new TColumn(); - _elem132.read(iprot); - struct.columns.add(_elem132); - } - } - struct.setColumnsIsSet(true); - } - if (incoming.get(1)) { - struct.binaryColumns = iprot.readBinary(); - struct.setBinaryColumnsIsSet(true); - } - if (incoming.get(2)) { - struct.columnCount = iprot.readI32(); - struct.setColumnCountIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java deleted file mode 100644 index d89251455777..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSessionHandle.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionHandle"); - - private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSessionHandleStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSessionHandleTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable THandleIdentifier sessionId; // 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_ID((short)1, "sessionId"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_ID - return SESSION_ID; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionHandle.class, metaDataMap); - } - - public TSessionHandle() { - } - - public TSessionHandle( - THandleIdentifier sessionId) - { - this(); - this.sessionId = sessionId; - } - - /** - * Performs a deep copy on other. - */ - public TSessionHandle(TSessionHandle other) { - if (other.isSetSessionId()) { - this.sessionId = new THandleIdentifier(other.sessionId); - } - } - - public TSessionHandle deepCopy() { - return new TSessionHandle(this); - } - - @Override - public void clear() { - this.sessionId = null; - } - - @org.apache.thrift.annotation.Nullable - public THandleIdentifier getSessionId() { - return this.sessionId; - } - - public void setSessionId(@org.apache.thrift.annotation.Nullable THandleIdentifier sessionId) { - this.sessionId = sessionId; - } - - public void unsetSessionId() { - this.sessionId = null; - } - - /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionId() { - return this.sessionId != null; - } - - public void setSessionIdIsSet(boolean value) { - if (!value) { - this.sessionId = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_ID: - if (value == null) { - unsetSessionId(); - } else { - setSessionId((THandleIdentifier)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_ID: - return getSessionId(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_ID: - return isSetSessionId(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TSessionHandle) - return this.equals((TSessionHandle)that); - return false; - } - - public boolean equals(TSessionHandle that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_sessionId = true && this.isSetSessionId(); - boolean that_present_sessionId = true && that.isSetSessionId(); - if (this_present_sessionId || that_present_sessionId) { - if (!(this_present_sessionId && that_present_sessionId)) - return false; - if (!this.sessionId.equals(that.sessionId)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionId()) ? 131071 : 524287); - if (isSetSessionId()) - hashCode = hashCode * 8191 + sessionId.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TSessionHandle other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TSessionHandle("); - boolean first = true; - - sb.append("sessionId:"); - if (this.sessionId == null) { - sb.append("null"); - } else { - sb.append(this.sessionId); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionId' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionId != null) { - sessionId.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, java.lang.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 TSessionHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TSessionHandleStandardScheme getScheme() { - return new TSessionHandleStandardScheme(); - } - } - - private static class TSessionHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionHandle 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_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionId = new THandleIdentifier(); - struct.sessionId.read(iprot); - struct.setSessionIdIsSet(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, TSessionHandle struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionId != null) { - oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); - struct.sessionId.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TSessionHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TSessionHandleTupleScheme getScheme() { - return new TSessionHandleTupleScheme(); - } - } - - private static class TSessionHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionId.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionId = new THandleIdentifier(); - struct.sessionId.read(iprot); - struct.setSessionIdIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java deleted file mode 100644 index 7b7b3a14665e..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoReq.java +++ /dev/null @@ -1,535 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TSetClientInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoReq"); - - 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 CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoReqTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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 { - SESSION_HANDLE((short)1, "sessionHandle"), - CONFIGURATION((short)2, "configuration"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CONFIGURATION - return CONFIGURATION; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CONFIGURATION}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoReq.class, metaDataMap); - } - - public TSetClientInfoReq() { - } - - public TSetClientInfoReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TSetClientInfoReq(TSetClientInfoReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetConfiguration()) { - java.util.Map __this__configuration = new java.util.HashMap(other.configuration); - this.configuration = __this__configuration; - } - } - - public TSetClientInfoReq deepCopy() { - return new TSetClientInfoReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.configuration = null; - } - - @org.apache.thrift.annotation.Nullable - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 int getConfigurationSize() { - return (this.configuration == null) ? 0 : this.configuration.size(); - } - - public void putToConfiguration(java.lang.String key, java.lang.String val) { - if (this.configuration == null) { - this.configuration = new java.util.HashMap(); - } - this.configuration.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfiguration() { - return this.configuration; - } - - public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { - this.configuration = configuration; - } - - public void unsetConfiguration() { - this.configuration = null; - } - - /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ - public boolean isSetConfiguration() { - return this.configuration != null; - } - - public void setConfigurationIsSet(boolean value) { - if (!value) { - this.configuration = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CONFIGURATION: - if (value == null) { - unsetConfiguration(); - } else { - setConfiguration((java.util.Map)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CONFIGURATION: - return getConfiguration(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CONFIGURATION: - return isSetConfiguration(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TSetClientInfoReq) - return this.equals((TSetClientInfoReq)that); - return false; - } - - public boolean equals(TSetClientInfoReq that) { - if (that == null) - return false; - if (this == that) - return true; - - 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_configuration = true && this.isSetConfiguration(); - boolean that_present_configuration = true && that.isSetConfiguration(); - if (this_present_configuration || that_present_configuration) { - if (!(this_present_configuration && that_present_configuration)) - return false; - if (!this.configuration.equals(that.configuration)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); - if (isSetConfiguration()) - hashCode = hashCode * 8191 + configuration.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TSetClientInfoReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfiguration()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetConfiguration()) { - if (!first) sb.append(", "); - sb.append("configuration:"); - if (this.configuration == null) { - sb.append("null"); - } else { - sb.append(this.configuration); - } - 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()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.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, java.lang.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 TSetClientInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TSetClientInfoReqStandardScheme getScheme() { - return new TSetClientInfoReqStandardScheme(); - } - } - - private static class TSetClientInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoReq 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: // CONFIGURATION - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); - struct.configuration = new java.util.HashMap(2*_map162.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key163; - @org.apache.thrift.annotation.Nullable java.lang.String _val164; - for (int _i165 = 0; _i165 < _map162.size; ++_i165) - { - _key163 = iprot.readString(); - _val164 = iprot.readString(); - struct.configuration.put(_key163, _val164); - } - iprot.readMapEnd(); - } - struct.setConfigurationIsSet(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, TSetClientInfoReq 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.configuration != null) { - if (struct.isSetConfiguration()) { - oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (java.util.Map.Entry _iter166 : struct.configuration.entrySet()) - { - oprot.writeString(_iter166.getKey()); - oprot.writeString(_iter166.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TSetClientInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TSetClientInfoReqTupleScheme getScheme() { - return new TSetClientInfoReqTupleScheme(); - } - } - - private static class TSetClientInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetConfiguration()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetConfiguration()) { - { - oprot.writeI32(struct.configuration.size()); - for (java.util.Map.Entry _iter167 : struct.configuration.entrySet()) - { - oprot.writeString(_iter167.getKey()); - oprot.writeString(_iter167.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new java.util.HashMap(2*_map168.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key169; - @org.apache.thrift.annotation.Nullable java.lang.String _val170; - for (int _i171 = 0; _i171 < _map168.size; ++_i171) - { - _key169 = iprot.readString(); - _val170 = iprot.readString(); - struct.configuration.put(_key169, _val170); - } - } - struct.setConfigurationIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java deleted file mode 100644 index fc1546c69153..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TSetClientInfoResp.java +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TSetClientInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoResp"); - - 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoRespTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { - STATUS((short)1, "status"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoResp.class, metaDataMap); - } - - public TSetClientInfoResp() { - } - - public TSetClientInfoResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TSetClientInfoResp(TSetClientInfoResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TSetClientInfoResp deepCopy() { - return new TSetClientInfoResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - @org.apache.thrift.annotation.Nullable - public TStatus getStatus() { - return this.status; - } - - public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TSetClientInfoResp) - return this.equals((TSetClientInfoResp)that); - return false; - } - - public boolean equals(TSetClientInfoResp that) { - if (that == null) - return false; - if (this == that) - return true; - - 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; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TSetClientInfoResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - 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()); - } - - // check for sub-struct validity - if (status != null) { - status.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, java.lang.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 TSetClientInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TSetClientInfoRespStandardScheme getScheme() { - return new TSetClientInfoRespStandardScheme(); - } - } - - private static class TSetClientInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoResp 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; - 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, TSetClientInfoResp 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(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TSetClientInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TSetClientInfoRespTupleScheme getScheme() { - return new TSetClientInfoRespTupleScheme(); - } - } - - private static class TSetClientInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java deleted file mode 100644 index 36cfddc24861..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatus.java +++ /dev/null @@ -1,854 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus"); - - private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField INFO_MESSAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("infoMessages", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStatusStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStatusTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable TStatusCode statusCode; // required - private @org.apache.thrift.annotation.Nullable java.util.List infoMessages; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional - private int errorCode; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // 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 { - /** - * - * @see TStatusCode - */ - STATUS_CODE((short)1, "statusCode"), - INFO_MESSAGES((short)2, "infoMessages"), - SQL_STATE((short)3, "sqlState"), - ERROR_CODE((short)4, "errorCode"), - ERROR_MESSAGE((short)5, "errorMessage"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS_CODE - return STATUS_CODE; - case 2: // INFO_MESSAGES - return INFO_MESSAGES; - case 3: // SQL_STATE - return SQL_STATE; - case 4: // ERROR_CODE - return ERROR_CODE; - case 5: // ERROR_MESSAGE - return ERROR_MESSAGE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERRORCODE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class))); - tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap); - } - - public TStatus() { - } - - public TStatus( - TStatusCode statusCode) - { - this(); - this.statusCode = statusCode; - } - - /** - * Performs a deep copy on other. - */ - public TStatus(TStatus other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatusCode()) { - this.statusCode = other.statusCode; - } - if (other.isSetInfoMessages()) { - java.util.List __this__infoMessages = new java.util.ArrayList(other.infoMessages); - this.infoMessages = __this__infoMessages; - } - if (other.isSetSqlState()) { - this.sqlState = other.sqlState; - } - this.errorCode = other.errorCode; - if (other.isSetErrorMessage()) { - this.errorMessage = other.errorMessage; - } - } - - public TStatus deepCopy() { - return new TStatus(this); - } - - @Override - public void clear() { - this.statusCode = null; - this.infoMessages = null; - this.sqlState = null; - setErrorCodeIsSet(false); - this.errorCode = 0; - this.errorMessage = null; - } - - /** - * - * @see TStatusCode - */ - @org.apache.thrift.annotation.Nullable - public TStatusCode getStatusCode() { - return this.statusCode; - } - - /** - * - * @see TStatusCode - */ - public void setStatusCode(@org.apache.thrift.annotation.Nullable TStatusCode statusCode) { - this.statusCode = statusCode; - } - - public void unsetStatusCode() { - this.statusCode = null; - } - - /** Returns true if field statusCode is set (has been assigned a value) and false otherwise */ - public boolean isSetStatusCode() { - return this.statusCode != null; - } - - public void setStatusCodeIsSet(boolean value) { - if (!value) { - this.statusCode = null; - } - } - - public int getInfoMessagesSize() { - return (this.infoMessages == null) ? 0 : this.infoMessages.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getInfoMessagesIterator() { - return (this.infoMessages == null) ? null : this.infoMessages.iterator(); - } - - public void addToInfoMessages(java.lang.String elem) { - if (this.infoMessages == null) { - this.infoMessages = new java.util.ArrayList(); - } - this.infoMessages.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getInfoMessages() { - return this.infoMessages; - } - - public void setInfoMessages(@org.apache.thrift.annotation.Nullable java.util.List infoMessages) { - this.infoMessages = infoMessages; - } - - public void unsetInfoMessages() { - this.infoMessages = null; - } - - /** Returns true if field infoMessages is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoMessages() { - return this.infoMessages != null; - } - - public void setInfoMessagesIsSet(boolean value) { - if (!value) { - this.infoMessages = null; - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getSqlState() { - return this.sqlState; - } - - public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { - this.sqlState = sqlState; - } - - public void unsetSqlState() { - this.sqlState = null; - } - - /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ - public boolean isSetSqlState() { - return this.sqlState != null; - } - - public void setSqlStateIsSet(boolean value) { - if (!value) { - this.sqlState = null; - } - } - - public int getErrorCode() { - return this.errorCode; - } - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - setErrorCodeIsSet(true); - } - - public void unsetErrorCode() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorCode() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getErrorMessage() { - return this.errorMessage; - } - - public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { - this.errorMessage = errorMessage; - } - - public void unsetErrorMessage() { - this.errorMessage = null; - } - - /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorMessage() { - return this.errorMessage != null; - } - - public void setErrorMessageIsSet(boolean value) { - if (!value) { - this.errorMessage = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case STATUS_CODE: - if (value == null) { - unsetStatusCode(); - } else { - setStatusCode((TStatusCode)value); - } - break; - - case INFO_MESSAGES: - if (value == null) { - unsetInfoMessages(); - } else { - setInfoMessages((java.util.List)value); - } - break; - - case SQL_STATE: - if (value == null) { - unsetSqlState(); - } else { - setSqlState((java.lang.String)value); - } - break; - - case ERROR_CODE: - if (value == null) { - unsetErrorCode(); - } else { - setErrorCode((java.lang.Integer)value); - } - break; - - case ERROR_MESSAGE: - if (value == null) { - unsetErrorMessage(); - } else { - setErrorMessage((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case STATUS_CODE: - return getStatusCode(); - - case INFO_MESSAGES: - return getInfoMessages(); - - case SQL_STATE: - return getSqlState(); - - case ERROR_CODE: - return getErrorCode(); - - case ERROR_MESSAGE: - return getErrorMessage(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case STATUS_CODE: - return isSetStatusCode(); - case INFO_MESSAGES: - return isSetInfoMessages(); - case SQL_STATE: - return isSetSqlState(); - case ERROR_CODE: - return isSetErrorCode(); - case ERROR_MESSAGE: - return isSetErrorMessage(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TStatus) - return this.equals((TStatus)that); - return false; - } - - public boolean equals(TStatus that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_statusCode = true && this.isSetStatusCode(); - boolean that_present_statusCode = true && that.isSetStatusCode(); - if (this_present_statusCode || that_present_statusCode) { - if (!(this_present_statusCode && that_present_statusCode)) - return false; - if (!this.statusCode.equals(that.statusCode)) - return false; - } - - boolean this_present_infoMessages = true && this.isSetInfoMessages(); - boolean that_present_infoMessages = true && that.isSetInfoMessages(); - if (this_present_infoMessages || that_present_infoMessages) { - if (!(this_present_infoMessages && that_present_infoMessages)) - return false; - if (!this.infoMessages.equals(that.infoMessages)) - return false; - } - - boolean this_present_sqlState = true && this.isSetSqlState(); - boolean that_present_sqlState = true && that.isSetSqlState(); - if (this_present_sqlState || that_present_sqlState) { - if (!(this_present_sqlState && that_present_sqlState)) - return false; - if (!this.sqlState.equals(that.sqlState)) - return false; - } - - boolean this_present_errorCode = true && this.isSetErrorCode(); - boolean that_present_errorCode = true && that.isSetErrorCode(); - if (this_present_errorCode || that_present_errorCode) { - if (!(this_present_errorCode && that_present_errorCode)) - return false; - if (this.errorCode != that.errorCode) - return false; - } - - boolean this_present_errorMessage = true && this.isSetErrorMessage(); - boolean that_present_errorMessage = true && that.isSetErrorMessage(); - if (this_present_errorMessage || that_present_errorMessage) { - if (!(this_present_errorMessage && that_present_errorMessage)) - return false; - if (!this.errorMessage.equals(that.errorMessage)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetStatusCode()) ? 131071 : 524287); - if (isSetStatusCode()) - hashCode = hashCode * 8191 + statusCode.getValue(); - - hashCode = hashCode * 8191 + ((isSetInfoMessages()) ? 131071 : 524287); - if (isSetInfoMessages()) - hashCode = hashCode * 8191 + infoMessages.hashCode(); - - hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); - if (isSetSqlState()) - hashCode = hashCode * 8191 + sqlState.hashCode(); - - hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); - if (isSetErrorCode()) - hashCode = hashCode * 8191 + errorCode; - - hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); - if (isSetErrorMessage()) - hashCode = hashCode * 8191 + errorMessage.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TStatus other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatusCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusCode, other.statusCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoMessages()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoMessages, other.infoMessages); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSqlState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStatus("); - boolean first = true; - - sb.append("statusCode:"); - if (this.statusCode == null) { - sb.append("null"); - } else { - sb.append(this.statusCode); - } - first = false; - if (isSetInfoMessages()) { - if (!first) sb.append(", "); - sb.append("infoMessages:"); - if (this.infoMessages == null) { - sb.append("null"); - } else { - sb.append(this.infoMessages); - } - first = false; - } - if (isSetSqlState()) { - if (!first) sb.append(", "); - sb.append("sqlState:"); - if (this.sqlState == null) { - sb.append("null"); - } else { - sb.append(this.sqlState); - } - first = false; - } - if (isSetErrorCode()) { - if (!first) sb.append(", "); - sb.append("errorCode:"); - sb.append(this.errorCode); - first = false; - } - if (isSetErrorMessage()) { - if (!first) sb.append(", "); - sb.append("errorMessage:"); - if (this.errorMessage == null) { - sb.append("null"); - } else { - sb.append(this.errorMessage); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatusCode()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - 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 TStatusStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStatusStandardScheme getScheme() { - return new TStatusStandardScheme(); - } - } - - private static class TStatusStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus 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_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.statusCode = org.apache.spark.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INFO_MESSAGES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); - struct.infoMessages = new java.util.ArrayList(_list134.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem135; - for (int _i136 = 0; _i136 < _list134.size; ++_i136) - { - _elem135 = iprot.readString(); - struct.infoMessages.add(_elem135); - } - iprot.readListEnd(); - } - struct.setInfoMessagesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SQL_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // ERROR_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // ERROR_MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(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, TStatus struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.statusCode != null) { - oprot.writeFieldBegin(STATUS_CODE_FIELD_DESC); - oprot.writeI32(struct.statusCode.getValue()); - oprot.writeFieldEnd(); - } - if (struct.infoMessages != null) { - if (struct.isSetInfoMessages()) { - oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); - for (java.lang.String _iter137 : struct.infoMessages) - { - oprot.writeString(_iter137); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.sqlState != null) { - if (struct.isSetSqlState()) { - oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); - oprot.writeString(struct.sqlState); - oprot.writeFieldEnd(); - } - } - if (struct.isSetErrorCode()) { - oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); - oprot.writeI32(struct.errorCode); - oprot.writeFieldEnd(); - } - if (struct.errorMessage != null) { - if (struct.isSetErrorMessage()) { - oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); - oprot.writeString(struct.errorMessage); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStatusTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStatusTupleScheme getScheme() { - return new TStatusTupleScheme(); - } - } - - private static class TStatusTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeI32(struct.statusCode.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetInfoMessages()) { - optionals.set(0); - } - if (struct.isSetSqlState()) { - optionals.set(1); - } - if (struct.isSetErrorCode()) { - optionals.set(2); - } - if (struct.isSetErrorMessage()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetInfoMessages()) { - { - oprot.writeI32(struct.infoMessages.size()); - for (java.lang.String _iter138 : struct.infoMessages) - { - oprot.writeString(_iter138); - } - } - } - if (struct.isSetSqlState()) { - oprot.writeString(struct.sqlState); - } - if (struct.isSetErrorCode()) { - oprot.writeI32(struct.errorCode); - } - if (struct.isSetErrorMessage()) { - oprot.writeString(struct.errorMessage); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.statusCode = org.apache.spark.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.infoMessages = new java.util.ArrayList(_list139.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem140; - for (int _i141 = 0; _i141 < _list139.size; ++_i141) - { - _elem140 = iprot.readString(); - struct.infoMessages.add(_elem140); - } - } - struct.setInfoMessagesIsSet(true); - } - if (incoming.get(1)) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } - if (incoming.get(2)) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } - if (incoming.get(3)) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java deleted file mode 100644 index ea075d05cb37..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStatusCode.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TStatusCode implements org.apache.thrift.TEnum { - SUCCESS_STATUS(0), - SUCCESS_WITH_INFO_STATUS(1), - STILL_EXECUTING_STATUS(2), - ERROR_STATUS(3), - INVALID_HANDLE_STATUS(4); - - private final int value; - - private TStatusCode(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TStatusCode findByValue(int value) { - switch (value) { - case 0: - return SUCCESS_STATUS; - case 1: - return SUCCESS_WITH_INFO_STATUS; - case 2: - return STILL_EXECUTING_STATUS; - case 3: - return ERROR_STATUS; - case 4: - return INVALID_HANDLE_STATUS; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java deleted file mode 100644 index 3a37e1a9da13..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringColumn.java +++ /dev/null @@ -1,531 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringColumnTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap); - } - - public TStringColumn() { - } - - public TStringColumn( - java.util.List values, - java.nio.ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TStringColumn(TStringColumn other) { - if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TStringColumn deepCopy() { - return new TStringColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(java.lang.String elem) { - if (this.values == null) { - this.values = new java.util.ArrayList(); - } - this.values.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { - return this.values; - } - - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public java.nio.ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); - } - - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((java.util.List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TStringColumn) - return this.equals((TStringColumn)that); - return false; - } - - public boolean equals(TStringColumn that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); - - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TStringColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TStringColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStringColumnStandardScheme getScheme() { - return new TStringColumnStandardScheme(); - } - } - - private static class TStringColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn 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: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list102.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem103; - for (int _i104 = 0; _i104 < _list102.size; ++_i104) - { - _elem103 = iprot.readString(); - struct.values.add(_elem103); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(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, TStringColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (java.lang.String _iter105 : struct.values) - { - oprot.writeString(_iter105); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStringColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStringColumnTupleScheme getScheme() { - return new TStringColumnTupleScheme(); - } - } - - private static class TStringColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (java.lang.String _iter106 : struct.values) - { - oprot.writeString(_iter106); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new java.util.ArrayList(_list107.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem108; - for (int _i109 = 0; _i109 < _list107.size; ++_i109) - { - _elem108 = iprot.readString(); - struct.values.add(_elem108); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java deleted file mode 100644 index f45b06239bcb..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStringValue.java +++ /dev/null @@ -1,372 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringValueTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.lang.String value; // 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 { - VALUE((short)1, "value"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); - } - - public TStringValue() { - } - - /** - * Performs a deep copy on other. - */ - public TStringValue(TStringValue other) { - if (other.isSetValue()) { - this.value = other.value; - } - } - - public TStringValue deepCopy() { - return new TStringValue(this); - } - - @Override - public void clear() { - this.value = null; - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getValue() { - return this.value; - } - - public void setValue(@org.apache.thrift.annotation.Nullable java.lang.String value) { - this.value = value; - } - - public void unsetValue() { - this.value = null; - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return this.value != null; - } - - public void setValueIsSet(boolean value) { - if (!value) { - this.value = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TStringValue) - return this.equals((TStringValue)that); - return false; - } - - public boolean equals(TStringValue that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (!this.value.equals(that.value)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + value.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TStringValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - 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, java.lang.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 TStringValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStringValueStandardScheme getScheme() { - return new TStringValueStandardScheme(); - } - } - - private static class TStringValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue 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: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.value = iprot.readString(); - struct.setValueIsSet(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, TStringValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.value != null) { - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeString(struct.value); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStringValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStringValueTupleScheme getScheme() { - return new TStringValueTupleScheme(); - } - } - - private static class TStringValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeString(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readString(); - struct.setValueIsSet(true); - } - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java deleted file mode 100644 index 2bd39df87ed9..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TStructTypeEntry.java +++ /dev/null @@ -1,431 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStructTypeEntry"); - - private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStructTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStructTypeEntryTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // 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 { - NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME_TO_TYPE_PTR - return NAME_TO_TYPE_PTR; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStructTypeEntry.class, metaDataMap); - } - - public TStructTypeEntry() { - } - - public TStructTypeEntry( - java.util.Map nameToTypePtr) - { - this(); - this.nameToTypePtr = nameToTypePtr; - } - - /** - * Performs a deep copy on other. - */ - public TStructTypeEntry(TStructTypeEntry other) { - if (other.isSetNameToTypePtr()) { - java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); - for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { - - java.lang.String other_element_key = other_element.getKey(); - java.lang.Integer other_element_value = other_element.getValue(); - - java.lang.String __this__nameToTypePtr_copy_key = other_element_key; - - java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; - - __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); - } - this.nameToTypePtr = __this__nameToTypePtr; - } - } - - public TStructTypeEntry deepCopy() { - return new TStructTypeEntry(this); - } - - @Override - public void clear() { - this.nameToTypePtr = null; - } - - public int getNameToTypePtrSize() { - return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); - } - - public void putToNameToTypePtr(java.lang.String key, int val) { - if (this.nameToTypePtr == null) { - this.nameToTypePtr = new java.util.HashMap(); - } - this.nameToTypePtr.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map getNameToTypePtr() { - return this.nameToTypePtr; - } - - public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { - this.nameToTypePtr = nameToTypePtr; - } - - public void unsetNameToTypePtr() { - this.nameToTypePtr = null; - } - - /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetNameToTypePtr() { - return this.nameToTypePtr != null; - } - - public void setNameToTypePtrIsSet(boolean value) { - if (!value) { - this.nameToTypePtr = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case NAME_TO_TYPE_PTR: - if (value == null) { - unsetNameToTypePtr(); - } else { - setNameToTypePtr((java.util.Map)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case NAME_TO_TYPE_PTR: - return getNameToTypePtr(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case NAME_TO_TYPE_PTR: - return isSetNameToTypePtr(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TStructTypeEntry) - return this.equals((TStructTypeEntry)that); - return false; - } - - public boolean equals(TStructTypeEntry that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); - boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); - if (this_present_nameToTypePtr || that_present_nameToTypePtr) { - if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) - return false; - if (!this.nameToTypePtr.equals(that.nameToTypePtr)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); - if (isSetNameToTypePtr()) - hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TStructTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNameToTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStructTypeEntry("); - boolean first = true; - - sb.append("nameToTypePtr:"); - if (this.nameToTypePtr == null) { - sb.append("null"); - } else { - sb.append(this.nameToTypePtr); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetNameToTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TStructTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStructTypeEntryStandardScheme getScheme() { - return new TStructTypeEntryStandardScheme(); - } - } - - private static class TStructTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry 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: // NAME_TO_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin(); - struct.nameToTypePtr = new java.util.HashMap(2*_map10.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key11; - int _val12; - for (int _i13 = 0; _i13 < _map10.size; ++_i13) - { - _key11 = iprot.readString(); - _val12 = iprot.readI32(); - struct.nameToTypePtr.put(_key11, _val12); - } - iprot.readMapEnd(); - } - struct.setNameToTypePtrIsSet(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, TStructTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.nameToTypePtr != null) { - oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (java.util.Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter14.getKey()); - oprot.writeI32(_iter14.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStructTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TStructTypeEntryTupleScheme getScheme() { - return new TStructTypeEntryTupleScheme(); - } - } - - private static class TStructTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.nameToTypePtr.size()); - for (java.util.Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter15.getKey()); - oprot.writeI32(_iter15.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new java.util.HashMap(2*_map16.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key17; - int _val18; - for (int _i19 = 0; _i19 < _map16.size; ++_i19) - { - _key17 = iprot.readString(); - _val18 = iprot.readI32(); - struct.nameToTypePtr.put(_key17, _val18); - } - } - struct.setNameToTypePtrIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java deleted file mode 100644 index e64d4f6119ac..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTableSchema.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableSchema"); - - private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableSchemaStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableSchemaTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List columns; // 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 { - COLUMNS((short)1, "columns"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COLUMNS - return COLUMNS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnDesc.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableSchema.class, metaDataMap); - } - - public TTableSchema() { - } - - public TTableSchema( - java.util.List columns) - { - this(); - this.columns = columns; - } - - /** - * Performs a deep copy on other. - */ - public TTableSchema(TTableSchema other) { - if (other.isSetColumns()) { - java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); - for (TColumnDesc other_element : other.columns) { - __this__columns.add(new TColumnDesc(other_element)); - } - this.columns = __this__columns; - } - } - - public TTableSchema deepCopy() { - return new TTableSchema(this); - } - - @Override - public void clear() { - this.columns = null; - } - - public int getColumnsSize() { - return (this.columns == null) ? 0 : this.columns.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getColumnsIterator() { - return (this.columns == null) ? null : this.columns.iterator(); - } - - public void addToColumns(TColumnDesc elem) { - if (this.columns == null) { - this.columns = new java.util.ArrayList(); - } - this.columns.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getColumns() { - return this.columns; - } - - public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { - this.columns = columns; - } - - public void unsetColumns() { - this.columns = null; - } - - /** Returns true if field columns is set (has been assigned a value) and false otherwise */ - public boolean isSetColumns() { - return this.columns != null; - } - - public void setColumnsIsSet(boolean value) { - if (!value) { - this.columns = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case COLUMNS: - if (value == null) { - unsetColumns(); - } else { - setColumns((java.util.List)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case COLUMNS: - return getColumns(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case COLUMNS: - return isSetColumns(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TTableSchema) - return this.equals((TTableSchema)that); - return false; - } - - public boolean equals(TTableSchema that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_columns = true && this.isSetColumns(); - boolean that_present_columns = true && that.isSetColumns(); - if (this_present_columns || that_present_columns) { - if (!(this_present_columns && that_present_columns)) - return false; - if (!this.columns.equals(that.columns)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); - if (isSetColumns()) - hashCode = hashCode * 8191 + columns.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TTableSchema other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TTableSchema("); - boolean first = true; - - sb.append("columns:"); - if (this.columns == null) { - sb.append("null"); - } else { - sb.append(this.columns); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColumns()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TTableSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TTableSchemaStandardScheme getScheme() { - return new TTableSchemaStandardScheme(); - } - } - - private static class TTableSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema 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: // COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); - struct.columns = new java.util.ArrayList(_list38.size); - @org.apache.thrift.annotation.Nullable TColumnDesc _elem39; - for (int _i40 = 0; _i40 < _list38.size; ++_i40) - { - _elem39 = new TColumnDesc(); - _elem39.read(iprot); - struct.columns.add(_elem39); - } - iprot.readListEnd(); - } - struct.setColumnsIsSet(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, TTableSchema struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.columns != null) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); - for (TColumnDesc _iter41 : struct.columns) - { - _iter41.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTableSchemaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TTableSchemaTupleScheme getScheme() { - return new TTableSchemaTupleScheme(); - } - } - - private static class TTableSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.columns.size()); - for (TColumnDesc _iter42 : struct.columns) - { - _iter42.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new java.util.ArrayList(_list43.size); - @org.apache.thrift.annotation.Nullable TColumnDesc _elem44; - for (int _i45 = 0; _i45 < _list43.size; ++_i45) - { - _elem44 = new TColumnDesc(); - _elem44.read(iprot); - struct.columns.add(_elem44); - } - } - struct.setColumnsIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java deleted file mode 100644 index 484b76e60e1e..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeDesc.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeDesc"); - - private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeDescStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeDescTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.List types; // 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 { - TYPES((short)1, "types"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPES - return TYPES; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeEntry.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeDesc.class, metaDataMap); - } - - public TTypeDesc() { - } - - public TTypeDesc( - java.util.List types) - { - this(); - this.types = types; - } - - /** - * Performs a deep copy on other. - */ - public TTypeDesc(TTypeDesc other) { - if (other.isSetTypes()) { - java.util.List __this__types = new java.util.ArrayList(other.types.size()); - for (TTypeEntry other_element : other.types) { - __this__types.add(new TTypeEntry(other_element)); - } - this.types = __this__types; - } - } - - public TTypeDesc deepCopy() { - return new TTypeDesc(this); - } - - @Override - public void clear() { - this.types = null; - } - - public int getTypesSize() { - return (this.types == null) ? 0 : this.types.size(); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getTypesIterator() { - return (this.types == null) ? null : this.types.iterator(); - } - - public void addToTypes(TTypeEntry elem) { - if (this.types == null) { - this.types = new java.util.ArrayList(); - } - this.types.add(elem); - } - - @org.apache.thrift.annotation.Nullable - public java.util.List getTypes() { - return this.types; - } - - public void setTypes(@org.apache.thrift.annotation.Nullable java.util.List types) { - this.types = types; - } - - public void unsetTypes() { - this.types = null; - } - - /** Returns true if field types is set (has been assigned a value) and false otherwise */ - public boolean isSetTypes() { - return this.types != null; - } - - public void setTypesIsSet(boolean value) { - if (!value) { - this.types = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case TYPES: - if (value == null) { - unsetTypes(); - } else { - setTypes((java.util.List)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case TYPES: - return getTypes(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case TYPES: - return isSetTypes(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TTypeDesc) - return this.equals((TTypeDesc)that); - return false; - } - - public boolean equals(TTypeDesc that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_types = true && this.isSetTypes(); - boolean that_present_types = true && that.isSetTypes(); - if (this_present_types || that_present_types) { - if (!(this_present_types && that_present_types)) - return false; - if (!this.types.equals(that.types)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetTypes()) ? 131071 : 524287); - if (isSetTypes()) - hashCode = hashCode * 8191 + types.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TTypeDesc other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypes()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.types, other.types); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeDesc("); - boolean first = true; - - sb.append("types:"); - if (this.types == null) { - sb.append("null"); - } else { - sb.append(this.types); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetTypes()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'types' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TTypeDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TTypeDescStandardScheme getScheme() { - return new TTypeDescStandardScheme(); - } - } - - private static class TTypeDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc 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: // TYPES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); - struct.types = new java.util.ArrayList(_list30.size); - @org.apache.thrift.annotation.Nullable TTypeEntry _elem31; - for (int _i32 = 0; _i32 < _list30.size; ++_i32) - { - _elem31 = new TTypeEntry(); - _elem31.read(iprot); - struct.types.add(_elem31); - } - iprot.readListEnd(); - } - struct.setTypesIsSet(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, TTypeDesc struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.types != null) { - oprot.writeFieldBegin(TYPES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.types.size())); - for (TTypeEntry _iter33 : struct.types) - { - _iter33.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTypeDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TTypeDescTupleScheme getScheme() { - return new TTypeDescTupleScheme(); - } - } - - private static class TTypeDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.types.size()); - for (TTypeEntry _iter34 : struct.types) - { - _iter34.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.types = new java.util.ArrayList(_list35.size); - @org.apache.thrift.annotation.Nullable TTypeEntry _elem36; - for (int _i37 = 0; _i37 < _list35.size; ++_i37) - { - _elem36 = new TTypeEntry(); - _elem36.read(iprot); - struct.types.add(_elem36); - } - } - struct.setTypesIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java deleted file mode 100644 index 9d57e8a3396b..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeEntry.java +++ /dev/null @@ -1,591 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TTypeEntry extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry"); - private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ARRAY_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("arrayEntry", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField MAP_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("mapEntry", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField STRUCT_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("structEntry", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField UNION_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("unionEntry", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField USER_DEFINED_TYPE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("userDefinedTypeEntry", org.apache.thrift.protocol.TType.STRUCT, (short)6); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - PRIMITIVE_ENTRY((short)1, "primitiveEntry"), - ARRAY_ENTRY((short)2, "arrayEntry"), - MAP_ENTRY((short)3, "mapEntry"), - STRUCT_ENTRY((short)4, "structEntry"), - UNION_ENTRY((short)5, "unionEntry"), - USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // PRIMITIVE_ENTRY - return PRIMITIVE_ENTRY; - case 2: // ARRAY_ENTRY - return ARRAY_ENTRY; - case 3: // MAP_ENTRY - return MAP_ENTRY; - case 4: // STRUCT_ENTRY - return STRUCT_ENTRY; - case 5: // UNION_ENTRY - return UNION_ENTRY; - case 6: // USER_DEFINED_TYPE_ENTRY - return USER_DEFINED_TYPE_ENTRY; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class))); - tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class))); - tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class))); - tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class))); - tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class))); - tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap); - } - - public TTypeEntry() { - super(); - } - - public TTypeEntry(_Fields setField, java.lang.Object value) { - super(setField, value); - } - - public TTypeEntry(TTypeEntry other) { - super(other); - } - public TTypeEntry deepCopy() { - return new TTypeEntry(this); - } - - public static TTypeEntry primitiveEntry(TPrimitiveTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setPrimitiveEntry(value); - return x; - } - - public static TTypeEntry arrayEntry(TArrayTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setArrayEntry(value); - return x; - } - - public static TTypeEntry mapEntry(TMapTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setMapEntry(value); - return x; - } - - public static TTypeEntry structEntry(TStructTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setStructEntry(value); - return x; - } - - public static TTypeEntry unionEntry(TUnionTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setUnionEntry(value); - return x; - } - - public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setUserDefinedTypeEntry(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { - switch (setField) { - case PRIMITIVE_ENTRY: - if (value instanceof TPrimitiveTypeEntry) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); - case ARRAY_ENTRY: - if (value instanceof TArrayTypeEntry) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); - case MAP_ENTRY: - if (value instanceof TMapTypeEntry) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); - case STRUCT_ENTRY: - if (value instanceof TStructTypeEntry) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); - case UNION_ENTRY: - if (value instanceof TUnionTypeEntry) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); - case USER_DEFINED_TYPE_ENTRY: - if (value instanceof TUserDefinedTypeEntry) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case PRIMITIVE_ENTRY: - if (field.type == PRIMITIVE_ENTRY_FIELD_DESC.type) { - TPrimitiveTypeEntry primitiveEntry; - primitiveEntry = new TPrimitiveTypeEntry(); - primitiveEntry.read(iprot); - return primitiveEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case ARRAY_ENTRY: - if (field.type == ARRAY_ENTRY_FIELD_DESC.type) { - TArrayTypeEntry arrayEntry; - arrayEntry = new TArrayTypeEntry(); - arrayEntry.read(iprot); - return arrayEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case MAP_ENTRY: - if (field.type == MAP_ENTRY_FIELD_DESC.type) { - TMapTypeEntry mapEntry; - mapEntry = new TMapTypeEntry(); - mapEntry.read(iprot); - return mapEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRUCT_ENTRY: - if (field.type == STRUCT_ENTRY_FIELD_DESC.type) { - TStructTypeEntry structEntry; - structEntry = new TStructTypeEntry(); - structEntry.read(iprot); - return structEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case UNION_ENTRY: - if (field.type == UNION_ENTRY_FIELD_DESC.type) { - TUnionTypeEntry unionEntry; - unionEntry = new TUnionTypeEntry(); - unionEntry.read(iprot); - return unionEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case USER_DEFINED_TYPE_ENTRY: - if (field.type == USER_DEFINED_TYPE_ENTRY_FIELD_DESC.type) { - TUserDefinedTypeEntry userDefinedTypeEntry; - userDefinedTypeEntry = new TUserDefinedTypeEntry(); - userDefinedTypeEntry.read(iprot); - return userDefinedTypeEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; - primitiveEntry.write(oprot); - return; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; - arrayEntry.write(oprot); - return; - case MAP_ENTRY: - TMapTypeEntry mapEntry = (TMapTypeEntry)value_; - mapEntry.write(oprot); - return; - case STRUCT_ENTRY: - TStructTypeEntry structEntry = (TStructTypeEntry)value_; - structEntry.write(oprot); - return; - case UNION_ENTRY: - TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; - unionEntry.write(oprot); - return; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; - userDefinedTypeEntry.write(oprot); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry; - primitiveEntry = new TPrimitiveTypeEntry(); - primitiveEntry.read(iprot); - return primitiveEntry; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry; - arrayEntry = new TArrayTypeEntry(); - arrayEntry.read(iprot); - return arrayEntry; - case MAP_ENTRY: - TMapTypeEntry mapEntry; - mapEntry = new TMapTypeEntry(); - mapEntry.read(iprot); - return mapEntry; - case STRUCT_ENTRY: - TStructTypeEntry structEntry; - structEntry = new TStructTypeEntry(); - structEntry.read(iprot); - return structEntry; - case UNION_ENTRY: - TUnionTypeEntry unionEntry; - unionEntry = new TUnionTypeEntry(); - unionEntry.read(iprot); - return unionEntry; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry; - userDefinedTypeEntry = new TUserDefinedTypeEntry(); - userDefinedTypeEntry.read(iprot); - return userDefinedTypeEntry; - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; - primitiveEntry.write(oprot); - return; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; - arrayEntry.write(oprot); - return; - case MAP_ENTRY: - TMapTypeEntry mapEntry = (TMapTypeEntry)value_; - mapEntry.write(oprot); - return; - case STRUCT_ENTRY: - TStructTypeEntry structEntry = (TStructTypeEntry)value_; - structEntry.write(oprot); - return; - case UNION_ENTRY: - TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; - unionEntry.write(oprot); - return; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; - userDefinedTypeEntry.write(oprot); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case PRIMITIVE_ENTRY: - return PRIMITIVE_ENTRY_FIELD_DESC; - case ARRAY_ENTRY: - return ARRAY_ENTRY_FIELD_DESC; - case MAP_ENTRY: - return MAP_ENTRY_FIELD_DESC; - case STRUCT_ENTRY: - return STRUCT_ENTRY_FIELD_DESC; - case UNION_ENTRY: - return UNION_ENTRY_FIELD_DESC; - case USER_DEFINED_TYPE_ENTRY: - return USER_DEFINED_TYPE_ENTRY_FIELD_DESC; - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TPrimitiveTypeEntry getPrimitiveEntry() { - if (getSetField() == _Fields.PRIMITIVE_ENTRY) { - return (TPrimitiveTypeEntry)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setPrimitiveEntry(TPrimitiveTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.PRIMITIVE_ENTRY; - value_ = value; - } - - public TArrayTypeEntry getArrayEntry() { - if (getSetField() == _Fields.ARRAY_ENTRY) { - return (TArrayTypeEntry)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setArrayEntry(TArrayTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.ARRAY_ENTRY; - value_ = value; - } - - public TMapTypeEntry getMapEntry() { - if (getSetField() == _Fields.MAP_ENTRY) { - return (TMapTypeEntry)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setMapEntry(TMapTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.MAP_ENTRY; - value_ = value; - } - - public TStructTypeEntry getStructEntry() { - if (getSetField() == _Fields.STRUCT_ENTRY) { - return (TStructTypeEntry)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStructEntry(TStructTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.STRUCT_ENTRY; - value_ = value; - } - - public TUnionTypeEntry getUnionEntry() { - if (getSetField() == _Fields.UNION_ENTRY) { - return (TUnionTypeEntry)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setUnionEntry(TUnionTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.UNION_ENTRY; - value_ = value; - } - - public TUserDefinedTypeEntry getUserDefinedTypeEntry() { - if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) { - return (TUserDefinedTypeEntry)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.USER_DEFINED_TYPE_ENTRY; - value_ = value; - } - - public boolean isSetPrimitiveEntry() { - return setField_ == _Fields.PRIMITIVE_ENTRY; - } - - - public boolean isSetArrayEntry() { - return setField_ == _Fields.ARRAY_ENTRY; - } - - - public boolean isSetMapEntry() { - return setField_ == _Fields.MAP_ENTRY; - } - - - public boolean isSetStructEntry() { - return setField_ == _Fields.STRUCT_ENTRY; - } - - - public boolean isSetUnionEntry() { - return setField_ == _Fields.UNION_ENTRY; - } - - - public boolean isSetUserDefinedTypeEntry() { - return setField_ == _Fields.USER_DEFINED_TYPE_ENTRY; - } - - - public boolean equals(java.lang.Object other) { - if (other instanceof TTypeEntry) { - return equals((TTypeEntry)other); - } else { - return false; - } - } - - public boolean equals(TTypeEntry other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TTypeEntry other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - java.util.List list = new java.util.ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - 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, java.lang.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); - } - } - - -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java deleted file mode 100644 index 4780d4bb1173..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeId.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - - -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public enum TTypeId implements org.apache.thrift.TEnum { - BOOLEAN_TYPE(0), - TINYINT_TYPE(1), - SMALLINT_TYPE(2), - INT_TYPE(3), - BIGINT_TYPE(4), - FLOAT_TYPE(5), - DOUBLE_TYPE(6), - STRING_TYPE(7), - TIMESTAMP_TYPE(8), - BINARY_TYPE(9), - ARRAY_TYPE(10), - MAP_TYPE(11), - STRUCT_TYPE(12), - UNION_TYPE(13), - USER_DEFINED_TYPE(14), - DECIMAL_TYPE(15), - NULL_TYPE(16), - DATE_TYPE(17), - VARCHAR_TYPE(18), - CHAR_TYPE(19), - INTERVAL_YEAR_MONTH_TYPE(20), - INTERVAL_DAY_TIME_TYPE(21), - TIMESTAMPLOCALTZ_TYPE(22); - - private final int value; - - private TTypeId(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - @org.apache.thrift.annotation.Nullable - public static TTypeId findByValue(int value) { - switch (value) { - case 0: - return BOOLEAN_TYPE; - case 1: - return TINYINT_TYPE; - case 2: - return SMALLINT_TYPE; - case 3: - return INT_TYPE; - case 4: - return BIGINT_TYPE; - case 5: - return FLOAT_TYPE; - case 6: - return DOUBLE_TYPE; - case 7: - return STRING_TYPE; - case 8: - return TIMESTAMP_TYPE; - case 9: - return BINARY_TYPE; - case 10: - return ARRAY_TYPE; - case 11: - return MAP_TYPE; - case 12: - return STRUCT_TYPE; - case 13: - return UNION_TYPE; - case 14: - return USER_DEFINED_TYPE; - case 15: - return DECIMAL_TYPE; - case 16: - return NULL_TYPE; - case 17: - return DATE_TYPE; - case 18: - return VARCHAR_TYPE; - case 19: - return CHAR_TYPE; - case 20: - return INTERVAL_YEAR_MONTH_TYPE; - case 21: - return INTERVAL_DAY_TIME_TYPE; - case 22: - return TIMESTAMPLOCALTZ_TYPE; - default: - return null; - } - } -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java deleted file mode 100644 index f88f97770c1a..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifierValue.java +++ /dev/null @@ -1,342 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TTypeQualifierValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifierValue"); - private static final org.apache.thrift.protocol.TField I32_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Value", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)2); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - I32_VALUE((short)1, "i32Value"), - STRING_VALUE((short)2, "stringValue"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // I32_VALUE - return I32_VALUE; - case 2: // STRING_VALUE - return STRING_VALUE; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.I32_VALUE, new org.apache.thrift.meta_data.FieldMetaData("i32Value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifierValue.class, metaDataMap); - } - - public TTypeQualifierValue() { - super(); - } - - public TTypeQualifierValue(_Fields setField, java.lang.Object value) { - super(setField, value); - } - - public TTypeQualifierValue(TTypeQualifierValue other) { - super(other); - } - public TTypeQualifierValue deepCopy() { - return new TTypeQualifierValue(this); - } - - public static TTypeQualifierValue i32Value(int value) { - TTypeQualifierValue x = new TTypeQualifierValue(); - x.setI32Value(value); - return x; - } - - public static TTypeQualifierValue stringValue(java.lang.String value) { - TTypeQualifierValue x = new TTypeQualifierValue(); - x.setStringValue(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { - switch (setField) { - case I32_VALUE: - if (value instanceof java.lang.Integer) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); - case STRING_VALUE: - if (value instanceof java.lang.String) { - break; - } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case I32_VALUE: - if (field.type == I32_VALUE_FIELD_DESC.type) { - java.lang.Integer i32Value; - i32Value = iprot.readI32(); - return i32Value; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VALUE: - if (field.type == STRING_VALUE_FIELD_DESC.type) { - java.lang.String stringValue; - stringValue = iprot.readString(); - return stringValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case I32_VALUE: - java.lang.Integer i32Value = (java.lang.Integer)value_; - oprot.writeI32(i32Value); - return; - case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; - oprot.writeString(stringValue); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case I32_VALUE: - java.lang.Integer i32Value; - i32Value = iprot.readI32(); - return i32Value; - case STRING_VALUE: - java.lang.String stringValue; - stringValue = iprot.readString(); - return stringValue; - default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case I32_VALUE: - java.lang.Integer i32Value = (java.lang.Integer)value_; - oprot.writeI32(i32Value); - return; - case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; - oprot.writeString(stringValue); - return; - default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case I32_VALUE: - return I32_VALUE_FIELD_DESC; - case STRING_VALUE: - return STRING_VALUE_FIELD_DESC; - default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public int getI32Value() { - if (getSetField() == _Fields.I32_VALUE) { - return (java.lang.Integer)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Value(int value) { - setField_ = _Fields.I32_VALUE; - value_ = value; - } - - public java.lang.String getStringValue() { - if (getSetField() == _Fields.STRING_VALUE) { - return (java.lang.String)getFieldValue(); - } else { - throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringValue(java.lang.String value) { - if (value == null) throw new java.lang.NullPointerException(); - setField_ = _Fields.STRING_VALUE; - value_ = value; - } - - public boolean isSetI32Value() { - return setField_ == _Fields.I32_VALUE; - } - - - public boolean isSetStringValue() { - return setField_ == _Fields.STRING_VALUE; - } - - - public boolean equals(java.lang.Object other) { - if (other instanceof TTypeQualifierValue) { - return equals((TTypeQualifierValue)other); - } else { - return false; - } - } - - public boolean equals(TTypeQualifierValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TTypeQualifierValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - java.util.List list = new java.util.ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - 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, java.lang.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); - } - } - - -} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java deleted file mode 100644 index 350d0dc72cfb..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TTypeQualifiers.java +++ /dev/null @@ -1,433 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifiers"); - - private static final org.apache.thrift.protocol.TField QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifiers", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeQualifiersStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeQualifiersTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.Map qualifiers; // 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 { - QUALIFIERS((short)1, "qualifiers"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // QUALIFIERS - return QUALIFIERS; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("qualifiers", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifierValue.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifiers.class, metaDataMap); - } - - public TTypeQualifiers() { - } - - public TTypeQualifiers( - java.util.Map qualifiers) - { - this(); - this.qualifiers = qualifiers; - } - - /** - * Performs a deep copy on other. - */ - public TTypeQualifiers(TTypeQualifiers other) { - if (other.isSetQualifiers()) { - java.util.Map __this__qualifiers = new java.util.HashMap(other.qualifiers.size()); - for (java.util.Map.Entry other_element : other.qualifiers.entrySet()) { - - java.lang.String other_element_key = other_element.getKey(); - TTypeQualifierValue other_element_value = other_element.getValue(); - - java.lang.String __this__qualifiers_copy_key = other_element_key; - - TTypeQualifierValue __this__qualifiers_copy_value = new TTypeQualifierValue(other_element_value); - - __this__qualifiers.put(__this__qualifiers_copy_key, __this__qualifiers_copy_value); - } - this.qualifiers = __this__qualifiers; - } - } - - public TTypeQualifiers deepCopy() { - return new TTypeQualifiers(this); - } - - @Override - public void clear() { - this.qualifiers = null; - } - - public int getQualifiersSize() { - return (this.qualifiers == null) ? 0 : this.qualifiers.size(); - } - - public void putToQualifiers(java.lang.String key, TTypeQualifierValue val) { - if (this.qualifiers == null) { - this.qualifiers = new java.util.HashMap(); - } - this.qualifiers.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map getQualifiers() { - return this.qualifiers; - } - - public void setQualifiers(@org.apache.thrift.annotation.Nullable java.util.Map qualifiers) { - this.qualifiers = qualifiers; - } - - public void unsetQualifiers() { - this.qualifiers = null; - } - - /** Returns true if field qualifiers is set (has been assigned a value) and false otherwise */ - public boolean isSetQualifiers() { - return this.qualifiers != null; - } - - public void setQualifiersIsSet(boolean value) { - if (!value) { - this.qualifiers = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case QUALIFIERS: - if (value == null) { - unsetQualifiers(); - } else { - setQualifiers((java.util.Map)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case QUALIFIERS: - return getQualifiers(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case QUALIFIERS: - return isSetQualifiers(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TTypeQualifiers) - return this.equals((TTypeQualifiers)that); - return false; - } - - public boolean equals(TTypeQualifiers that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_qualifiers = true && this.isSetQualifiers(); - boolean that_present_qualifiers = true && that.isSetQualifiers(); - if (this_present_qualifiers || that_present_qualifiers) { - if (!(this_present_qualifiers && that_present_qualifiers)) - return false; - if (!this.qualifiers.equals(that.qualifiers)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetQualifiers()) ? 131071 : 524287); - if (isSetQualifiers()) - hashCode = hashCode * 8191 + qualifiers.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TTypeQualifiers other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifiers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifiers, other.qualifiers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeQualifiers("); - boolean first = true; - - sb.append("qualifiers:"); - if (this.qualifiers == null) { - sb.append("null"); - } else { - sb.append(this.qualifiers); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetQualifiers()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifiers' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TTypeQualifiersStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TTypeQualifiersStandardScheme getScheme() { - return new TTypeQualifiersStandardScheme(); - } - } - - private static class TTypeQualifiersStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers 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: // QUALIFIERS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.qualifiers = new java.util.HashMap(2*_map0.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key1; - @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val2; - for (int _i3 = 0; _i3 < _map0.size; ++_i3) - { - _key1 = iprot.readString(); - _val2 = new TTypeQualifierValue(); - _val2.read(iprot); - struct.qualifiers.put(_key1, _val2); - } - iprot.readMapEnd(); - } - struct.setQualifiersIsSet(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, TTypeQualifiers struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.qualifiers != null) { - oprot.writeFieldBegin(QUALIFIERS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.qualifiers.size())); - for (java.util.Map.Entry _iter4 : struct.qualifiers.entrySet()) - { - oprot.writeString(_iter4.getKey()); - _iter4.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTypeQualifiersTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TTypeQualifiersTupleScheme getScheme() { - return new TTypeQualifiersTupleScheme(); - } - } - - private static class TTypeQualifiersTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.qualifiers.size()); - for (java.util.Map.Entry _iter5 : struct.qualifiers.entrySet()) - { - oprot.writeString(_iter5.getKey()); - _iter5.getValue().write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.qualifiers = new java.util.HashMap(2*_map6.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7; - @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val8; - for (int _i9 = 0; _i9 < _map6.size; ++_i9) - { - _key7 = iprot.readString(); - _val8 = new TTypeQualifierValue(); - _val8.read(iprot); - struct.qualifiers.put(_key7, _val8); - } - } - struct.setQualifiersIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java deleted file mode 100644 index 7899575ffcc9..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUnionTypeEntry.java +++ /dev/null @@ -1,431 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTypeEntry"); - - private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUnionTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUnionTypeEntryTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // 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 { - NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME_TO_TYPE_PTR - return NAME_TO_TYPE_PTR; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTypeEntry.class, metaDataMap); - } - - public TUnionTypeEntry() { - } - - public TUnionTypeEntry( - java.util.Map nameToTypePtr) - { - this(); - this.nameToTypePtr = nameToTypePtr; - } - - /** - * Performs a deep copy on other. - */ - public TUnionTypeEntry(TUnionTypeEntry other) { - if (other.isSetNameToTypePtr()) { - java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); - for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { - - java.lang.String other_element_key = other_element.getKey(); - java.lang.Integer other_element_value = other_element.getValue(); - - java.lang.String __this__nameToTypePtr_copy_key = other_element_key; - - java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; - - __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); - } - this.nameToTypePtr = __this__nameToTypePtr; - } - } - - public TUnionTypeEntry deepCopy() { - return new TUnionTypeEntry(this); - } - - @Override - public void clear() { - this.nameToTypePtr = null; - } - - public int getNameToTypePtrSize() { - return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); - } - - public void putToNameToTypePtr(java.lang.String key, int val) { - if (this.nameToTypePtr == null) { - this.nameToTypePtr = new java.util.HashMap(); - } - this.nameToTypePtr.put(key, val); - } - - @org.apache.thrift.annotation.Nullable - public java.util.Map getNameToTypePtr() { - return this.nameToTypePtr; - } - - public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { - this.nameToTypePtr = nameToTypePtr; - } - - public void unsetNameToTypePtr() { - this.nameToTypePtr = null; - } - - /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetNameToTypePtr() { - return this.nameToTypePtr != null; - } - - public void setNameToTypePtrIsSet(boolean value) { - if (!value) { - this.nameToTypePtr = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case NAME_TO_TYPE_PTR: - if (value == null) { - unsetNameToTypePtr(); - } else { - setNameToTypePtr((java.util.Map)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case NAME_TO_TYPE_PTR: - return getNameToTypePtr(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case NAME_TO_TYPE_PTR: - return isSetNameToTypePtr(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TUnionTypeEntry) - return this.equals((TUnionTypeEntry)that); - return false; - } - - public boolean equals(TUnionTypeEntry that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); - boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); - if (this_present_nameToTypePtr || that_present_nameToTypePtr) { - if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) - return false; - if (!this.nameToTypePtr.equals(that.nameToTypePtr)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); - if (isSetNameToTypePtr()) - hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TUnionTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNameToTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TUnionTypeEntry("); - boolean first = true; - - sb.append("nameToTypePtr:"); - if (this.nameToTypePtr == null) { - sb.append("null"); - } else { - sb.append(this.nameToTypePtr); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetNameToTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TUnionTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TUnionTypeEntryStandardScheme getScheme() { - return new TUnionTypeEntryStandardScheme(); - } - } - - private static class TUnionTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry 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: // NAME_TO_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin(); - struct.nameToTypePtr = new java.util.HashMap(2*_map20.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key21; - int _val22; - for (int _i23 = 0; _i23 < _map20.size; ++_i23) - { - _key21 = iprot.readString(); - _val22 = iprot.readI32(); - struct.nameToTypePtr.put(_key21, _val22); - } - iprot.readMapEnd(); - } - struct.setNameToTypePtrIsSet(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, TUnionTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.nameToTypePtr != null) { - oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (java.util.Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter24.getKey()); - oprot.writeI32(_iter24.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TUnionTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TUnionTypeEntryTupleScheme getScheme() { - return new TUnionTypeEntryTupleScheme(); - } - } - - private static class TUnionTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - oprot.writeI32(struct.nameToTypePtr.size()); - for (java.util.Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter25.getKey()); - oprot.writeI32(_iter25.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new java.util.HashMap(2*_map26.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key27; - int _val28; - for (int _i29 = 0; _i29 < _map26.size; ++_i29) - { - _key27 = iprot.readString(); - _val28 = iprot.readI32(); - struct.nameToTypePtr.put(_key27, _val28); - } - } - struct.setNameToTypePtrIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java deleted file mode 100644 index 9ad9d584b3ce..000000000000 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/service/rpc/thrift/TUserDefinedTypeEntry.java +++ /dev/null @@ -1,368 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.12.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.spark.service.rpc.thrift; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)") -public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry"); - - private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUserDefinedTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUserDefinedTypeEntryTupleSchemeFactory(); - - private @org.apache.thrift.annotation.Nullable java.lang.String typeClassName; // 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 { - TYPE_CLASS_NAME((short)1, "typeClassName"); - - private static final java.util.Map byName = new java.util.HashMap(); - - static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPE_CLASS_NAME - return TYPE_CLASS_NAME; - 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { - return byName.get(name); - } - - private final short _thriftId; - private final java.lang.String _fieldName; - - _Fields(short thriftId, java.lang.String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public java.lang.String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap); - } - - public TUserDefinedTypeEntry() { - } - - public TUserDefinedTypeEntry( - java.lang.String typeClassName) - { - this(); - this.typeClassName = typeClassName; - } - - /** - * Performs a deep copy on other. - */ - public TUserDefinedTypeEntry(TUserDefinedTypeEntry other) { - if (other.isSetTypeClassName()) { - this.typeClassName = other.typeClassName; - } - } - - public TUserDefinedTypeEntry deepCopy() { - return new TUserDefinedTypeEntry(this); - } - - @Override - public void clear() { - this.typeClassName = null; - } - - @org.apache.thrift.annotation.Nullable - public java.lang.String getTypeClassName() { - return this.typeClassName; - } - - public void setTypeClassName(@org.apache.thrift.annotation.Nullable java.lang.String typeClassName) { - this.typeClassName = typeClassName; - } - - public void unsetTypeClassName() { - this.typeClassName = null; - } - - /** Returns true if field typeClassName is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeClassName() { - return this.typeClassName != null; - } - - public void setTypeClassNameIsSet(boolean value) { - if (!value) { - this.typeClassName = null; - } - } - - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { - switch (field) { - case TYPE_CLASS_NAME: - if (value == null) { - unsetTypeClassName(); - } else { - setTypeClassName((java.lang.String)value); - } - break; - - } - } - - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { - switch (field) { - case TYPE_CLASS_NAME: - return getTypeClassName(); - - } - throw new java.lang.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 java.lang.IllegalArgumentException(); - } - - switch (field) { - case TYPE_CLASS_NAME: - return isSetTypeClassName(); - } - throw new java.lang.IllegalStateException(); - } - - @Override - public boolean equals(java.lang.Object that) { - if (that == null) - return false; - if (that instanceof TUserDefinedTypeEntry) - return this.equals((TUserDefinedTypeEntry)that); - return false; - } - - public boolean equals(TUserDefinedTypeEntry that) { - if (that == null) - return false; - if (this == that) - return true; - - boolean this_present_typeClassName = true && this.isSetTypeClassName(); - boolean that_present_typeClassName = true && that.isSetTypeClassName(); - if (this_present_typeClassName || that_present_typeClassName) { - if (!(this_present_typeClassName && that_present_typeClassName)) - return false; - if (!this.typeClassName.equals(that.typeClassName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetTypeClassName()) ? 131071 : 524287); - if (isSetTypeClassName()) - hashCode = hashCode * 8191 + typeClassName.hashCode(); - - return hashCode; - } - - @Override - public int compareTo(TUserDefinedTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = java.lang.Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeClassName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeClassName, other.typeClassName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - @org.apache.thrift.annotation.Nullable - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); - } - - @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TUserDefinedTypeEntry("); - boolean first = true; - - sb.append("typeClassName:"); - if (this.typeClassName == null) { - sb.append("null"); - } else { - sb.append(this.typeClassName); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetTypeClassName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeClassName' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - 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, java.lang.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 TUserDefinedTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TUserDefinedTypeEntryStandardScheme getScheme() { - return new TUserDefinedTypeEntryStandardScheme(); - } - } - - private static class TUserDefinedTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry 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: // TYPE_CLASS_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.typeClassName = iprot.readString(); - struct.setTypeClassNameIsSet(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, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.typeClassName != null) { - oprot.writeFieldBegin(TYPE_CLASS_NAME_FIELD_DESC); - oprot.writeString(struct.typeClassName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TUserDefinedTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { - public TUserDefinedTypeEntryTupleScheme getScheme() { - return new TUserDefinedTypeEntryTupleScheme(); - } - } - - private static class TUserDefinedTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - oprot.writeString(struct.typeClassName); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - struct.typeClassName = iprot.readString(); - struct.setTypeClassNameIsSet(true); - } - } - - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } -} - From 5365dcf7e1ebe7c0c2c2c6d81035b7d79086ce1e Mon Sep 17 00:00:00 2001 From: Yuming Wang Date: Fri, 25 Oct 2019 09:02:52 +0800 Subject: [PATCH 07/55] org.apache.thrift.tools:maven-thrift-plugin -> org.apache.thrift:thrift-maven-plugin --- sql/thriftserver/pom.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index f3a889d338d3..d935e67b2b64 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -131,11 +131,10 @@ target/scala-${scala.binary.version}/test-classes - org.apache.thrift.tools - maven-thrift-plugin - 0.1.11 + org.apache.thrift + thrift-maven-plugin + 0.10.0 - /usr/local/opt/thrift@0.9/bin/thrift ../thriftserver/if From 95d8137cc9a747e15db0622c751303206b73f3fb Mon Sep 17 00:00:00 2001 From: angerszhu Date: Sat, 26 Oct 2019 14:02:39 +0800 Subject: [PATCH 08/55] save some basic code --- .../sql/thriftserver/AbstractService.scala | 137 ++++++++++++++++++ .../sql/thriftserver/CompositeServices.scala | 113 +++++++++++++++ .../spark/sql/thriftserver/CookieSigner.scala | 102 +++++++++++++ .../spark/sql/thriftserver/Service.scala | 113 +++++++++++++++ .../sql/thriftserver/ServiceException.scala | 27 ++++ .../sql/thriftserver/ServiceOperations.scala | 132 +++++++++++++++++ .../ServiceStateChangeListener.scala | 44 ++++++ .../spark/sql/thriftserver/ServiceUtils.scala | 69 +++++++++ .../spark/sql/thriftserver/cli/Handle.scala | 61 ++++++++ .../thriftserver/cli/HandleIdentifier.scala | 86 +++++++++++ .../thriftserver/cli/OperationHandle.scala | 81 +++++++++++ .../sql/thriftserver/cli/OperationState.scala | 130 +++++++++++++++++ .../thriftserver/cli/OperationStatus.scala | 32 ++++ .../sql/thriftserver/cli/OperationType.scala | 79 ++++++++++ .../sql/thriftserver/cli/SessionHandle.scala | 48 ++++++ .../cli/SparkThriftServerSQLException.scala | 119 +++++++++++++++ 16 files changed, 1373 insertions(+) create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala new file mode 100644 index 000000000000..2008fe453868 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala @@ -0,0 +1,137 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.util + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.conf.HiveConf + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.Service._ + +/** + * Construct the service. + * + * @param name + * service name + */ +abstract class AbstractService(val name: String) extends Service with Logging { + + /** + * Service state: initially {@link STATE#NOTINITED}. + */ + private var state: STATE = NOTINITED + /** + * Service start time. Will be zero until the service is started. + */ + private var startTime = 0L + /** + * The configuration. Will be null until the service is initialized. + */ + private var hiveConf: HiveConf = null + /** + * List of state change listeners; it is final to ensure + * that it will never be null. + */ + final private val listeners = new util.ArrayList[ServiceStateChangeListener] + + def getServiceState: Service.STATE = synchronized { + state + } + + /** + * {@inheritDoc } + * + * @throws IllegalStateException + * if the current service state does not permit + * this action + */ + def init(hiveConf: HiveConf): Unit = { + ensureCurrentState(NOTINITED) + this.hiveConf = hiveConf + changeState(INITED) + logInfo("Service:" + getName + " is inited.") + } + + def start(): Unit = { + startTime = System.currentTimeMillis + ensureCurrentState(INITED) + changeState(STARTED) + logInfo("Service:" + getName + " is started.") + } + + def stop(): Unit = { + if ((state eq STOPPED) || + (state eq INITED) || + (state eq NOTINITED)) { + // already stopped, or else it was never + // started (eg another service failing canceled startup) + return + } + ensureCurrentState(STARTED) + changeState(STOPPED) + logInfo("Service:" + getName + " is stopped.") + } + + def register(l: ServiceStateChangeListener): Unit = { + listeners.add(l) + } + + def unregister(l: ServiceStateChangeListener): Unit = { + listeners.remove(l) + } + + def getName: String = name + + def getHiveConf: HiveConf = hiveConf + + def getStartTime: Long = startTime + + /** + * Verify that a service is in a given state. + * + * @param currentState + * the desired state + * @throws IllegalStateException + * if the service state is different from + * the desired state + */ + private def ensureCurrentState(currentState: STATE): Unit = { + ServiceOperations.ensureCurrentState(state, currentState) + } + + /** + * Change to a new state and notify all listeners. + * This is a private method that is only invoked from synchronized methods, + * which avoid having to clone the listener list. It does imply that + * the state change listener methods should be short lived, as they + * will delay the state transition. + * + * @param newState + * new service state + */ + private def changeState(newState: STATE): Unit = { + state = newState + // notify listeners + for (l <- listeners.asScala) { + l.stateChanged(this) + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala new file mode 100644 index 000000000000..9142a99b2f8f --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.util +import java.util.Collections + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.conf.HiveConf + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.Service.STOPPED + +class CompositeService(name: String) extends AbstractService(name) with Logging { + + + private val serviceList: util.ArrayList[Service] = new util.ArrayList[Service] + + def getServices: util.Collection[Service] = Collections.unmodifiableList(serviceList) + + protected def addService(service: Service): Unit = { + serviceList.add(service) + } + + protected def removeService(service: Service): Boolean = serviceList.remove(service) + + override def init(hiveConf: HiveConf): Unit = { + for (service <- serviceList.asScala) { + service.init(hiveConf) + } + super.init(hiveConf) + } + + override def start(): Unit = { + var i = 0 + try { + val n = serviceList.size + while (i < n) { + val service = serviceList.get(i) + service.start + i += 1 + } + super.start + } catch { + case e: Throwable => + logError("Error starting services " + getName, e) + // Note that the state of the failed service is still INITED and not + // STARTED. Even though the last service is not started completely, still + // call stop() on all services including failed service to make sure cleanup + // happens. + stop(i) + throw new ServiceException("Failed to Start " + getName, e) + } + } + + override def stop(): Unit = { + if (this.getServiceState eq STOPPED) { + // The base composite-service is already stopped, don't do anything again. + return + } + if (serviceList.size > 0) { + stop(serviceList.size - 1) + } + super.stop + } + + private def stop(numOfServicesStarted: Int): Unit = { + // stop in reserve order of start + var i = numOfServicesStarted + while (i >= 0) { + val service = serviceList.get(i) + try { + service.stop + } catch { + case t: Throwable => + logInfo("Error stopping " + service.getName, t) + } + i -= 1 + } + } + + /** + * JVM Shutdown hook for CompositeService which will stop the given + * CompositeService gracefully in case of JVM shutdown. + */ + class CompositeServiceShutdownHook(val compositeService: CompositeService) extends Runnable { + override def run(): Unit = { + try // Stop the Composite Service + compositeService.stop + catch { + case t: Throwable => + logInfo("Error stopping " + compositeService.getName, t) + } + } + } + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala new file mode 100644 index 000000000000..de4bd0ed22ae --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.security.{MessageDigest, NoSuchAlgorithmException} + +import org.apache.commons.codec.binary.Base64 + +import org.apache.spark.internal.Logging + +/** + * The cookie signer generates a signature based on SHA digest + * and appends it to the cookie value generated at the + * server side. It uses SHA digest algorithm to sign and verify signatures. + */ +object CookieSigner { + private val SIGNATURE = "&s=" + private val SHA_STRING = "SHA" +} + +class CookieSigner extends Logging { + private var secretBytes: Array[Byte] = null + + def this(secret: Array[Byte]) { + this() + if (secret == null) { + throw new IllegalArgumentException("NULL Secret Bytes") + } + this.secretBytes = secret.clone + } + + + /** + * Sign the cookie given the string token as input. + * + * @param str Input token + * @return Signed token that can be used to create a cookie + */ + def signCookie(str: String): String = { + if (str == null || str.isEmpty) { + throw new IllegalArgumentException("NULL or empty string to sign") + } + val signature = getSignature(str) + logDebug("Signature generated for " + str + " is " + signature) + str + CookieSigner.SIGNATURE + signature + } + + /** + * Verify a signed string and extracts the original string. + * + * @param signedStr The already signed string + * @return Raw Value of the string without the signature + */ + def verifyAndExtract(signedStr: String): String = { + val index = signedStr.lastIndexOf(CookieSigner.SIGNATURE) + if (index == -1) { + throw new IllegalArgumentException("Invalid input sign: " + signedStr) + } + val originalSignature = signedStr.substring(index + CookieSigner.SIGNATURE.length) + val rawValue = signedStr.substring(0, index) + val currentSignature = getSignature(rawValue) + logDebug("Signature generated for " + rawValue + " inside verify is " + currentSignature) + if (!(originalSignature == currentSignature)) { + throw new IllegalArgumentException("Invalid sign, original = " + + originalSignature + " current = " + currentSignature) + } + rawValue + } + + /** + * Get the signature of the input string based on SHA digest algorithm. + * + * @param str Input token + * @return Signed String + */ + private def getSignature(str: String) = try { + val md = MessageDigest.getInstance(CookieSigner.SHA_STRING) + md.update(str.getBytes) + md.update(secretBytes) + val digest = md.digest + new Base64(0).encodeToString(digest) + } catch { + case ex: NoSuchAlgorithmException => + throw new RuntimeException("Invalid SHA digest String: " + + CookieSigner.SHA_STRING + " " + ex.getMessage, ex) + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala new file mode 100644 index 000000000000..52ac32fde739 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import org.apache.hadoop.hive.conf.HiveConf + +trait Service { + /** + * Initialize the service. + * + * The transition must be from {@link STATE#NOTINITED} to {@link STATE#INITED} unless the + * operation failed and an exception was raised. + * + * @param conf + * the configuration of the service + */ + def init(conf: HiveConf): Unit + + + /** + * Start the service. + * + * The transition should be from {@link STATE#INITED} to {@link STATE#STARTED} unless the + * operation failed and an exception was raised. + */ + def start(): Unit + + /** + * Stop the service. + * + * This operation must be designed to complete regardless of the initial state + * of the service, including the state of all its internal fields. + */ + def stop(): Unit + + /** + * Register an instance of the service state change events. + * + * @param listener + * a new listener + */ + def register(listener: ServiceStateChangeListener): Unit + + /** + * Unregister a previously instance of the service state change events. + * + * @param listener + * the listener to unregister. + */ + def unregister(listener: ServiceStateChangeListener): Unit + + /** + * Get the name of this service. + * + * @return the service name + */ + def getName: String + + /** + * Get the configuration of this service. + * This is normally not a clone and may be manipulated, though there are no + * guarantees as to what the consequences of such actions may be + * + * @return the current configuration, unless a specific implementation chooses + * otherwise. + */ + def getHiveConf: HiveConf + + /** + * Get the current service state + * + * @return the state of the service + */ + def getServiceState: Service.STATE + + /** + * Get the service start time + * + * @return the start time of the service. This will be zero if the service + * has not yet been started. + */ + def getStartTime: Long +} + +object Service { + + trait STATE + + case object NOTINITED extends STATE + + case object INITED extends STATE + + case object STARTED extends STATE + + case object STOPPED extends STATE + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala new file mode 100644 index 000000000000..e7d1ef3438fe --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +class ServiceException(msg: String, cause: Throwable) + extends RuntimeException(msg, cause) { + + def this(cause: Throwable) = this(null, cause) + + def this(message: String) = this(message, null) +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala new file mode 100644 index 000000000000..1a79105533e7 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala @@ -0,0 +1,132 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import org.apache.hadoop.hive.conf.HiveConf + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.Service._ + +object ServiceOperations extends Logging { + + /** + * Verify that a service is in a given state. + * + * @param state the actual state a service is in + * @param expectedState the desired state + * @throws IllegalStateException if the service state is different from + * the desired state + */ + def ensureCurrentState(state: STATE, expectedState: STATE): Unit = { + if (state ne expectedState) { + throw new IllegalStateException("For this operation, the " + + "current service state must be " + expectedState + " instead of " + state) + } + } + + /** + * Initialize a service. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service that must be in the state + * { @link Service.STATE#NOTINITED} + * @param configuration the configuration to initialize the service with + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + def init(service: Service, configuration: HiveConf): Unit = { + val state = service.getServiceState + ensureCurrentState(state, NOTINITED) + service.init(configuration) + } + + /** + * Start a service. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service that must be in the state + * { @link Service.STATE#INITED} + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + def start(service: Service): Unit = { + val state = service.getServiceState + ensureCurrentState(state, INITED) + service.start() + } + + /** + * Initialize then start a service. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service that must be in the state + * { @link Service.STATE#NOTINITED} + * @param configuration the configuration to initialize the service with + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + def deploy(service: Service, configuration: HiveConf): Unit = { + init(service, configuration) + start(service) + } + + /** + * Stop a service. + * + * Do nothing if the service is null or not in a state in which it can be/needs to be stopped. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service or null + */ + def stop(service: Service): Unit = { + if (service != null) { + val state = service.getServiceState + if (state eq STARTED) { + service.stop() + + } + } + } + + /** + * Stop a service; if it is null do nothing. Exceptions are caught and + * logged at warn level. (but not Throwables). This operation is intended to + * be used in cleanup operations + * + * @param service a service; may be null + * @return any exception that was caught; null if none was. + */ + def stopQuietly(service: Service): Exception = { + try { + stop(service) + } catch { + case e: Exception => + logWarning("When stopping the service " + service.getName + " : " + e, e) + return e + } + null + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala new file mode 100644 index 000000000000..1b9010b42aa5 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +/** + * ServiceStateChangeListener. + * + */ +trait ServiceStateChangeListener { + + /** + * Callback to notify of a state change. The service will already + * have changed state before this callback is invoked. + * + * This operation is invoked on the thread that initiated the state change, + * while the service itself in a synchronized section. + *
    + *
  1. Any long-lived operation here will prevent the service state + * change from completing in a timely manner.
  2. + *
  3. If another thread is somehow invoked from the listener, and + * that thread invokes the methods of the service (including + * subclass-specific methods), there is a risk of a deadlock.
  4. + *
+ * + * @param service the service that has changed. + */ + def stateChanged(service: Service): Unit +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala new file mode 100644 index 000000000000..0ebc1bb444c2 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.io.{Closeable, IOException} + +import org.slf4j.Logger + +object ServiceUtils { + + /* + * Get the index separating the user name from domain name (the user's name up + * to the first '/' or '@'). + * + * @param userName full user name. + * @return index of domain match or -1 if not found + */ + def indexOfDomainMatch(userName: String): Int = { + if (userName == null) { + return -1 + } + val idx = userName.indexOf('/') + val idx2 = userName.indexOf('@') + var endIdx = Math.min(idx, idx2) // Use the earlier match. + // Unless at least one of '/' or '@' was not found, in + // which case, user the latter match. + if (endIdx == -1) { + endIdx = Math.max(idx, idx2) + } + endIdx + } + + /** + * Close the Closeable objects and ignore any {@link IOException} or + * null pointers. Must only be used for cleanup in exception handlers. + * + * @param log the log to record problems to at debug level. Can be null. + * @param closeables the objects to close + */ + def cleanup(log: Logger, closeables: Closeable*): Unit = { + for (c <- closeables) { + if (c != null) { + try { + c.close() + } catch { + case e: IOException => + if (log != null && log.isDebugEnabled) { + log.debug("Exception in closing " + c, e) + } + } + } + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala new file mode 100644 index 000000000000..1416b845257e --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier + + +abstract class Handle(val handleId: HandleIdentifier) { + def this() = this(new HandleIdentifier()) + + def this(tHandleIdentifier: THandleIdentifier) = this(new HandleIdentifier(tHandleIdentifier)) + + def getHandleIdentifier: HandleIdentifier = handleId + + override def hashCode: Int = { + val prime = 31 + var result = 1 + result = prime * result + (if (handleId == null) 0 else handleId.hashCode) + result + } + + override def equals(obj: Any): Boolean = { + if (obj == null) { + return false + } + + if (!obj.isInstanceOf[Handle]) { + return false + } + + val other = obj.asInstanceOf[Handle] + if (this eq other) { + return true + } + + if (handleId == null) { + if (other.handleId != null) { + return false + } + } else if (handleId != other.handleId) { + return false + } + + true + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala new file mode 100644 index 000000000000..bdef1031131a --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.nio.ByteBuffer +import java.util.UUID + +import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier + +class HandleIdentifier(val publicId: UUID, val secretId: UUID) { + + def this() = this(UUID.randomUUID(), UUID.randomUUID()) + + def this(guid: ByteBuffer, secret: ByteBuffer) = + this(Option(guid).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID()), + Option(secret).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID())) + + def this(tHandleId: THandleIdentifier) = + this(ByteBuffer.wrap(tHandleId.getGuid), ByteBuffer.wrap(tHandleId.getSecret)) + + def getPublicId: UUID = this.publicId + + def getSecretId: UUID = this.secretId + + def toTHandleIdentifier: THandleIdentifier = { + val guid = new Array[Byte](16) + val gBuff = ByteBuffer.wrap(guid) + val secret = new Array[Byte](16) + val sBuff = ByteBuffer.wrap(secret) + gBuff.putLong(publicId.getMostSignificantBits) + gBuff.putLong(publicId.getLeastSignificantBits) + sBuff.putLong(secretId.getMostSignificantBits) + sBuff.putLong(secretId.getLeastSignificantBits) + new THandleIdentifier(ByteBuffer.wrap(guid), ByteBuffer.wrap(secret)) + } + + override def hashCode: Int = { + val prime = 31 + var result = 1 + result = prime * result + (if (publicId == null) 0 else publicId.hashCode) + result = prime * result + (if (secretId == null) 0 else secretId.hashCode) + result + } + + override def equals(obj: Any): Boolean = { + if (obj == null) return false + if (!obj.isInstanceOf[HandleIdentifier]) return false + + val other = obj.asInstanceOf[HandleIdentifier] + if (this eq other) return true + + if (publicId == null) { + if (other.publicId != null) { + return false + } + } else if (!(publicId == other.publicId)) { + return false + } + + if (secretId == null) { + if (other.secretId != null) { + return false + } + } else if (!(secretId == other.secretId)) { + return false + } + true + } + + override def toString: String = Option(publicId).map(_.toString).getOrElse("") +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala new file mode 100644 index 000000000000..6466f63c4902 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.{TOperationHandle, TProtocolVersion} + +class OperationHandle private(val opType: OperationType, + protocol: TProtocolVersion, + handleId: HandleIdentifier) extends Handle(handleId) { + + private[this] var hasResultSet: Boolean = false + + def this(opType: OperationType, protocol: TProtocolVersion) = + this(opType, protocol, new HandleIdentifier) + + def this(tOperationHandle: TOperationHandle, protocol: TProtocolVersion) = { + this( + OperationType.getOperationType(tOperationHandle.getOperationType), + protocol, + new HandleIdentifier(tOperationHandle.getOperationId)) + setHasResultSet(tOperationHandle.isHasResultSet) + } + + def this(tOperationHandle: TOperationHandle) = + this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) + + def getOperationType: OperationType = opType + + def toTOperationHandle: TOperationHandle = { + val tOperationHandle = new TOperationHandle + tOperationHandle.setOperationId(getHandleIdentifier.toTHandleIdentifier) + tOperationHandle.setOperationType(opType.toTOperationType) + tOperationHandle.setHasResultSet(this.hasResultSet) + tOperationHandle + } + + def setHasResultSet(hasResultSet: Boolean): Unit = { + this.hasResultSet = hasResultSet + } + + def isHasResultSet: Boolean = this.hasResultSet + + def getProtocolVersion: TProtocolVersion = protocol + + override def hashCode: Int = { + val prime = 31 + var result = super.hashCode + result = prime * result + (if (opType == null) 0 else opType.hashCode) + result + } + + override def equals(obj: Any): Boolean = { + if (!super.equals(obj)) return false + if (!obj.isInstanceOf[OperationHandle]) return false + val other = obj.asInstanceOf[OperationHandle] + if (this eq other) return true + if (opType != other.opType) { + return false + } + true + } + + override def toString: String = + "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier + "]" + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala new file mode 100644 index 000000000000..9d456eb7adf1 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala @@ -0,0 +1,130 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationState + +trait OperationState { + + def toTOperationState(): TOperationState + + def isTerminal(): Boolean = false + + @throws[SparkThriftServerSQLException] + def validateTransition(newState: OperationState): Unit = ex(newState) + + @throws[SparkThriftServerSQLException] + protected def ex(state: OperationState): Unit = throw new SparkThriftServerSQLException( + "Illegal Operation state transition " + this + " -> " + state, "ServerError", 1000) +} + +case object INITIALIZED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.INITIALIZED_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case PENDING | RUNNING | CANCELED | CLOSED | TIMEOUT => + case _ => ex(newState) + } +} + +case object PENDING extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.PENDING_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case RUNNING | FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => + case _ => ex(newState) + } +} + +case object RUNNING extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.RUNNING_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => + case _ => ex(newState) + } +} + +case object TIMEOUT extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.TIMEDOUT_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object FINISHED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.FINISHED_STATE + + override def isTerminal(): Boolean = true + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object CANCELED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.CANCELED_STATE + + override def isTerminal(): Boolean = true + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object CLOSED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.CLOSED_STATE + + override def isTerminal(): Boolean = true +} + +case object ERROR extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.ERROR_STATE + + override def isTerminal(): Boolean = true + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object UNKNOWN extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.UKNOWN_STATE +} + + +object OperationState { + def getOperationState(tOperationState: TOperationState): OperationState = { + tOperationState match { + case TOperationState.INITIALIZED_STATE => INITIALIZED + case TOperationState.PENDING_STATE => PENDING + case TOperationState.RUNNING_STATE => RUNNING + case TOperationState.CANCELED_STATE => CANCELED + case TOperationState.ERROR_STATE => ERROR + case TOperationState.CLOSED_STATE => CLOSED + case TOperationState.FINISHED_STATE => FINISHED + case TOperationState.TIMEDOUT_STATE => TIMEOUT + case TOperationState.UKNOWN_STATE => UNKNOWN + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala new file mode 100644 index 000000000000..05aea20acd4f --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + + +/** + * OperationStatus + * + */ +class OperationStatus(val state: OperationState, + val operationException: SparkThriftServerSQLException) { + + def getState: OperationState = state + + def getOperationException: SparkThriftServerSQLException = operationException +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala new file mode 100644 index 000000000000..7597d8d823d1 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationType + + +/** + * OperationType. + */ +abstract class OperationType { + def toTOperationType: TOperationType +} + +case object EXECUTE_STATEMENT extends OperationType { + override def toTOperationType: TOperationType = TOperationType.EXECUTE_STATEMENT +} + +case object GET_TYPE_INFO extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_TYPE_INFO +} + +case object GET_CATALOGS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_CATALOGS +} + +case object GET_SCHEMAS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_SCHEMAS +} + +case object GET_TABLES extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_TABLES +} + +case object GET_TABLE_TYPES extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_TABLE_TYPES +} + +case object GET_COLUMNS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_COLUMNS +} + +case object GET_FUNCTIONS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_FUNCTIONS +} + +case object UNKNOWN_OPERATION extends OperationType { + override def toTOperationType: TOperationType = TOperationType.UNKNOWN +} + +object OperationType { + def getOperationType(tOperationType: TOperationType): OperationType = + tOperationType match { + case TOperationType.EXECUTE_STATEMENT => EXECUTE_STATEMENT + case TOperationType.GET_TYPE_INFO => GET_TYPE_INFO + case TOperationType.GET_CATALOGS => GET_CATALOGS + case TOperationType.GET_SCHEMAS => GET_SCHEMAS + case TOperationType.GET_TABLES => GET_TABLES + case TOperationType.GET_TABLE_TYPES => GET_TABLE_TYPES + case TOperationType.GET_COLUMNS => GET_COLUMNS + case TOperationType.GET_FUNCTIONS => GET_FUNCTIONS + case _ => UNKNOWN_OPERATION + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala new file mode 100644 index 000000000000..aba1823dcd46 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.util.UUID + +import org.apache.spark.sql.thriftserver.cli.thrift.{TProtocolVersion, TSessionHandle} + +class SessionHandle private(handleId: HandleIdentifier, protocol: TProtocolVersion) + extends Handle(handleId) { + + def this(tSessionHandle: TSessionHandle) = + this(new HandleIdentifier(tSessionHandle.getSessionId), + TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) + + + def this(tSessionHandle: TSessionHandle, protocol: TProtocolVersion) = + this(new HandleIdentifier(tSessionHandle.getSessionId), protocol) + + def this(protocol: TProtocolVersion) = this(new HandleIdentifier(), protocol) + + def toTSessionHandle: TSessionHandle = { + val tSessionHandle = new TSessionHandle + tSessionHandle.setSessionId(getHandleIdentifier.toTHandleIdentifier) + tSessionHandle + } + + def getSessionId: UUID = getHandleIdentifier.getPublicId + + def getProtocolVersion: TProtocolVersion = protocol + + override def toString: String = "SessionHandle [" + getHandleIdentifier + "]" +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala new file mode 100644 index 000000000000..104b1d78bd32 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.sql.SQLException + +import scala.collection.JavaConverters._ + +import org.apache.spark.sql.thriftserver.cli.thrift.{TStatus, TStatusCode} + +class SparkThriftServerSQLException(reason: String, + sqlState: String, + vendorCode: Int, + cause: Throwable) + extends SQLException(reason, sqlState, vendorCode, cause) { + + def this(reason: String, sqlState: String, cause: Throwable) = this(reason, sqlState, 0, cause) + + def this(reason: String, sqlState: String, vendorCode: Int) = + this(reason, sqlState, vendorCode, null) + + def this(reason: String, cause: Throwable) = this(reason, null, 0, cause) + + def this(reason: String, sqlState: String) = this(reason, sqlState, vendorCode = 0) + + def this(reason: String) = this(reason, sqlState = null) + + def this(cause: Throwable) = this(cause.toString, cause) + + def this(status: TStatus) { + // TODO: set correct vendorCode field + this(status.getErrorMessage, status.getSqlState, status.getErrorCode) + // if (status.getInfoMessages != null) { + // initCause(toCause(status.getInfoMessages.asScala.toArray)) + // } + } + + /** + * Converts current object to a [[TStatus]] object + * + * @return a { @link TStatus} object + */ + def toTStatus: TStatus = { + val tStatus = new TStatus(TStatusCode.ERROR_STATUS) + tStatus.setSqlState(getSQLState) + tStatus.setErrorCode(getErrorCode) + tStatus.setErrorMessage(getMessage) + tStatus.setInfoMessages(SparkThriftServerSQLException.toString(this).asJava) + tStatus + } + + // def toCause(details: Array[String]): Throwable = { + // toStackTrace(details, null, 0) + // } + +} + +object SparkThriftServerSQLException { + + def toTStatus(e: Exception): TStatus = e match { + case k: SparkThriftServerSQLException => k.toTStatus + case _ => + val tStatus = new TStatus(TStatusCode.ERROR_STATUS) + tStatus.setErrorMessage(e.getMessage) + tStatus.setInfoMessages(toString(e).asJava) + tStatus + } + + + def toString(cause: Throwable): List[String] = { + toString(cause, null) + } + + def toString(cause: Throwable, parent: Array[StackTraceElement]): List[String] = { + val trace = cause.getStackTrace + var m = trace.length - 1 + if (parent != null) { + var n = parent.length - 1 + while (m >= 0 && n >= 0 && trace(m).equals(parent(n))) { + m = m - 1 + n = n - 1 + } + } + + enroll(cause, trace, m) ++ + Option(cause.getCause).map(toString(_, trace)).getOrElse(Nil) + } + + private[this] def enroll(ex: Throwable, + trace: Array[StackTraceElement], max: Int): List[String] = { + val builder = new StringBuilder + builder.append('*').append(ex.getClass.getName).append(':') + builder.append(ex.getMessage).append(':') + builder.append(trace.length).append(':').append(max) + List(builder.toString) ++ (0 to max).map { i => + builder.setLength(0) + builder.append(trace(i).getClassName).append(":") + builder.append(trace(i).getMethodName).append(":") + builder.append(Option(trace(i).getFileName).getOrElse("")).append(':') + builder.append(trace(i).getLineNumber) + builder.toString + }.toList + } +} \ No newline at end of file From 5efe8cb6377335c217188b195de3f70633b358b7 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Sun, 27 Oct 2019 11:34:44 +0800 Subject: [PATCH 09/55] Revert "save some basic code" This reverts commit 95d8137cc9a747e15db0622c751303206b73f3fb. --- .../sql/thriftserver/AbstractService.scala | 137 ------------------ .../sql/thriftserver/CompositeServices.scala | 113 --------------- .../spark/sql/thriftserver/CookieSigner.scala | 102 ------------- .../spark/sql/thriftserver/Service.scala | 113 --------------- .../sql/thriftserver/ServiceException.scala | 27 ---- .../sql/thriftserver/ServiceOperations.scala | 132 ----------------- .../ServiceStateChangeListener.scala | 44 ------ .../spark/sql/thriftserver/ServiceUtils.scala | 69 --------- .../spark/sql/thriftserver/cli/Handle.scala | 61 -------- .../thriftserver/cli/HandleIdentifier.scala | 86 ----------- .../thriftserver/cli/OperationHandle.scala | 81 ----------- .../sql/thriftserver/cli/OperationState.scala | 130 ----------------- .../thriftserver/cli/OperationStatus.scala | 32 ---- .../sql/thriftserver/cli/OperationType.scala | 79 ---------- .../sql/thriftserver/cli/SessionHandle.scala | 48 ------ .../cli/SparkThriftServerSQLException.scala | 119 --------------- 16 files changed, 1373 deletions(-) delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala deleted file mode 100644 index 2008fe453868..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.util - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.conf.HiveConf - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.Service._ - -/** - * Construct the service. - * - * @param name - * service name - */ -abstract class AbstractService(val name: String) extends Service with Logging { - - /** - * Service state: initially {@link STATE#NOTINITED}. - */ - private var state: STATE = NOTINITED - /** - * Service start time. Will be zero until the service is started. - */ - private var startTime = 0L - /** - * The configuration. Will be null until the service is initialized. - */ - private var hiveConf: HiveConf = null - /** - * List of state change listeners; it is final to ensure - * that it will never be null. - */ - final private val listeners = new util.ArrayList[ServiceStateChangeListener] - - def getServiceState: Service.STATE = synchronized { - state - } - - /** - * {@inheritDoc } - * - * @throws IllegalStateException - * if the current service state does not permit - * this action - */ - def init(hiveConf: HiveConf): Unit = { - ensureCurrentState(NOTINITED) - this.hiveConf = hiveConf - changeState(INITED) - logInfo("Service:" + getName + " is inited.") - } - - def start(): Unit = { - startTime = System.currentTimeMillis - ensureCurrentState(INITED) - changeState(STARTED) - logInfo("Service:" + getName + " is started.") - } - - def stop(): Unit = { - if ((state eq STOPPED) || - (state eq INITED) || - (state eq NOTINITED)) { - // already stopped, or else it was never - // started (eg another service failing canceled startup) - return - } - ensureCurrentState(STARTED) - changeState(STOPPED) - logInfo("Service:" + getName + " is stopped.") - } - - def register(l: ServiceStateChangeListener): Unit = { - listeners.add(l) - } - - def unregister(l: ServiceStateChangeListener): Unit = { - listeners.remove(l) - } - - def getName: String = name - - def getHiveConf: HiveConf = hiveConf - - def getStartTime: Long = startTime - - /** - * Verify that a service is in a given state. - * - * @param currentState - * the desired state - * @throws IllegalStateException - * if the service state is different from - * the desired state - */ - private def ensureCurrentState(currentState: STATE): Unit = { - ServiceOperations.ensureCurrentState(state, currentState) - } - - /** - * Change to a new state and notify all listeners. - * This is a private method that is only invoked from synchronized methods, - * which avoid having to clone the listener list. It does imply that - * the state change listener methods should be short lived, as they - * will delay the state transition. - * - * @param newState - * new service state - */ - private def changeState(newState: STATE): Unit = { - state = newState - // notify listeners - for (l <- listeners.asScala) { - l.stateChanged(this) - } - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala deleted file mode 100644 index 9142a99b2f8f..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.util -import java.util.Collections - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.conf.HiveConf - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.Service.STOPPED - -class CompositeService(name: String) extends AbstractService(name) with Logging { - - - private val serviceList: util.ArrayList[Service] = new util.ArrayList[Service] - - def getServices: util.Collection[Service] = Collections.unmodifiableList(serviceList) - - protected def addService(service: Service): Unit = { - serviceList.add(service) - } - - protected def removeService(service: Service): Boolean = serviceList.remove(service) - - override def init(hiveConf: HiveConf): Unit = { - for (service <- serviceList.asScala) { - service.init(hiveConf) - } - super.init(hiveConf) - } - - override def start(): Unit = { - var i = 0 - try { - val n = serviceList.size - while (i < n) { - val service = serviceList.get(i) - service.start - i += 1 - } - super.start - } catch { - case e: Throwable => - logError("Error starting services " + getName, e) - // Note that the state of the failed service is still INITED and not - // STARTED. Even though the last service is not started completely, still - // call stop() on all services including failed service to make sure cleanup - // happens. - stop(i) - throw new ServiceException("Failed to Start " + getName, e) - } - } - - override def stop(): Unit = { - if (this.getServiceState eq STOPPED) { - // The base composite-service is already stopped, don't do anything again. - return - } - if (serviceList.size > 0) { - stop(serviceList.size - 1) - } - super.stop - } - - private def stop(numOfServicesStarted: Int): Unit = { - // stop in reserve order of start - var i = numOfServicesStarted - while (i >= 0) { - val service = serviceList.get(i) - try { - service.stop - } catch { - case t: Throwable => - logInfo("Error stopping " + service.getName, t) - } - i -= 1 - } - } - - /** - * JVM Shutdown hook for CompositeService which will stop the given - * CompositeService gracefully in case of JVM shutdown. - */ - class CompositeServiceShutdownHook(val compositeService: CompositeService) extends Runnable { - override def run(): Unit = { - try // Stop the Composite Service - compositeService.stop - catch { - case t: Throwable => - logInfo("Error stopping " + compositeService.getName, t) - } - } - } - -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala deleted file mode 100644 index de4bd0ed22ae..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.security.{MessageDigest, NoSuchAlgorithmException} - -import org.apache.commons.codec.binary.Base64 - -import org.apache.spark.internal.Logging - -/** - * The cookie signer generates a signature based on SHA digest - * and appends it to the cookie value generated at the - * server side. It uses SHA digest algorithm to sign and verify signatures. - */ -object CookieSigner { - private val SIGNATURE = "&s=" - private val SHA_STRING = "SHA" -} - -class CookieSigner extends Logging { - private var secretBytes: Array[Byte] = null - - def this(secret: Array[Byte]) { - this() - if (secret == null) { - throw new IllegalArgumentException("NULL Secret Bytes") - } - this.secretBytes = secret.clone - } - - - /** - * Sign the cookie given the string token as input. - * - * @param str Input token - * @return Signed token that can be used to create a cookie - */ - def signCookie(str: String): String = { - if (str == null || str.isEmpty) { - throw new IllegalArgumentException("NULL or empty string to sign") - } - val signature = getSignature(str) - logDebug("Signature generated for " + str + " is " + signature) - str + CookieSigner.SIGNATURE + signature - } - - /** - * Verify a signed string and extracts the original string. - * - * @param signedStr The already signed string - * @return Raw Value of the string without the signature - */ - def verifyAndExtract(signedStr: String): String = { - val index = signedStr.lastIndexOf(CookieSigner.SIGNATURE) - if (index == -1) { - throw new IllegalArgumentException("Invalid input sign: " + signedStr) - } - val originalSignature = signedStr.substring(index + CookieSigner.SIGNATURE.length) - val rawValue = signedStr.substring(0, index) - val currentSignature = getSignature(rawValue) - logDebug("Signature generated for " + rawValue + " inside verify is " + currentSignature) - if (!(originalSignature == currentSignature)) { - throw new IllegalArgumentException("Invalid sign, original = " + - originalSignature + " current = " + currentSignature) - } - rawValue - } - - /** - * Get the signature of the input string based on SHA digest algorithm. - * - * @param str Input token - * @return Signed String - */ - private def getSignature(str: String) = try { - val md = MessageDigest.getInstance(CookieSigner.SHA_STRING) - md.update(str.getBytes) - md.update(secretBytes) - val digest = md.digest - new Base64(0).encodeToString(digest) - } catch { - case ex: NoSuchAlgorithmException => - throw new RuntimeException("Invalid SHA digest String: " + - CookieSigner.SHA_STRING + " " + ex.getMessage, ex) - } -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala deleted file mode 100644 index 52ac32fde739..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import org.apache.hadoop.hive.conf.HiveConf - -trait Service { - /** - * Initialize the service. - * - * The transition must be from {@link STATE#NOTINITED} to {@link STATE#INITED} unless the - * operation failed and an exception was raised. - * - * @param conf - * the configuration of the service - */ - def init(conf: HiveConf): Unit - - - /** - * Start the service. - * - * The transition should be from {@link STATE#INITED} to {@link STATE#STARTED} unless the - * operation failed and an exception was raised. - */ - def start(): Unit - - /** - * Stop the service. - * - * This operation must be designed to complete regardless of the initial state - * of the service, including the state of all its internal fields. - */ - def stop(): Unit - - /** - * Register an instance of the service state change events. - * - * @param listener - * a new listener - */ - def register(listener: ServiceStateChangeListener): Unit - - /** - * Unregister a previously instance of the service state change events. - * - * @param listener - * the listener to unregister. - */ - def unregister(listener: ServiceStateChangeListener): Unit - - /** - * Get the name of this service. - * - * @return the service name - */ - def getName: String - - /** - * Get the configuration of this service. - * This is normally not a clone and may be manipulated, though there are no - * guarantees as to what the consequences of such actions may be - * - * @return the current configuration, unless a specific implementation chooses - * otherwise. - */ - def getHiveConf: HiveConf - - /** - * Get the current service state - * - * @return the state of the service - */ - def getServiceState: Service.STATE - - /** - * Get the service start time - * - * @return the start time of the service. This will be zero if the service - * has not yet been started. - */ - def getStartTime: Long -} - -object Service { - - trait STATE - - case object NOTINITED extends STATE - - case object INITED extends STATE - - case object STARTED extends STATE - - case object STOPPED extends STATE - -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala deleted file mode 100644 index e7d1ef3438fe..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -class ServiceException(msg: String, cause: Throwable) - extends RuntimeException(msg, cause) { - - def this(cause: Throwable) = this(null, cause) - - def this(message: String) = this(message, null) -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala deleted file mode 100644 index 1a79105533e7..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import org.apache.hadoop.hive.conf.HiveConf - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.Service._ - -object ServiceOperations extends Logging { - - /** - * Verify that a service is in a given state. - * - * @param state the actual state a service is in - * @param expectedState the desired state - * @throws IllegalStateException if the service state is different from - * the desired state - */ - def ensureCurrentState(state: STATE, expectedState: STATE): Unit = { - if (state ne expectedState) { - throw new IllegalStateException("For this operation, the " + - "current service state must be " + expectedState + " instead of " + state) - } - } - - /** - * Initialize a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service that must be in the state - * { @link Service.STATE#NOTINITED} - * @param configuration the configuration to initialize the service with - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - def init(service: Service, configuration: HiveConf): Unit = { - val state = service.getServiceState - ensureCurrentState(state, NOTINITED) - service.init(configuration) - } - - /** - * Start a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service that must be in the state - * { @link Service.STATE#INITED} - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - def start(service: Service): Unit = { - val state = service.getServiceState - ensureCurrentState(state, INITED) - service.start() - } - - /** - * Initialize then start a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service that must be in the state - * { @link Service.STATE#NOTINITED} - * @param configuration the configuration to initialize the service with - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - def deploy(service: Service, configuration: HiveConf): Unit = { - init(service, configuration) - start(service) - } - - /** - * Stop a service. - * - * Do nothing if the service is null or not in a state in which it can be/needs to be stopped. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service or null - */ - def stop(service: Service): Unit = { - if (service != null) { - val state = service.getServiceState - if (state eq STARTED) { - service.stop() - - } - } - } - - /** - * Stop a service; if it is null do nothing. Exceptions are caught and - * logged at warn level. (but not Throwables). This operation is intended to - * be used in cleanup operations - * - * @param service a service; may be null - * @return any exception that was caught; null if none was. - */ - def stopQuietly(service: Service): Exception = { - try { - stop(service) - } catch { - case e: Exception => - logWarning("When stopping the service " + service.getName + " : " + e, e) - return e - } - null - } -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala deleted file mode 100644 index 1b9010b42aa5..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -/** - * ServiceStateChangeListener. - * - */ -trait ServiceStateChangeListener { - - /** - * Callback to notify of a state change. The service will already - * have changed state before this callback is invoked. - * - * This operation is invoked on the thread that initiated the state change, - * while the service itself in a synchronized section. - *
    - *
  1. Any long-lived operation here will prevent the service state - * change from completing in a timely manner.
  2. - *
  3. If another thread is somehow invoked from the listener, and - * that thread invokes the methods of the service (including - * subclass-specific methods), there is a risk of a deadlock.
  4. - *
- * - * @param service the service that has changed. - */ - def stateChanged(service: Service): Unit -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala deleted file mode 100644 index 0ebc1bb444c2..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.io.{Closeable, IOException} - -import org.slf4j.Logger - -object ServiceUtils { - - /* - * Get the index separating the user name from domain name (the user's name up - * to the first '/' or '@'). - * - * @param userName full user name. - * @return index of domain match or -1 if not found - */ - def indexOfDomainMatch(userName: String): Int = { - if (userName == null) { - return -1 - } - val idx = userName.indexOf('/') - val idx2 = userName.indexOf('@') - var endIdx = Math.min(idx, idx2) // Use the earlier match. - // Unless at least one of '/' or '@' was not found, in - // which case, user the latter match. - if (endIdx == -1) { - endIdx = Math.max(idx, idx2) - } - endIdx - } - - /** - * Close the Closeable objects and ignore any {@link IOException} or - * null pointers. Must only be used for cleanup in exception handlers. - * - * @param log the log to record problems to at debug level. Can be null. - * @param closeables the objects to close - */ - def cleanup(log: Logger, closeables: Closeable*): Unit = { - for (c <- closeables) { - if (c != null) { - try { - c.close() - } catch { - case e: IOException => - if (log != null && log.isDebugEnabled) { - log.debug("Exception in closing " + c, e) - } - } - } - } - } -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala deleted file mode 100644 index 1416b845257e..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier - - -abstract class Handle(val handleId: HandleIdentifier) { - def this() = this(new HandleIdentifier()) - - def this(tHandleIdentifier: THandleIdentifier) = this(new HandleIdentifier(tHandleIdentifier)) - - def getHandleIdentifier: HandleIdentifier = handleId - - override def hashCode: Int = { - val prime = 31 - var result = 1 - result = prime * result + (if (handleId == null) 0 else handleId.hashCode) - result - } - - override def equals(obj: Any): Boolean = { - if (obj == null) { - return false - } - - if (!obj.isInstanceOf[Handle]) { - return false - } - - val other = obj.asInstanceOf[Handle] - if (this eq other) { - return true - } - - if (handleId == null) { - if (other.handleId != null) { - return false - } - } else if (handleId != other.handleId) { - return false - } - - true - } -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala deleted file mode 100644 index bdef1031131a..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.nio.ByteBuffer -import java.util.UUID - -import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier - -class HandleIdentifier(val publicId: UUID, val secretId: UUID) { - - def this() = this(UUID.randomUUID(), UUID.randomUUID()) - - def this(guid: ByteBuffer, secret: ByteBuffer) = - this(Option(guid).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID()), - Option(secret).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID())) - - def this(tHandleId: THandleIdentifier) = - this(ByteBuffer.wrap(tHandleId.getGuid), ByteBuffer.wrap(tHandleId.getSecret)) - - def getPublicId: UUID = this.publicId - - def getSecretId: UUID = this.secretId - - def toTHandleIdentifier: THandleIdentifier = { - val guid = new Array[Byte](16) - val gBuff = ByteBuffer.wrap(guid) - val secret = new Array[Byte](16) - val sBuff = ByteBuffer.wrap(secret) - gBuff.putLong(publicId.getMostSignificantBits) - gBuff.putLong(publicId.getLeastSignificantBits) - sBuff.putLong(secretId.getMostSignificantBits) - sBuff.putLong(secretId.getLeastSignificantBits) - new THandleIdentifier(ByteBuffer.wrap(guid), ByteBuffer.wrap(secret)) - } - - override def hashCode: Int = { - val prime = 31 - var result = 1 - result = prime * result + (if (publicId == null) 0 else publicId.hashCode) - result = prime * result + (if (secretId == null) 0 else secretId.hashCode) - result - } - - override def equals(obj: Any): Boolean = { - if (obj == null) return false - if (!obj.isInstanceOf[HandleIdentifier]) return false - - val other = obj.asInstanceOf[HandleIdentifier] - if (this eq other) return true - - if (publicId == null) { - if (other.publicId != null) { - return false - } - } else if (!(publicId == other.publicId)) { - return false - } - - if (secretId == null) { - if (other.secretId != null) { - return false - } - } else if (!(secretId == other.secretId)) { - return false - } - true - } - - override def toString: String = Option(publicId).map(_.toString).getOrElse("") -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala deleted file mode 100644 index 6466f63c4902..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.{TOperationHandle, TProtocolVersion} - -class OperationHandle private(val opType: OperationType, - protocol: TProtocolVersion, - handleId: HandleIdentifier) extends Handle(handleId) { - - private[this] var hasResultSet: Boolean = false - - def this(opType: OperationType, protocol: TProtocolVersion) = - this(opType, protocol, new HandleIdentifier) - - def this(tOperationHandle: TOperationHandle, protocol: TProtocolVersion) = { - this( - OperationType.getOperationType(tOperationHandle.getOperationType), - protocol, - new HandleIdentifier(tOperationHandle.getOperationId)) - setHasResultSet(tOperationHandle.isHasResultSet) - } - - def this(tOperationHandle: TOperationHandle) = - this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) - - def getOperationType: OperationType = opType - - def toTOperationHandle: TOperationHandle = { - val tOperationHandle = new TOperationHandle - tOperationHandle.setOperationId(getHandleIdentifier.toTHandleIdentifier) - tOperationHandle.setOperationType(opType.toTOperationType) - tOperationHandle.setHasResultSet(this.hasResultSet) - tOperationHandle - } - - def setHasResultSet(hasResultSet: Boolean): Unit = { - this.hasResultSet = hasResultSet - } - - def isHasResultSet: Boolean = this.hasResultSet - - def getProtocolVersion: TProtocolVersion = protocol - - override def hashCode: Int = { - val prime = 31 - var result = super.hashCode - result = prime * result + (if (opType == null) 0 else opType.hashCode) - result - } - - override def equals(obj: Any): Boolean = { - if (!super.equals(obj)) return false - if (!obj.isInstanceOf[OperationHandle]) return false - val other = obj.asInstanceOf[OperationHandle] - if (this eq other) return true - if (opType != other.opType) { - return false - } - true - } - - override def toString: String = - "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier + "]" - -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala deleted file mode 100644 index 9d456eb7adf1..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.TOperationState - -trait OperationState { - - def toTOperationState(): TOperationState - - def isTerminal(): Boolean = false - - @throws[SparkThriftServerSQLException] - def validateTransition(newState: OperationState): Unit = ex(newState) - - @throws[SparkThriftServerSQLException] - protected def ex(state: OperationState): Unit = throw new SparkThriftServerSQLException( - "Illegal Operation state transition " + this + " -> " + state, "ServerError", 1000) -} - -case object INITIALIZED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.INITIALIZED_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case PENDING | RUNNING | CANCELED | CLOSED | TIMEOUT => - case _ => ex(newState) - } -} - -case object PENDING extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.PENDING_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case RUNNING | FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => - case _ => ex(newState) - } -} - -case object RUNNING extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.RUNNING_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => - case _ => ex(newState) - } -} - -case object TIMEOUT extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.TIMEDOUT_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -case object FINISHED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.FINISHED_STATE - - override def isTerminal(): Boolean = true - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -case object CANCELED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.CANCELED_STATE - - override def isTerminal(): Boolean = true - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -case object CLOSED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.CLOSED_STATE - - override def isTerminal(): Boolean = true -} - -case object ERROR extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.ERROR_STATE - - override def isTerminal(): Boolean = true - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -case object UNKNOWN extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.UKNOWN_STATE -} - - -object OperationState { - def getOperationState(tOperationState: TOperationState): OperationState = { - tOperationState match { - case TOperationState.INITIALIZED_STATE => INITIALIZED - case TOperationState.PENDING_STATE => PENDING - case TOperationState.RUNNING_STATE => RUNNING - case TOperationState.CANCELED_STATE => CANCELED - case TOperationState.ERROR_STATE => ERROR - case TOperationState.CLOSED_STATE => CLOSED - case TOperationState.FINISHED_STATE => FINISHED - case TOperationState.TIMEDOUT_STATE => TIMEOUT - case TOperationState.UKNOWN_STATE => UNKNOWN - } - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala deleted file mode 100644 index 05aea20acd4f..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - - -/** - * OperationStatus - * - */ -class OperationStatus(val state: OperationState, - val operationException: SparkThriftServerSQLException) { - - def getState: OperationState = state - - def getOperationException: SparkThriftServerSQLException = operationException -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala deleted file mode 100644 index 7597d8d823d1..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.TOperationType - - -/** - * OperationType. - */ -abstract class OperationType { - def toTOperationType: TOperationType -} - -case object EXECUTE_STATEMENT extends OperationType { - override def toTOperationType: TOperationType = TOperationType.EXECUTE_STATEMENT -} - -case object GET_TYPE_INFO extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_TYPE_INFO -} - -case object GET_CATALOGS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_CATALOGS -} - -case object GET_SCHEMAS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_SCHEMAS -} - -case object GET_TABLES extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_TABLES -} - -case object GET_TABLE_TYPES extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_TABLE_TYPES -} - -case object GET_COLUMNS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_COLUMNS -} - -case object GET_FUNCTIONS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_FUNCTIONS -} - -case object UNKNOWN_OPERATION extends OperationType { - override def toTOperationType: TOperationType = TOperationType.UNKNOWN -} - -object OperationType { - def getOperationType(tOperationType: TOperationType): OperationType = - tOperationType match { - case TOperationType.EXECUTE_STATEMENT => EXECUTE_STATEMENT - case TOperationType.GET_TYPE_INFO => GET_TYPE_INFO - case TOperationType.GET_CATALOGS => GET_CATALOGS - case TOperationType.GET_SCHEMAS => GET_SCHEMAS - case TOperationType.GET_TABLES => GET_TABLES - case TOperationType.GET_TABLE_TYPES => GET_TABLE_TYPES - case TOperationType.GET_COLUMNS => GET_COLUMNS - case TOperationType.GET_FUNCTIONS => GET_FUNCTIONS - case _ => UNKNOWN_OPERATION - } -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala deleted file mode 100644 index aba1823dcd46..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.util.UUID - -import org.apache.spark.sql.thriftserver.cli.thrift.{TProtocolVersion, TSessionHandle} - -class SessionHandle private(handleId: HandleIdentifier, protocol: TProtocolVersion) - extends Handle(handleId) { - - def this(tSessionHandle: TSessionHandle) = - this(new HandleIdentifier(tSessionHandle.getSessionId), - TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) - - - def this(tSessionHandle: TSessionHandle, protocol: TProtocolVersion) = - this(new HandleIdentifier(tSessionHandle.getSessionId), protocol) - - def this(protocol: TProtocolVersion) = this(new HandleIdentifier(), protocol) - - def toTSessionHandle: TSessionHandle = { - val tSessionHandle = new TSessionHandle - tSessionHandle.setSessionId(getHandleIdentifier.toTHandleIdentifier) - tSessionHandle - } - - def getSessionId: UUID = getHandleIdentifier.getPublicId - - def getProtocolVersion: TProtocolVersion = protocol - - override def toString: String = "SessionHandle [" + getHandleIdentifier + "]" -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala deleted file mode 100644 index 104b1d78bd32..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.sql.SQLException - -import scala.collection.JavaConverters._ - -import org.apache.spark.sql.thriftserver.cli.thrift.{TStatus, TStatusCode} - -class SparkThriftServerSQLException(reason: String, - sqlState: String, - vendorCode: Int, - cause: Throwable) - extends SQLException(reason, sqlState, vendorCode, cause) { - - def this(reason: String, sqlState: String, cause: Throwable) = this(reason, sqlState, 0, cause) - - def this(reason: String, sqlState: String, vendorCode: Int) = - this(reason, sqlState, vendorCode, null) - - def this(reason: String, cause: Throwable) = this(reason, null, 0, cause) - - def this(reason: String, sqlState: String) = this(reason, sqlState, vendorCode = 0) - - def this(reason: String) = this(reason, sqlState = null) - - def this(cause: Throwable) = this(cause.toString, cause) - - def this(status: TStatus) { - // TODO: set correct vendorCode field - this(status.getErrorMessage, status.getSqlState, status.getErrorCode) - // if (status.getInfoMessages != null) { - // initCause(toCause(status.getInfoMessages.asScala.toArray)) - // } - } - - /** - * Converts current object to a [[TStatus]] object - * - * @return a { @link TStatus} object - */ - def toTStatus: TStatus = { - val tStatus = new TStatus(TStatusCode.ERROR_STATUS) - tStatus.setSqlState(getSQLState) - tStatus.setErrorCode(getErrorCode) - tStatus.setErrorMessage(getMessage) - tStatus.setInfoMessages(SparkThriftServerSQLException.toString(this).asJava) - tStatus - } - - // def toCause(details: Array[String]): Throwable = { - // toStackTrace(details, null, 0) - // } - -} - -object SparkThriftServerSQLException { - - def toTStatus(e: Exception): TStatus = e match { - case k: SparkThriftServerSQLException => k.toTStatus - case _ => - val tStatus = new TStatus(TStatusCode.ERROR_STATUS) - tStatus.setErrorMessage(e.getMessage) - tStatus.setInfoMessages(toString(e).asJava) - tStatus - } - - - def toString(cause: Throwable): List[String] = { - toString(cause, null) - } - - def toString(cause: Throwable, parent: Array[StackTraceElement]): List[String] = { - val trace = cause.getStackTrace - var m = trace.length - 1 - if (parent != null) { - var n = parent.length - 1 - while (m >= 0 && n >= 0 && trace(m).equals(parent(n))) { - m = m - 1 - n = n - 1 - } - } - - enroll(cause, trace, m) ++ - Option(cause.getCause).map(toString(_, trace)).getOrElse(Nil) - } - - private[this] def enroll(ex: Throwable, - trace: Array[StackTraceElement], max: Int): List[String] = { - val builder = new StringBuilder - builder.append('*').append(ex.getClass.getName).append(':') - builder.append(ex.getMessage).append(':') - builder.append(trace.length).append(':').append(max) - List(builder.toString) ++ (0 to max).map { i => - builder.setLength(0) - builder.append(trace(i).getClassName).append(":") - builder.append(trace(i).getMethodName).append(":") - builder.append(Option(trace(i).getFileName).getOrElse("")).append(':') - builder.append(trace(i).getLineNumber) - builder.toString - }.toList - } -} \ No newline at end of file From 6f7d48a987fd0cabef7e0cd4ee8af54197d66eaa Mon Sep 17 00:00:00 2001 From: angerszhu Date: Sun, 27 Oct 2019 11:36:25 +0800 Subject: [PATCH 10/55] Update TCLIService.thrift --- sql/thriftserver/if/TCLIService.thrift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/thriftserver/if/TCLIService.thrift b/sql/thriftserver/if/TCLIService.thrift index 924e79eef8cd..b230a59d8ae7 100644 --- a/sql/thriftserver/if/TCLIService.thrift +++ b/sql/thriftserver/if/TCLIService.thrift @@ -32,8 +32,8 @@ // * Service names begin with the letter "T", use a capital letter for each // new word (with no underscores), and end with the word "Service". -namespace java org.apache.spark.service.rpc.thrift -namespace cpp apache.spark.service.rpc.thrift +namespace java org.apache.spark.sql.thriftserver.cli.thrift +namespace cpp apache.spark.sql.thriftserver.cli.thrift // List of protocol versions. A new token should be // added to the end of this list every time a change is made. From cf243064c7ea317c2c0406bfd691844c209d5c1e Mon Sep 17 00:00:00 2001 From: angerszhu Date: Sun, 27 Oct 2019 22:31:28 +0800 Subject: [PATCH 11/55] Add basic data --- .../AnonymousAuthenticationProviderImpl.java | 33 + .../auth/AuthenticationProviderFactory.java | 71 ++ .../CustomAuthenticationProviderImpl.java | 50 ++ .../auth/HttpAuthenticationException.java | 43 + .../auth/LdapAuthenticationProviderImpl.java | 84 ++ .../auth/PamAuthenticationProviderImpl.java | 51 ++ .../auth/PasswdAuthenticationProvider.java | 39 + .../thriftserver/auth/PlainSaslServer.java | 171 ++++ .../spark/sql/thriftserver/auth/SaslQOP.java | 65 ++ .../auth/TSubjectAssumingTransport.java | 70 ++ .../sql/thriftserver/cli/CLIServiceUtils.java | 76 ++ .../sql/thriftserver/cli/GetInfoType.java | 96 +++ .../sql/thriftserver/cli/GetInfoValue.java | 82 ++ .../cli/operation/LogDivertAppender.java | 204 +++++ .../ThreadFactoryWithGarbageCleanup.java | 64 ++ .../server/ThreadWithGarbageCleanup.java | 77 ++ .../sql/thriftserver/AbstractService.scala | 137 +++ .../sql/thriftserver/CompositeServices.scala | 113 +++ .../spark/sql/thriftserver/CookieSigner.scala | 102 +++ .../sql/thriftserver/ReflectionUtils.scala | 58 ++ .../spark/sql/thriftserver/Service.scala | 113 +++ .../sql/thriftserver/ServiceException.scala | 27 + .../sql/thriftserver/ServiceOperations.scala | 132 +++ .../ServiceStateChangeListener.scala | 44 + .../spark/sql/thriftserver/ServiceUtils.scala | 69 ++ .../spark/sql/thriftserver/SparkSQLEnv.scala | 72 ++ .../sql/thriftserver/SparkThriftServer2.scala | 316 +++++++ .../sql/thriftserver/auth/AuthType.scala | 37 + .../thriftserver/auth/HiveAuthFactory.scala | 433 ++++++++++ .../sql/thriftserver/auth/HttpAuthUtils.scala | 193 +++++ .../auth/KerberosSaslHelper.scala | 108 +++ .../thriftserver/auth/PlainSaslHelper.scala | 136 +++ .../auth/TSetIpAddressProcessor.scala | 94 ++ .../ThriftserverDelegationTokenManager.scala | 160 ++++ .../sql/thriftserver/cli/CLIService.scala | 482 +++++++++++ .../sql/thriftserver/cli/ColumnBasedSet.scala | 153 ++++ .../thriftserver/cli/ColumnDescriptor.scala | 41 + .../thriftserver/cli/FetchOrientation.scala | 57 ++ .../sql/thriftserver/cli/FetchType.scala | 38 + .../spark/sql/thriftserver/cli/Handle.scala | 61 ++ .../thriftserver/cli/HandleIdentifier.scala | 86 ++ .../sql/thriftserver/cli/ICLIService.scala | 147 ++++ .../thriftserver/cli/OperationHandle.scala | 81 ++ .../sql/thriftserver/cli/OperationState.scala | 130 +++ .../thriftserver/cli/OperationStatus.scala | 32 + .../sql/thriftserver/cli/OperationType.scala | 79 ++ .../cli/PatternOrIdentifier.scala | 33 + .../sql/thriftserver/cli/RowBasedSet.scala | 153 ++++ .../spark/sql/thriftserver/cli/RowSet.scala | 37 + .../sql/thriftserver/cli/RowSetFactory.scala | 43 + .../sql/thriftserver/cli/SchemaMapper.scala | 61 ++ .../sql/thriftserver/cli/SessionHandle.scala | 48 ++ .../cli/SparkThriftServerSQLException.scala | 119 +++ .../spark/sql/thriftserver/cli/Type.scala | 501 +++++++++++ .../sql/thriftserver/cli/TypeDescriptor.scala | 41 + .../sql/thriftserver/cli/TypeQualifiers.scala | 58 ++ .../operation/ClassicTableTypeMapping.scala | 76 ++ .../cli/operation/HiveTableTypeMapping.scala | 30 + .../cli/operation/HiveTableTypes.scala | 22 + .../cli/operation/Operation.scala | 299 +++++++ .../cli/operation/OperationManager.scala | 330 +++++++ .../SparkExecuteStatementOperation.scala | 336 ++++++++ .../operation/SparkGetCatalogsOperation.scala | 108 +++ .../operation/SparkGetColumnsOperation.scala | 233 +++++ .../SparkGetFunctionsOperation.scala | 148 ++++ .../operation/SparkGetSchemasOperation.scala | 127 +++ .../SparkGetTableTypesOperation.scala | 122 +++ .../operation/SparkGetTablesOperation.scala | 187 ++++ .../operation/SparkGetTypeInfoOperation.scala | 150 ++++ .../operation/SparkMetadataOperation.scala | 122 +++ .../SparkMetadataOperationUtils.scala | 34 + .../cli/operation/TableTypeMapping.scala | 44 + .../operation/TableTypeMappingFactory.scala | 37 + .../cli/session/SessionManager.scala | 347 ++++++++ .../cli/session/ThriftServerSession.scala | 214 +++++ .../cli/session/ThriftServerSessionBase.scala | 91 ++ .../cli/session/ThriftServerSessionImpl.scala | 790 +++++++++++++++++ .../ThriftServerSessionImplWithUgi.scala | 154 ++++ .../session/ThriftServerSessionProxy.scala | 84 ++ .../cli/thrift/CLIServiceUtils.scala | 62 ++ .../cli/thrift/ThriftBinaryCLIService.scala | 109 +++ .../cli/thrift/ThriftCLIService.scala | 807 ++++++++++++++++++ .../cli/thrift/ThriftHttpCLIService.scala | 165 ++++ .../cli/thrift/ThriftHttpServlet.scala | 490 +++++++++++ .../thriftserver/cli/utils/LogHelper.scala | 131 +++ .../cli/utils/VariableSubstitution.scala | 56 ++ .../server/SparkThriftServer.scala | 295 +++++++ .../thriftserver/ui/ThriftServerPage.scala | 196 +++++ .../ui/ThriftServerSessionPage.scala | 166 ++++ .../sql/thriftserver/ui/ThriftServerTab.scala | 52 ++ 90 files changed, 12715 insertions(+) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AuthenticationProviderFactory.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthenticationException.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslServer.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/SaslQOP.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSubjectAssumingTransport.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceUtils.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoValue.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadFactoryWithGarbageCleanup.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadWithGarbageCleanup.java create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java new file mode 100644 index 000000000000..322ab54b0910 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth; + +import javax.security.sasl.AuthenticationException; + +/** + * This authentication provider allows any combination of username and password. + */ +public class AnonymousAuthenticationProviderImpl implements PasswdAuthenticationProvider { + + @Override + public void Authenticate(String user, String password) throws AuthenticationException { + // no-op authentication + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AuthenticationProviderFactory.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AuthenticationProviderFactory.java new file mode 100644 index 000000000000..d4cfa66028f6 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AuthenticationProviderFactory.java @@ -0,0 +1,71 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import javax.security.sasl.AuthenticationException; + +/** + * This class helps select a {@link PasswdAuthenticationProvider} for a given {@code AuthMethod}. + */ +public final class AuthenticationProviderFactory { + + public enum AuthMethods { + LDAP("LDAP"), + PAM("PAM"), + CUSTOM("CUSTOM"), + NONE("NONE"); + + private final String authMethod; + + AuthMethods(String authMethod) { + this.authMethod = authMethod; + } + + public String getAuthMethod() { + return authMethod; + } + + public static AuthMethods getValidAuthMethod(String authMethodStr) + throws AuthenticationException { + for (AuthMethods auth : AuthMethods.values()) { + if (authMethodStr.equals(auth.getAuthMethod())) { + return auth; + } + } + throw new AuthenticationException("Not a valid authentication method"); + } + } + + private AuthenticationProviderFactory() { + } + + public static PasswdAuthenticationProvider getAuthenticationProvider(AuthMethods authMethod) + throws AuthenticationException { + if (authMethod == AuthMethods.LDAP) { + return new LdapAuthenticationProviderImpl(); + } else if (authMethod == AuthMethods.PAM) { + return new PamAuthenticationProviderImpl(); + } else if (authMethod == AuthMethods.CUSTOM) { + return new CustomAuthenticationProviderImpl(); + } else if (authMethod == AuthMethods.NONE) { + return new AnonymousAuthenticationProviderImpl(); + } else { + throw new AuthenticationException("Unsupported authentication method"); + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java new file mode 100644 index 000000000000..8122a003e458 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java @@ -0,0 +1,50 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.util.ReflectionUtils; + +import javax.security.sasl.AuthenticationException; + +/** + * This authentication provider implements the {@code CUSTOM} authentication. It allows a {@link + * PasswdAuthenticationProvider} to be specified at configuration time which may additionally + * implement {@link org.apache.hadoop.conf.Configurable Configurable} to grab Hive's {@link + * org.apache.hadoop.conf.Configuration Configuration}. + */ +public class CustomAuthenticationProviderImpl implements PasswdAuthenticationProvider { + + private final PasswdAuthenticationProvider customProvider; + + @SuppressWarnings("unchecked") + CustomAuthenticationProviderImpl() { + HiveConf conf = new HiveConf(); + Class customHandlerClass = + (Class) conf.getClass( + HiveConf.ConfVars.HIVE_SERVER2_CUSTOM_AUTHENTICATION_CLASS.varname, + PasswdAuthenticationProvider.class); + customProvider = ReflectionUtils.newInstance(customHandlerClass, conf); + } + + @Override + public void Authenticate(String user, String password) throws AuthenticationException { + customProvider.Authenticate(user, password); + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthenticationException.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthenticationException.java new file mode 100644 index 000000000000..6ccb15a635f2 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthenticationException.java @@ -0,0 +1,43 @@ +/** + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. See accompanying LICENSE file. + */ + +package org.apache.spark.sql.thriftserver.auth; + +public class HttpAuthenticationException extends Exception { + + private static final long serialVersionUID = 0; + + /** + * @param cause original exception + */ + public HttpAuthenticationException(Throwable cause) { + super(cause); + } + + /** + * @param msg exception message + */ + public HttpAuthenticationException(String msg) { + super(msg); + } + + /** + * @param msg exception message + * @param cause original exception + */ + public HttpAuthenticationException(String msg, Throwable cause) { + super(msg, cause); + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java new file mode 100644 index 000000000000..8e2113f1b7c6 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java @@ -0,0 +1,84 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.spark.sql.thriftserver.ServiceUtils; + +import javax.naming.Context; +import javax.naming.NamingException; +import javax.naming.directory.InitialDirContext; +import javax.security.sasl.AuthenticationException; +import java.util.Hashtable; + +public class LdapAuthenticationProviderImpl implements PasswdAuthenticationProvider { + + private final String ldapURL; + private final String baseDN; + private final String ldapDomain; + + LdapAuthenticationProviderImpl() { + HiveConf conf = new HiveConf(); + ldapURL = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_PLAIN_LDAP_URL); + baseDN = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_PLAIN_LDAP_BASEDN); + ldapDomain = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_PLAIN_LDAP_DOMAIN); + } + + @Override + public void Authenticate(String user, String password) throws AuthenticationException { + + Hashtable env = new Hashtable(); + env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); + env.put(Context.PROVIDER_URL, ldapURL); + + // If the domain is available in the config, then append it unless domain is + // already part of the username. LDAP providers like Active Directory use a + // fully qualified user name like foo@bar.com. + if (!hasDomain(user) && ldapDomain != null) { + user = user + "@" + ldapDomain; + } + + if (password == null || password.isEmpty() || password.getBytes()[0] == 0) { + throw new AuthenticationException("Error validating LDAP user:" + + " a null or blank password has been provided"); + } + + // setup the security principal + String bindDN; + if (baseDN == null) { + bindDN = user; + } else { + bindDN = "uid=" + user + "," + baseDN; + } + env.put(Context.SECURITY_AUTHENTICATION, "simple"); + env.put(Context.SECURITY_PRINCIPAL, bindDN); + env.put(Context.SECURITY_CREDENTIALS, password); + + try { + // Create initial context + Context ctx = new InitialDirContext(env); + ctx.close(); + } catch (NamingException e) { + throw new AuthenticationException("Error validating LDAP user", e); + } + } + + private boolean hasDomain(String userName) { + return (ServiceUtils.indexOfDomainMatch(userName) > 0); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java new file mode 100644 index 000000000000..a969cab69583 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java @@ -0,0 +1,51 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import net.sf.jpam.Pam; +import org.apache.hadoop.hive.conf.HiveConf; + +import javax.security.sasl.AuthenticationException; + +public class PamAuthenticationProviderImpl implements PasswdAuthenticationProvider { + + private final String pamServiceNames; + + PamAuthenticationProviderImpl() { + HiveConf conf = new HiveConf(); + pamServiceNames = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_PAM_SERVICES); + } + + @Override + public void Authenticate(String user, String password) throws AuthenticationException { + + if (pamServiceNames == null || pamServiceNames.trim().isEmpty()) { + throw new AuthenticationException("No PAM services are set."); + } + + String[] pamServices = pamServiceNames.split(","); + for (String pamService : pamServices) { + Pam pam = new Pam(pamService); + boolean isAuthenticated = pam.authenticateSuccessful(user, password); + if (!isAuthenticated) { + throw new AuthenticationException( + "Error authenticating with the PAM service: " + pamService); + } + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java new file mode 100644 index 000000000000..da78f7ea4feb --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import javax.security.sasl.AuthenticationException; + +public interface PasswdAuthenticationProvider { + + /** + * The Authenticate method is called by the HiveServer2 authentication layer + * to authenticate users for their requests. + * If a user is to be granted, return nothing/throw nothing. + * When a user is to be disallowed, throw an appropriate {@link AuthenticationException}. + * + * For an example implementation, see {@link LdapAuthenticationProviderImpl}. + * + * @param user The username received over the connection request + * @param password The password received over the connection request + * + * @throws AuthenticationException When a user is found to be + * invalid by the implementation + */ + void Authenticate(String user, String password) throws AuthenticationException; +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslServer.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslServer.java new file mode 100644 index 000000000000..70c6ebe9e81d --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslServer.java @@ -0,0 +1,171 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import javax.security.auth.callback.*; +import javax.security.sasl.AuthorizeCallback; +import javax.security.sasl.SaslException; +import javax.security.sasl.SaslServer; +import javax.security.sasl.SaslServerFactory; +import java.io.IOException; +import java.security.Provider; +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.Map; + +/** + * Sun JDK only provides a PLAIN client and no server. This class implements the Plain SASL server + * conforming to RFC #4616 (http://www.ietf.org/rfc/rfc4616.txt). + */ +public class PlainSaslServer implements SaslServer { + + public static final String PLAIN_METHOD = "PLAIN"; + private String user; + private final CallbackHandler handler; + + PlainSaslServer(CallbackHandler handler, String authMethodStr) throws SaslException { + this.handler = handler; + AuthenticationProviderFactory.AuthMethods.getValidAuthMethod(authMethodStr); + } + + @Override + public String getMechanismName() { + return PLAIN_METHOD; + } + + @Override + public byte[] evaluateResponse(byte[] response) throws SaslException { + try { + // parse the response + // message = [authzid] UTF8NUL authcid UTF8NUL passwd' + + Deque tokenList = new ArrayDeque(); + StringBuilder messageToken = new StringBuilder(); + for (byte b : response) { + if (b == 0) { + tokenList.addLast(messageToken.toString()); + messageToken = new StringBuilder(); + } else { + messageToken.append((char) b); + } + } + tokenList.addLast(messageToken.toString()); + + // validate response + if (tokenList.size() < 2 || tokenList.size() > 3) { + throw new SaslException("Invalid message format"); + } + String passwd = tokenList.removeLast(); + user = tokenList.removeLast(); + // optional authzid + String authzId; + if (tokenList.isEmpty()) { + authzId = user; + } else { + authzId = tokenList.removeLast(); + } + if (user == null || user.isEmpty()) { + throw new SaslException("No user name provided"); + } + if (passwd == null || passwd.isEmpty()) { + throw new SaslException("No password name provided"); + } + + NameCallback nameCallback = new NameCallback("User"); + nameCallback.setName(user); + PasswordCallback pcCallback = new PasswordCallback("Password", false); + pcCallback.setPassword(passwd.toCharArray()); + AuthorizeCallback acCallback = new AuthorizeCallback(user, authzId); + + Callback[] cbList = {nameCallback, pcCallback, acCallback}; + handler.handle(cbList); + if (!acCallback.isAuthorized()) { + throw new SaslException("Authentication failed"); + } + } catch (IllegalStateException eL) { + throw new SaslException("Invalid message format", eL); + } catch (IOException eI) { + throw new SaslException("Error validating the login", eI); + } catch (UnsupportedCallbackException eU) { + throw new SaslException("Error validating the login", eU); + } + return null; + } + + @Override + public boolean isComplete() { + return user != null; + } + + @Override + public String getAuthorizationID() { + return user; + } + + @Override + public byte[] unwrap(byte[] incoming, int offset, int len) { + throw new UnsupportedOperationException(); + } + + @Override + public byte[] wrap(byte[] outgoing, int offset, int len) { + throw new UnsupportedOperationException(); + } + + @Override + public Object getNegotiatedProperty(String propName) { + return null; + } + + @Override + public void dispose() {} + + public static class SaslPlainServerFactory implements SaslServerFactory { + + @Override + public SaslServer createSaslServer(String mechanism, String protocol, String serverName, + Map props, CallbackHandler cbh) { + if (PLAIN_METHOD.equals(mechanism)) { + try { + return new PlainSaslServer(cbh, protocol); + } catch (SaslException e) { + /* This is to fulfill the contract of the interface which states that an exception shall + be thrown when a SaslServer cannot be created due to an error but null should be + returned when a Server can't be created due to the parameters supplied. And the only + thing PlainSaslServer can fail on is a non-supported authentication mechanism. + That's why we return null instead of throwing the Exception */ + return null; + } + } + return null; + } + + @Override + public String[] getMechanismNames(Map props) { + return new String[] {PLAIN_METHOD}; + } + } + + public static class SaslPlainProvider extends Provider { + + public SaslPlainProvider() { + super("HiveSaslPlain", 1.0, "Hive Plain SASL provider"); + put("SaslServerFactory.PLAIN", SaslPlainServerFactory.class.getName()); + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/SaslQOP.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/SaslQOP.java new file mode 100644 index 000000000000..1fe9dfddc2d8 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/SaslQOP.java @@ -0,0 +1,65 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * Possible values of SASL quality-of-protection value. + */ +public enum SaslQOP { + // Authentication only. + AUTH("auth"), + // Authentication and integrity checking by using signatures. + AUTH_INT("auth-int"), + // Authentication, integrity and confidentiality checking by using signatures and encryption. + AUTH_CONF("auth-conf"); + + public final String saslQop; + + private static final Map STR_TO_ENUM = new HashMap(); + + static { + for (SaslQOP saslQop : values()) { + STR_TO_ENUM.put(saslQop.toString(), saslQop); + } + } + + SaslQOP(String saslQop) { + this.saslQop = saslQop; + } + + public String toString() { + return saslQop; + } + + public static SaslQOP fromString(String str) { + if (str != null) { + str = str.toLowerCase(Locale.ROOT); + } + SaslQOP saslQOP = STR_TO_ENUM.get(str); + if (saslQOP == null) { + throw new IllegalArgumentException( + "Unknown auth type: " + str + " Allowed values are: " + STR_TO_ENUM.keySet()); + } + return saslQOP; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSubjectAssumingTransport.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSubjectAssumingTransport.java new file mode 100644 index 000000000000..515bbe7e9ebe --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSubjectAssumingTransport.java @@ -0,0 +1,70 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth; + +import org.apache.hadoop.hive.thrift.TFilterTransport; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; + +import javax.security.auth.Subject; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +/** + * This is used on the client side, where the API explicitly opens a transport to + * the server using the Subject.doAs(). + */ +public class TSubjectAssumingTransport extends TFilterTransport { + + public TSubjectAssumingTransport(TTransport wrapped) { + super(wrapped); + } + + @Override + public void open() throws TTransportException { + try { + AccessControlContext context = AccessController.getContext(); + Subject subject = Subject.getSubject(context); + Subject.doAs(subject, new PrivilegedExceptionAction() { + public Void run() { + try { + wrapped.open(); + } catch (TTransportException tte) { + // Wrap the transport exception in an RTE, since Subject.doAs() then goes + // and unwraps this for us out of the doAs block. We then unwrap one + // more time in our catch clause to get back the TTE. (ugh) + throw new RuntimeException(tte); + } + return null; + } + }); + } catch (PrivilegedActionException ioe) { + throw new RuntimeException("Received an ioe we never threw!", ioe); + } catch (RuntimeException rte) { + if (rte.getCause() instanceof TTransportException) { + throw (TTransportException) rte.getCause(); + } else { + throw rte; + } + } + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceUtils.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceUtils.java new file mode 100644 index 000000000000..514c11f04147 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceUtils.java @@ -0,0 +1,76 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.log4j.Layout; +import org.apache.log4j.PatternLayout; + +/** + * CLIServiceUtils. + * + */ +public class CLIServiceUtils { + + + private static final char SEARCH_STRING_ESCAPE = '\\'; + public static final Layout verboseLayout = new PatternLayout( + "%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n"); + public static final Layout nonVerboseLayout = new PatternLayout( + "%-5p : %m%n"); + + /** + * Convert a SQL search pattern into an equivalent Java Regex. + * + * @param pattern input which may contain '%' or '_' wildcard characters, or + * these characters escaped using {@code getSearchStringEscape()}. + * @return replace %/_ with regex search characters, also handle escaped + * characters. + */ + public static String patternToRegex(String pattern) { + if (pattern == null) { + return ".*"; + } else { + StringBuilder result = new StringBuilder(pattern.length()); + + boolean escaped = false; + for (int i = 0, len = pattern.length(); i < len; i++) { + char c = pattern.charAt(i); + if (escaped) { + if (c != SEARCH_STRING_ESCAPE) { + escaped = false; + } + result.append(c); + } else { + if (c == SEARCH_STRING_ESCAPE) { + escaped = true; + continue; + } else if (c == '%') { + result.append(".*"); + } else if (c == '_') { + result.append('.'); + } else { + result.append(Character.toLowerCase(c)); + } + } + } + return result.toString(); + } + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java new file mode 100644 index 000000000000..0c1ae302c9db --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java @@ -0,0 +1,96 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.cli.thrift.TGetInfoType; + +/** + * GetInfoType. + */ +public enum GetInfoType { + CLI_MAX_DRIVER_CONNECTIONS(TGetInfoType.CLI_MAX_DRIVER_CONNECTIONS), + CLI_MAX_CONCURRENT_ACTIVITIES(TGetInfoType.CLI_MAX_CONCURRENT_ACTIVITIES), + CLI_DATA_SOURCE_NAME(TGetInfoType.CLI_DATA_SOURCE_NAME), + CLI_FETCH_DIRECTION(TGetInfoType.CLI_FETCH_DIRECTION), + CLI_SERVER_NAME(TGetInfoType.CLI_SERVER_NAME), + CLI_SEARCH_PATTERN_ESCAPE(TGetInfoType.CLI_SEARCH_PATTERN_ESCAPE), + CLI_DBMS_NAME(TGetInfoType.CLI_DBMS_NAME), + CLI_DBMS_VER(TGetInfoType.CLI_DBMS_VER), + CLI_ACCESSIBLE_TABLES(TGetInfoType.CLI_ACCESSIBLE_TABLES), + CLI_ACCESSIBLE_PROCEDURES(TGetInfoType.CLI_ACCESSIBLE_PROCEDURES), + CLI_CURSOR_COMMIT_BEHAVIOR(TGetInfoType.CLI_CURSOR_COMMIT_BEHAVIOR), + CLI_DATA_SOURCE_READ_ONLY(TGetInfoType.CLI_DATA_SOURCE_READ_ONLY), + CLI_DEFAULT_TXN_ISOLATION(TGetInfoType.CLI_DEFAULT_TXN_ISOLATION), + CLI_IDENTIFIER_CASE(TGetInfoType.CLI_IDENTIFIER_CASE), + CLI_IDENTIFIER_QUOTE_CHAR(TGetInfoType.CLI_IDENTIFIER_QUOTE_CHAR), + CLI_MAX_COLUMN_NAME_LEN(TGetInfoType.CLI_MAX_COLUMN_NAME_LEN), + CLI_MAX_CURSOR_NAME_LEN(TGetInfoType.CLI_MAX_CURSOR_NAME_LEN), + CLI_MAX_SCHEMA_NAME_LEN(TGetInfoType.CLI_MAX_SCHEMA_NAME_LEN), + CLI_MAX_CATALOG_NAME_LEN(TGetInfoType.CLI_MAX_CATALOG_NAME_LEN), + CLI_MAX_TABLE_NAME_LEN(TGetInfoType.CLI_MAX_TABLE_NAME_LEN), + CLI_SCROLL_CONCURRENCY(TGetInfoType.CLI_SCROLL_CONCURRENCY), + CLI_TXN_CAPABLE(TGetInfoType.CLI_TXN_CAPABLE), + CLI_USER_NAME(TGetInfoType.CLI_USER_NAME), + CLI_TXN_ISOLATION_OPTION(TGetInfoType.CLI_TXN_ISOLATION_OPTION), + CLI_INTEGRITY(TGetInfoType.CLI_INTEGRITY), + CLI_GETDATA_EXTENSIONS(TGetInfoType.CLI_GETDATA_EXTENSIONS), + CLI_NULL_COLLATION(TGetInfoType.CLI_NULL_COLLATION), + CLI_ALTER_TABLE(TGetInfoType.CLI_ALTER_TABLE), + CLI_ORDER_BY_COLUMNS_IN_SELECT(TGetInfoType.CLI_ORDER_BY_COLUMNS_IN_SELECT), + CLI_SPECIAL_CHARACTERS(TGetInfoType.CLI_SPECIAL_CHARACTERS), + CLI_MAX_COLUMNS_IN_GROUP_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_GROUP_BY), + CLI_MAX_COLUMNS_IN_INDEX(TGetInfoType.CLI_MAX_COLUMNS_IN_INDEX), + CLI_MAX_COLUMNS_IN_ORDER_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_ORDER_BY), + CLI_MAX_COLUMNS_IN_SELECT(TGetInfoType.CLI_MAX_COLUMNS_IN_SELECT), + CLI_MAX_COLUMNS_IN_TABLE(TGetInfoType.CLI_MAX_COLUMNS_IN_TABLE), + CLI_MAX_INDEX_SIZE(TGetInfoType.CLI_MAX_INDEX_SIZE), + CLI_MAX_ROW_SIZE(TGetInfoType.CLI_MAX_ROW_SIZE), + CLI_MAX_STATEMENT_LEN(TGetInfoType.CLI_MAX_STATEMENT_LEN), + CLI_MAX_TABLES_IN_SELECT(TGetInfoType.CLI_MAX_TABLES_IN_SELECT), + CLI_MAX_USER_NAME_LEN(TGetInfoType.CLI_MAX_USER_NAME_LEN), + CLI_OJ_CAPABILITIES(TGetInfoType.CLI_OJ_CAPABILITIES), + + CLI_XOPEN_CLI_YEAR(TGetInfoType.CLI_XOPEN_CLI_YEAR), + CLI_CURSOR_SENSITIVITY(TGetInfoType.CLI_CURSOR_SENSITIVITY), + CLI_DESCRIBE_PARAMETER(TGetInfoType.CLI_DESCRIBE_PARAMETER), + CLI_CATALOG_NAME(TGetInfoType.CLI_CATALOG_NAME), + CLI_COLLATION_SEQ(TGetInfoType.CLI_COLLATION_SEQ), + CLI_MAX_IDENTIFIER_LEN(TGetInfoType.CLI_MAX_IDENTIFIER_LEN), + CLI_ODBC_KEYWORDS(TGetInfoType.CLI_ODBC_KEYWORDS); + + private final TGetInfoType tInfoType; + + GetInfoType(TGetInfoType tInfoType) { + this.tInfoType = tInfoType; + } + + public static GetInfoType getGetInfoType(TGetInfoType tGetInfoType) { + for (GetInfoType infoType : values()) { + if (tGetInfoType.equals(infoType.tInfoType)) { + return infoType; + } + } + throw new IllegalArgumentException("Unrecognized Thrift TGetInfoType value: " + tGetInfoType); + } + + public TGetInfoType toTGetInfoType() { + return tInfoType; + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoValue.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoValue.java new file mode 100644 index 000000000000..21844587eacf --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoValue.java @@ -0,0 +1,82 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.cli.thrift.TGetInfoValue; + +/** + * GetInfoValue. + * + */ +public class GetInfoValue { + private String stringValue = null; + private short shortValue; + private int intValue; + private long longValue; + + public GetInfoValue(String stringValue) { + this.stringValue = stringValue; + } + + public GetInfoValue(short shortValue) { + this.shortValue = shortValue; + } + + public GetInfoValue(int intValue) { + this.intValue = intValue; + } + + public GetInfoValue(long longValue) { + this.longValue = longValue; + } + + public GetInfoValue(TGetInfoValue tGetInfoValue) { + switch (tGetInfoValue.getSetField()) { + case STRING_VALUE: + stringValue = tGetInfoValue.getStringValue(); + break; + default: + throw new IllegalArgumentException("Unrecognized TGetInfoValue"); + } + } + + public TGetInfoValue toTGetInfoValue() { + TGetInfoValue tInfoValue = new TGetInfoValue(); + if (stringValue != null) { + tInfoValue.setStringValue(stringValue); + } + return tInfoValue; + } + + public String getStringValue() { + return stringValue; + } + + public short getShortValue() { + return shortValue; + } + + public int getIntValue() { + return intValue; + } + + public long getLongValue() { + return longValue; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java new file mode 100644 index 000000000000..a2c0174d7ef8 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java @@ -0,0 +1,204 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation; + +import com.google.common.base.Joiner; +import org.apache.hadoop.hive.ql.exec.Task; +import org.apache.hadoop.hive.ql.log.PerfLogger; +import org.apache.hadoop.hive.ql.session.OperationLog; +import org.apache.log4j.*; +import org.apache.log4j.spi.Filter; +import org.apache.log4j.spi.LoggingEvent; +import org.apache.spark.sql.thriftserver.cli.CLIServiceUtils; + +import java.io.CharArrayWriter; +import java.util.Enumeration; +import java.util.regex.Pattern; + +/** + * An Appender to divert logs from individual threads to the LogObject they belong to. + */ +public class LogDivertAppender extends WriterAppender { + private static final Logger LOG = Logger.getLogger(LogDivertAppender.class.getName()); + private final OperationManager operationManager; + private boolean isVerbose; + private Layout verboseLayout; + + /** + * A log filter that filters messages coming from the logger with the given names. + * It be used as a white list filter or a black list filter. + * We apply black list filter on the Loggers used by the log diversion stuff, so that + * they don't generate more logs for themselves when they process logs. + * White list filter is used for less verbose log collection + */ + private static class NameFilter extends Filter { + private Pattern namePattern; + private OperationLog.LoggingLevel loggingMode; + private OperationManager operationManager; + + /* Patterns that are excluded in verbose logging level. + * Filter out messages coming from log processing classes, or we'll run an infinite loop. + */ + private static final Pattern verboseExcludeNamePattern = Pattern.compile(Joiner.on("|") + .join(new String[]{LOG.getName(), OperationLog.class.getName(), + OperationManager.class.getName()})); + + /* Patterns that are included in execution logging level. + * In execution mode, show only select logger messages. + */ + private static final Pattern executionIncludeNamePattern = Pattern.compile(Joiner.on("|") + .join(new String[]{"org.apache.hadoop.mapreduce.JobSubmitter", + "org.apache.hadoop.mapreduce.Job", "SessionState", Task.class.getName(), + "org.apache.hadoop.hive.ql.exec.spark.status.SparkJobMonitor"})); + + /* Patterns that are included in performance logging level. + * In performance mode, show execution and performance logger messages. + */ + private static final Pattern performanceIncludeNamePattern = Pattern.compile( + executionIncludeNamePattern.pattern() + "|" + PerfLogger.class.getName()); + + private void setCurrentNamePattern(OperationLog.LoggingLevel mode) { + if (mode == OperationLog.LoggingLevel.VERBOSE) { + this.namePattern = verboseExcludeNamePattern; + } else if (mode == OperationLog.LoggingLevel.EXECUTION) { + this.namePattern = executionIncludeNamePattern; + } else if (mode == OperationLog.LoggingLevel.PERFORMANCE) { + this.namePattern = performanceIncludeNamePattern; + } + } + + NameFilter( + OperationLog.LoggingLevel loggingMode, OperationManager op) { + this.operationManager = op; + this.loggingMode = loggingMode; + setCurrentNamePattern(loggingMode); + } + + @Override + public int decide(LoggingEvent ev) { + OperationLog log = operationManager.getOperationLogByThread(); + boolean excludeMatches = (loggingMode == OperationLog.LoggingLevel.VERBOSE); + + if (log == null) { + return Filter.DENY; + } + + OperationLog.LoggingLevel currentLoggingMode = log.getOpLoggingLevel(); + // If logging is disabled, deny everything. + if (currentLoggingMode == OperationLog.LoggingLevel.NONE) { + return Filter.DENY; + } + // Look at the current session's setting + // and set the pattern and excludeMatches accordingly. + if (currentLoggingMode != loggingMode) { + loggingMode = currentLoggingMode; + setCurrentNamePattern(loggingMode); + } + + boolean isMatch = namePattern.matcher(ev.getLoggerName()).matches(); + + if (excludeMatches == isMatch) { + // Deny if this is black-list filter (excludeMatches = true) and it + // matched + // or if this is whitelist filter and it didn't match + return Filter.DENY; + } + return Filter.NEUTRAL; + } + } + + /** This is where the log message will go to */ + private final CharArrayWriter writer = new CharArrayWriter(); + + private void setLayout(boolean isVerbose, Layout lo) { + if (isVerbose) { + if (lo == null) { + lo = CLIServiceUtils.verboseLayout; + LOG.info("Cannot find a Layout from a ConsoleAppender. Using default Layout pattern."); + } + } else { + lo = CLIServiceUtils.nonVerboseLayout; + } + setLayout(lo); + } + + private void initLayout(boolean isVerbose) { + // There should be a ConsoleAppender. Copy its Layout. + Logger root = Logger.getRootLogger(); + Layout layout = null; + + Enumeration appenders = root.getAllAppenders(); + while (appenders.hasMoreElements()) { + Appender ap = (Appender) appenders.nextElement(); + if (ap.getClass().equals(ConsoleAppender.class)) { + layout = ap.getLayout(); + break; + } + } + setLayout(isVerbose, layout); + } + + public LogDivertAppender(OperationManager operationManager, + OperationLog.LoggingLevel loggingMode) { + isVerbose = (loggingMode == OperationLog.LoggingLevel.VERBOSE); + initLayout(isVerbose); + setWriter(writer); + setName("LogDivertAppender"); + this.operationManager = operationManager; + this.verboseLayout = isVerbose ? layout : CLIServiceUtils.verboseLayout; + addFilter(new NameFilter(loggingMode, operationManager)); + } + + @Override + public void doAppend(LoggingEvent event) { + OperationLog log = operationManager.getOperationLogByThread(); + + // Set current layout depending on the verbose/non-verbose mode. + if (log != null) { + boolean isCurrModeVerbose = (log.getOpLoggingLevel() == OperationLog.LoggingLevel.VERBOSE); + + // If there is a logging level change from verbose->non-verbose or vice-versa since + // the last subAppend call, change the layout to preserve consistency. + if (isCurrModeVerbose != isVerbose) { + isVerbose = isCurrModeVerbose; + setLayout(isVerbose, verboseLayout); + } + } + super.doAppend(event); + } + + /** + * Overrides WriterAppender.subAppend(), which does the real logging. No need + * to worry about concurrency since log4j calls this synchronously. + */ + @Override + protected void subAppend(LoggingEvent event) { + super.subAppend(event); + // That should've gone into our writer. Notify the LogContext. + String logOutput = writer.toString(); + writer.reset(); + + OperationLog log = operationManager.getOperationLogByThread(); + if (log == null) { + LOG.debug(" ---+++=== Dropped log event from thread " + event.getThreadName()); + return; + } + log.writeOperationLog(logOutput); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadFactoryWithGarbageCleanup.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadFactoryWithGarbageCleanup.java new file mode 100644 index 000000000000..125775e6db93 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadFactoryWithGarbageCleanup.java @@ -0,0 +1,64 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.spark.sql.thriftserver.server; + +import org.apache.hadoop.hive.metastore.RawStore; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ThreadFactory; + +/** + * A ThreadFactory for constructing new HiveServer2 threads that lets you plug + * in custom cleanup code to be called before this thread is GC-ed. + * Currently cleans up the following: + * 1. ThreadLocal RawStore object: + * In case of an embedded metastore, HiveServer2 threads (foreground and background) + * end up caching a ThreadLocal RawStore object. The ThreadLocal RawStore object has + * an instance of PersistenceManagerFactory and PersistenceManager. + * The PersistenceManagerFactory keeps a cache of PersistenceManager objects, + * which are only removed when PersistenceManager#close method is called. + * HiveServer2 uses ExecutorService for managing thread pools for foreground and background threads. + * ExecutorService unfortunately does not provide any hooks to be called, + * when a thread from the pool is terminated. + * As a solution, we're using this ThreadFactory to keep a cache of RawStore objects per thread. + * And we are doing clean shutdown in the finalizer for each thread. + */ +public class ThreadFactoryWithGarbageCleanup implements ThreadFactory { + + private static Map threadRawStoreMap = new ConcurrentHashMap(); + + private final String namePrefix; + + public ThreadFactoryWithGarbageCleanup(String threadPoolName) { + namePrefix = threadPoolName; + } + + @Override + public Thread newThread(Runnable runnable) { + Thread newThread = new ThreadWithGarbageCleanup(runnable); + newThread.setName(namePrefix + ": Thread-" + newThread.getId()); + return newThread; + } + + public static Map getThreadRawStoreMap() { + return threadRawStoreMap; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadWithGarbageCleanup.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadWithGarbageCleanup.java new file mode 100644 index 000000000000..33b1fcac24c0 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/server/ThreadWithGarbageCleanup.java @@ -0,0 +1,77 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.spark.sql.thriftserver.server; + +import java.util.Map; + +import org.apache.hadoop.hive.metastore.HiveMetaStore; +import org.apache.hadoop.hive.metastore.RawStore; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A HiveServer2 thread used to construct new server threads. + * In particular, this thread ensures an orderly cleanup, + * when killed by its corresponding ExecutorService. + */ +public class ThreadWithGarbageCleanup extends Thread { + private static final Logger LOG = LoggerFactory.getLogger(ThreadWithGarbageCleanup.class); + + Map threadRawStoreMap = + ThreadFactoryWithGarbageCleanup.getThreadRawStoreMap(); + + public ThreadWithGarbageCleanup(Runnable runnable) { + super(runnable); + } + + /** + * Add any Thread specific garbage cleanup code here. + * Currently, it shuts down the RawStore object for this thread if it is not null. + */ + @Override + public void finalize() throws Throwable { + cleanRawStore(); + super.finalize(); + } + + private void cleanRawStore() { + Long threadId = this.getId(); + RawStore threadLocalRawStore = threadRawStoreMap.get(threadId); + if (threadLocalRawStore != null) { + LOG.debug("RawStore: " + threadLocalRawStore + ", for the thread: " + + this.getName() + " will be closed now."); + threadLocalRawStore.shutdown(); + threadRawStoreMap.remove(threadId); + } + } + + /** + * Cache the ThreadLocal RawStore object. Called from the corresponding thread. + */ + public void cacheThreadLocalRawStore() { + Long threadId = this.getId(); + RawStore threadLocalRawStore = HiveMetaStore.HMSHandler.getRawStore(); + if (threadLocalRawStore != null && !threadRawStoreMap.containsKey(threadId)) { + LOG.debug("Adding RawStore: " + threadLocalRawStore + ", for the thread: " + + this.getName() + " to threadRawStoreMap for future cleanup."); + threadRawStoreMap.put(threadId, threadLocalRawStore); + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala new file mode 100644 index 000000000000..2008fe453868 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala @@ -0,0 +1,137 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.util + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.conf.HiveConf + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.Service._ + +/** + * Construct the service. + * + * @param name + * service name + */ +abstract class AbstractService(val name: String) extends Service with Logging { + + /** + * Service state: initially {@link STATE#NOTINITED}. + */ + private var state: STATE = NOTINITED + /** + * Service start time. Will be zero until the service is started. + */ + private var startTime = 0L + /** + * The configuration. Will be null until the service is initialized. + */ + private var hiveConf: HiveConf = null + /** + * List of state change listeners; it is final to ensure + * that it will never be null. + */ + final private val listeners = new util.ArrayList[ServiceStateChangeListener] + + def getServiceState: Service.STATE = synchronized { + state + } + + /** + * {@inheritDoc } + * + * @throws IllegalStateException + * if the current service state does not permit + * this action + */ + def init(hiveConf: HiveConf): Unit = { + ensureCurrentState(NOTINITED) + this.hiveConf = hiveConf + changeState(INITED) + logInfo("Service:" + getName + " is inited.") + } + + def start(): Unit = { + startTime = System.currentTimeMillis + ensureCurrentState(INITED) + changeState(STARTED) + logInfo("Service:" + getName + " is started.") + } + + def stop(): Unit = { + if ((state eq STOPPED) || + (state eq INITED) || + (state eq NOTINITED)) { + // already stopped, or else it was never + // started (eg another service failing canceled startup) + return + } + ensureCurrentState(STARTED) + changeState(STOPPED) + logInfo("Service:" + getName + " is stopped.") + } + + def register(l: ServiceStateChangeListener): Unit = { + listeners.add(l) + } + + def unregister(l: ServiceStateChangeListener): Unit = { + listeners.remove(l) + } + + def getName: String = name + + def getHiveConf: HiveConf = hiveConf + + def getStartTime: Long = startTime + + /** + * Verify that a service is in a given state. + * + * @param currentState + * the desired state + * @throws IllegalStateException + * if the service state is different from + * the desired state + */ + private def ensureCurrentState(currentState: STATE): Unit = { + ServiceOperations.ensureCurrentState(state, currentState) + } + + /** + * Change to a new state and notify all listeners. + * This is a private method that is only invoked from synchronized methods, + * which avoid having to clone the listener list. It does imply that + * the state change listener methods should be short lived, as they + * will delay the state transition. + * + * @param newState + * new service state + */ + private def changeState(newState: STATE): Unit = { + state = newState + // notify listeners + for (l <- listeners.asScala) { + l.stateChanged(this) + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala new file mode 100644 index 000000000000..9142a99b2f8f --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.util +import java.util.Collections + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.conf.HiveConf + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.Service.STOPPED + +class CompositeService(name: String) extends AbstractService(name) with Logging { + + + private val serviceList: util.ArrayList[Service] = new util.ArrayList[Service] + + def getServices: util.Collection[Service] = Collections.unmodifiableList(serviceList) + + protected def addService(service: Service): Unit = { + serviceList.add(service) + } + + protected def removeService(service: Service): Boolean = serviceList.remove(service) + + override def init(hiveConf: HiveConf): Unit = { + for (service <- serviceList.asScala) { + service.init(hiveConf) + } + super.init(hiveConf) + } + + override def start(): Unit = { + var i = 0 + try { + val n = serviceList.size + while (i < n) { + val service = serviceList.get(i) + service.start + i += 1 + } + super.start + } catch { + case e: Throwable => + logError("Error starting services " + getName, e) + // Note that the state of the failed service is still INITED and not + // STARTED. Even though the last service is not started completely, still + // call stop() on all services including failed service to make sure cleanup + // happens. + stop(i) + throw new ServiceException("Failed to Start " + getName, e) + } + } + + override def stop(): Unit = { + if (this.getServiceState eq STOPPED) { + // The base composite-service is already stopped, don't do anything again. + return + } + if (serviceList.size > 0) { + stop(serviceList.size - 1) + } + super.stop + } + + private def stop(numOfServicesStarted: Int): Unit = { + // stop in reserve order of start + var i = numOfServicesStarted + while (i >= 0) { + val service = serviceList.get(i) + try { + service.stop + } catch { + case t: Throwable => + logInfo("Error stopping " + service.getName, t) + } + i -= 1 + } + } + + /** + * JVM Shutdown hook for CompositeService which will stop the given + * CompositeService gracefully in case of JVM shutdown. + */ + class CompositeServiceShutdownHook(val compositeService: CompositeService) extends Runnable { + override def run(): Unit = { + try // Stop the Composite Service + compositeService.stop + catch { + case t: Throwable => + logInfo("Error stopping " + compositeService.getName, t) + } + } + } + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala new file mode 100644 index 000000000000..de4bd0ed22ae --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.security.{MessageDigest, NoSuchAlgorithmException} + +import org.apache.commons.codec.binary.Base64 + +import org.apache.spark.internal.Logging + +/** + * The cookie signer generates a signature based on SHA digest + * and appends it to the cookie value generated at the + * server side. It uses SHA digest algorithm to sign and verify signatures. + */ +object CookieSigner { + private val SIGNATURE = "&s=" + private val SHA_STRING = "SHA" +} + +class CookieSigner extends Logging { + private var secretBytes: Array[Byte] = null + + def this(secret: Array[Byte]) { + this() + if (secret == null) { + throw new IllegalArgumentException("NULL Secret Bytes") + } + this.secretBytes = secret.clone + } + + + /** + * Sign the cookie given the string token as input. + * + * @param str Input token + * @return Signed token that can be used to create a cookie + */ + def signCookie(str: String): String = { + if (str == null || str.isEmpty) { + throw new IllegalArgumentException("NULL or empty string to sign") + } + val signature = getSignature(str) + logDebug("Signature generated for " + str + " is " + signature) + str + CookieSigner.SIGNATURE + signature + } + + /** + * Verify a signed string and extracts the original string. + * + * @param signedStr The already signed string + * @return Raw Value of the string without the signature + */ + def verifyAndExtract(signedStr: String): String = { + val index = signedStr.lastIndexOf(CookieSigner.SIGNATURE) + if (index == -1) { + throw new IllegalArgumentException("Invalid input sign: " + signedStr) + } + val originalSignature = signedStr.substring(index + CookieSigner.SIGNATURE.length) + val rawValue = signedStr.substring(0, index) + val currentSignature = getSignature(rawValue) + logDebug("Signature generated for " + rawValue + " inside verify is " + currentSignature) + if (!(originalSignature == currentSignature)) { + throw new IllegalArgumentException("Invalid sign, original = " + + originalSignature + " current = " + currentSignature) + } + rawValue + } + + /** + * Get the signature of the input string based on SHA digest algorithm. + * + * @param str Input token + * @return Signed String + */ + private def getSignature(str: String) = try { + val md = MessageDigest.getInstance(CookieSigner.SHA_STRING) + md.update(str.getBytes) + md.update(secretBytes) + val digest = md.digest + new Base64(0).encodeToString(digest) + } catch { + case ex: NoSuchAlgorithmException => + throw new RuntimeException("Invalid SHA digest String: " + + CookieSigner.SHA_STRING + " " + ex.getMessage, ex) + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala new file mode 100644 index 000000000000..d3937e43108b --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +private[thriftserver] object ReflectionUtils { + def setSuperField(obj : Object, fieldName: String, fieldValue: Object): Unit = { + setAncestorField(obj, 1, fieldName, fieldValue) + } + + def setAncestorField(obj: AnyRef, level: Int, fieldName: String, fieldValue: AnyRef): Unit = { + val ancestor = Iterator.iterate[Class[_]](obj.getClass)(_.getSuperclass).drop(level).next() + val field = ancestor.getDeclaredField(fieldName) + field.setAccessible(true) + field.set(obj, fieldValue) + } + + def getSuperField[T](obj: AnyRef, fieldName: String): T = { + getAncestorField[T](obj, 1, fieldName) + } + + def getAncestorField[T](clazz: Object, level: Int, fieldName: String): T = { + val ancestor = Iterator.iterate[Class[_]](clazz.getClass)(_.getSuperclass).drop(level).next() + val field = ancestor.getDeclaredField(fieldName) + field.setAccessible(true) + field.get(clazz).asInstanceOf[T] + } + + def invokeStatic(clazz: Class[_], methodName: String, args: (Class[_], AnyRef)*): AnyRef = { + invoke(clazz, null, methodName, args: _*) + } + + def invoke( + clazz: Class[_], + obj: AnyRef, + methodName: String, + args: (Class[_], AnyRef)*): AnyRef = { + + val (types, values) = args.unzip + val method = clazz.getDeclaredMethod(methodName, types: _*) + method.setAccessible(true) + method.invoke(obj, values.toSeq: _*) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala new file mode 100644 index 000000000000..52ac32fde739 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala @@ -0,0 +1,113 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import org.apache.hadoop.hive.conf.HiveConf + +trait Service { + /** + * Initialize the service. + * + * The transition must be from {@link STATE#NOTINITED} to {@link STATE#INITED} unless the + * operation failed and an exception was raised. + * + * @param conf + * the configuration of the service + */ + def init(conf: HiveConf): Unit + + + /** + * Start the service. + * + * The transition should be from {@link STATE#INITED} to {@link STATE#STARTED} unless the + * operation failed and an exception was raised. + */ + def start(): Unit + + /** + * Stop the service. + * + * This operation must be designed to complete regardless of the initial state + * of the service, including the state of all its internal fields. + */ + def stop(): Unit + + /** + * Register an instance of the service state change events. + * + * @param listener + * a new listener + */ + def register(listener: ServiceStateChangeListener): Unit + + /** + * Unregister a previously instance of the service state change events. + * + * @param listener + * the listener to unregister. + */ + def unregister(listener: ServiceStateChangeListener): Unit + + /** + * Get the name of this service. + * + * @return the service name + */ + def getName: String + + /** + * Get the configuration of this service. + * This is normally not a clone and may be manipulated, though there are no + * guarantees as to what the consequences of such actions may be + * + * @return the current configuration, unless a specific implementation chooses + * otherwise. + */ + def getHiveConf: HiveConf + + /** + * Get the current service state + * + * @return the state of the service + */ + def getServiceState: Service.STATE + + /** + * Get the service start time + * + * @return the start time of the service. This will be zero if the service + * has not yet been started. + */ + def getStartTime: Long +} + +object Service { + + trait STATE + + case object NOTINITED extends STATE + + case object INITED extends STATE + + case object STARTED extends STATE + + case object STOPPED extends STATE + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala new file mode 100644 index 000000000000..e7d1ef3438fe --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala @@ -0,0 +1,27 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +class ServiceException(msg: String, cause: Throwable) + extends RuntimeException(msg, cause) { + + def this(cause: Throwable) = this(null, cause) + + def this(message: String) = this(message, null) +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala new file mode 100644 index 000000000000..1a79105533e7 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala @@ -0,0 +1,132 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import org.apache.hadoop.hive.conf.HiveConf + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.Service._ + +object ServiceOperations extends Logging { + + /** + * Verify that a service is in a given state. + * + * @param state the actual state a service is in + * @param expectedState the desired state + * @throws IllegalStateException if the service state is different from + * the desired state + */ + def ensureCurrentState(state: STATE, expectedState: STATE): Unit = { + if (state ne expectedState) { + throw new IllegalStateException("For this operation, the " + + "current service state must be " + expectedState + " instead of " + state) + } + } + + /** + * Initialize a service. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service that must be in the state + * { @link Service.STATE#NOTINITED} + * @param configuration the configuration to initialize the service with + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + def init(service: Service, configuration: HiveConf): Unit = { + val state = service.getServiceState + ensureCurrentState(state, NOTINITED) + service.init(configuration) + } + + /** + * Start a service. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service that must be in the state + * { @link Service.STATE#INITED} + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + def start(service: Service): Unit = { + val state = service.getServiceState + ensureCurrentState(state, INITED) + service.start() + } + + /** + * Initialize then start a service. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service that must be in the state + * { @link Service.STATE#NOTINITED} + * @param configuration the configuration to initialize the service with + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + def deploy(service: Service, configuration: HiveConf): Unit = { + init(service, configuration) + start(service) + } + + /** + * Stop a service. + * + * Do nothing if the service is null or not in a state in which it can be/needs to be stopped. + * + * The service state is checked before the operation begins. + * This process is not thread safe. + * + * @param service a service or null + */ + def stop(service: Service): Unit = { + if (service != null) { + val state = service.getServiceState + if (state eq STARTED) { + service.stop() + + } + } + } + + /** + * Stop a service; if it is null do nothing. Exceptions are caught and + * logged at warn level. (but not Throwables). This operation is intended to + * be used in cleanup operations + * + * @param service a service; may be null + * @return any exception that was caught; null if none was. + */ + def stopQuietly(service: Service): Exception = { + try { + stop(service) + } catch { + case e: Exception => + logWarning("When stopping the service " + service.getName + " : " + e, e) + return e + } + null + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala new file mode 100644 index 000000000000..1b9010b42aa5 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +/** + * ServiceStateChangeListener. + * + */ +trait ServiceStateChangeListener { + + /** + * Callback to notify of a state change. The service will already + * have changed state before this callback is invoked. + * + * This operation is invoked on the thread that initiated the state change, + * while the service itself in a synchronized section. + *

    + *
  1. Any long-lived operation here will prevent the service state + * change from completing in a timely manner.
  2. + *
  3. If another thread is somehow invoked from the listener, and + * that thread invokes the methods of the service (including + * subclass-specific methods), there is a risk of a deadlock.
  4. + *
+ * + * @param service the service that has changed. + */ + def stateChanged(service: Service): Unit +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala new file mode 100644 index 000000000000..0ebc1bb444c2 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.io.{Closeable, IOException} + +import org.slf4j.Logger + +object ServiceUtils { + + /* + * Get the index separating the user name from domain name (the user's name up + * to the first '/' or '@'). + * + * @param userName full user name. + * @return index of domain match or -1 if not found + */ + def indexOfDomainMatch(userName: String): Int = { + if (userName == null) { + return -1 + } + val idx = userName.indexOf('/') + val idx2 = userName.indexOf('@') + var endIdx = Math.min(idx, idx2) // Use the earlier match. + // Unless at least one of '/' or '@' was not found, in + // which case, user the latter match. + if (endIdx == -1) { + endIdx = Math.max(idx, idx2) + } + endIdx + } + + /** + * Close the Closeable objects and ignore any {@link IOException} or + * null pointers. Must only be used for cleanup in exception handlers. + * + * @param log the log to record problems to at debug level. Can be null. + * @param closeables the objects to close + */ + def cleanup(log: Logger, closeables: Closeable*): Unit = { + for (c <- closeables) { + if (c != null) { + try { + c.close() + } catch { + case e: IOException => + if (log != null && log.isDebugEnabled) { + log.debug("Exception in closing " + c, e) + } + } + } + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala new file mode 100644 index 000000000000..05609bed7ab6 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala @@ -0,0 +1,72 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.io.PrintStream +import java.nio.charset.StandardCharsets.UTF_8 + +import org.apache.spark.{SparkConf, SparkContext} +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{SparkSession, SQLContext} +import org.apache.spark.sql.hive.{HiveExternalCatalog, HiveUtils} +import org.apache.spark.util.Utils + +/** A singleton object for the master program. The slaves should not access this. */ +private[thriftserver] object SparkSQLEnv extends Logging { + logDebug("Initializing SparkSQLEnv") + + var sqlContext: SQLContext = _ + var sparkContext: SparkContext = _ + + def init() { + if (sqlContext == null) { + val sparkConf = new SparkConf(loadDefaults = true) + // If user doesn't specify the appName, we want to get [SparkSQL::localHostName] instead of + // the default appName [SparkSQLCLIDriver] in cli or beeline. + val maybeAppName = sparkConf + .getOption("spark.app.name") +// .filterNot(_ == classOf[SparkSQLCLIDriver].getName) + .filterNot(_ == classOf[SparkThriftServer2].getName) + + sparkConf + .setAppName(maybeAppName.getOrElse(s"SparkSQL::${Utils.localHostName()}")) + + val sparkSession = SparkSession.builder.config(sparkConf).enableHiveSupport().getOrCreate() + sparkContext = sparkSession.sparkContext + sqlContext = sparkSession.sqlContext + + val metadataHive = sparkSession + .sharedState.externalCatalog.unwrapped.asInstanceOf[HiveExternalCatalog].client + metadataHive.setOut(new PrintStream(System.out, true, UTF_8.name())) + metadataHive.setInfo(new PrintStream(System.err, true, UTF_8.name())) + metadataHive.setError(new PrintStream(System.err, true, UTF_8.name())) + sparkSession.conf.set(HiveUtils.FAKE_HIVE_VERSION.key, HiveUtils.builtinHiveVersion) + } + } + + /** Cleans up and shuts down the Spark SQL environments. */ + def stop() { + logDebug("Shutting down Spark SQL Environment") + // Stop the SparkContext + if (SparkSQLEnv.sparkContext != null) { + sparkContext.stop() + sparkContext = null + sqlContext = null + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala new file mode 100644 index 000000000000..344ecfa0a8c6 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala @@ -0,0 +1,316 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.util.concurrent.atomic.AtomicBoolean + +import scala.collection.mutable +import scala.collection.mutable.ArrayBuffer + +import org.apache.hadoop.hive.conf.HiveConf + +import org.apache.spark.SparkContext +import org.apache.spark.annotation.DeveloperApi +import org.apache.spark.internal.Logging +import org.apache.spark.internal.config.UI.UI_ENABLED +import org.apache.spark.scheduler.{SparkListener, SparkListenerApplicationEnd, SparkListenerJobStart} +import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.thriftserver.server.SparkThriftServer +import org.apache.spark.sql.thriftserver.ui.ThriftServerTab +import org.apache.spark.util.{ShutdownHookManager, Utils} + + + +/** + * The main entry point for the Spark SQL port of HiveServer2. Starts up a `SparkSQLContext` and a + * `HiveThriftServer2` thrift server. + */ +object SparkThriftServer2 extends Logging { + var uiTab: Option[ThriftServerTab] = None + var listener: SparkThriftServer2Listener = _ + + /** + * :: DeveloperApi :: + * Starts a new thrift server with the given context. + */ + @DeveloperApi + def startWithContext(sqlContext: SQLContext): SparkThriftServer2 = { + val server = new SparkThriftServer2(sqlContext) + + server.init(new HiveConf()) + server.start() + listener = new SparkThriftServer2Listener(server, sqlContext.conf) + sqlContext.sparkContext.addSparkListener(listener) + uiTab = if (sqlContext.sparkContext.getConf.get(UI_ENABLED)) { + Some(new ThriftServerTab(sqlContext.sparkContext)) + } else { + None + } + server + } + + def main(args: Array[String]) { + // If the arguments contains "-h" or "--help", print out the usage and exit. + if (args.contains("-h") || args.contains("--help")) { + SparkThriftServer.main(args) + // The following code should not be reachable. It is added to ensure the main function exits. + return + } + + Utils.initDaemon(log) + val optionsProcessor = new SparkThriftServer.ServerOptionsProcessor("HiveThriftServer2") + optionsProcessor.parse(args) + + logInfo("Starting SparkContext") + SparkSQLEnv.init() + + ShutdownHookManager.addShutdownHook { () => + SparkSQLEnv.stop() + uiTab.foreach(_.detach()) + } + + try { + val server = new SparkThriftServer2(SparkSQLEnv.sqlContext) + server.init(new HiveConf()) + server.start() + logInfo("HiveThriftServer2 started") + listener = new SparkThriftServer2Listener(server, SparkSQLEnv.sqlContext.conf) + SparkSQLEnv.sparkContext.addSparkListener(listener) + uiTab = if (SparkSQLEnv.sparkContext.getConf.get(UI_ENABLED)) { + Some(new ThriftServerTab(SparkSQLEnv.sparkContext)) + } else { + + None + } + // If application was killed before HiveThriftServer2 start successfully then SparkSubmit + // process can not exit, so check whether if SparkContext was stopped. + if (SparkSQLEnv.sparkContext.stopped.get()) { + logError("SparkContext has stopped even if HiveServer2 has started, so exit") + System.exit(-1) + } + } catch { + case e: Exception => + logError("Error starting HiveThriftServer2", e) + System.exit(-1) + } + } + + private[thriftserver] class SessionInfo( + val sessionId: String, + val startTimestamp: Long, + val ip: String, + val userName: String) { + var finishTimestamp: Long = 0L + var totalExecution: Int = 0 + + def totalTime: Long = { + if (finishTimestamp == 0L) { + System.currentTimeMillis - startTimestamp + } else { + finishTimestamp - startTimestamp + } + } + } + + private[thriftserver] object ExecutionState extends Enumeration { + val STARTED, CANCELED, COMPILED, FAILED, FINISHED, CLOSED = Value + type ExecutionState = Value + } + + private[thriftserver] class ExecutionInfo( + val statement: String, + val sessionId: String, + val startTimestamp: Long, + val userName: String) { + var finishTimestamp: Long = 0L + var closeTimestamp: Long = 0L + var executePlan: String = "" + var detail: String = "" + var state: ExecutionState.Value = ExecutionState.STARTED + val jobId: ArrayBuffer[String] = ArrayBuffer[String]() + var groupId: String = "" + + def totalTime(endTime: Long): Long = { + if (endTime == 0L) { + System.currentTimeMillis - startTimestamp + } else { + endTime - startTimestamp + } + } + } + + + /** + * An inner sparkListener called in sc.stop to clean up the HiveThriftServer2 + */ + private[thriftserver] class SparkThriftServer2Listener(val server: SparkThriftServer, + val conf: SQLConf) extends SparkListener { + + override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd): Unit = { + server.stop() + } + + private val sessionList = new mutable.LinkedHashMap[String, SessionInfo] + private val executionList = new mutable.LinkedHashMap[String, ExecutionInfo] + private val retainedStatements = conf.getConf(SQLConf.THRIFTSERVER_UI_STATEMENT_LIMIT) + private val retainedSessions = conf.getConf(SQLConf.THRIFTSERVER_UI_SESSION_LIMIT) + + def getOnlineSessionNum: Int = synchronized { + sessionList.count(_._2.finishTimestamp == 0) + } + + def isExecutionActive(execInfo: ExecutionInfo): Boolean = { + !(execInfo.state == ExecutionState.FAILED || + execInfo.state == ExecutionState.CANCELED || + execInfo.state == ExecutionState.CLOSED) + } + + /** + * When an error or a cancellation occurs, we set the finishTimestamp of the statement. + * Therefore, when we count the number of running statements, we need to exclude errors and + * cancellations and count all statements that have not been closed so far. + */ + def getTotalRunning: Int = synchronized { + executionList.count { + case (_, v) => isExecutionActive(v) + } + } + + def getSessionList: Seq[SessionInfo] = synchronized { + sessionList.values.toSeq + } + + def getSession(sessionId: String): Option[SessionInfo] = synchronized { + sessionList.get(sessionId) + } + + def getExecutionList: Seq[ExecutionInfo] = synchronized { + executionList.values.toSeq + } + + override def onJobStart(jobStart: SparkListenerJobStart): Unit = synchronized { + for { + props <- Option(jobStart.properties) + groupId <- Option(props.getProperty(SparkContext.SPARK_JOB_GROUP_ID)) + (_, info) <- executionList if info.groupId == groupId + } { + info.jobId += jobStart.jobId.toString + info.groupId = groupId + } + } + + def onSessionCreated(ip: String, sessionId: String, userName: String = "UNKNOWN"): Unit = { + synchronized { + val info = new SessionInfo(sessionId, System.currentTimeMillis, ip, userName) + sessionList.put(sessionId, info) + trimSessionIfNecessary() + } + } + + def onSessionClosed(sessionId: String): Unit = synchronized { + sessionList(sessionId).finishTimestamp = System.currentTimeMillis + trimSessionIfNecessary() + } + + def onStatementStart( + id: String, + sessionId: String, + statement: String, + groupId: String, + userName: String = "UNKNOWN"): Unit = synchronized { + val info = new ExecutionInfo(statement, sessionId, System.currentTimeMillis, userName) + info.state = ExecutionState.STARTED + executionList.put(id, info) + trimExecutionIfNecessary() + sessionList(sessionId).totalExecution += 1 + executionList(id).groupId = groupId + } + + def onStatementParsed(id: String, executionPlan: String): Unit = synchronized { + executionList(id).executePlan = executionPlan + executionList(id).state = ExecutionState.COMPILED + } + + def onStatementCanceled(id: String): Unit = synchronized { + executionList(id).finishTimestamp = System.currentTimeMillis + executionList(id).state = ExecutionState.CANCELED + trimExecutionIfNecessary() + } + + def onStatementError(id: String, errorMsg: String, errorTrace: String): Unit = synchronized { + executionList(id).finishTimestamp = System.currentTimeMillis + executionList(id).detail = errorMsg + executionList(id).state = ExecutionState.FAILED + trimExecutionIfNecessary() + } + + def onStatementFinish(id: String): Unit = synchronized { + executionList(id).finishTimestamp = System.currentTimeMillis + executionList(id).state = ExecutionState.FINISHED + trimExecutionIfNecessary() + } + + def onOperationClosed(id: String): Unit = synchronized { + executionList(id).closeTimestamp = System.currentTimeMillis + executionList(id).state = ExecutionState.CLOSED + } + + private def trimExecutionIfNecessary() = { + if (executionList.size > retainedStatements) { + val toRemove = math.max(retainedStatements / 10, 1) + executionList.filter(_._2.finishTimestamp != 0).take(toRemove).foreach { s => + executionList.remove(s._1) + } + } + } + + private def trimSessionIfNecessary() = { + if (sessionList.size > retainedSessions) { + val toRemove = math.max(retainedSessions / 10, 1) + sessionList.filter(_._2.finishTimestamp != 0).take(toRemove).foreach { s => + sessionList.remove(s._1) + } + } + + } + } + +} + +private[thriftserver] class SparkThriftServer2(sqlContext: SQLContext) + extends SparkThriftServer(sqlContext) { + // state is tracked internally so that the server only attempts to shut down if it successfully + // started, and then once only. + private val started = new AtomicBoolean(false) + + override def init(hiveConf: HiveConf) { + super.init(hiveConf) + } + + override def start(): Unit = { + super.start() + started.set(true) + } + + override def stop(): Unit = { + if (started.getAndSet(false)) { + super.stop() + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala new file mode 100644 index 000000000000..307d9acddb6d --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth + +abstract class AuthType(authType: String) { + + def getAuthName: String = authType + + override def toString: String = getAuthName +} + +case object NOSASL extends AuthType("NOSASL") + +case object NONE extends AuthType("NONE") + +case object LDAP extends AuthType("LDAP") + +case object KERBEROS extends AuthType("KERBEROS") + +case object CUSTOM extends AuthType("CUSTOM") + +case object PAM extends AuthType("PAM") \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala new file mode 100644 index 000000000000..725a2e46b24b --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala @@ -0,0 +1,433 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth + +import java.io.IOException +import java.lang.reflect.{Field, Method} +import java.net.{InetSocketAddress, UnknownHostException} +import java.util +import java.util.{Locale, Objects} +import javax.net.ssl.SSLServerSocket +import javax.security.auth.login.LoginException +import javax.security.sasl.Sasl + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hadoop.hive.metastore.HiveMetaStore +import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler +import org.apache.hadoop.hive.metastore.api.MetaException +import org.apache.hadoop.hive.shims.ShimLoader +import org.apache.hadoop.hive.thrift.{DBTokenStore, HadoopThriftAuthBridge} +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server.ServerMode +import org.apache.hadoop.security.{SecurityUtil, UserGroupInformation} +import org.apache.hadoop.security.authorize.ProxyUsers +import org.apache.thrift.TProcessorFactory +import org.apache.thrift.transport._ + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.ReflectionUtils +import org.apache.spark.sql.thriftserver.cli.SparkThriftServerSQLException +import org.apache.spark.sql.thriftserver.cli.thrift.ThriftCLIService + + +class HiveAuthFactory extends Logging { + + import HiveAuthFactory._ + + private var saslServer: HadoopThriftAuthBridge.Server = null + private var delegationTokenManager: ThriftserverDelegationTokenManager = null + private var authTypeStr: String = null + private var transportMode: String = null + private var conf: HiveConf = null + + + def this(hiveConf: HiveConf) { + this() + this.conf = hiveConf + transportMode = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE) + authTypeStr = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION) + + // In http mode we use NOSASL as the default auth type + if ("http".equalsIgnoreCase(transportMode)) { + if (authTypeStr == null) { + authTypeStr = NOSASL.getAuthName + } else { + if (authTypeStr == null) { + authTypeStr = NONE.getAuthName + } + if (authTypeStr.equalsIgnoreCase(KERBEROS.getAuthName)) { + val principal = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL) + val keytab = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB) + if (needUgiLogin(UserGroupInformation.getCurrentUser, + SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keytab)) { + saslServer = ShimLoader.getHadoopThriftAuthBridge.createServer(principal, keytab) + } else { // Using the default constructor to avoid unnecessary UGI login. + saslServer = new HadoopThriftAuthBridge.Server + } + + delegationTokenManager = new ThriftserverDelegationTokenManager() + // start delegation token manager + try { // rawStore is only necessary for DBTokenStore + var rawStore: Any = null + val tokenStoreClass = + conf.getVar(HiveConf.ConfVars.METASTORE_CLUSTER_DELEGATION_TOKEN_STORE_CLS) + if (tokenStoreClass == classOf[DBTokenStore].getName) { + val baseHandler: HMSHandler = + new HiveMetaStore.HMSHandler("new db based metaserver", conf, true) + rawStore = baseHandler.getMS + } + delegationTokenManager + .startDelegationTokenSecretManager(conf, rawStore, ServerMode.HIVESERVER2) + ReflectionUtils.setSuperField(saslServer, "secretManager", delegationTokenManager) + } catch { + case e@(_: MetaException | _: IOException) => + throw new TTransportException("Failed to start token manager", e) + } + } + } + } + } + + def getSaslProperties: util.HashMap[String, String] = { + val saslProps = new util.HashMap[String, String]; + val saslQOP = SaslQOP.fromString(conf.getVar(ConfVars.HIVE_SERVER2_THRIFT_SASL_QOP)) + saslProps.put(Sasl.QOP, saslQOP.toString) + saslProps.put(Sasl.SERVER_AUTH, "true") + saslProps + } + + @throws[LoginException] + def getAuthTransFactory: TTransportFactory = { + var transportFactory: TTransportFactory = null + if (authTypeStr.equalsIgnoreCase(KERBEROS.getAuthName)) { + try { + transportFactory = saslServer.createTransportFactory(getSaslProperties) + } catch { + case e: TTransportException => + throw new LoginException(e.getMessage) + } + } else if (authTypeStr.equalsIgnoreCase(NONE.getAuthName)) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) + } else if (authTypeStr.equalsIgnoreCase(LDAP.getAuthName)) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) + } else if (authTypeStr.equalsIgnoreCase(PAM.getAuthName)) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) + } else if (authTypeStr.equalsIgnoreCase(NOSASL.getAuthName)) { + transportFactory = new TTransportFactory() + } else if (authTypeStr.equalsIgnoreCase(CUSTOM.getAuthName)) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) + } else { + throw new LoginException("Unsupported authentication type " + authTypeStr) + } + transportFactory + } + + /** + * Returns the thrift processor factory for HiveServer2 running in binary mode + * + * @param service + * @return + * @throws LoginException + */ + @throws[LoginException] + def getAuthProcFactory(service: ThriftCLIService): TProcessorFactory = { + if (authTypeStr.equalsIgnoreCase(KERBEROS.getAuthName)) { + KerberosSaslHelper.getKerberosProcessorFactory(saslServer, service) + } else { + PlainSaslHelper.getPlainProcessorFactory(service) + } + } + + def getRemoteUser: String = { + if (saslServer == null) { + null + } else { + saslServer.getRemoteUser + } + } + + def getIpAddress: String = { + if (saslServer == null || saslServer.getRemoteAddress == null) { + null + } else { + saslServer.getRemoteAddress.getHostAddress + } + } + + + def getSocketTransport(host: String, port: Int, loginTimeout: Int): TSocket = { + new TSocket(host, port, loginTimeout) + } + + // retrieve delegation token for the given user + @throws[SparkThriftServerSQLException] + def getDelegationToken(owner: String, renewer: String, remoteAddr: String): String = { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException("Delegation token only supported " + + "over kerberos authentication", "08S01") + } + try { + val tokenStr = + delegationTokenManager.getDelegationTokenWithService( + owner, + renewer, + HS2_CLIENT_TOKEN, + remoteAddr) + if (tokenStr == null || tokenStr.isEmpty) { + throw new SparkThriftServerSQLException("Received empty retrieving " + + "delegation token for user " + owner, "08S01") + } + tokenStr + } catch { + case e: IOException => + throw new SparkThriftServerSQLException("Error retrieving " + + "delegation token for user " + owner, "08S01", e) + case e: InterruptedException => + throw new SparkThriftServerSQLException("delegation token retrieval interrupted", + "08S01", e) + } + } + + // cancel given delegation token + @throws[SparkThriftServerSQLException] + def cancelDelegationToken(delegationToken: String): Unit = { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException("Delegation token only supported " + + "over kerberos authentication", "08S01") + } + try { + delegationTokenManager.cancelDelegationToken(delegationToken) + } catch { + case e: IOException => + throw new SparkThriftServerSQLException("Error canceling delegation token " + + delegationToken, "08S01", e) + } + } + + @throws[SparkThriftServerSQLException] + def renewDelegationToken(delegationToken: String): Unit = { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException("Delegation token only supported " + + "over kerberos authentication", "08S01") + } + try { + delegationTokenManager.renewDelegationToken(delegationToken) + } catch { + case e: IOException => + throw new SparkThriftServerSQLException("Error renewing delegation token " + + delegationToken, "08S01", e) + } + } + + @throws[SparkThriftServerSQLException] + def getUserFromToken(delegationToken: String): String = { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException("Delegation token only supported over" + + " kerberos authentication", "08S01") + } + try { + delegationTokenManager.getUserFromToken(delegationToken) + } catch { + case e: IOException => + throw new SparkThriftServerSQLException("Error extracting user from delegation token " + + delegationToken, "08S01", e) + } + } + + +} + +object HiveAuthFactory extends Logging { + val HS2_PROXY_USER = "hive.server2.proxy.user" + val HS2_CLIENT_TOKEN = "hiveserver2ClientToken" + + private var keytabFile: Field = null + private var getKeytab: Method = null + + try { + val clz = classOf[UserGroupInformation] + try { + keytabFile = clz.getDeclaredField("keytabFile") + keytabFile.setAccessible(true); + } catch { + case nfe: NoSuchFieldError => + logDebug("Cannot find private field \"keytabFile\" in class: " + + classOf[UserGroupInformation].getCanonicalName, nfe) + keytabFile = null + } + + try { + getKeytab = clz.getDeclaredMethod("getKeytab") + getKeytab.setAccessible(true); + } catch { + case nme: NoSuchMethodError => + logDebug("Cannot find private method \"getKeytab\" in class:" + + classOf[UserGroupInformation].getCanonicalName, nme + ) + getKeytab = null + } + } catch { + case e: Throwable => + } + + @throws[SparkThriftServerSQLException] + def verifyProxyAccess(realUser: String, + proxyUser: String, + ipAddress: String, + hiveConf: HiveConf): Unit = { + try { + var sessionUgi: UserGroupInformation = null + if (UserGroupInformation.isSecurityEnabled) { + val kerbName = ShimLoader.getHadoopShims.getKerberosNameShim(realUser) + sessionUgi = + UserGroupInformation.createProxyUser(kerbName.getServiceName, + UserGroupInformation.getLoginUser) + } else { + sessionUgi = UserGroupInformation.createRemoteUser(realUser) + } + if (!proxyUser.equalsIgnoreCase(realUser)) { + ProxyUsers.refreshSuperUserGroupsConfiguration(hiveConf) + ProxyUsers.authorize(UserGroupInformation.createProxyUser(proxyUser, sessionUgi), + ipAddress, hiveConf) + } + } catch { + case e: IOException => + throw new SparkThriftServerSQLException("Failed to validate proxy privilege of " + + realUser + " for " + proxyUser, "08S01", e) + } + } + + @throws[TTransportException] + def getSSLSocket(host: String, port: Int, loginTimeout: Int): TTransport = { + TSSLTransportFactory.getClientSocket(host, port, loginTimeout) + } + + @throws[TTransportException] + def getSSLSocket(host: String, + port: Int, + loginTimeout: Int, + trustStorePath: String, + trustStorePassWord: String): TTransport = { + val params = new TSSLTransportFactory.TSSLTransportParameters() + params.setTrustStore(trustStorePath, trustStorePassWord) + params.requireClientAuth(true) + TSSLTransportFactory.getClientSocket(host, port, loginTimeout, params) + } + + @throws[TTransportException] + def getServerSocket(hiveHost: String, portNum: Int): TServerSocket = { + var serverAddress: InetSocketAddress = null + if (hiveHost == null || hiveHost.isEmpty) { // Wildcard bind + serverAddress = new InetSocketAddress(portNum) + } else { + serverAddress = new InetSocketAddress(hiveHost, portNum) + } + new TServerSocket(serverAddress) + } + + @throws[TTransportException] + @throws[UnknownHostException] + def getServerSSLSocket(hiveHost: String, + portNum: Int, + keyStorePath: String, + keyStorePassWord: String, + sslVersionBlacklist: util.List[String]): TServerSocket = { + val params: TSSLTransportFactory.TSSLTransportParameters = + new TSSLTransportFactory.TSSLTransportParameters() + params.setKeyStore(keyStorePath, keyStorePassWord) + var serverAddress: InetSocketAddress = null + if (hiveHost == null || hiveHost.isEmpty) { + serverAddress = new InetSocketAddress(portNum) + } else { + serverAddress = new InetSocketAddress(hiveHost, portNum) + } + val thriftServerSocket = + TSSLTransportFactory.getServerSocket(portNum, 0, serverAddress.getAddress, params) + if (thriftServerSocket.getServerSocket.isInstanceOf[SSLServerSocket]) { + val sslVersionBlacklistLocal = new util.ArrayList[String] + for (sslVersion <- sslVersionBlacklist.asScala) { + sslVersionBlacklistLocal.add(sslVersion.trim.toLowerCase(Locale.ROOT)) + } + val sslServerSocket = thriftServerSocket.getServerSocket.asInstanceOf[SSLServerSocket] + val enabledProtocols = new util.ArrayList[String] + for (protocol <- sslServerSocket.getEnabledProtocols) { + if (sslVersionBlacklistLocal.contains(protocol.toLowerCase(Locale.ROOT))) { + logDebug("Disabling SSL Protocol: " + protocol) + } else { + enabledProtocols.add(protocol) + } + } + sslServerSocket.setEnabledProtocols(enabledProtocols.toArray(new Array[String](0))) + logInfo("SSL Server Socket Enabled Protocols: " + + sslServerSocket.getEnabledProtocols.mkString(",")) + } + thriftServerSocket + } + + // Perform kerberos login using the hadoop shim API if the configuration is available + @throws[IOException] + def loginFromKeytab(hiveConf: HiveConf): Unit = { + val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL) + val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB) + if (principal.isEmpty || keyTabFile.isEmpty) { + throw new IOException("HiveServer2 Kerberos principal or keytab is not correctly configured") + } else { + UserGroupInformation + .loginUserFromKeytab(SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile) + } + } + + // Perform SPNEGO login using the hadoop shim API if the configuration is available + @throws[IOException] + def loginFromSpnegoKeytabAndReturnUGI(hiveConf: HiveConf): UserGroupInformation = { + val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL) + val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB) + if (principal.isEmpty || keyTabFile.isEmpty) { + throw new IOException("HiveServer2 SPNEGO principal or keytab is not correctly configured") + } else { + UserGroupInformation.loginUserFromKeytabAndReturnUGI( + SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile) + } + } + + def needUgiLogin(ugi: UserGroupInformation, principal: String, keytab: String): Boolean = { + null == ugi || + !ugi.hasKerberosCredentials || + !(ugi.getUserName == principal) || + !Objects.equals(keytab, getKeytabFromUgi) + } + + private def getKeytabFromUgi: String = classOf[UserGroupInformation].synchronized { + try { + if (keytabFile != null) { + keytabFile.get(null).asInstanceOf[String] + } else if (getKeytab != null) { + getKeytab.invoke(UserGroupInformation.getCurrentUser).asInstanceOf[String] + } else { + null + } + } catch { + case e: Exception => + logDebug("Fail to get keytabFile path via reflection", e) + null + } + + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala new file mode 100644 index 000000000000..8d867c71a44c --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala @@ -0,0 +1,193 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth + +import java.security.{AccessController, PrivilegedExceptionAction} +import java.util +import java.util.{Random, StringTokenizer} +import javax.security.auth.Subject + +import org.apache.commons.codec.binary.Base64 +import org.apache.commons.logging.LogFactory +import org.apache.hadoop.hive.shims.ShimLoader +import org.apache.http.protocol.{BasicHttpContext, HttpContext} +import org.ietf.jgss.{GSSContext, GSSManager, Oid} + +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * Utility functions for HTTP mode authentication. + */ +object HttpAuthUtils { + val WWW_AUTHENTICATE = "WWW-Authenticate" + val AUTHORIZATION = "Authorization" + val BASIC = "Basic" + val NEGOTIATE = "Negotiate" + private val LOG = LogFactory.getLog(classOf[HttpAuthUtils]) + private val COOKIE_ATTR_SEPARATOR = "&" + private val COOKIE_CLIENT_USER_NAME = "cu" + private val COOKIE_CLIENT_RAND_NUMBER = "rn" + private val COOKIE_KEY_VALUE_SEPARATOR = "=" + private val COOKIE_ATTRIBUTES = + new util.HashSet[String](util.Arrays.asList(COOKIE_CLIENT_USER_NAME, COOKIE_CLIENT_RAND_NUMBER)) + + /** + * @return Stringified Base64 encoded kerberosAuthHeader on success + * @throws Exception + */ + @throws[Exception] + def getKerberosServiceTicket(principal: String, + host: String, + serverHttpUrl: String, + assumeSubject: Boolean): String = { + val serverPrincipal = ShimLoader.getHadoopThriftAuthBridge.getServerPrincipal(principal, host) + if (assumeSubject) { // With this option, we're assuming that the external application, + // using the JDBC driver has done a JAAS kerberos login already + val context = AccessController.getContext + val subject = Subject.getSubject(context) + if (subject == null) throw new Exception("The Subject is not set") + Subject.doAs(subject, + new HttpAuthUtils.HttpKerberosClientAction(serverPrincipal, serverHttpUrl)) + } + else { // JAAS login from ticket cache to setup the client UserGroupInformation + val clientUGI = ShimLoader.getHadoopThriftAuthBridge.getCurrentUGIWithConf("kerberos") + clientUGI.doAs(new HttpAuthUtils.HttpKerberosClientAction(serverPrincipal, serverHttpUrl)) + } + } + + /** + * Creates and returns a HS2 cookie token. + * + * @param clientUserName Client User name. + * @return An unsigned cookie token generated from input parameters. + * The final cookie generated is of the following format : + * { @code cu=&rn=&s=} + */ + def createCookieToken(clientUserName: String): String = { + val sb = new StringBuffer + sb.append(COOKIE_CLIENT_USER_NAME) + .append(COOKIE_KEY_VALUE_SEPARATOR) + .append(clientUserName).append(COOKIE_ATTR_SEPARATOR) + sb.append(COOKIE_CLIENT_RAND_NUMBER) + .append(COOKIE_KEY_VALUE_SEPARATOR) + .append(new Random(System.currentTimeMillis).nextLong) + sb.toString + } + + /** + * Parses a cookie token to retrieve client user name. + * + * @param tokenStr Token String. + * @return A valid user name if input is of valid format, else returns null. + */ + def getUserNameFromCookieToken(tokenStr: String): String = { + val map = splitCookieToken(tokenStr) + if (!(map.keySet == COOKIE_ATTRIBUTES)) { + LOG.error("Invalid token with missing attributes " + tokenStr) + return null + } + map.get(COOKIE_CLIENT_USER_NAME) + } + + /** + * Splits the cookie token into attributes pairs. + * + * @param str input token. + * @return a map with the attribute pairs of the token if the input is valid. + * Else, returns null. + */ + private def splitCookieToken(tokenStr: String): util.Map[String, String] = { + val map = new util.HashMap[String, String] + val st = new StringTokenizer(tokenStr, COOKIE_ATTR_SEPARATOR) + while ( { + st.hasMoreTokens + }) { + val part = st.nextToken + val separator = part.indexOf(COOKIE_KEY_VALUE_SEPARATOR) + if (separator == -1) { + LOG.error("Invalid token string " + tokenStr) + return null + } + val key = part.substring(0, separator) + val value = part.substring(separator + 1) + map.put(key, value) + } + map + } + + /** + * We'll create an instance of this class within a doAs block so that the client's TGT credentials + * can be read from the Subject + */ + object HttpKerberosClientAction { + val HTTP_RESPONSE = "HTTP_RESPONSE" + val SERVER_HTTP_URL = "SERVER_HTTP_URL" + } + + class HttpKerberosClientAction(val serverPrincipal: String, + val serverHttpUrl: String) + extends PrivilegedExceptionAction[String] { + base64codec = new Base64(0) + httpContext = new BasicHttpContext + httpContext.setAttribute(HttpKerberosClientAction.SERVER_HTTP_URL, serverHttpUrl) + final private var base64codec: Base64 = null + final private var httpContext: HttpContext = null + + @throws[Exception] + override def run: String = { // This Oid for Kerberos GSS-API mechanism. + val mechOid = new Oid("1.2.840.113554.1.2.2") + // Oid for kerberos principal name + val krb5PrincipalOid = new Oid("1.2.840.113554.1.2.2.1") + val manager = GSSManager.getInstance + // GSS name for server + val serverName = manager.createName(serverPrincipal, krb5PrincipalOid) + // Create a GSSContext for authentication with the service. + // We're passing client credentials as null since we want them to be read from the Subject. + val gssContext = manager.createContext(serverName, mechOid, null, GSSContext.DEFAULT_LIFETIME) + gssContext.requestMutualAuth(false) + // Establish context + val inToken = new Array[Byte](0) + val outToken = gssContext.initSecContext(inToken, 0, inToken.length) + gssContext.dispose() + // Base64 encoded and stringified token for server + new String(base64codec.encode(outToken)) + } + } + +} + +final class HttpAuthUtils private() { + throw new UnsupportedOperationException("Can't initialize class") +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala new file mode 100644 index 000000000000..4eaa7b5e71f4 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth + +import java.io.IOException +import java.util +import javax.security.sasl.SaslException + +import org.apache.hadoop.hive.shims.ShimLoader +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge +import org.apache.thrift.{TProcessor, TProcessorFactory} +import org.apache.thrift.transport.{TSaslClientTransport, TTransport} + +import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIService, ThriftCLIService} + + +object KerberosSaslHelper { + + def getKerberosProcessorFactory( + saslServer: HadoopThriftAuthBridge.Server, + service: ThriftCLIService): KerberosSaslHelper.CLIServiceProcessorFactory = { + new KerberosSaslHelper.CLIServiceProcessorFactory(saslServer, service) + } + + @throws[SaslException] + def getKerberosTransport(principal: String, + host: String, + underlyingTransport: TTransport, + saslProps: util.Map[String, String], + assumeSubject: Boolean): TTransport = try { + val names = principal.split("[/@]") + if (names.length != 3) { + throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal) + } + if (assumeSubject) { + createSubjectAssumedTransport(principal, underlyingTransport, saslProps) + } else { + val authBridge = ShimLoader.getHadoopThriftAuthBridge.createClientWithConf("kerberos") + authBridge.createClientTransport(principal, host, "KERBEROS", + null, underlyingTransport, saslProps) + } + } catch { + case e: IOException => + throw new SaslException("Failed to open client transport", e) + } + + @throws[IOException] + def createSubjectAssumedTransport(principal: String, + underlyingTransport: TTransport, + saslProps: util.Map[String, String]): TTransport = { + val names = principal.split("[/@]") + try { + val saslTransport = + new TSaslClientTransport("GSSAPI", + null, + names(0), + names(1), + saslProps, + null, + underlyingTransport) + new TSubjectAssumingTransport(saslTransport) + } catch { + case se: SaslException => + throw new IOException("Could not instantiate SASL transport", se) + } + } + + @throws[SaslException] + def getTokenTransport(tokenStr: String, + host: String, + underlyingTransport: TTransport, + saslProps: util.Map[String, String]): TTransport = { + val authBridge = ShimLoader.getHadoopThriftAuthBridge.createClientWithConf("kerberos") + try { + authBridge.createClientTransport(null, host, "DIGEST", + tokenStr, underlyingTransport, saslProps) + } catch { + case e: IOException => + throw new SaslException("Failed to open client transport", e) + } + } + + + private[auth] class CLIServiceProcessorFactory(val saslServer: HadoopThriftAuthBridge.Server, + val service: ThriftCLIService) + extends TProcessorFactory(null) { + override def getProcessor(trans: TTransport): TProcessor = { + val sqlProcessor = new TCLIService.Processor[TCLIService.Iface](service) + saslServer.wrapNonAssumingProcessor(sqlProcessor) + } + } + +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala new file mode 100644 index 000000000000..3d87be31bdfe --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala @@ -0,0 +1,136 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth + +import java.io.IOException +import java.security.Security +import java.util +import javax.security.auth.callback._ +import javax.security.auth.login.LoginException +import javax.security.sasl.{AuthenticationException, AuthorizeCallback, SaslException} + +import org.apache.thrift.{TProcessor, TProcessorFactory} +import org.apache.thrift.transport.{TSaslClientTransport, TSaslServerTransport, TTransport, TTransportFactory} + +import org.apache.spark.sql.thriftserver.auth.AuthenticationProviderFactory.AuthMethods +import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService.Iface +import org.apache.spark.sql.thriftserver.cli.thrift.ThriftCLIService + + +object PlainSaslHelper { + + // Register Plain SASL server provider + try { + Security.addProvider(new PlainSaslServer.SaslPlainProvider) + } catch { + case e: Exception => + throw new UnsupportedOperationException("Can't initialize class") + } + + def getPlainProcessorFactory(service: ThriftCLIService): SQLPlainProcessorFactory = { + new SQLPlainProcessorFactory(service) + } + + @throws[LoginException] + def getPlainTransportFactory(authTypeStr: String): TTransportFactory = { + val saslFactory: TSaslServerTransport.Factory = new TSaslServerTransport.Factory() + try + saslFactory.addServerDefinition("PLAIN", + authTypeStr, + null, + new util.HashMap[String, String](), + new PlainServerCallbackHandler(authTypeStr)) + catch { + case e: AuthenticationException => + throw new LoginException("Error setting callback handler" + e) + } + saslFactory + } + + + @throws[SaslException] + def getPlainTransport(username: String, + password: String, + underlyingTransport: TTransport): TSaslClientTransport = { + new TSaslClientTransport("PLAIN", + null, + null, + null, + new util.HashMap[String, String](), + new PlainCallbackHandler(username, password), + underlyingTransport) + } +} + + +private class PlainServerCallbackHandler @throws[AuthenticationException] +(val authMethodStr: String) extends CallbackHandler { + final private var authMethod = AuthMethods.getValidAuthMethod(authMethodStr) + + @throws[IOException] + @throws[UnsupportedCallbackException] + def handle(callbacks: Array[Callback]): Unit = { + var username: String = null + var password: String = null + var ac: AuthorizeCallback = null + for (callback <- callbacks) { + if (callback.isInstanceOf[NameCallback]) { + val nc = callback.asInstanceOf[NameCallback] + username = nc.getName + } else if (callback.isInstanceOf[PasswordCallback]) { + val pc = callback.asInstanceOf[PasswordCallback] + password = new String(pc.getPassword) + } else if (callback.isInstanceOf[AuthorizeCallback]) { + ac = callback.asInstanceOf[AuthorizeCallback] + } else { + throw new UnsupportedCallbackException(callback) + } + } + val provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod) + provider.Authenticate(username, password) + if (ac != null) { + ac.setAuthorized(true) + } + } +} + + +class SQLPlainProcessorFactory(val service: ThriftCLIService) + extends TProcessorFactory(null) { + override def getProcessor(trans: TTransport): TProcessor = { + new TSetIpAddressProcessor[Iface](service) + } +} + +class PlainCallbackHandler(val username: String, val password: String) extends CallbackHandler { + @throws[IOException] + @throws[UnsupportedCallbackException] + def handle(callbacks: Array[Callback]): Unit = { + for (callback <- callbacks) { + if (callback.isInstanceOf[NameCallback]) { + val nameCallback = callback.asInstanceOf[NameCallback] + nameCallback.setName(username) + } + else if (callback.isInstanceOf[PasswordCallback]) { + val passCallback = callback.asInstanceOf[PasswordCallback] + passCallback.setPassword(password.toCharArray) + } + else throw new UnsupportedCallbackException(callback) + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala new file mode 100644 index 000000000000..1b1a3a67365a --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala @@ -0,0 +1,94 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth + +import org.apache.thrift.TException +import org.apache.thrift.protocol.TProtocol +import org.apache.thrift.transport.{TSaslClientTransport, TSaslServerTransport, TSocket, TTransport} + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService +import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService.Iface + +/** + * This class is responsible for setting the ipAddress for operations executed via HiveServer2. + * + * - IP address is only set for operations that calls listeners with hookContext + * - IP address is only set if the underlying transport mechanism is socket + * + * @see org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext + */ +object TSetIpAddressProcessor extends Logging { + + private val THREAD_LOCAL_IP_ADDRESS = new ThreadLocal[String]() { + override protected def initialValue: String = null + } + private val THREAD_LOCAL_USER_NAME = new ThreadLocal[String]() { + override protected def initialValue: String = null + } + + def getUserIpAddress: String = THREAD_LOCAL_IP_ADDRESS.get + + def getUserName: String = THREAD_LOCAL_USER_NAME.get +} + +class TSetIpAddressProcessor[I <: Iface](val iface: Iface) + extends TCLIService.Processor[Iface](iface) + with Logging { + @throws[TException] + override def process(in: TProtocol, out: TProtocol): Boolean = { + setIpAddress(in) + setUserName(in) + try + super.process(in, out) + finally { + TSetIpAddressProcessor.THREAD_LOCAL_USER_NAME.remove() + TSetIpAddressProcessor.THREAD_LOCAL_IP_ADDRESS.remove() + } + } + + private def setUserName(in: TProtocol): Unit = { + val transport: TTransport = in.getTransport + transport match { + case transport1: TSaslServerTransport => + val userName = transport1.getSaslServer.getAuthorizationID + TSetIpAddressProcessor.THREAD_LOCAL_USER_NAME.set(userName) + case _ => + } + } + + protected def setIpAddress(in: TProtocol): Unit = { + val transport: TTransport = in.getTransport + val tSocket = getUnderlyingSocketFromTransport(transport) + if (tSocket == null) { + logWarning("Unknown Transport, cannot determine ipAddress") + } else { + TSetIpAddressProcessor.THREAD_LOCAL_IP_ADDRESS + .set(tSocket.getSocket.getInetAddress.getHostAddress) + } + } + + private def getUnderlyingSocketFromTransport(transport: TTransport): TSocket = transport match { + case t: TSaslServerTransport => getUnderlyingSocketFromTransport(t.getUnderlyingTransport) + case t: TSaslClientTransport => getUnderlyingSocketFromTransport(t.getUnderlyingTransport) + case t: TSocket => t + case _ => null + } + +} + diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala new file mode 100644 index 000000000000..c835ebfb3050 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth + +import java.io.IOException +import java.security.PrivilegedExceptionAction + +import org.apache.commons.lang.StringUtils +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.shims.Utils +import org.apache.hadoop.hive.thrift._ +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server +import org.apache.hadoop.security.UserGroupInformation +import org.apache.hadoop.security.authorize.ProxyUsers +import org.apache.hadoop.util.ReflectionUtils + +object ThriftserverDelegationTokenManager { + val DELEGATION_TOKEN_GC_INTERVAL = "hive.cluster.delegation.token.gc-interval" + val DELEGATION_TOKEN_GC_INTERVAL_DEFAULT = 3600000 // 1 hour + + // Delegation token related keys + val DELEGATION_KEY_UPDATE_INTERVAL_KEY = "hive.cluster.delegation.key.update-interval" + val DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT: Long = 24 * 60 * 60 * 1000 // 1 day + + val DELEGATION_TOKEN_RENEW_INTERVAL_KEY = "hive.cluster.delegation.token.renew-interval" + val DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT: Long = 24 * 60 * 60 * 1000 + val DELEGATION_TOKEN_MAX_LIFETIME_KEY = "hive.cluster.delegation.token.max-lifetime" + val DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT: Long = 7 * 24 * 60 * 60 * 1000 // 7 days + + val DELEGATION_TOKEN_STORE_CLS = "hive.cluster.delegation.token.store.class" + val DELEGATION_TOKEN_STORE_ZK_CONNECT_STR = + "hive.cluster.delegation.token.store.zookeeper.connectString" + // Alternate connect string specification configuration + val DELEGATION_TOKEN_STORE_ZK_CONNECT_STR_ALTERNATE = "hive.zookeeper.quorum" + + val DELEGATION_TOKEN_STORE_ZK_CONNECT_TIMEOUTMILLIS = + "hive.cluster.delegation.token.store.zookeeper.connectTimeoutMillis" + val DELEGATION_TOKEN_STORE_ZK_ZNODE = "hive.cluster.delegation.token.store.zookeeper.znode" + val DELEGATION_TOKEN_STORE_ZK_ACL = "hive.cluster.delegation.token.store.zookeeper.acl" + val DELEGATION_TOKEN_STORE_ZK_ZNODE_DEFAULT = "/hivedelegation" +} + +class ThriftserverDelegationTokenManager { + + import ThriftserverDelegationTokenManager._ + + protected var secretManager: DelegationTokenSecretManager = null + + def getSecretManager: DelegationTokenSecretManager = secretManager + + @throws[IOException] + def startDelegationTokenSecretManager(conf: HiveConf, + hms: Any, + smode: Server.ServerMode): Unit = { + val secretKeyInterval = + conf.getLong(DELEGATION_KEY_UPDATE_INTERVAL_KEY, + DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT) + val tokenMaxLifetime = + conf.getLong(DELEGATION_TOKEN_MAX_LIFETIME_KEY, + DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT) + val tokenRenewInterval = + conf.getLong(DELEGATION_TOKEN_RENEW_INTERVAL_KEY, + DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT) + val tokenGcInterval = + conf.getLong(DELEGATION_TOKEN_GC_INTERVAL, + DELEGATION_TOKEN_GC_INTERVAL_DEFAULT) + val dts: DelegationTokenStore = getTokenStore(conf) + dts.setConf(conf) + dts.init(hms, smode) + secretManager = + new TokenStoreDelegationTokenSecretManager( + secretKeyInterval, + tokenMaxLifetime, + tokenRenewInterval, + tokenGcInterval, + dts) + secretManager.startThreads + } + + @throws[IOException] + @throws[InterruptedException] + def getDelegationToken(owner: String, renewer: String, remoteAddr: String): String = { + /** + * If the user asking the token is same as the 'owner' then don't do + * any proxy authorization checks. For cases like oozie, where it gets + * a delegation token for another user, we need to make sure oozie is + * authorized to get a delegation token. + */ + // Do all checks on short names + val currUser = UserGroupInformation.getCurrentUser + var ownerUgi = UserGroupInformation.createRemoteUser(owner) + if (!(ownerUgi.getShortUserName == currUser.getShortUserName)) { + // in the case of proxy users, the getCurrentUser will return the + // real user (for e.g. oozie) due to the doAs that happened just before the + // server started executing the method getDelegationToken in the MetaStore + ownerUgi = UserGroupInformation.createProxyUser(owner, UserGroupInformation.getCurrentUser) + ProxyUsers.authorize(ownerUgi, remoteAddr, null) + } + ownerUgi.doAs(new PrivilegedExceptionAction[String]() { + @throws[IOException] + override def run: String = return secretManager.getDelegationToken(renewer) + }) + } + + @throws[IOException] + @throws[InterruptedException] + def getDelegationTokenWithService(owner: String, + renewer: String, + service: String, + remoteAddr: String): String = { + val token = getDelegationToken(owner, renewer, remoteAddr) + Utils.addServiceToToken(token, service) + } + + @throws[IOException] + def renewDelegationToken(tokenStrForm: String): Long = + secretManager.renewDelegationToken(tokenStrForm) + + @throws[IOException] + def getUserFromToken(tokenStr: String): String = secretManager.getUserFromToken(tokenStr) + + @throws[IOException] + def cancelDelegationToken(tokenStrForm: String): Unit = { + secretManager.cancelDelegationToken(tokenStrForm) + } + + @throws[IOException] + private def getTokenStore(conf: Configuration): DelegationTokenStore = { + val tokenStoreClassName = conf.get(DELEGATION_TOKEN_STORE_CLS, "") + if (StringUtils.isBlank(tokenStoreClassName)) { + return new MemoryTokenStore + } + try { + val storeClass = org.apache.spark.util.Utils.classForName(tokenStoreClassName) + .asSubclass(classOf[DelegationTokenStore]) + ReflectionUtils.newInstance(storeClass, conf) + } catch { + case e: ClassNotFoundException => + throw new IOException("Error initializing delegation token store: " + + tokenStoreClassName, e) + } + } + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala new file mode 100644 index 000000000000..61ee223c7ee8 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -0,0 +1,482 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.io.IOException +import java.util.concurrent.{CancellationException, ExecutionException, TimeoutException, TimeUnit} +import javax.security.auth.login.LoginException + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hadoop.hive.ql.metadata.{Hive, HiveException} +import org.apache.hadoop.hive.shims.Utils +import org.apache.hadoop.security.{SecurityUtil, UserGroupInformation} + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.thriftserver.{CompositeService, ServiceException} +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli.operation.Operation +import org.apache.spark.sql.thriftserver.cli.session.SessionManager +import org.apache.spark.sql.thriftserver.cli.thrift._ +import org.apache.spark.sql.thriftserver.server.SparkThriftServer +import org.apache.spark.sql.types.StructType + +class CLIService(hiveServer2: SparkThriftServer, sqlContext: SQLContext) + extends CompositeService(classOf[CLIService].getSimpleName) + with ICLIService with Logging { + + import CLIService._ + + private var hiveConf: HiveConf = null + private var sessionManager: SessionManager = null + private var serviceUGI: UserGroupInformation = null + private var httpUGI: UserGroupInformation = null + + override def init(hiveConf: HiveConf): Unit = { + this.hiveConf = hiveConf + sessionManager = new SessionManager(hiveServer2, sqlContext) + addService(sessionManager) + + if (UserGroupInformation.isSecurityEnabled) { + try { + val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL) + val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB) + if (principal.isEmpty || keyTabFile.isEmpty) { + throw new IOException( + "HiveServer2 Kerberos principal or keytab is not correctly configured") + } + val originalUgi = UserGroupInformation.getCurrentUser + serviceUGI = + if (HiveAuthFactory.needUgiLogin(originalUgi, + SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile)) { + HiveAuthFactory.loginFromKeytab(hiveConf) + Utils.getUGI() + } else { + originalUgi + } + } catch { + case e@(_: IOException | _: LoginException) => + throw new ServiceException("Unable to login to kerberos with given principal/keytab", e) + } + + // Try creating spnego UGI if it is configured. + val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL).trim + val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB).trim + if (principal.nonEmpty && keyTabFile.nonEmpty) { + try { + httpUGI = HiveAuthFactory.loginFromSpnegoKeytabAndReturnUGI(hiveConf) + } catch { + case e: IOException => + throw new ServiceException("Unable to login to spnego with given principal " + + s"$principal and keytab $keyTabFile: $e", e) + } + } + } + + super.init(hiveConf) + } + + override def start(): Unit = { + super.start() + } + + def getServiceUGI: UserGroupInformation = this.serviceUGI + + def getHttpUGI: UserGroupInformation = this.httpUGI + + def openSession(protocol: TProtocolVersion, + username: String, + password: String, + configuration: Predef.Map[String, String]): SessionHandle = { + val sessionHandle: SessionHandle = + sessionManager.openSession(protocol, + username, + password, + null, + configuration, + false, + null) + logDebug(sessionHandle + ": openSession()") + sessionHandle + } + + def openSession(protocol: TProtocolVersion, + username: String, + password: String, + ipAddress: String, + configuration: Predef.Map[String, String]): SessionHandle = { + val sessionHandle = + sessionManager.openSession(protocol, + username, + password, + ipAddress, + configuration, + false, + null) + logDebug(sessionHandle + ": openSession()") + sessionHandle + } + + def openSessionWithImpersonation(protocol: TProtocolVersion, + username: String, + password: String, + configuration: Predef.Map[String, String], + delegationToken: String): SessionHandle = { + val sessionHandle = + sessionManager.openSession(protocol, + username, + password, + null, + configuration, + true, + delegationToken) + logDebug(sessionHandle + ": openSessionWithImpersonation()") + sessionHandle + } + + def openSessionWithImpersonation(protocol: TProtocolVersion, + username: String, + password: String, + ipAddress: String, + configuration: Predef.Map[String, String], + delegationToken: String): SessionHandle = { + val sessionHandle = + sessionManager.openSession(protocol, + username, + password, + ipAddress, + configuration, + true, + delegationToken) + logDebug(sessionHandle + ": openSessionWithImpersonation()") + sessionHandle + } + + override def openSession(username: String, + password: String, + configuration: Predef.Map[String, String]): SessionHandle = { + val sessionHandle = + sessionManager.openSession( + SERVER_VERSION, + username, + password, + null, + configuration, + false, + null) + logDebug(sessionHandle + ": openSession()") + sessionHandle + } + + override def openSessionWithImpersonation(username: String, + password: String, + configuration: Predef.Map[String, String], + delegationToken: String): SessionHandle = { + val sessionHandle = + sessionManager.openSession(SERVER_VERSION, + username, + password, + null, + configuration, + true, + delegationToken) + logDebug(sessionHandle + ": openSessionWithImpersonation()") + sessionHandle + } + + override def closeSession(sessionHandle: SessionHandle): Unit = { + sessionManager.closeSession(sessionHandle) + logDebug(sessionHandle + ": closeSession()") + } + + + override def getInfo(sessionHandle: SessionHandle, + infoType: GetInfoType): GetInfoValue = { + val infoValue = sessionManager.getSession(sessionHandle).getInfo(infoType) + logDebug(sessionHandle + ": getInfo()") + infoValue + } + + override def executeStatement(sessionHandle: SessionHandle, + statement: String, + confOverlay: Predef.Map[String, String]): OperationHandle = { + val session = sessionManager.getSession(sessionHandle) + val opHandle: OperationHandle = session.executeStatement(statement, confOverlay) + logDebug(sessionHandle + ": executeStatement()") + opHandle + } + + override def executeStatementAsync(sessionHandle: SessionHandle, + statement: String, + confOverlay: Predef.Map[String, String]): OperationHandle = { + val opHandle: OperationHandle = + sessionManager.getSession(sessionHandle) + .executeStatementAsync(statement, confOverlay) + logDebug(sessionHandle + ": executeStatementAsync()") + opHandle + } + + override def getTypeInfo(sessionHandle: SessionHandle): OperationHandle = { + val opHandle: OperationHandle = sessionManager.getSession(sessionHandle).getTypeInfo + logDebug(sessionHandle + ": getTypeInfo()") + opHandle + } + + override def getCatalogs(sessionHandle: SessionHandle): OperationHandle = { + val opHandle: OperationHandle = sessionManager.getSession(sessionHandle).getTypeInfo + logDebug(sessionHandle + ": getTypeInfo()") + opHandle + } + + + override def getSchemas(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String): OperationHandle = { + val opHandle: OperationHandle = + sessionManager.getSession(sessionHandle) + .getSchemas(catalogName, schemaName) + logDebug(sessionHandle + ": getSchemas()") + opHandle + } + + override def getTables(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + tableName: String, + tableTypes: List[String]): OperationHandle = { + val opHandle: OperationHandle = + sessionManager.getSession(sessionHandle) + .getTables(catalogName, schemaName, tableName, tableTypes) + logDebug(sessionHandle + ": getTables()") + opHandle + } + + + override def getTableTypes(sessionHandle: SessionHandle): OperationHandle = { + val opHandle: OperationHandle = sessionManager.getSession(sessionHandle).getTableTypes + logDebug(sessionHandle + ": getTableTypes()") + opHandle + } + + override def getColumns(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + tableName: String, + columnName: String): OperationHandle = { + val opHandle: OperationHandle = + sessionManager.getSession(sessionHandle) + .getColumns(catalogName, schemaName, tableName, columnName) + logDebug(sessionHandle + ": getColumns()") + opHandle + } + + + override def getFunctions(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + functionName: String): OperationHandle = { + val opHandle: OperationHandle = + sessionManager.getSession(sessionHandle) + .getFunctions(catalogName, schemaName, functionName) + logDebug(sessionHandle + ": getFunctions()") + opHandle + } + + @throws[SparkThriftServerSQLException] + override def getPrimaryKeys(sessionHandle: SessionHandle, + catalog: String, + schema: String, + table: String): OperationHandle = { + val opHandle = sessionManager.getSession(sessionHandle).getPrimaryKeys(catalog, schema, table) + logDebug(sessionHandle + ": getPrimaryKeys()") + opHandle + } + + @throws[SparkThriftServerSQLException] + override def getCrossReference(sessionHandle: SessionHandle, + primaryCatalog: String, + primarySchema: String, + primaryTable: String, + foreignCatalog: String, + foreignSchema: String, + foreignTable: String): OperationHandle = { + val opHandle = sessionManager.getSession(sessionHandle) + .getCrossReference(primaryCatalog, + primarySchema, + primaryTable, + foreignCatalog, + foreignSchema, + foreignTable) + logDebug(sessionHandle + ": getCrossReference()") + opHandle + } + + override def getOperationStatus(opHandle: OperationHandle): OperationStatus = { + val operation = sessionManager.getOperationManager.getOperation(opHandle) + + /* + * If this is a background operation run asynchronously, + * we block for a configured duration, before we return + * (duration: HIVE_SERVER2_LONG_POLLING_TIMEOUT). + * However, if the background operation is complete, we return immediately. + */ + if (operation.shouldRunAsync) { + val conf = operation.getParentSession.getHiveConf + val timeout = + HiveConf.getTimeVar(conf, + HiveConf.ConfVars.HIVE_SERVER2_LONG_POLLING_TIMEOUT, + TimeUnit.MILLISECONDS) + try + operation.getBackgroundHandle.get(timeout, TimeUnit.MILLISECONDS) + catch { + case e: TimeoutException => + // No Op, return to the caller since long polling timeout has expired + logTrace(opHandle + ": Long polling timed out") + case e: CancellationException => + // The background operation thread was cancelled + logTrace(opHandle + ": The background operation was cancelled", e) + case e: ExecutionException => + // The background operation thread was aborted + logTrace(opHandle + ": The background operation was aborted", e) + case e: InterruptedException => + + // No op, this thread was interrupted + // In this case, the call might return sooner than long polling timeout + } + } + val opStatus = operation.getStatus + logDebug(opHandle + ": getOperationStatus()") + opStatus + } + + override def getQueryId(opHandle: TOperationHandle): String = { + val operation: Operation = + sessionManager.getOperationManager.getOperation(new OperationHandle(opHandle)) + val queryId = operation.statementId + logDebug(opHandle + ": getQueryId() " + queryId) + return queryId + } + + override def cancelOperation(opHandle: OperationHandle): Unit = { + sessionManager.getOperationManager + .getOperation(opHandle) + .getParentSession + .cancelOperation(opHandle) + logDebug(opHandle + ": cancelOperation()") + } + + override def closeOperation(opHandle: OperationHandle): Unit = { + sessionManager.getOperationManager + .getOperation(opHandle) + .getParentSession + .closeOperation(opHandle) + logDebug(opHandle + ": closeOperation") + } + + override def getResultSetMetadata(opHandle: OperationHandle): StructType = { + val tableSchema = sessionManager + .getOperationManager + .getOperation(opHandle) + .getParentSession + .getResultSetMetadata(opHandle) + logDebug(opHandle + ": getResultSetMetadata()") + tableSchema + } + + override def fetchResults(opHandle: OperationHandle): RowSet = { + fetchResults(opHandle, + Operation.DEFAULT_FETCH_ORIENTATION, + Operation.DEFAULT_FETCH_MAX_ROWS, + FetchType.QUERY_OUTPUT) + } + + override def fetchResults(opHandle: OperationHandle, + orientation: FetchOrientation, + maxRows: Long, + fetchType: FetchType): RowSet = { + val rowSet: RowSet = sessionManager + .getOperationManager + .getOperation(opHandle) + .getParentSession + .fetchResults(opHandle, orientation, maxRows, fetchType) + logDebug(opHandle + ": fetchResults()") + rowSet + } + + // obtain delegation token for the give user from metastore + @throws[SparkThriftServerSQLException] + @throws[UnsupportedOperationException] + @throws[LoginException] + @throws[IOException] + def getDelegationTokenFromMetaStore(owner: String): String = { + if (!hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL) || + !hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)) { + throw new UnsupportedOperationException("delegation token is can only " + + "be obtained for a secure remote metastore") + } + try { + Hive.closeCurrent() + Hive.get(hiveConf).getDelegationToken(owner, owner) + } catch { + case e: HiveException => + if (e.getCause.isInstanceOf[UnsupportedOperationException]) { + throw e.getCause.asInstanceOf[UnsupportedOperationException] + } else { + throw new SparkThriftServerSQLException("Error connect metastore to " + + "setup impersonation", e) + } + } + } + + + @throws[SparkThriftServerSQLException] + override def getDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + owner: String, + renewer: String, + remoteAddr: String): String = { + val delegationToken = sessionManager.getSession(sessionHandle) + .getDelegationToken(authFactory, owner, renewer, remoteAddr) + logInfo(sessionHandle + ": getDelegationToken()") + delegationToken + } + + @throws[SparkThriftServerSQLException] + override def cancelDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit = { + sessionManager.getSession(sessionHandle).cancelDelegationToken(authFactory, tokenStr) + logInfo(sessionHandle + ": cancelDelegationToken()") + } + + @throws[SparkThriftServerSQLException] + override def renewDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit = { + sessionManager.getSession(sessionHandle).renewDelegationToken(authFactory, tokenStr) + logInfo(sessionHandle + ": renewDelegationToken()") + } + + def getSessionManager: SessionManager = sessionManager +} + +object CLIService { + val protocols: Array[TProtocolVersion] = TProtocolVersion.values() + val SERVER_VERSION: TProtocolVersion = protocols(protocols.length - 1) +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala new file mode 100644 index 000000000000..c741cbd21395 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -0,0 +1,153 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.nio.ByteBuffer +import java.util.BitSet + +import scala.collection.JavaConverters._ +import scala.collection.mutable.ArrayBuffer + +import org.apache.spark.sql.Row +import org.apache.spark.sql.execution.HiveResult +import org.apache.spark.sql.thriftserver.cli.thrift._ +import org.apache.spark.sql.types.{BinaryType, _} + +case class ColumnBasedSet(types: StructType, + rows: ArrayBuffer[Row], + initStartOffset: Long) + extends RowSet { + + var startOffset: Long = initStartOffset + + import ColumnBasedSet._ + + override def toTRowSet: TRowSet = { + val tRowSet = new TRowSet(startOffset, Seq[TRow]().asJava) + if (rows != null) { + (0 until types.length).map(i => { + toTColumn(i, types(i).dataType) + } + ).foreach(tRowSet.addToColumns) + } + tRowSet + } + + private[this] def toTColumn(ordinal: Int, typ: DataType): TColumn = { + val nulls = new BitSet() + typ match { + case BooleanType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) true else rows(i).getBoolean(ordinal) + }.map(_.asInstanceOf[java.lang.Boolean]).asJava + TColumn.boolVal(new TBoolColumn(values, bitSetToBuffer(nulls))) + case ByteType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) 0.toByte else rows(i).getByte(ordinal) + }.map(_.asInstanceOf[java.lang.Byte]).asJava + TColumn.byteVal(new TByteColumn(values, bitSetToBuffer(nulls))) + case ShortType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) 0.toShort else rows(i).getShort(ordinal) + }.map(_.asInstanceOf[java.lang.Short]).asJava + TColumn.i16Val(new TI16Column(values, bitSetToBuffer(nulls))) + case IntegerType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) 0 else rows(i).getInt(ordinal) + }.map(_.asInstanceOf[java.lang.Integer]).asJava + TColumn.i32Val(new TI32Column(values, bitSetToBuffer(nulls))) + case LongType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) 0 else rows(i).getLong(ordinal) + }.map(_.asInstanceOf[java.lang.Long]).asJava + TColumn.i64Val(new TI64Column(values, bitSetToBuffer(nulls))) + case FloatType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) 0 else rows(i).getFloat(ordinal) + }.map(_.toDouble.asInstanceOf[java.lang.Double]).asJava + TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) + case DoubleType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) 0 else rows(i).getDouble(ordinal) + }.map(_.asInstanceOf[java.lang.Double]).asJava + TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) + case StringType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) EMPTY_STRING else rows(i).getString(ordinal) + }.asJava + TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) + case BinaryType => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) { + EMPTY_BINARY + } else { + ByteBuffer.wrap(rows(i).getAs[Array[Byte]](ordinal)) + } + }.asJava + TColumn.binaryVal(new TBinaryColumn(values, bitSetToBuffer(nulls))) + case _ => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) { + EMPTY_STRING + } else { + HiveResult.toHiveString((rows(i).get(ordinal), typ)) + } + }.asJava + TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) + } + } + + private[this] def bitSetToBuffer(bitSet: BitSet): ByteBuffer = ByteBuffer.wrap(bitSet.toByteArray) + + override def addRow(row: Row): RowSet = { + rows.+=(row) + this + } + + override def extractSubset(maxRows: Int): RowSet = { + val numRows = Math.min(rows.size, maxRows) + val result = new ColumnBasedSet(types, rows.slice(0, numRows), startOffset) + rows.remove(0, numRows) + startOffset += numRows + return result + } + + override def numColumns: Int = types.size + + override def numRows: Int = rows.size + + override def getStartOffset: Long = startOffset + + override def setStartOffset(startOffset: Long): Unit = this.startOffset = startOffset + +} + +object ColumnBasedSet { + private val EMPTY_STRING = "" + private val EMPTY_BINARY = ByteBuffer.allocate(0) +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala new file mode 100644 index 000000000000..0e6756da631c --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.TColumnDesc +import org.apache.spark.sql.types.StructField + +/** + * A wrapper class for Spark's [[StructField]] with a column position, + * and can be transform to [[TColumnDesc]] + */ +case class ColumnDescriptor(field: StructField, pos: Int) { + /** + * Transform a [[ColumnDescriptor]] to a [[TColumnDesc]] instance. + */ + def toTColumnDesc: TColumnDesc = { + val tColumnDesc = new TColumnDesc + if (field != null) { + tColumnDesc.setColumnName(field.name) + tColumnDesc.setComment(field.getComment().getOrElse("")) + tColumnDesc.setTypeDesc(TypeDescriptor(field.dataType).toTTypeDesc) + } + tColumnDesc.setPosition(pos) + tColumnDesc + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala new file mode 100644 index 000000000000..3ee326f7d42b --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation + +trait FetchOrientation { + def toTFetchOrientation: TFetchOrientation +} + +object FetchOrientation { + + case object FETCH_NEXT extends FetchOrientation { + override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_NEXT + } + + case object FETCH_PRIOR extends FetchOrientation { + override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_PRIOR + } + + case object FETCH_RELATIVE extends FetchOrientation { + override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_RELATIVE + } + + case object FETCH_ABSOLUTE extends FetchOrientation { + override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_ABSOLUTE + } + + case object FETCH_FIRST extends FetchOrientation { + override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_FIRST + } + + case object FETCH_LAST extends FetchOrientation { + override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_LAST + } + + def getFetchOrientation(tFetchOrientation: TFetchOrientation): FetchOrientation = + tFetchOrientation match { + case FETCH_FIRST.toTFetchOrientation => FETCH_FIRST + case _ => FETCH_NEXT + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala new file mode 100644 index 000000000000..05a8fb4dbd44 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +trait FetchType { + def toTFetchType: Short +} + +object FetchType { + + case object QUERY_OUTPUT extends FetchType { + override val toTFetchType: Short = 0 + } + + case object LOG extends FetchType { + override val toTFetchType: Short = 1 + } + + def getFetchType(tFetchType: Short): FetchType = tFetchType match { + case LOG.toTFetchType => LOG + case _ => QUERY_OUTPUT + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala new file mode 100644 index 000000000000..1416b845257e --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier + + +abstract class Handle(val handleId: HandleIdentifier) { + def this() = this(new HandleIdentifier()) + + def this(tHandleIdentifier: THandleIdentifier) = this(new HandleIdentifier(tHandleIdentifier)) + + def getHandleIdentifier: HandleIdentifier = handleId + + override def hashCode: Int = { + val prime = 31 + var result = 1 + result = prime * result + (if (handleId == null) 0 else handleId.hashCode) + result + } + + override def equals(obj: Any): Boolean = { + if (obj == null) { + return false + } + + if (!obj.isInstanceOf[Handle]) { + return false + } + + val other = obj.asInstanceOf[Handle] + if (this eq other) { + return true + } + + if (handleId == null) { + if (other.handleId != null) { + return false + } + } else if (handleId != other.handleId) { + return false + } + + true + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala new file mode 100644 index 000000000000..bdef1031131a --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.nio.ByteBuffer +import java.util.UUID + +import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier + +class HandleIdentifier(val publicId: UUID, val secretId: UUID) { + + def this() = this(UUID.randomUUID(), UUID.randomUUID()) + + def this(guid: ByteBuffer, secret: ByteBuffer) = + this(Option(guid).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID()), + Option(secret).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID())) + + def this(tHandleId: THandleIdentifier) = + this(ByteBuffer.wrap(tHandleId.getGuid), ByteBuffer.wrap(tHandleId.getSecret)) + + def getPublicId: UUID = this.publicId + + def getSecretId: UUID = this.secretId + + def toTHandleIdentifier: THandleIdentifier = { + val guid = new Array[Byte](16) + val gBuff = ByteBuffer.wrap(guid) + val secret = new Array[Byte](16) + val sBuff = ByteBuffer.wrap(secret) + gBuff.putLong(publicId.getMostSignificantBits) + gBuff.putLong(publicId.getLeastSignificantBits) + sBuff.putLong(secretId.getMostSignificantBits) + sBuff.putLong(secretId.getLeastSignificantBits) + new THandleIdentifier(ByteBuffer.wrap(guid), ByteBuffer.wrap(secret)) + } + + override def hashCode: Int = { + val prime = 31 + var result = 1 + result = prime * result + (if (publicId == null) 0 else publicId.hashCode) + result = prime * result + (if (secretId == null) 0 else secretId.hashCode) + result + } + + override def equals(obj: Any): Boolean = { + if (obj == null) return false + if (!obj.isInstanceOf[HandleIdentifier]) return false + + val other = obj.asInstanceOf[HandleIdentifier] + if (this eq other) return true + + if (publicId == null) { + if (other.publicId != null) { + return false + } + } else if (!(publicId == other.publicId)) { + return false + } + + if (secretId == null) { + if (other.secretId != null) { + return false + } + } else if (!(secretId == other.secretId)) { + return false + } + true + } + + override def toString: String = Option(publicId).map(_.toString).getOrElse("") +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala new file mode 100644 index 000000000000..9eaf7e5ac04c --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala @@ -0,0 +1,147 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli.thrift.{TGetQueryIdReq, TGetQueryIdResp, TSetClientInfoReq, TSetClientInfoResp} +import org.apache.spark.sql.types.StructType + + +trait ICLIService { + + @throws[SparkThriftServerSQLException] + def openSession(username: String, + password: String, + configuration: Map[String, String]): SessionHandle + + @throws[SparkThriftServerSQLException] + def openSessionWithImpersonation(username: String, + password: String, + configuration: Map[String, String], + delegationToken: String): SessionHandle + + @throws[SparkThriftServerSQLException] + def closeSession(sessionHandle: SessionHandle): Unit + + @throws[SparkThriftServerSQLException] + def getInfo(sessionHandle: SessionHandle, + infoType: GetInfoType): GetInfoValue + + @throws[SparkThriftServerSQLException] + def executeStatement(sessionHandle: SessionHandle, + statement: String, + confOverlay: Map[String, String]): OperationHandle + + @throws[SparkThriftServerSQLException] + def executeStatementAsync(sessionHandle: SessionHandle, + statement: String, + confOverlay: Map[String, String]): OperationHandle + + @throws[SparkThriftServerSQLException] + def getTypeInfo(sessionHandle: SessionHandle): OperationHandle + + @throws[SparkThriftServerSQLException] + def getCatalogs(sessionHandle: SessionHandle): OperationHandle + + @throws[SparkThriftServerSQLException] + def getSchemas(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String): OperationHandle + + @throws[SparkThriftServerSQLException] + def getTables(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + tableName: String, + tableTypes: List[String]): OperationHandle + + @throws[SparkThriftServerSQLException] + def getTableTypes(sessionHandle: SessionHandle): OperationHandle + + @throws[SparkThriftServerSQLException] + def getColumns(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + tableName: String, + columnName: String): OperationHandle + + @throws[SparkThriftServerSQLException] + def getFunctions(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + functionName: String): OperationHandle + + @throws[SparkThriftServerSQLException] + def getPrimaryKeys(sessionHandle: SessionHandle, + catalog: String, + schema: String, + table: String): OperationHandle + + @throws[SparkThriftServerSQLException] + def getCrossReference(sessionHandle: SessionHandle, + primaryCatalog: String, + primarySchema: String, + primaryTable: String, + foreignCatalog: String, + foreignSchema: String, + foreignTable: String): OperationHandle + + @throws[SparkThriftServerSQLException] + def getOperationStatus(opHandle: OperationHandle): OperationStatus + + import org.apache.spark.sql.thriftserver.cli.thrift.TOperationHandle + + @throws[SparkThriftServerSQLException] + def getQueryId(opHandle: TOperationHandle): String + + @throws[SparkThriftServerSQLException] + def cancelOperation(opHandle: OperationHandle): Unit + + @throws[SparkThriftServerSQLException] + def closeOperation(opHandle: OperationHandle): Unit + + @throws[SparkThriftServerSQLException] + def getResultSetMetadata(opHandle: OperationHandle): StructType + + @throws[SparkThriftServerSQLException] + def fetchResults(opHandle: OperationHandle): RowSet + + @throws[SparkThriftServerSQLException] + def fetchResults(opHandle: OperationHandle, + orientation: FetchOrientation, + maxRows: Long, + fetchType: FetchType): RowSet + + @throws[SparkThriftServerSQLException] + def getDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + owner: String, + renewer: String, + remoteAddr: String): String + + @throws[SparkThriftServerSQLException] + def cancelDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit + + @throws[SparkThriftServerSQLException] + def renewDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala new file mode 100644 index 000000000000..6466f63c4902 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala @@ -0,0 +1,81 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.{TOperationHandle, TProtocolVersion} + +class OperationHandle private(val opType: OperationType, + protocol: TProtocolVersion, + handleId: HandleIdentifier) extends Handle(handleId) { + + private[this] var hasResultSet: Boolean = false + + def this(opType: OperationType, protocol: TProtocolVersion) = + this(opType, protocol, new HandleIdentifier) + + def this(tOperationHandle: TOperationHandle, protocol: TProtocolVersion) = { + this( + OperationType.getOperationType(tOperationHandle.getOperationType), + protocol, + new HandleIdentifier(tOperationHandle.getOperationId)) + setHasResultSet(tOperationHandle.isHasResultSet) + } + + def this(tOperationHandle: TOperationHandle) = + this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) + + def getOperationType: OperationType = opType + + def toTOperationHandle: TOperationHandle = { + val tOperationHandle = new TOperationHandle + tOperationHandle.setOperationId(getHandleIdentifier.toTHandleIdentifier) + tOperationHandle.setOperationType(opType.toTOperationType) + tOperationHandle.setHasResultSet(this.hasResultSet) + tOperationHandle + } + + def setHasResultSet(hasResultSet: Boolean): Unit = { + this.hasResultSet = hasResultSet + } + + def isHasResultSet: Boolean = this.hasResultSet + + def getProtocolVersion: TProtocolVersion = protocol + + override def hashCode: Int = { + val prime = 31 + var result = super.hashCode + result = prime * result + (if (opType == null) 0 else opType.hashCode) + result + } + + override def equals(obj: Any): Boolean = { + if (!super.equals(obj)) return false + if (!obj.isInstanceOf[OperationHandle]) return false + val other = obj.asInstanceOf[OperationHandle] + if (this eq other) return true + if (opType != other.opType) { + return false + } + true + } + + override def toString: String = + "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier + "]" + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala new file mode 100644 index 000000000000..9d456eb7adf1 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala @@ -0,0 +1,130 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationState + +trait OperationState { + + def toTOperationState(): TOperationState + + def isTerminal(): Boolean = false + + @throws[SparkThriftServerSQLException] + def validateTransition(newState: OperationState): Unit = ex(newState) + + @throws[SparkThriftServerSQLException] + protected def ex(state: OperationState): Unit = throw new SparkThriftServerSQLException( + "Illegal Operation state transition " + this + " -> " + state, "ServerError", 1000) +} + +case object INITIALIZED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.INITIALIZED_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case PENDING | RUNNING | CANCELED | CLOSED | TIMEOUT => + case _ => ex(newState) + } +} + +case object PENDING extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.PENDING_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case RUNNING | FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => + case _ => ex(newState) + } +} + +case object RUNNING extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.RUNNING_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => + case _ => ex(newState) + } +} + +case object TIMEOUT extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.TIMEDOUT_STATE + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object FINISHED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.FINISHED_STATE + + override def isTerminal(): Boolean = true + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object CANCELED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.CANCELED_STATE + + override def isTerminal(): Boolean = true + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object CLOSED extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.CLOSED_STATE + + override def isTerminal(): Boolean = true +} + +case object ERROR extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.ERROR_STATE + + override def isTerminal(): Boolean = true + + override def validateTransition(newState: OperationState): Unit = newState match { + case CLOSED => + case _ => ex(newState) + } +} + +case object UNKNOWN extends OperationState { + override def toTOperationState(): TOperationState = TOperationState.UKNOWN_STATE +} + + +object OperationState { + def getOperationState(tOperationState: TOperationState): OperationState = { + tOperationState match { + case TOperationState.INITIALIZED_STATE => INITIALIZED + case TOperationState.PENDING_STATE => PENDING + case TOperationState.RUNNING_STATE => RUNNING + case TOperationState.CANCELED_STATE => CANCELED + case TOperationState.ERROR_STATE => ERROR + case TOperationState.CLOSED_STATE => CLOSED + case TOperationState.FINISHED_STATE => FINISHED + case TOperationState.TIMEDOUT_STATE => TIMEOUT + case TOperationState.UKNOWN_STATE => UNKNOWN + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala new file mode 100644 index 000000000000..05aea20acd4f --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala @@ -0,0 +1,32 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + + +/** + * OperationStatus + * + */ +class OperationStatus(val state: OperationState, + val operationException: SparkThriftServerSQLException) { + + def getState: OperationState = state + + def getOperationException: SparkThriftServerSQLException = operationException +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala new file mode 100644 index 000000000000..7597d8d823d1 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationType + + +/** + * OperationType. + */ +abstract class OperationType { + def toTOperationType: TOperationType +} + +case object EXECUTE_STATEMENT extends OperationType { + override def toTOperationType: TOperationType = TOperationType.EXECUTE_STATEMENT +} + +case object GET_TYPE_INFO extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_TYPE_INFO +} + +case object GET_CATALOGS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_CATALOGS +} + +case object GET_SCHEMAS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_SCHEMAS +} + +case object GET_TABLES extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_TABLES +} + +case object GET_TABLE_TYPES extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_TABLE_TYPES +} + +case object GET_COLUMNS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_COLUMNS +} + +case object GET_FUNCTIONS extends OperationType { + override def toTOperationType: TOperationType = TOperationType.GET_FUNCTIONS +} + +case object UNKNOWN_OPERATION extends OperationType { + override def toTOperationType: TOperationType = TOperationType.UNKNOWN +} + +object OperationType { + def getOperationType(tOperationType: TOperationType): OperationType = + tOperationType match { + case TOperationType.EXECUTE_STATEMENT => EXECUTE_STATEMENT + case TOperationType.GET_TYPE_INFO => GET_TYPE_INFO + case TOperationType.GET_CATALOGS => GET_CATALOGS + case TOperationType.GET_SCHEMAS => GET_SCHEMAS + case TOperationType.GET_TABLES => GET_TABLES + case TOperationType.GET_TABLE_TYPES => GET_TABLE_TYPES + case TOperationType.GET_COLUMNS => GET_COLUMNS + case TOperationType.GET_FUNCTIONS => GET_FUNCTIONS + case _ => UNKNOWN_OPERATION + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala new file mode 100644 index 000000000000..2240cc0bc3a4 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +/** + * PatternOrIdentifier. + * + */ +class PatternOrIdentifier(var text: String) { + + var isPt: Boolean = false + + def isPattern: Boolean = isPt + + def isIdentifier: Boolean = !isPt + + override def toString: String = text +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala new file mode 100644 index 000000000000..b53453dbbaf9 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala @@ -0,0 +1,153 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import scala.collection.JavaConverters._ +import scala.collection.mutable.ArrayBuffer + +import org.apache.spark.sql.Row +import org.apache.spark.sql.execution.HiveResult +import org.apache.spark.sql.thriftserver.cli.thrift._ +import org.apache.spark.sql.types._ + +/** + * A result set of Spark's [[Row]]s with its [[StructType]] as its schema, + * with the ability of + * transform to [[TRowSet]]. + */ +case class RowBasedSet(types: StructType, + rows: ArrayBuffer[Row], initStartOffset: Long) + extends RowSet { + + var startOffset: Long = initStartOffset + + override def toTRowSet: TRowSet = new TRowSet(startOffset, toTRows.asJava) + + private[this] def toTRows: Seq[TRow] = { + if (rows != null) { + if (types == null || (rows.nonEmpty && rows.head.size != types.size)) { + throw new IllegalArgumentException("The given schema does't match the given row") + } + rows.map(toTRow) + } else { + Nil + } + } + + private[this] def toTRow(row: Row): TRow = { + val tRow = new TRow() + (0 until row.length).map(i => toTColumnValue(i, row)).foreach(tRow.addToColVals) + tRow + } + + private[this] def toTColumnValue(ordinal: Int, row: Row): TColumnValue = + types(ordinal).dataType match { + case BooleanType => + val boolValue = new TBoolValue + if (!row.isNullAt(ordinal)) boolValue.setValue(row.getBoolean(ordinal)) + TColumnValue.boolVal(boolValue) + + case ByteType => + val byteValue = new TByteValue + if (!row.isNullAt(ordinal)) byteValue.setValue(row.getByte(ordinal)) + TColumnValue.byteVal(byteValue) + + case ShortType => + val tI16Value = new TI16Value + if (!row.isNullAt(ordinal)) tI16Value.setValue(row.getShort(ordinal)) + TColumnValue.i16Val(tI16Value) + + case IntegerType => + val tI32Value = new TI32Value + if (!row.isNullAt(ordinal)) tI32Value.setValue(row.getInt(ordinal)) + TColumnValue.i32Val(tI32Value) + + case LongType => + val tI64Value = new TI64Value + if (!row.isNullAt(ordinal)) tI64Value.setValue(row.getLong(ordinal)) + TColumnValue.i64Val(tI64Value) + + case FloatType => + val tDoubleValue = new TDoubleValue + if (!row.isNullAt(ordinal)) tDoubleValue.setValue(row.getFloat(ordinal)) + TColumnValue.doubleVal(tDoubleValue) + + case DoubleType => + val tDoubleValue = new TDoubleValue + if (!row.isNullAt(ordinal)) tDoubleValue.setValue(row.getDouble(ordinal)) + TColumnValue.doubleVal(tDoubleValue) + + case StringType => + val tStringValue = new TStringValue + if (!row.isNullAt(ordinal)) tStringValue.setValue(row.getString(ordinal)) + TColumnValue.stringVal(tStringValue) + + case DecimalType() => + val tStrValue = new TStringValue + if (!row.isNullAt(ordinal)) tStrValue.setValue(row.getDecimal(ordinal).toString) + TColumnValue.stringVal(tStrValue) + + case DateType => + val tStringValue = new TStringValue + if (!row.isNullAt(ordinal)) tStringValue.setValue(row.get(ordinal).toString) + TColumnValue.stringVal(tStringValue) + + case TimestampType => + val tStringValue = new TStringValue + if (!row.isNullAt(ordinal)) tStringValue.setValue(row.get(ordinal).toString) + TColumnValue.stringVal(tStringValue) + + case BinaryType => + val tStringValue = new TStringValue + if (!row.isNullAt(ordinal)) { + val bytes = row.getAs[Array[Byte]](ordinal) + tStringValue.setValue(HiveResult.toHiveString((bytes, types(ordinal).dataType))) + } + TColumnValue.stringVal(tStringValue) + + case _: ArrayType | _: StructType | _: MapType => + val tStrValue = new TStringValue + if (!row.isNullAt(ordinal)) { + tStrValue.setValue( + HiveResult.toHiveString((row.get(ordinal), types(ordinal).dataType))) + } + TColumnValue.stringVal(tStrValue) + } + + override def addRow(row: Row): RowSet = { + rows.+=(row) + this + } + + override def extractSubset(maxRows: Int): RowSet = { + val numRows = Math.min(rows.size, maxRows) + val result = new RowBasedSet(types, rows.slice(0, numRows), startOffset) + rows.remove(0, numRows) + startOffset += numRows + return result + } + + override def numColumns: Int = types.size + + override def numRows: Int = rows.size + + override def getStartOffset: Long = startOffset + + override def setStartOffset(startOffset: Long): Unit = this.startOffset = startOffset + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala new file mode 100644 index 000000000000..17a3ec210f50 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.Row +import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet + +trait RowSet { + def addRow(row: Row): RowSet + + def extractSubset(maxRows: Int): RowSet + + def numColumns: Int + + def numRows: Int + + def getStartOffset: Long + + def setStartOffset(startOffset: Long): Unit + + def toTRowSet: TRowSet +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala new file mode 100644 index 000000000000..0188055484c9 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import scala.collection.mutable.ArrayBuffer + +import org.apache.spark.sql.Row +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion._ +import org.apache.spark.sql.types.StructType + +object RowSetFactory { + def create(types: StructType, rows: Seq[Row], version: TProtocolVersion): RowSet = { + if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { + ColumnBasedSet(types, ArrayBuffer(rows: _*), 0) + } else { + RowBasedSet(types, ArrayBuffer(rows: _*), 0) + } + } + + def create(types: StructType, version: TProtocolVersion): RowSet = { + if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { + ColumnBasedSet(types, new ArrayBuffer[Row](), 0) + } else { + RowBasedSet(types, new ArrayBuffer[Row](), 0) + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala new file mode 100644 index 000000000000..c8798b011afc --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -0,0 +1,61 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.{TTableSchema, TTypeId} +import org.apache.spark.sql.types._ + +object SchemaMapper { + + def toTTableSchema(fields: StructType): TTableSchema = { + val tTableSchema = new TTableSchema + if (fields != null) { + fields.zipWithIndex.map { + case (field, i) => ColumnDescriptor(field, i) + }.map(_.toTColumnDesc).foreach(tTableSchema.addToColumns) + } + tTableSchema + } + + def toTTypeId(typ: DataType): TTypeId = typ match { + case NullType => TTypeId.NULL_TYPE + case BooleanType => TTypeId.BOOLEAN_TYPE + case ByteType => TTypeId.TINYINT_TYPE + case ShortType => TTypeId.SMALLINT_TYPE + case IntegerType => TTypeId.INT_TYPE + case LongType => TTypeId.BIGINT_TYPE + case FloatType => TTypeId.FLOAT_TYPE + case DoubleType => TTypeId.DOUBLE_TYPE + case StringType => TTypeId.STRING_TYPE + case DecimalType() => TTypeId.DECIMAL_TYPE + case DateType => TTypeId.DATE_TYPE + case TimestampType => TTypeId.TIMESTAMP_TYPE + case BinaryType => TTypeId.BINARY_TYPE + case _: ArrayType => TTypeId.ARRAY_TYPE + case _: MapType => TTypeId.MAP_TYPE + case _: StructType => TTypeId.STRUCT_TYPE + case _: UserDefinedType[_] => TTypeId.USER_DEFINED_TYPE + case other => + val catalogString = if (other != null) { + other.catalogString + } else { + null + } + throw new IllegalArgumentException("Unrecognized type name: " + catalogString) + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala new file mode 100644 index 000000000000..aba1823dcd46 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.util.UUID + +import org.apache.spark.sql.thriftserver.cli.thrift.{TProtocolVersion, TSessionHandle} + +class SessionHandle private(handleId: HandleIdentifier, protocol: TProtocolVersion) + extends Handle(handleId) { + + def this(tSessionHandle: TSessionHandle) = + this(new HandleIdentifier(tSessionHandle.getSessionId), + TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) + + + def this(tSessionHandle: TSessionHandle, protocol: TProtocolVersion) = + this(new HandleIdentifier(tSessionHandle.getSessionId), protocol) + + def this(protocol: TProtocolVersion) = this(new HandleIdentifier(), protocol) + + def toTSessionHandle: TSessionHandle = { + val tSessionHandle = new TSessionHandle + tSessionHandle.setSessionId(getHandleIdentifier.toTHandleIdentifier) + tSessionHandle + } + + def getSessionId: UUID = getHandleIdentifier.getPublicId + + def getProtocolVersion: TProtocolVersion = protocol + + override def toString: String = "SessionHandle [" + getHandleIdentifier + "]" +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala new file mode 100644 index 000000000000..104b1d78bd32 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.sql.SQLException + +import scala.collection.JavaConverters._ + +import org.apache.spark.sql.thriftserver.cli.thrift.{TStatus, TStatusCode} + +class SparkThriftServerSQLException(reason: String, + sqlState: String, + vendorCode: Int, + cause: Throwable) + extends SQLException(reason, sqlState, vendorCode, cause) { + + def this(reason: String, sqlState: String, cause: Throwable) = this(reason, sqlState, 0, cause) + + def this(reason: String, sqlState: String, vendorCode: Int) = + this(reason, sqlState, vendorCode, null) + + def this(reason: String, cause: Throwable) = this(reason, null, 0, cause) + + def this(reason: String, sqlState: String) = this(reason, sqlState, vendorCode = 0) + + def this(reason: String) = this(reason, sqlState = null) + + def this(cause: Throwable) = this(cause.toString, cause) + + def this(status: TStatus) { + // TODO: set correct vendorCode field + this(status.getErrorMessage, status.getSqlState, status.getErrorCode) + // if (status.getInfoMessages != null) { + // initCause(toCause(status.getInfoMessages.asScala.toArray)) + // } + } + + /** + * Converts current object to a [[TStatus]] object + * + * @return a { @link TStatus} object + */ + def toTStatus: TStatus = { + val tStatus = new TStatus(TStatusCode.ERROR_STATUS) + tStatus.setSqlState(getSQLState) + tStatus.setErrorCode(getErrorCode) + tStatus.setErrorMessage(getMessage) + tStatus.setInfoMessages(SparkThriftServerSQLException.toString(this).asJava) + tStatus + } + + // def toCause(details: Array[String]): Throwable = { + // toStackTrace(details, null, 0) + // } + +} + +object SparkThriftServerSQLException { + + def toTStatus(e: Exception): TStatus = e match { + case k: SparkThriftServerSQLException => k.toTStatus + case _ => + val tStatus = new TStatus(TStatusCode.ERROR_STATUS) + tStatus.setErrorMessage(e.getMessage) + tStatus.setInfoMessages(toString(e).asJava) + tStatus + } + + + def toString(cause: Throwable): List[String] = { + toString(cause, null) + } + + def toString(cause: Throwable, parent: Array[StackTraceElement]): List[String] = { + val trace = cause.getStackTrace + var m = trace.length - 1 + if (parent != null) { + var n = parent.length - 1 + while (m >= 0 && n >= 0 && trace(m).equals(parent(n))) { + m = m - 1 + n = n - 1 + } + } + + enroll(cause, trace, m) ++ + Option(cause.getCause).map(toString(_, trace)).getOrElse(Nil) + } + + private[this] def enroll(ex: Throwable, + trace: Array[StackTraceElement], max: Int): List[String] = { + val builder = new StringBuilder + builder.append('*').append(ex.getClass.getName).append(':') + builder.append(ex.getMessage).append(':') + builder.append(trace.length).append(':').append(max) + List(builder.toString) ++ (0 to max).map { i => + builder.setLength(0) + builder.append(trace(i).getClassName).append(":") + builder.append(trace(i).getMethodName).append(":") + builder.append(Option(trace(i).getFileName).getOrElse("")).append(':') + builder.append(trace(i).getLineNumber) + builder.toString + }.toList + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala new file mode 100644 index 000000000000..f3769ece89d2 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala @@ -0,0 +1,501 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.sql.DatabaseMetaData +import java.util.Locale + +import org.apache.spark.sql.thriftserver.cli.thrift.TTypeId +import org.apache.spark.sql.types.DecimalType + +trait Type { + + def getName: String + + def tTypeId: TTypeId + + def isComplex: Boolean + + def isQualifiedType: Boolean + + def isCollectionType: Boolean + + def isPrimitiveType: Boolean = !isComplex + + def isComplexType: Boolean = isComplex + + /** + * Radix for this type (typically either 2 or 10) + * Null is returned for data types where this is not applicable. + */ + def getNumPrecRadix: Integer = { + if (this.isNumericType) { + 10 + } else { + null + } + } + + def getMaxPrecision(): Option[Int] + + def isNumericType(): Boolean = false + + /** + * Prefix used to quote a literal of this type (may be null) + */ + def getLiteralPrefix: String = null + + /** + * Suffix used to quote a literal of this type (may be null) + * + * @return + */ + def getLiteralSuffix: String = null + + /** + * Can you use NULL for this type? + * + * @return + * DatabaseMetaData.typeNoNulls - does not allow NULL values + * DatabaseMetaData.typeNullable - allows NULL values + * DatabaseMetaData.typeNullableUnknown - nullability unknown + */ + def getNullable: Short = { + // All Hive types are nullable + DatabaseMetaData.typeNullable.toShort + } + + /** + * Is the type case sensitive? + * + * @return + */ + def isCaseSensitive: Boolean = false + + /** + * Parameters used in creating the type (may be null) + * + * @return + */ + def getCreateParams: String = null + + /** + * Can you use WHERE based on this type? + * + * @return + * DatabaseMetaData.typePredNone - No support + * DatabaseMetaData.typePredChar - Only support with WHERE .. LIKE + * DatabaseMetaData.typePredBasic - Supported except for WHERE .. LIKE + * DatabaseMetaData.typeSearchable - Supported for all WHERE .. + */ + def getSearchable: Short = { + if (isPrimitiveType) { + DatabaseMetaData.typeSearchable.toShort + } else { + DatabaseMetaData.typePredNone.toShort + } + } + + /** + * Is this type unsigned? + * + * @return + */ + def isUnsignedAttribute: Boolean = { + if (isNumericType) { + false + } else { + true + } + } + + /** + * Can this type represent money? + * + * @return + */ + def isFixedPrecScale: Boolean = false + + /** + * Can this type be used for an auto-increment value? + * + * @return + */ + def isAutoIncrement: Boolean = false + + /** + * Localized version of type name (may be null). + * + * @return + */ + def getLocalizedName: String = null + + /** + * Minimum scale supported for this type + * + * @return + */ + def getMinimumScale: Short = 0.toShort + + /** + * Maximum scale supported for this type + * + * @return + */ + def getMaximumScale: Short = 0.toShort + + def javaSQLType: Int + + def toJavaSQLType: Int = javaSQLType +} + +object Type { + + val typeMap: Map[String, Type] = Map( + NULL.getName -> NULL, + STRING.getName -> STRING, + INT.getName -> INT, + BOOLEAN.getName -> BOOLEAN, + DOUBLE.getName -> DOUBLE, + FLOAT.getName -> FLOAT, + DECIMAL.getName -> DECIMAL, + LONG.getName -> LONG, + BYTE.getName -> BYTE, + SHORT.getName -> SHORT, + DATE.getName -> DATE, + TIMESTAMP.getName -> TIMESTAMP, + BINARY.getName -> BINARY, + ARRAY.getName -> ARRAY, + MAP.getName -> MAP, + STRUCT.getName -> STRUCT, + USER_DEFINED.getName -> USER_DEFINED + ) + + def values: Seq[Type] = typeMap.values.toSeq + + def getType(tTypeId: TTypeId): Type = { + val tType = values.find(_.tTypeId == tTypeId) + if (tType.isDefined) { + tType.get + } else { + throw new IllegalArgumentException("Unregonized Thrift TTypeId value: " + tTypeId) + } + + } + + def getType(name: String): Type = { + values.foreach(t => { + if (t.getName == name) { + return t + } else { + if ((t.isQualifiedType || t.isComplex) && + name.toUpperCase(Locale.ROOT).startsWith(t.getName)) { + return t + } + } + }) + throw new IllegalArgumentException("Unrecognized type name: " + name) + } + + case object NULL extends Type() { + override def getName: String = "VOID" + + override def tTypeId: TTypeId = TTypeId.NULL_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.NULL + } + + case object STRING extends Type { + override def getName: String = "STRING" + + override def tTypeId: TTypeId = TTypeId.STRING_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.VARCHAR + + override def isCaseSensitive: Boolean = true + } + + case object INT extends Type { + override def getName: String = "INT" + + override def tTypeId: TTypeId = TTypeId.INT_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = Some(10) + + override def javaSQLType: Int = java.sql.Types.INTEGER + + override def isNumericType(): Boolean = true + } + + case object BOOLEAN extends Type { + override def getName: String = "BOOLEAN" + + override def tTypeId: TTypeId = TTypeId.BOOLEAN_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.BOOLEAN + } + + case object DOUBLE extends Type { + override def getName: String = "DOUBLE" + + override def tTypeId: TTypeId = TTypeId.DOUBLE_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = Some(15) + + override def javaSQLType: Int = java.sql.Types.DOUBLE + + override def isNumericType(): Boolean = true + } + + case object FLOAT extends Type { + override def getName: String = "FLOAT" + + override def tTypeId: TTypeId = TTypeId.FLOAT_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = Some(7) + + override def javaSQLType: Int = java.sql.Types.FLOAT + + override def isNumericType(): Boolean = true + } + + case object DECIMAL extends Type { + override def getName: String = "DECIMAL" + + override def tTypeId: TTypeId = TTypeId.DECIMAL_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = true + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = Some(DecimalType.MAX_PRECISION) + + override def javaSQLType: Int = java.sql.Types.DECIMAL + + override def isNumericType(): Boolean = true + } + + case object LONG extends Type { + override def getName: String = "BIGINT" + + override def tTypeId: TTypeId = TTypeId.BIGINT_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = Some(19) + + override def javaSQLType: Int = java.sql.Types.BIGINT + + override def isNumericType(): Boolean = true + } + + case object BYTE extends Type { + override def getName: String = "TINYINT" + + override def tTypeId: TTypeId = TTypeId.TINYINT_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.TINYINT + } + + case object SHORT extends Type { + override def getName: String = "SMALLINT" + + override def tTypeId: TTypeId = TTypeId.SMALLINT_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = Some(5) + + override def javaSQLType: Int = java.sql.Types.SMALLINT + + override def isNumericType(): Boolean = true + } + + case object DATE extends Type { + override def getName: String = "DATE" + + override def tTypeId: TTypeId = TTypeId.DATE_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.DATE + } + + case object TIMESTAMP extends Type { + override def getName: String = "TIMESTAMP" + + override def tTypeId: TTypeId = TTypeId.TIMESTAMP_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.TIMESTAMP + } + + case object BINARY extends Type { + override def getName: String = "BINARY" + + override def tTypeId: TTypeId = TTypeId.BINARY_TYPE + + override def isComplex: Boolean = false + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.BINARY + } + + case object ARRAY extends Type { + override def getName: String = "ARRAY" + + override def tTypeId: TTypeId = TTypeId.ARRAY_TYPE + + override def isComplex: Boolean = true + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = true + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.ARRAY + } + + case object MAP extends Type { + override def getName: String = "MAP" + + override def tTypeId: TTypeId = TTypeId.MAP_TYPE + + override def isComplex: Boolean = true + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = true + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.JAVA_OBJECT + } + + case object STRUCT extends Type { + override def getName: String = "STRUCT" + + override def tTypeId: TTypeId = TTypeId.STRUCT_TYPE + + override def isComplex: Boolean = true + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.STRUCT + } + + case object USER_DEFINED extends Type { + override def getName: String = "USER_DEFINED" + + override def tTypeId: TTypeId = TTypeId.USER_DEFINED_TYPE + + override def isComplex: Boolean = true + + override def isQualifiedType: Boolean = false + + override def isCollectionType: Boolean = false + + override def getMaxPrecision(): Option[Int] = None + + override def javaSQLType: Int = java.sql.Types.OTHER + } + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala new file mode 100644 index 000000000000..e88c455092b8 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import org.apache.spark.sql.thriftserver.cli.thrift.{TPrimitiveTypeEntry, TTypeDesc, TTypeEntry} +import org.apache.spark.sql.types.{DataType, DecimalType} + +/** + * A wrapper class of Spark's [[DataType]] with [[TypeQualifiers]] for [[DecimalType]]s, and could + * be transformed to [[TTypeDesc]]. + */ +case class TypeDescriptor(typ: DataType) { + private[this] val typeQualifiers: Option[TypeQualifiers] = typ match { + case d: DecimalType => Some(TypeQualifiers.fromTypeInfo(d)) + case _ => None + } + + def toTTypeDesc: TTypeDesc = { + val primitiveEntry = new TPrimitiveTypeEntry(SchemaMapper.toTTypeId(typ)) + typeQualifiers.map(_.toTTypeQualifiers).foreach(primitiveEntry.setTypeQualifiers) + val entry = TTypeEntry.primitiveEntry(primitiveEntry) + val desc = new TTypeDesc + desc.addToTypes(entry) + desc + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala new file mode 100644 index 000000000000..dcc4e993fa78 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import scala.collection.JavaConverters._ + +import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIServiceConstants, TTypeQualifiers, TTypeQualifierValue} +import org.apache.spark.sql.types.{DataType, DecimalType} + +class TypeQualifiers private() { + private[this] var precision: Option[Int] = None + private[this] var scale: Option[Int] = None + + private def setPrecision(precision: Int): Unit = { + this.precision = Some(precision) + } + + private def setScale(scale: Int): Unit = { + this.scale = Some(scale) + } + + def toTTypeQualifiers: TTypeQualifiers = new TTypeQualifiers( + (precision + .map(TTypeQualifierValue.i32Value) + .map(TCLIServiceConstants.PRECISION -> _) ++ + scale + .map(TTypeQualifierValue.i32Value) + .map(TCLIServiceConstants.SCALE -> _)) + .toMap.asJava) +} + +object TypeQualifiers { + def fromTypeInfo(typ: DataType): TypeQualifiers = { + val result = new TypeQualifiers + typ match { + case decimalType: DecimalType => + result.setScale(decimalType.scale) + result.setPrecision(decimalType.precision) + case _ => + } + result + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala new file mode 100644 index 000000000000..e568008c8d2f --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util.Locale + +import com.google.common.collect.{ArrayListMultimap, Iterables, Multimap} +import java.util +import org.apache.hadoop.hive.metastore.TableType + +import org.apache.spark.internal.Logging + +class ClassicTableTypeMapping extends TableTypeMapping with Logging { + + object ClassicTableTypes extends Enumeration { + type ClassicTableTypes = Value + val TABLE, VIEW, MATERIALIZED_VIEW = Value + } + + private val hiveToClientMap = new util.HashMap[String, String] + private val clientToHiveMap: ArrayListMultimap[String, String] = ArrayListMultimap.create() + + try { + hiveToClientMap.put(HiveTableTypes.MANAGED_TABLE.toString, ClassicTableTypes.TABLE.toString) + hiveToClientMap.put(HiveTableTypes.EXTERNAL_TABLE.toString, ClassicTableTypes.TABLE.toString) + hiveToClientMap.put(HiveTableTypes.VIRTUAL_VIEW.toString, ClassicTableTypes.VIEW.toString) + hiveToClientMap.put(HiveTableTypes.MATERIALIZED_VIEW.toString, + ClassicTableTypes.MATERIALIZED_VIEW.toString) + + clientToHiveMap.putAll(ClassicTableTypes.TABLE.toString, + util.Arrays.asList(TableType.MANAGED_TABLE.toString, + HiveTableTypes.EXTERNAL_TABLE.toString)) + clientToHiveMap.put(ClassicTableTypes.VIEW.toString, HiveTableTypes.VIRTUAL_VIEW.toString) + clientToHiveMap.put(ClassicTableTypes.MATERIALIZED_VIEW.toString, + HiveTableTypes.MATERIALIZED_VIEW.toString) + } catch { + case e: Throwable => e.printStackTrace() + } + + override def mapToHiveType(clientTypeName: String): Array[String] = { + val hiveTableType: util.Collection[String] = + clientToHiveMap.get(clientTypeName.toUpperCase(Locale.ROOT)) + if (hiveTableType == null) { + logWarning("Not supported client table type " + clientTypeName) + return Array[String](clientTypeName) + } + return Iterables.toArray(hiveTableType, classOf[String]) + } + + override def mapToClientType(hiveTypeName: String): String = + if (hiveToClientMap.containsKey(hiveTypeName)) { + hiveToClientMap.get(hiveTypeName) + } else { + logWarning("Invalid hive table type " + hiveTypeName) + hiveTypeName + } + + override def getTableTypeNames: Set[String] = { + ClassicTableTypes.values.map(_.toString) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala new file mode 100644 index 000000000000..88dec4c15cb3 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala @@ -0,0 +1,30 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +class HiveTableTypeMapping extends TableTypeMapping { + + def mapToHiveType(clientTypeName: String): Array[String] = + Array[String](mapToClientType(clientTypeName)) + + def mapToClientType(hiveTypeName: String): String = hiveTypeName + + def getTableTypeNames: Set[String] = { + HiveTableTypes.values.map(_.toString) + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala new file mode 100644 index 000000000000..11462be765ea --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala @@ -0,0 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.cli.operation + +object HiveTableTypes extends Enumeration { + type TableType = Value + val MANAGED_TABLE, EXTERNAL_TABLE, VIRTUAL_VIEW, INDEX_TABLE, MATERIALIZED_VIEW = Value +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala new file mode 100644 index 000000000000..3217fb776272 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala @@ -0,0 +1,299 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.io.{File, FileNotFoundException} +import java.util.concurrent.Future + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse +import org.apache.hadoop.hive.ql.session.OperationLog + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion +import org.apache.spark.sql.types.StructType +import org.apache.spark.util.Utils + +abstract class Operation(session: ThriftServerSession, + opType: OperationType, + runInBackground: Boolean) extends Logging { + private[this] var _state: OperationState = INITIALIZED + private[this] val _opHandle: OperationHandle = + new OperationHandle(opType, session.getProtocolVersion) + private[this] var _conf: HiveConf = session.getHiveConf + + protected var _statementId: String = _ + protected var _hasResultSet = false + protected var _operationException: SparkThriftServerSQLException = _ + protected val _runAsync: Boolean = runInBackground + protected var _backgroundHandle: Future[_] = _ + protected var _operationLog: OperationLog = _ + protected var _isOperationLogEnabled = false + + private var _operationTimeout: Long = + Utils.timeStringAsMs(_conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_IDLE_OPERATION_TIMEOUT)) + private var _lastAccessTime = System.currentTimeMillis() + + protected val DEFAULT_FETCH_ORIENTATION_SET: Set[FetchOrientation] = + Set(FetchOrientation.FETCH_NEXT, FetchOrientation.FETCH_FIRST) + + def getBackgroundHandle: Future[_] = _backgroundHandle + + protected def setBackgroundHandle(backgroundHandle: Future[_]): Unit = { + this._backgroundHandle = backgroundHandle + } + + def shouldRunAsync: Boolean = _runAsync + + def setConfiguration(conf: HiveConf): Unit = { + this._conf = conf + } + + def getConfiguration: HiveConf = _conf + + def getParentSession: ThriftServerSession = session + + def getHandle: OperationHandle = _opHandle + + def getProtocolVersion: TProtocolVersion = _opHandle.getProtocolVersion + + def getType: OperationType = _opHandle.getOperationType + + def getStatus: OperationStatus = new OperationStatus(_state, _operationException) + + def statementId: String = _statementId + + def hasResultSet: Boolean = _hasResultSet + + protected def setHasResultSet(hasResultSet: Boolean): Unit = { + this._hasResultSet = hasResultSet + _opHandle.setHasResultSet(this._hasResultSet) + } + + def getOperationLog: OperationLog = _operationLog + + + @throws[SparkThriftServerSQLException] + protected def setState(newState: OperationState): OperationState = { + _state.validateTransition(newState) + this._state = newState + this._lastAccessTime = System.currentTimeMillis() + this._state + } + + def isTimedOut(current: Long): Boolean = { + if (_operationTimeout == 0) { + return false + } + if (_operationTimeout > 0) { // check only when it's in terminal state + return _state.isTerminal && _lastAccessTime + _operationTimeout <= current + } + _lastAccessTime + -_operationTimeout <= current + } + + def getLastAccessTime: Long = _lastAccessTime + + def getOperationTimeout: Long = _operationTimeout + + def setOperationTimeout(operationTimeout: Long): Unit = { + this._operationTimeout = operationTimeout + } + + protected def setOperationException(opEx: SparkThriftServerSQLException): Unit = { + this._operationException = opEx + } + + @throws[SparkThriftServerSQLException] + protected final def assertState(state: OperationState): Unit = { + if (this._state ne state) { + throw new SparkThriftServerSQLException("Expected state " + + state + ", but found " + this._state) + } + this._lastAccessTime = System.currentTimeMillis + } + + def isRunning: Boolean = RUNNING == _state + + def isFinished: Boolean = FINISHED == _state + + def isCanceled: Boolean = CANCELED == _state + + def isFailed: Boolean = ERROR == _state + + + protected def createOperationLog(): Unit = { + if (session.isOperationLogEnabled) { + val logFile = + new File(session.getOperationLogSessionDir, _opHandle.getHandleIdentifier.toString) + val logFilePath = logFile.getAbsolutePath + this._isOperationLogEnabled = true + // create log file + try { + if (logFile.exists) { + logWarning( + s""" + |The operation log file should not exist, but it is already there: $logFilePath" + """.stripMargin) + logFile.delete + } + if (!logFile.createNewFile) { + // the log file already exists and cannot be deleted. + // If it can be read/written, keep its contents and use it. + if (!logFile.canRead || !logFile.canWrite) { + logWarning( + s""" + |The already existed operation log file cannot be recreated, + |and it cannot be read or written: $logFilePath" + """.stripMargin) + this._isOperationLogEnabled = false + return + } + } + } catch { + case e: Exception => + logWarning("Unable to create operation log file: " + logFilePath, e) + this._isOperationLogEnabled = false + return + } + // create OperationLog object with above log file + try + this._operationLog = new OperationLog(this._opHandle.toString, logFile, new HiveConf()) + catch { + case e: FileNotFoundException => + logWarning("Unable to instantiate OperationLog object for operation: " + + this._opHandle, e) + this._isOperationLogEnabled = false + return + } + // register this operationLog + // session.getSessionMgr.getOperationMgr + // .setOperationLog(session.getUserName, this._operationLog) + OperationLog.setCurrentOperationLog(_operationLog) + } + } + + protected def unregisterOperationLog(): Unit = { + if (_isOperationLogEnabled) { + OperationLog.removeCurrentOperationLog() + } + } + + + /** + * Invoked before runInternal(). + * Set up some preconditions, or configurations. + */ + protected def beforeRun(): Unit = { + createOperationLog() + } + + /** + * Invoked after runInternal(), even if an exception is thrown in runInternal(). + * Clean up resources, which was set up in beforeRun(). + */ + protected def afterRun(): Unit = { + unregisterOperationLog() + } + + /** + * Implemented by subclass of Operation class to execute specific behaviors. + * + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + protected def runInternal(): Unit + + @throws[SparkThriftServerSQLException] + def run(): Unit = { + beforeRun() + try + runInternal() + finally afterRun() + } + + + protected def cleanupOperationLog(): Unit = { + if (_isOperationLogEnabled) { + if (_operationLog == null) { + logError("Operation [ " + _opHandle.getHandleIdentifier + " ] " + + "logging is enabled, but its OperationLog object cannot be found.") + } else { + _operationLog.close() + } + } + } + + // TODO: make this abstract and implement in subclasses. + @throws[SparkThriftServerSQLException] + def cancel(): Unit = { + setState(CANCELED) + throw new UnsupportedOperationException("SQLOperation.cancel()") + } + + @throws[SparkThriftServerSQLException] + def close(): Unit + + @throws[SparkThriftServerSQLException] + def getResultSetSchema: StructType + + @throws[SparkThriftServerSQLException] + def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet + + @throws[SparkThriftServerSQLException] + def getNextRowSet: RowSet = + getNextRowSet(FetchOrientation.FETCH_NEXT, Operation.DEFAULT_FETCH_MAX_ROWS) + + + /** + * Verify if the given fetch orientation is part of the default orientation types. + */ + @throws[SparkThriftServerSQLException] + protected def validateDefaultFetchOrientation(orientation: FetchOrientation): Unit = { + validateFetchOrientation(orientation, DEFAULT_FETCH_ORIENTATION_SET) + } + + /** + * Verify if the given fetch orientation is part of the supported orientation types. + */ + @throws[SparkThriftServerSQLException] + protected def validateFetchOrientation(orientation: FetchOrientation, + supportedOrientations: Set[FetchOrientation]): Unit = { + if (!supportedOrientations.contains(orientation)) { + throw new SparkThriftServerSQLException( + "The fetch type " + orientation.toString + " is not supported for this resultset", "HY106") + } + } + + protected def toSQLException( + prefix: String, + response: CommandProcessorResponse): SparkThriftServerSQLException = { + val ex = new SparkThriftServerSQLException(prefix + ": " + + response.getErrorMessage, response.getSQLState, response.getResponseCode) + if (response.getException != null) { + ex.initCause(response.getException) + } + ex + } +} + +object Operation { + final val DEFAULT_FETCH_ORIENTATION: FetchOrientation = FetchOrientation.FETCH_NEXT + final val DEFAULT_FETCH_MAX_ROWS = 100 +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala new file mode 100644 index 000000000000..95fc4784e0ab --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala @@ -0,0 +1,330 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.sql.SQLException +import java.util +import java.util.concurrent.ConcurrentHashMap + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.session.OperationLog +import org.apache.log4j.Logger + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.hive.HiveUtils +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.thriftserver.AbstractService +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types.StructType + + +private[thriftserver] class OperationManager + extends AbstractService(classOf[OperationManager].getSimpleName) + with Logging { + + private[this] lazy val logSchema: StructType = new StructType().add("operation_log", "string") + private[this] val handleToOperation = new ConcurrentHashMap[OperationHandle, Operation] + val sessionToContexts = new ConcurrentHashMap[SessionHandle, SQLContext]() + val sessionToActivePool = new ConcurrentHashMap[SessionHandle, String]() + + override def init(hiveConf: HiveConf): Unit = synchronized { + if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { + initOperationLogCapture( + hiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL)) + } else { + logDebug("Operation level logging is turned off") + } + super.init(hiveConf) + } + + override def start(): Unit = { + super.start() + // TODO + } + + override def stop(): Unit = { + super.stop() + } + + private def initOperationLogCapture(loggingMode: String): Unit = { + // Register another Appender (with the same layout) that talks to us. + val ap = new LogDivertAppender(this, OperationLog.getLoggingLevel(loggingMode)) + Logger.getRootLogger.addAppender(ap) + } + + + def newExecuteStatementOperation(parentSession: ThriftServerSession, + statement: String, + confOverlay: Map[String, String], + async: Boolean): SparkExecuteStatementOperation = synchronized { + val sqlContext = sessionToContexts.get(parentSession.getSessionHandle) + require(sqlContext != null, s"Session handle: ${parentSession.getSessionHandle} has not been" + + s" initialized or had already closed.") + val conf = sqlContext.sessionState.conf + val runInBackground = async && conf.getConf(HiveUtils.HIVE_THRIFT_SERVER_ASYNC) + val operation = new SparkExecuteStatementOperation(parentSession, statement, confOverlay, + runInBackground)(sqlContext, sessionToActivePool) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created Operation for $statement with session=$parentSession, " + + s"runInBackground=$runInBackground") + operation + } + + def newGetTypeInfoOperation(session: ThriftServerSession): SparkGetTypeInfoOperation = + synchronized { + val sqlContext = sessionToContexts.get(session.getSessionHandle) + require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + + " initialized or had already closed.") + val operation = new SparkGetTypeInfoOperation(sqlContext, session) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created GetTypeInfoOperation with session=$session.") + operation + } + + def newGetCatalogsOperation(session: ThriftServerSession): SparkGetCatalogsOperation = + synchronized { + val sqlContext = sessionToContexts.get(session.getSessionHandle) + require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + + " initialized or had already closed.") + val operation = new SparkGetCatalogsOperation(sqlContext, session) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created GetCatalogsOperation with session=$session.") + operation + } + + def newGetSchemasOperation(session: ThriftServerSession, + catalogName: String, + schemaName: String): SparkGetSchemasOperation = synchronized { + val sqlContext = sessionToContexts.get(session.getSessionHandle) + require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + + " initialized or had already closed.") + val operation = new SparkGetSchemasOperation(sqlContext, session, catalogName, schemaName) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created GetSchemasOperation with session=$session.") + operation + } + + def newGetTablesOperation(session: ThriftServerSession, + catalogName: String, + schemaName: String, + tableName: String, + tableTypes: List[String]): SparkMetadataOperation = synchronized { + val sqlContext = sessionToContexts.get(session.getSessionHandle) + require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + + " initialized or had already closed.") + val operation = new SparkGetTablesOperation(sqlContext, session, + catalogName, schemaName, tableName, tableTypes.asJava) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created GetTablesOperation with session=$session.") + operation + } + + def newGetColumnsOperation(session: ThriftServerSession, + catalogName: String, + schemaName: String, + tableName: String, + columnName: String): SparkGetColumnsOperation = synchronized { + val sqlContext = sessionToContexts.get(session.getSessionHandle) + require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + + " initialized or had already closed.") + val operation = new SparkGetColumnsOperation(sqlContext, session, + catalogName, schemaName, tableName, columnName) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created GetColumnsOperation with session=$session.") + operation + } + + def newGetTableTypesOperation(session: ThriftServerSession): SparkGetTableTypesOperation = + synchronized { + val sqlContext = sessionToContexts.get(session.getSessionHandle) + require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + + " initialized or had already closed.") + val operation = new SparkGetTableTypesOperation(sqlContext, session) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created GetTableTypesOperation with session=$session.") + operation + } + + def newGetFunctionsOperation(session: ThriftServerSession, + catalogName: String, + schemaName: String, + functionName: String): SparkGetFunctionsOperation = synchronized { + val sqlContext = sessionToContexts.get(session.getSessionHandle) + require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + + " initialized or had already closed.") + val operation = new SparkGetFunctionsOperation(sqlContext, session, + catalogName, schemaName, functionName) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created GetFunctionsOperation with session=$session.") + operation + } + + def newGetPrimaryKeysOperation(session: ThriftServerSession, + catalogName: String, + schemaName: String, + tableName: String): Operation = { + throw new SparkThriftServerSQLException("GetFunctionsOperation is not supported yet") + } + + def newGetCrossReferenceOperation(parentSession: ThriftServerSession, + primaryCatalog: String, + primarySchema: String, + primaryTable: String, + foreignCatalog: String, + foreignSchema: String, + foreignTable: String): Operation = { + throw new SparkThriftServerSQLException("GetPrimaryKeysOperation is not supported yet") + } + + def setConfMap(conf: SQLConf, confMap: java.util.Map[String, String]): Unit = { + val iterator = confMap.entrySet().iterator() + while (iterator.hasNext) { + val kv = iterator.next() + conf.setConfString(kv.getKey, kv.getValue) + } + } + + @throws[SparkThriftServerSQLException] + def getOperation(operationHandle: OperationHandle): Operation = { + val operation: Operation = getOperationInternal(operationHandle) + if (operation == null) { + throw new SparkThriftServerSQLException("Invalid OperationHandle: " + operationHandle) + } + operation + } + + private def getOperationInternal(operationHandle: OperationHandle): Operation = { + handleToOperation.get(operationHandle) + } + + private def removeTimedOutOperation(operationHandle: OperationHandle): Operation = { + val operation: Operation = handleToOperation.get(operationHandle) + if (operation != null && operation.isTimedOut(System.currentTimeMillis)) { + handleToOperation.remove(operationHandle) + return operation + } + null + } + + private def addOperation(operation: Operation): Unit = { + handleToOperation.put(operation.getHandle, operation) + } + + private def removeOperation(opHandle: OperationHandle): Operation = { + handleToOperation.remove(opHandle) + } + + @throws[SparkThriftServerSQLException] + def getOperationStatus(opHandle: OperationHandle): OperationStatus = { + getOperation(opHandle).getStatus + } + + @throws[SparkThriftServerSQLException] + def cancelOperation(opHandle: OperationHandle): Unit = { + val operation: Operation = getOperation(opHandle) + val opState: OperationState = operation.getStatus.getState + if ((opState eq CANCELED) || + (opState eq CLOSED) || + (opState eq FINISHED) || + (opState eq ERROR) || + (opState eq UNKNOWN)) { // Cancel should be a no-op in either cases + logDebug(opHandle + ": Operation is already aborted in state - " + opState) + } else { + logDebug(opHandle + ": Attempting to cancel from state - " + opState) + operation.cancel + } + } + + @throws[SparkThriftServerSQLException] + def closeOperation(opHandle: OperationHandle): Unit = { + val operation: Operation = removeOperation(opHandle) + if (operation == null) { + throw new SparkThriftServerSQLException("Operation does not exist!") + } + operation.close + } + + @throws[SparkThriftServerSQLException] + def getOperationResultSetSchema(opHandle: OperationHandle): StructType = { + getOperation(opHandle).getResultSetSchema + } + + @throws[SparkThriftServerSQLException] + def getOperationNextRowSet(opHandle: OperationHandle): RowSet = { + getOperation(opHandle).getNextRowSet + } + + @throws[SparkThriftServerSQLException] + def getOperationNextRowSet(opHandle: OperationHandle, + orientation: FetchOrientation, + maxRows: Long): RowSet = { + getOperation(opHandle).getNextRowSet(orientation, maxRows) + } + + @throws[SparkThriftServerSQLException] + def getOperationLogRowSet(opHandle: OperationHandle, + orientation: FetchOrientation, + maxRows: Long): RowSet = { + // get the OperationLog object from the operation + val operationLog: OperationLog = getOperation(opHandle).getOperationLog + if (operationLog == null) { + throw new SparkThriftServerSQLException("Couldn't find log associated " + + "with operation handle: " + opHandle) + } + // read logs + var logs: util.List[String] = null + try { + logs = operationLog.readOperationLog(isFetchFirst(orientation), maxRows) + } catch { + case e: SQLException => + throw new SparkThriftServerSQLException(e.getMessage, e.getCause) + } + // convert logs to RowSet + val rowSet: RowSet = RowSetFactory.create(logSchema, logs.asScala.map(Row(_)), getOperation(opHandle).getProtocolVersion) + rowSet + } + + private def isFetchFirst(fetchOrientation: FetchOrientation): Boolean = { + // TODO: Since OperationLog is moved to package o.a.h.h.ql.session, + // we may add a Enum there and map FetchOrientation to it. + if (fetchOrientation.equals(FetchOrientation.FETCH_FIRST)) { + return true + } + false + } + + def getOperationLogByThread: OperationLog = { + OperationLog.getCurrentOperationLog + } + + def removeExpiredOperations(handles: Array[OperationHandle]): List[Operation] = { + val removed: util.List[Operation] = new util.ArrayList[Operation] + handles.foreach(handle => { + val operation: Operation = removeTimedOutOperation(handle) + if (operation != null) { + logWarning("Operation " + handle + " is timed-out and will be closed") + removed.add(operation) + } + }) + removed.asScala.toList + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala new file mode 100644 index 000000000000..619a3302b596 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala @@ -0,0 +1,336 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.security.PrivilegedExceptionAction +import java.util.{Map => JMap, UUID} +import java.util.concurrent.RejectedExecutionException + +import scala.collection.JavaConverters._ +import scala.util.control.NonFatal + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.ql.session.OperationLog +import org.apache.hadoop.hive.shims.Utils + +import org.apache.spark.SparkContext +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{DataFrame, Row => SparkRow, SQLContext} +import org.apache.spark.sql.execution.command.SetCommand +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types._ +import org.apache.spark.util.{Utils => SparkUtils} + +private[thriftserver] class SparkExecuteStatementOperation( + parentSession: ThriftServerSession, + statement: String, + confOverlay: Map[String, String], + runInBackground: Boolean = true)(sqlContext: SQLContext, + sessionToActivePool: JMap[SessionHandle, String]) + extends Operation(parentSession, EXECUTE_STATEMENT, runInBackground) + with Logging { + + private var result: DataFrame = _ + + // We cache the returned rows to get iterators again in case the user wants to use FETCH_FIRST. + // This is only used when `spark.sql.thriftServer.incrementalCollect` is set to `false`. + // In case of `true`, this will be `None` and FETCH_FIRST will trigger re-execution. + private var resultList: Option[Array[SparkRow]] = _ + private var previousFetchEndOffset: Long = 0 + private var previousFetchStartOffset: Long = 0 + private var iter: Iterator[SparkRow] = _ + private var dataTypes: Array[DataType] = _ + + def registerCurrentOperationLog(): Unit = { + if (_isOperationLogEnabled) { + if (_operationLog == null) { + logWarning("Failed to get current OperationLog object of Operation: " + + getHandle.getHandleIdentifier) + _isOperationLogEnabled = false + } else { + OperationLog.setCurrentOperationLog(_operationLog) + } + } + } + + override def close(): Unit = { + // RDDs will be cleaned automatically upon garbage collection. + logInfo(s"Close statement with $statementId") + cleanup(CLOSED) + SparkThriftServer2.listener.onOperationClosed(statementId) + } + + def getNextRowSet(order: FetchOrientation, maxRowsL: Long): RowSet = withSchedulerPool { + logInfo(s"Received getNextRowSet request order=${order} and maxRowsL=${maxRowsL} " + + s"with ${_statementId}") + validateDefaultFetchOrientation(order) + assertState(FINISHED) + setHasResultSet(true) + val resultRowSet: RowSet = + RowSetFactory.create(getResultSetSchema, getProtocolVersion) + + // Reset iter when FETCH_FIRST or FETCH_PRIOR + if ((order.equals(FetchOrientation.FETCH_FIRST) || + order.equals(FetchOrientation.FETCH_PRIOR)) && previousFetchEndOffset != 0) { + // Reset the iterator to the beginning of the query. + iter = if (sqlContext.getConf(SQLConf.THRIFTSERVER_INCREMENTAL_COLLECT.key).toBoolean) { + resultList = None + result.toLocalIterator.asScala + } else { + if (resultList.isEmpty) { + resultList = Some(result.collect()) + } + resultList.get.iterator + } + } + + var resultOffset = { + if (order.equals(FetchOrientation.FETCH_FIRST)) { + logInfo(s"FETCH_FIRST request with $statementId. Resetting to resultOffset=0") + 0 + } else if (order.equals(FetchOrientation.FETCH_PRIOR)) { + // TODO: FETCH_PRIOR should be handled more efficiently than rewinding to beginning and + // reiterating. + val targetOffset = math.max(previousFetchStartOffset - maxRowsL, 0) + logInfo(s"FETCH_PRIOR request with $statementId. Resetting to resultOffset=$targetOffset") + var off = 0 + while (off < targetOffset && iter.hasNext) { + iter.next() + off += 1 + } + off + } else { // FETCH_NEXT + previousFetchEndOffset + } + } + + resultRowSet.setStartOffset(resultOffset) + previousFetchStartOffset = resultOffset + if (!iter.hasNext) { + resultRowSet + } else { + // maxRowsL here typically maps to java.sql.Statement.getFetchSize, which is an int + val maxRows = maxRowsL.toInt + var curRow = 0 + while (curRow < maxRows && iter.hasNext) { + val sparkRow = iter.next() + resultRowSet.addRow(sparkRow) + curRow += 1 + resultOffset += 1 + } + previousFetchEndOffset = resultOffset + logInfo(s"Returning result set with ${curRow} rows from offsets " + + s"[$previousFetchStartOffset, $previousFetchEndOffset) with $statementId") + resultRowSet + } + } + + def getResultSetSchema: StructType = { + assertState(FINISHED) + if (result == null || result.schema.isEmpty) { + new StructType().add("Result", "string") + } else { + result.schema + } + } + + override def runInternal(): Unit = { + setState(PENDING) + _statementId = UUID.randomUUID().toString + logInfo(s"Submitting query '$statement' with $statementId") + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + statement, + _statementId, + parentSession.getUsername) + setHasResultSet(true) // avoid no resultset for async run + + if (!runInBackground) { + execute() + } else { + val sparkServiceUGI = Utils.getUGI() + + // Runnable impl to call runInternal asynchronously, + // from a different thread + val backgroundOperation = new Runnable() { + + override def run(): Unit = { + val doAsAction = new PrivilegedExceptionAction[Unit]() { + override def run(): Unit = { + registerCurrentOperationLog() + try { + execute() + } catch { + case e: SparkThriftServerSQLException => + setOperationException(e) + logError("Error running hive query: ", e) + } + } + } + + try { + sparkServiceUGI.doAs(doAsAction) + } catch { + case e: Exception => + setOperationException(new SparkThriftServerSQLException(e)) + logError("Error running hive query as user : " + + sparkServiceUGI.getShortUserName(), e) + } + } + } + try { + // This submit blocks if no background threads are available to run this operation + val backgroundHandle = + parentSession.getSessionManager.submitBackgroundOperation(backgroundOperation) + setBackgroundHandle(backgroundHandle) + } catch { + case rejected: RejectedExecutionException => + logError("Error submitting query in background, query rejected", rejected) + setState(ERROR) + SparkThriftServer2.listener.onStatementError( + _statementId, rejected.getMessage, SparkUtils.exceptionString(rejected)) + throw new SparkThriftServerSQLException("The background threadpool cannot accept" + + " new task for execution, please retry the operation", rejected) + case NonFatal(e) => + logError(s"Error executing query in background", e) + setState(ERROR) + SparkThriftServer2.listener.onStatementError( + _statementId, e.getMessage, SparkUtils.exceptionString(e)) + throw new SparkThriftServerSQLException(e) + } + } + } + + private def execute(): Unit = withSchedulerPool { + try { + synchronized { + if (getStatus.getState.isTerminal) { + logInfo(s"Query with $statementId in terminal state before it started running") + return + } else { + logInfo(s"Running query with $statementId") + setState(RUNNING) + } + } + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + sqlContext.sparkContext.setJobGroup(_statementId, statement) + result = sqlContext.sql(statement) + logDebug(result.queryExecution.toString()) + result.queryExecution.logical match { + case SetCommand(Some((SQLConf.THRIFTSERVER_POOL.key, Some(value)))) => + sessionToActivePool.put(parentSession.getSessionHandle, value) + logInfo(s"Setting ${SparkContext.SPARK_SCHEDULER_POOL}=$value for future statements " + + "in this session.") + case _ => + } + SparkThriftServer2.listener.onStatementParsed(_statementId, result.queryExecution.toString()) + iter = { + if (sqlContext.getConf(SQLConf.THRIFTSERVER_INCREMENTAL_COLLECT.key).toBoolean) { + resultList = None + result.toLocalIterator.asScala + } else { + resultList = Some(result.collect()) + resultList.get.iterator + } + } + dataTypes = result.queryExecution.analyzed.output.map(_.dataType).toArray + } catch { + // Actually do need to catch Throwable as some failures don't inherit from Exception and + // HiveServer will silently swallow them. + case e: Throwable => + // When cancel() or close() is called very quickly after the query is started, + // then they may both call cleanup() before Spark Jobs are started. But before background + // task interrupted, it may have start some spark job, so we need to cancel again to + // make sure job was cancelled when background thread was interrupted + if (_statementId != null) { + sqlContext.sparkContext.cancelJobGroup(_statementId) + } + val currentState = getStatus.getState + if (currentState.isTerminal) { + // This may happen if the execution was cancelled, and then closed from another thread. + logWarning(s"Ignore exception in terminal state with $statementId: $e") + } else { + logError(s"Error executing query with $statementId, currentState $currentState, ", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error running query: " + root.toString, root) + } + } + } finally { + synchronized { + if (!getStatus.getState.isTerminal) { + setState(FINISHED) + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + } + sqlContext.sparkContext.clearJobGroup() + } + } + + override def cancel(): Unit = { + synchronized { + if (!getStatus.getState.isTerminal) { + logInfo(s"Cancel query with $statementId") + cleanup(CANCELED) + SparkThriftServer2.listener.onStatementCanceled(_statementId) + } + } + } + + private def cleanup(state: OperationState): Unit = { + setState(state) + if (runInBackground) { + val backgroundHandle = getBackgroundHandle + if (backgroundHandle != null) { + backgroundHandle.cancel(true) + } + } + if (_statementId != null) { + sqlContext.sparkContext.cancelJobGroup(_statementId) + } + } + + private def withSchedulerPool[T](body: => T): T = { + val pool = sessionToActivePool.get(parentSession.getSessionHandle) + if (pool != null) { + sqlContext.sparkContext.setLocalProperty(SparkContext.SPARK_SCHEDULER_POOL, pool) + } + try { + body + } finally { + if (pool != null) { + sqlContext.sparkContext.setLocalProperty(SparkContext.SPARK_SCHEDULER_POOL, null) + } + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala new file mode 100644 index 000000000000..07ebd2396bba --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util.UUID + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types.{StringType, StructField, StructType} +import org.apache.spark.util.{Utils => SparkUtils} + +/** + * Spark's own GetCatalogsOperation + * + * @param sqlContext SQLContext to use + * @param parentSession a HiveSession from SessionManager + */ +private[thriftserver] class SparkGetCatalogsOperation( + sqlContext: SQLContext, + parentSession: ThriftServerSession) + extends SparkMetadataOperation(parentSession, GET_CATALOGS) with Logging { + + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TABLE_CAT", StringType)) + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + + override def close(): Unit = { + super.close() + SparkThriftServer2.listener.onOperationClosed(_statementId) + } + + override def runInternal(): Unit = { + _statementId = UUID.randomUUID().toString + val logMsg = "Listing catalogs" + logInfo(s"$logMsg with $statementId") + setState(RUNNING) + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + logMsg, + _statementId, + parentSession.getUsername) + + try { + if (isAuthV2Enabled) { + authorizeMetaGets(HiveOperationType.GET_CATALOGS, null) + } + setState(FINISHED) + } catch { + case e: Throwable => + logError(s"Error executing get catalogs operation with $statementId", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error getting catalogs: " + + root.toString, root) + } + } + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + + override def getResultSetSchema: StructType = { + assertState(FINISHED) + RESULT_SET_SCHEMA + } + + override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { + assertState(FINISHED) + validateDefaultFetchOrientation(orientation) + if (orientation == FetchOrientation.FETCH_FIRST) { + rowSet.setStartOffset(0) + } + rowSet.extractSubset(maxRows.toInt) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala new file mode 100644 index 000000000000..b3eeecdcf03d --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala @@ -0,0 +1,233 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util.UUID +import java.util.regex.Pattern + +import scala.collection.JavaConverters.seqAsJavaListConverter + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObject} +import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject.HivePrivilegeObjectType + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.catalyst.catalog.SessionCatalog +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types._ +import org.apache.spark.util.{Utils => SparkUtils} + +/** + * Spark's own SparkGetColumnsOperation + * + * @param sqlContext SQLContext to use + * @param parentSession a HiveSession from SessionManager + * @param catalogName catalog name. NULL if not applicable. + * @param schemaName database name, NULL or a concrete database name + * @param tableName table name + * @param columnName column name + */ +private[thriftserver] class SparkGetColumnsOperation( + sqlContext: SQLContext, + parentSession: ThriftServerSession, + catalogName: String, + schemaName: String, + tableName: String, + columnName: String) + extends SparkMetadataOperation(parentSession, GET_COLUMNS) + with Logging { + + val catalog: SessionCatalog = sqlContext.sessionState.catalog + + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TABLE_CAT", StringType)) + .add(StructField("TABLE_SCHEM", StringType)) + .add(StructField("TABLE_NAME", StringType)) + .add(StructField("COLUMN_NAME", StringType)) + .add(StructField("DATA_TYPE", IntegerType)) + .add(StructField("TYPE_NAME", StringType)) + .add(StructField("COLUMN_SIZE", IntegerType)) + .add(StructField("BUFFER_LENGTH", ShortType)) + .add(StructField("DECIMAL_DIGITS", IntegerType)) + .add(StructField("NUM_PREC_RADIX", IntegerType)) + .add(StructField("NULLABLE", IntegerType)) + .add(StructField("REMARKS", StringType)) + .add(StructField("COLUMN_DEF", StringType)) + .add(StructField("SQL_DATA_TYPE", IntegerType)) + .add(StructField("SQL_DATETIME_SUB", IntegerType)) + .add(StructField("CHAR_OCTET_LENGTH", IntegerType)) + .add(StructField("ORDINAL_POSITION", IntegerType)) + .add(StructField("IS_NULLABLE", StringType)) + .add(StructField("SCOPE_CATALOG", StringType)) + .add(StructField("SCOPE_SCHEMA", StringType)) + .add(StructField("SCOPE_TABLE", StringType)) + .add(StructField("SOURCE_DATA_TYPE", ShortType)) + .add(StructField("IS_AUTO_INCREMENT", StringType)) + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + override def close(): Unit = { + super.close() + SparkThriftServer2.listener.onOperationClosed(_statementId) + } + + override def runInternal(): Unit = { + _statementId = UUID.randomUUID().toString + // Do not change cmdStr. It's used for Hive auditing and authorization. + val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName, tablePattern : $tableName" + val logMsg = s"Listing columns '$cmdStr, columnName : $columnName'" + logInfo(s"$logMsg with $statementId") + + setState(RUNNING) + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + logMsg, + _statementId, + parentSession.getUsername) + + val schemaPattern = convertSchemaPattern(schemaName) + val tablePattern = convertIdentifierPattern(tableName, true) + + var columnPattern: Pattern = null + if (columnName != null) { + columnPattern = Pattern.compile(convertIdentifierPattern(columnName, false)) + } + + val db2Tabs = catalog.listDatabases(schemaPattern).map { dbName => + (dbName, catalog.listTables(dbName, tablePattern, includeLocalTempViews = false)) + }.toMap + + if (isAuthV2Enabled) { + val privObjs = seqAsJavaListConverter(getPrivObjs(db2Tabs)).asJava + authorizeMetaGets(HiveOperationType.GET_COLUMNS, privObjs, cmdStr) + } + + try { + // Tables and views + db2Tabs.foreach { + case (dbName, tables) => + catalog.getTablesByName(tables).foreach { catalogTable => + addToRowSet(columnPattern, dbName, catalogTable.identifier.table, catalogTable.schema) + } + } + + // Global temporary views + val globalTempViewDb = catalog.globalTempViewManager.database + val databasePattern = Pattern.compile(CLIServiceUtils.patternToRegex(schemaName)) + if (databasePattern.matcher(globalTempViewDb).matches()) { + catalog.globalTempViewManager.listViewNames(tablePattern).foreach { globalTempView => + catalog.globalTempViewManager.get(globalTempView).foreach { plan => + addToRowSet(columnPattern, globalTempViewDb, globalTempView, plan.schema) + } + } + } + + // Temporary views + catalog.listLocalTempViews(tablePattern).foreach { localTempView => + catalog.getTempView(localTempView.table).foreach { plan => + addToRowSet(columnPattern, null, localTempView.table, plan.schema) + } + } + setState(FINISHED) + } catch { + case e: Throwable => + logError(s"Error executing get columns operation with $statementId", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error getting columns: " + root.toString, root) + } + } + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + + private def addToRowSet( + columnPattern: Pattern, + dbName: String, + tableName: String, + schema: StructType): Unit = { + schema.foreach { column => + if (columnPattern != null && !columnPattern.matcher(column.name).matches()) { + } else { + val rowData = Row( + null, // TABLE_CAT + dbName, // TABLE_SCHEM + tableName, // TABLE_NAME + column.name, // COLUMN_NAME + Type.getType(column.dataType.sql).getName, // DATA_TYPE + column.dataType.sql, // TYPE_NAME + null, // COLUMN_SIZE + null, // BUFFER_LENGTH, unused + null, // DECIMAL_DIGITS + null, // NUM_PREC_RADIX + (if (column.nullable) 1 else 0), // NULLABLE + column.getComment().getOrElse(""), // REMARKS + null, // COLUMN_DEF + null, // SQL_DATA_TYPE + null, // SQL_DATETIME_SUB + null, // CHAR_OCTET_LENGTH + null, // ORDINAL_POSITION + "YES", // IS_NULLABLE + null, // SCOPE_CATALOG + null, // SCOPE_SCHEMA + null, // SCOPE_TABLE + null, // SOURCE_DATA_TYPE + "NO" // IS_AUTO_INCREMENT + ) + rowSet.addRow(rowData) + } + } + } + + private def getPrivObjs(db2Tabs: Map[String, Seq[TableIdentifier]]): Seq[HivePrivilegeObject] = { + db2Tabs.foldLeft(Seq.empty[HivePrivilegeObject])({ + case (i, (dbName, tables)) => i ++ tables.map { tableId => + new HivePrivilegeObject(HivePrivilegeObjectType.TABLE_OR_VIEW, dbName, tableId.table) + } + }) + } + + override def getResultSetSchema: StructType = { + assertState(FINISHED) + RESULT_SET_SCHEMA + } + + override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { + assertState(FINISHED) + validateDefaultFetchOrientation(orientation) + if (orientation == FetchOrientation.FETCH_FIRST) { + rowSet.setStartOffset(0) + } + rowSet.extractSubset(maxRows.toInt) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala new file mode 100644 index 000000000000..92c49ca09aff --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala @@ -0,0 +1,148 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.sql.DatabaseMetaData +import java.util.UUID + +import scala.collection.JavaConverters.seqAsJavaListConverter + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObjectUtils} + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType} +import org.apache.spark.util.{Utils => SparkUtils} + +/** + * Spark's own GetFunctionsOperation + * + * @param sqlContext SQLContext to use + * @param parentSession a HiveSession from SessionManager + * @param catalogName catalog name. null if not applicable + * @param schemaName database name, null or a concrete database name + * @param functionName function name pattern + */ +private[thriftserver] class SparkGetFunctionsOperation( + sqlContext: SQLContext, + parentSession: ThriftServerSession, + catalogName: String, + schemaName: String, + functionName: String) + extends SparkMetadataOperation(parentSession, GET_FUNCTIONS) with Logging { + + RESULT_SET_SCHEMA = new StructType() + .add(StructField("FUNCTION_CAT", StringType)) + .add(StructField("FUNCTION_SCHEM", StringType)) + .add(StructField("FUNCTION_NAME", StringType)) + .add(StructField("REMARKS", StringType)) + .add(StructField("FUNCTION_TYPE", IntegerType)) + .add(StructField("SPECIFIC_NAME", StringType)) + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + + override def close(): Unit = { + super.close() + SparkThriftServer2.listener.onOperationClosed(_statementId) + } + + override def runInternal(): Unit = { + _statementId = UUID.randomUUID().toString + // Do not change cmdStr. It's used for Hive auditing and authorization. + val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" + val logMsg = s"Listing functions '$cmdStr, functionName : $functionName'" + logInfo(s"$logMsg with $statementId") + setState(RUNNING) + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + val catalog = sqlContext.sessionState.catalog + // get databases for schema pattern + val schemaPattern = convertSchemaPattern(schemaName) + val matchingDbs = catalog.listDatabases(schemaPattern) + val functionPattern = CLIServiceUtils.patternToRegex(functionName) + + if (isAuthV2Enabled) { + // authorize this call on the schema objects + val privObjs = + HivePrivilegeObjectUtils.getHivePrivDbObjects(seqAsJavaListConverter(matchingDbs).asJava) + authorizeMetaGets(HiveOperationType.GET_FUNCTIONS, privObjs, cmdStr) + } + + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + logMsg, + _statementId, + parentSession.getUsername) + + try { + matchingDbs.foreach { db => + catalog.listFunctions(db, functionPattern).foreach { + case (funcIdentifier, _) => + val info = catalog.lookupFunctionInfo(funcIdentifier) + val rowData = Row( + DEFAULT_HIVE_CATALOG, // FUNCTION_CAT + db, // FUNCTION_SCHEM + funcIdentifier.funcName, // FUNCTION_NAME + info.getUsage, // REMARKS + DatabaseMetaData.functionResultUnknown.asInstanceOf[AnyRef], // FUNCTION_TYPE + info.getClassName) // SPECIFIC_NAME + rowSet.addRow(rowData); + } + } + setState(FINISHED) + } catch { + case e: Throwable => + logError(s"Error executing get functions operation with $statementId", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error getting functions: " + + root.toString, root) + } + } + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + + override def getResultSetSchema: StructType = { + assertState(FINISHED) + RESULT_SET_SCHEMA + } + + override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { + assertState(FINISHED) + validateDefaultFetchOrientation(orientation) + if (orientation == FetchOrientation.FETCH_FIRST) { + rowSet.setStartOffset(0) + } + rowSet.extractSubset(maxRows.toInt) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala new file mode 100644 index 000000000000..1a65df10322c --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala @@ -0,0 +1,127 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util.UUID +import java.util.regex.Pattern + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types.{StringType, StructField, StructType} +import org.apache.spark.util.{Utils => SparkUtils} + +/** + * Spark's own GetSchemasOperation + * + * @param sqlContext SQLContext to use + * @param parentSession a HiveSession from SessionManager + * @param catalogName catalog name. null if not applicable. + * @param schemaName database name, null or a concrete database name + */ +private[thriftserver] class SparkGetSchemasOperation( + sqlContext: SQLContext, + parentSession: ThriftServerSession, + catalogName: String, + schemaName: String) + extends SparkMetadataOperation(parentSession, GET_SCHEMAS) with Logging { + + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TABLE_SCHEM", StringType)) + .add(StructField("TABLE_CATALOG", StringType)) + + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + + override def close(): Unit = { + super.close() + SparkThriftServer2.listener.onOperationClosed(_statementId) + } + + override def runInternal(): Unit = { + _statementId = UUID.randomUUID().toString + // Do not change cmdStr. It's used for Hive auditing and authorization. + val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" + val logMsg = s"Listing databases '$cmdStr'" + logInfo(s"$logMsg with $statementId") + setState(RUNNING) + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + if (isAuthV2Enabled) { + authorizeMetaGets(HiveOperationType.GET_TABLES, null, cmdStr) + } + + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + logMsg, + _statementId, + parentSession.getUsername) + + try { + val schemaPattern = convertSchemaPattern(schemaName) + sqlContext.sessionState.catalog.listDatabases(schemaPattern).foreach { dbName => + rowSet.addRow(Row(dbName, DEFAULT_HIVE_CATALOG)) + } + + val globalTempViewDb = sqlContext.sessionState.catalog.globalTempViewManager.database + val databasePattern = Pattern.compile(CLIServiceUtils.patternToRegex(schemaName)) + if (databasePattern.matcher(globalTempViewDb).matches()) { + rowSet.addRow(Row(globalTempViewDb, DEFAULT_HIVE_CATALOG)) + } + setState(FINISHED) + } catch { + case e: Throwable => + logError(s"Error executing get schemas operation with $statementId", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error getting schemas: " + root.toString, root) + } + } + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + + override def getResultSetSchema: StructType = { + assertState(FINISHED) + RESULT_SET_SCHEMA + } + + override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { + assertState(FINISHED) + validateDefaultFetchOrientation(orientation) + if (orientation == FetchOrientation.FETCH_FIRST) { + rowSet.setStartOffset(0) + } + rowSet.extractSubset(maxRows.toInt) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala new file mode 100644 index 000000000000..10116a579492 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala @@ -0,0 +1,122 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util.UUID + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.catalyst.catalog.CatalogTableType +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types.{StringType, StructField, StructType} +import org.apache.spark.util.{Utils => SparkUtils} + +/** + * Spark's own GetTableTypesOperation + * + * @param sqlContext SQLContext to use + * @param parentSession a HiveSession from SessionManager + */ +private[thriftserver] class SparkGetTableTypesOperation( + sqlContext: SQLContext, + parentSession: ThriftServerSession) + extends SparkMetadataOperation(parentSession, GET_TABLE_TYPES) + with SparkMetadataOperationUtils with Logging { + + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TABLE_TYPE", StringType)) + + private var tableTypeMapping: TableTypeMapping = { + val tableMappingStr = + parentSession.getHiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING) + TableTypeMappingFactory.getTableTypeMapping(tableMappingStr) + } + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + + override def close(): Unit = { + super.close() + SparkThriftServer2.listener.onOperationClosed(_statementId) + } + + override def runInternal(): Unit = { + _statementId = UUID.randomUUID().toString + val logMsg = "Listing table types" + logInfo(s"$logMsg with $statementId") + setState(RUNNING) + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + if (isAuthV2Enabled) { + authorizeMetaGets(HiveOperationType.GET_TABLETYPES, null) + } + + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + logMsg, + _statementId, + parentSession.getUsername) + + try { + val tableTypes = CatalogTableType.tableTypes.map(tableTypeString).toSet + tableTypes.foreach { tableType => + rowSet.addRow(Row(tableType)) + } + setState(FINISHED) + } catch { + case e: Throwable => + logError(s"Error executing get table types operation with $statementId", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error getting table types: " + + root.toString, root) + } + } + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + + override def getResultSetSchema: StructType = { + assertState(FINISHED) + RESULT_SET_SCHEMA + } + + override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { + assertState(FINISHED) + validateDefaultFetchOrientation(orientation) + if (orientation == FetchOrientation.FETCH_FIRST) { + rowSet.setStartOffset(0) + } + rowSet.extractSubset(maxRows.toInt) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala new file mode 100644 index 000000000000..de10050cc328 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util.{List => JList, UUID} +import java.util.regex.Pattern + +import scala.collection.JavaConverters._ + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObjectUtils} + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.catalyst.catalog.CatalogTableType._ +import org.apache.spark.sql.hive.HiveUtils +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types.{StringType, StructField, StructType} +import org.apache.spark.util.{Utils => SparkUtils} + +/** + * Spark's own GetTablesOperation + * + * @param sqlContext SQLContext to use + * @param parentSession a HiveSession from SessionManager + * @param catalogName catalog name. null if not applicable + * @param schemaName database name, null or a concrete database name + * @param tableName table name pattern + * @param tableTypes list of allowed table types, e.g. "TABLE", "VIEW" + */ +private[thriftserver] class SparkGetTablesOperation( + sqlContext: SQLContext, + parentSession: ThriftServerSession, + catalogName: String, + schemaName: String, + tableName: String, + tableTypes: JList[String]) + extends SparkMetadataOperation(parentSession, GET_TABLES) + with SparkMetadataOperationUtils with Logging { + + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TABLE_CAT", StringType)) + .add(StructField("TABLE_SCHEM", StringType)) + .add(StructField("TABLE_NAME", StringType)) + .add(StructField("TABLE_TYPE", StringType)) + .add(StructField("REMARKS", StringType)) + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + + private val tableTypeMapping: TableTypeMapping = { + val tableMappingStr = parentSession.getHiveConf + .getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING) + TableTypeMappingFactory.getTableTypeMapping(tableMappingStr) + } + + override def close(): Unit = { + super.close() + SparkThriftServer2.listener.onOperationClosed(_statementId) + } + + override def runInternal(): Unit = { + _statementId = UUID.randomUUID().toString + // Do not change cmdStr. It's used for Hive auditing and authorization. + val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" + val tableTypesStr = if (tableTypes == null) "null" else tableTypes.asScala.mkString(",") + val logMsg = s"Listing tables '$cmdStr, tableTypes : $tableTypesStr, tableName : $tableName'" + logInfo(s"$logMsg with $statementId") + setState(RUNNING) + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + val catalog = sqlContext.sessionState.catalog + val schemaPattern = convertSchemaPattern(schemaName) + val tablePattern = convertIdentifierPattern(tableName, true) + val matchingDbs = catalog.listDatabases(schemaPattern) + + if (isAuthV2Enabled) { + val privObjs = + HivePrivilegeObjectUtils.getHivePrivDbObjects(seqAsJavaListConverter(matchingDbs).asJava) + authorizeMetaGets(HiveOperationType.GET_TABLES, privObjs, cmdStr) + } + + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + logMsg, + _statementId, + parentSession.getUsername) + + try { + // Tables and views + matchingDbs.foreach { dbName => + val tables = catalog.listTables(dbName, tablePattern, includeLocalTempViews = false) + catalog.getTablesByName(tables).foreach { table => + val tableType = tableTypeString(table.tableType) + if (tableTypes == null || tableTypes.isEmpty || tableTypes.contains(tableType)) { + addToRowSet(table.database, table.identifier.table, tableType, table.comment) + } + } + } + + // Temporary views and global temporary views + if (tableTypes == null || tableTypes.isEmpty || tableTypes.contains(VIEW.name)) { + val globalTempViewDb = catalog.globalTempViewManager.database + val databasePattern = Pattern.compile(CLIServiceUtils.patternToRegex(schemaName)) + val tempViews = if (databasePattern.matcher(globalTempViewDb).matches()) { + catalog.listTables(globalTempViewDb, tablePattern, includeLocalTempViews = true) + } else { + catalog.listLocalTempViews(tablePattern) + } + tempViews.foreach { view => + addToRowSet(view.database.orNull, view.table, VIEW.name, None) + } + } + setState(FINISHED) + } catch { + case e: Throwable => + logError(s"Error executing get tables operation with $statementId", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error getting tables: " + root.toString, root) + } + } + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + + private def addToRowSet( + dbName: String, + tableName: String, + tableType: String, + comment: Option[String]): Unit = { + val rowData = Array[AnyRef]( + "", + dbName, + tableName, + tableType, + comment.getOrElse("")) + // Since HIVE-7575(Hive 2.0.0), adds 5 additional columns to the ResultSet of GetTables. + if (HiveUtils.isHive23) { + rowSet.addRow(Row(rowData ++ Array(null, null, null, null, null))) + } else { + rowSet.addRow(Row(rowData)) + } + } + + override def getResultSetSchema: StructType = { + assertState(FINISHED) + RESULT_SET_SCHEMA + } + + + override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { + assertState(FINISHED) + validateDefaultFetchOrientation(orientation) + if (orientation == FetchOrientation.FETCH_FIRST) { + rowSet.setStartOffset(0) + } + rowSet.extractSubset(maxRows.toInt) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala new file mode 100644 index 000000000000..1cd24052f7dc --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala @@ -0,0 +1,150 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util.UUID + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types._ +import org.apache.spark.util.{Utils => SparkUtils} + +/** + * Spark's own GetTypeInfoOperation + * + * @param sqlContext SQLContext to use + * @param parentSession a HiveSession from SessionManager + */ +private[thriftserver] class SparkGetTypeInfoOperation( + sqlContext: SQLContext, + parentSession: ThriftServerSession) + extends SparkMetadataOperation(parentSession, GET_TYPE_INFO) with Logging { + + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TYPE_NAME", StringType)) + .add(StructField("DATA_TYPE", IntegerType)) + .add(StructField("PRECISION", IntegerType)) + .add(StructField("LITERAL_PREFIX", StringType)) + .add(StructField("LITERAL_SUFFIX", StringType)) + .add(StructField("CREATE_PARAMS", StringType)) + .add(StructField("NULLABLE", ShortType)) + .add(StructField("CASE_SENSITIVE", BooleanType)) + .add(StructField("SEARCHABLE", ShortType)) + .add(StructField("UNSIGNED_ATTRIBUTE", BooleanType)) + .add(StructField("FIXED_PREC_SCALE", BooleanType)) + .add(StructField("AUTO_INCREMENT", BooleanType)) + .add(StructField("LOCAL_TYPE_NAME", StringType)) + .add(StructField("MINIMUM_SCALE", ShortType)) + .add(StructField("MAXIMUM_SCALE", ShortType)) + .add(StructField("SQL_DATA_TYPE", IntegerType)) + .add(StructField("SQL_DATETIME_SUB", IntegerType)) + .add(StructField("NUM_PREC_RADIX", IntegerType)) + + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + + override def close(): Unit = { + super.close() + SparkThriftServer2.listener.onOperationClosed(_statementId) + } + + override def runInternal(): Unit = { + _statementId = UUID.randomUUID().toString + val logMsg = "Listing type info" + logInfo(s"$logMsg with $statementId") + setState(RUNNING) + // Always use the latest class loader provided by executionHive's state. + val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader + Thread.currentThread().setContextClassLoader(executionHiveClassLoader) + + if (isAuthV2Enabled) { + authorizeMetaGets(HiveOperationType.GET_TYPEINFO, null) + } + + SparkThriftServer2.listener.onStatementStart( + _statementId, + parentSession.getSessionHandle.getSessionId.toString, + logMsg, + _statementId, + parentSession.getUsername) + + try { + Type.values.foreach(typeInfo => { + val rowData = Row( + typeInfo.getName, // TYPE_NAME + typeInfo.toJavaSQLType, // DATA_TYPE + typeInfo.getMaxPrecision.getOrElse(null), // PRECISION + typeInfo.getLiteralPrefix, // LITERAL_PREFIX + typeInfo.getLiteralSuffix, // LITERAL_SUFFIX + typeInfo.getCreateParams, // CREATE_PARAMS + typeInfo.getNullable, // NULLABLE + typeInfo.isCaseSensitive, // CASE_SENSITIVE + typeInfo.getSearchable, // SEARCHABLE + typeInfo.isUnsignedAttribute, // UNSIGNED_ATTRIBUTE + typeInfo.isFixedPrecScale, // FIXED_PREC_SCALE + typeInfo.isAutoIncrement, // AUTO_INCREMENT + typeInfo.getLocalizedName, // LOCAL_TYPE_NAME + typeInfo.getMinimumScale, // MINIMUM_SCALE + typeInfo.getMaximumScale, // MAXIMUM_SCALE + null, // SQL_DATA_TYPE, unused + null, // SQL_DATETIME_SUB, unused + typeInfo.getNumPrecRadix // NUM_PREC_RADIX + ) + rowSet.addRow(rowData) + }) + setState(FINISHED) + } catch { + case e: Throwable => + logError(s"Error executing get type info with $statementId", e) + setState(ERROR) + e match { + case hiveException: SparkThriftServerSQLException => + SparkThriftServer2.listener.onStatementError( + _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + throw hiveException + case _ => + val root = ExceptionUtils.getRootCause(e) + SparkThriftServer2.listener.onStatementError( + _statementId, root.getMessage, SparkUtils.exceptionString(root)) + throw new SparkThriftServerSQLException("Error getting type info: " + + root.toString, root) + } + } + SparkThriftServer2.listener.onStatementFinish(_statementId) + } + + override def getResultSetSchema: StructType = { + assertState(FINISHED) + RESULT_SET_SCHEMA + } + + override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { + assertState(FINISHED) + validateDefaultFetchOrientation(orientation) + if (orientation == FetchOrientation.FETCH_FIRST) { + rowSet.setStartOffset(0) + } + rowSet.extractSubset(maxRows.toInt) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala new file mode 100644 index 000000000000..32c76dc32a24 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala @@ -0,0 +1,122 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import java.util + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.security.authorization.plugin._ +import org.apache.hadoop.hive.ql.session.SessionState + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.cli.{CLOSED, OperationType, SparkThriftServerSQLException} +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.types.StructType + + +abstract class SparkMetadataOperation(session: ThriftServerSession, opType: OperationType) + extends Operation(session, opType, false) with Logging { + + protected val DEFAULT_HIVE_CATALOG: String = "" + protected var RESULT_SET_SCHEMA: StructType = null + protected val SEARCH_STRING_ESCAPE: Char = '\\' + + setHasResultSet(true) + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.Operation#close() + */ + @throws[SparkThriftServerSQLException] + override def close(): Unit = { + setState(CLOSED) + cleanupOperationLog() + } + + /** + * Convert wildchars and escape sequence from JDBC format to datanucleous/regex + */ + protected def convertIdentifierPattern(pattern: String, datanucleusFormat: Boolean): String = + if (pattern == null) { + convertPattern("%", true) + } else { + convertPattern(pattern, datanucleusFormat) + } + + /** + * Convert wildchars and escape sequence of schema pattern from JDBC format to datanucleous/regex + * The schema pattern treats empty string also as wildchar + */ + protected def convertSchemaPattern(pattern: String): String = + if ((pattern == null) || pattern.isEmpty) { + convertPattern("%", true) + } else { + convertPattern(pattern, true) + } + + /** + * Convert a pattern containing JDBC catalog search wildcards into + * Java regex patterns. + * + * @param pattern input which may contain '%' or '_' wildcard characters, or + * these characters escaped using { @link #getSearchStringEscape()}. + * @return replace %/_ with regex search characters, also handle escaped + * characters. + * + * The datanucleus module expects the wildchar as '*'. The columns search on the + * other hand is done locally inside the hive code and that requires the regex wildchar + * format '.*' This is driven by the datanucleusFormat flag. + */ + private def convertPattern(pattern: String, datanucleusFormat: Boolean): String = { + var wStr: String = null + if (datanucleusFormat) wStr = "*" + else wStr = ".*" + pattern.replaceAll("([^\\\\])%", "$1" + wStr) + .replaceAll("\\\\%", "%").replaceAll("^%", wStr) + .replaceAll("([^\\\\])_", "$1.") + .replaceAll("\\\\_", "_") + .replaceAll("^_", ".") + } + + protected def isAuthV2Enabled: Boolean = { + val ss: SessionState = SessionState.get + ss.isAuthorizationModeV2 && HiveConf.getBoolVar(ss.getConf, + HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED) + } + + @throws[SparkThriftServerSQLException] + protected def authorizeMetaGets(opType: HiveOperationType, + inpObjs: util.List[HivePrivilegeObject]): Unit = { + authorizeMetaGets(opType, inpObjs, null) + } + + @throws[SparkThriftServerSQLException] + protected def authorizeMetaGets(opType: HiveOperationType, + inpObjs: util.List[HivePrivilegeObject], + cmdString: String): Unit = { + val ss: SessionState = SessionState.get + val ctxBuilder: HiveAuthzContext.Builder = new HiveAuthzContext.Builder + ctxBuilder.setUserIpAddress(ss.getUserIpAddress) + ctxBuilder.setCommandString(cmdString) + try { + ss.getAuthorizerV2.checkPrivileges(opType, inpObjs, null, ctxBuilder.build) + } catch { + case e@(_: HiveAuthzPluginException | _: HiveAccessControlException) => + throw new SparkThriftServerSQLException(e.getMessage, e) + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala new file mode 100644 index 000000000000..f9feaf084a8d --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +import org.apache.spark.sql.catalyst.catalog.CatalogTableType +import org.apache.spark.sql.catalyst.catalog.CatalogTableType.{EXTERNAL, MANAGED, VIEW} + +/** + * Utils for metadata operations. + */ +private[thriftserver] trait SparkMetadataOperationUtils { + + def tableTypeString(tableType: CatalogTableType): String = tableType match { + case EXTERNAL | MANAGED => "TABLE" + case VIEW => "VIEW" + case t => + throw new IllegalArgumentException(s"Unknown table type is found: $t") + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala new file mode 100644 index 000000000000..f335702d1faa --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + + +trait TableTypeMapping { + /** + * Map client's table type name to hive's table type + * + * @param clientTypeName + * @return + */ + def mapToHiveType(clientTypeName: String): Array[String] + + /** + * Map hive's table type name to client's table type + * + * @param hiveTypeName + * @return + */ + def mapToClientType(hiveTypeName: String): String + + /** + * Get all the table types of this mapping + * + * @return + */ + def getTableTypeNames: Set[String] +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala new file mode 100644 index 000000000000..e4cb8956f66d --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.operation + +object TableTypeMappingFactory { + + object TableTypeMappings extends Enumeration { + type TableTypeMappings = Value + val HIVE, CLASSIC = Value + } + + private val hiveTableTypeMapping = new HiveTableTypeMapping + private val classicTableTypeMapping = new ClassicTableTypeMapping + + def getTableTypeMapping(mappingType: String): TableTypeMapping = + if (TableTypeMappings.CLASSIC.toString.equalsIgnoreCase(mappingType)) { + classicTableTypeMapping + } else { + hiveTableTypeMapping + } + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala new file mode 100644 index 000000000000..64ca223db7f5 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -0,0 +1,347 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session + +import java.io.{File, IOException} +import java.util.Date +import java.util.concurrent._ + +import org.apache.commons.io.FileUtils +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.hive.HiveUtils +import org.apache.spark.sql.thriftserver.{CompositeService, SparkThriftServer2} +import org.apache.spark.sql.thriftserver.cli.{SessionHandle, SparkThriftServerSQLException} +import org.apache.spark.sql.thriftserver.cli.operation.OperationManager +import org.apache.spark.sql.thriftserver.server.{ThreadFactoryWithGarbageCleanup, ThreadWithGarbageCleanup} +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion +import org.apache.spark.sql.thriftserver.server.SparkThriftServer + +class SessionManager(hiveServer2: SparkThriftServer, sqlContext: SQLContext) + extends CompositeService(classOf[SessionManager].getSimpleName) + with Logging { + + private var hiveConf: HiveConf = null + private val handleToSession: ConcurrentHashMap[SessionHandle, ThriftServerSession] = + new ConcurrentHashMap[SessionHandle, ThriftServerSession] + private val operationManager: OperationManager = new OperationManager() + private var backgroundOperationPool: ThreadPoolExecutor = null + private var isOperationLogEnabled: Boolean = false + private var operationLogRootDir: File = null + + private var checkInterval: Long = 0L + private var sessionTimeout: Long = 0L + private var checkOperation: Boolean = false + + private var shutdown: Boolean = false + + + override def init(hiveConf: HiveConf): Unit = { + this.hiveConf = hiveConf + // Create operation log root directory, if operation logging is enabled + if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { + initOperationLogRootDir + } + createBackgroundOperationPool + addService(operationManager) + super.init(hiveConf) + } + + private def createBackgroundOperationPool(): Unit = { + val poolSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_THREADS) + logInfo("HiveServer2: Background operation thread pool size: " + poolSize) + val poolQueueSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_WAIT_QUEUE_SIZE) + logInfo("HiveServer2: Background operation thread wait queue size: " + poolQueueSize) + val keepAliveTime = HiveConf.getTimeVar(hiveConf, + ConfVars.HIVE_SERVER2_ASYNC_EXEC_KEEPALIVE_TIME, TimeUnit.SECONDS) + logInfo("HiveServer2: Background operation thread keepalive time: " + + keepAliveTime + " seconds") + // Create a thread pool with #poolSize threads + // Threads terminate when they are idle for more than the keepAliveTime + // A bounded blocking queue is used to queue incoming operations, if #operations > poolSize + val threadPoolName = "HiveServer2-Background-Pool" + backgroundOperationPool = + new ThreadPoolExecutor(poolSize, + poolSize, keepAliveTime, + TimeUnit.SECONDS, + new LinkedBlockingQueue[Runnable](poolQueueSize), + new ThreadFactoryWithGarbageCleanup(threadPoolName)) + backgroundOperationPool.allowCoreThreadTimeOut(true) + checkInterval = HiveConf.getTimeVar(hiveConf, + ConfVars.HIVE_SERVER2_SESSION_CHECK_INTERVAL, TimeUnit.MILLISECONDS) + sessionTimeout = HiveConf.getTimeVar(hiveConf, + ConfVars.HIVE_SERVER2_IDLE_SESSION_TIMEOUT, TimeUnit.MILLISECONDS) + checkOperation = HiveConf.getBoolVar(hiveConf, + ConfVars.HIVE_SERVER2_IDLE_SESSION_CHECK_OPERATION) + } + + private def initOperationLogRootDir(): Unit = { + operationLogRootDir = + new File(hiveConf.getVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LOG_LOCATION)) + isOperationLogEnabled = true + if (operationLogRootDir.exists && !operationLogRootDir.isDirectory) { + logWarning("The operation log root directory exists, " + + "but it is not a directory: " + operationLogRootDir.getAbsolutePath) + isOperationLogEnabled = false + } + if (!operationLogRootDir.exists) if (!operationLogRootDir.mkdirs) { + logWarning("Unable to create operation log root directory: " + + operationLogRootDir.getAbsolutePath) + isOperationLogEnabled = false + } + if (isOperationLogEnabled) { + logWarning("Operation log root directory is created: " + operationLogRootDir.getAbsolutePath) + try + FileUtils.forceDeleteOnExit(operationLogRootDir) + catch { + case e: IOException => + logWarning("Failed to schedule cleanup HS2 operation logging root dir: " + + operationLogRootDir.getAbsolutePath, e) + } + } + } + + override def start(): Unit = { + super.start() + if (checkInterval > 0) { + startTimeoutChecker() + } + } + + private def startTimeoutChecker(): Unit = { + val interval: Long = Math.max(checkInterval, 3000L) + // minimum 3 seconds + val timeoutChecker: Runnable = new Runnable() { + override def run(): Unit = { + sleepInterval(interval) + while ( { + !shutdown + }) { + val current: Long = System.currentTimeMillis + handleToSession.values().forEach(session => { + if (sessionTimeout > 0 && + session.getLastAccessTime + sessionTimeout <= current && + (!checkOperation || session.getNoOperationTime > sessionTimeout)) { + val handle: SessionHandle = session.getSessionHandle + logWarning("Session " + handle + " is Timed-out (last access : " + + new Date(session.getLastAccessTime) + ") and will be closed") + try + closeSession(handle) + catch { + case e: SparkThriftServerSQLException => + logWarning("Exception is thrown closing session " + handle, e) + } + } + else session.closeExpiredOperations + }) + sleepInterval(interval) + } + } + + private + + def sleepInterval(interval: Long): Unit = { + try + Thread.sleep(interval) + catch { + case e: InterruptedException => + + // ignore + } + } + } + backgroundOperationPool.execute(timeoutChecker) + } + + override def stop(): Unit = { + super.stop() + shutdown = true + if (backgroundOperationPool != null) { + backgroundOperationPool.shutdown() + val timeout = + hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT, TimeUnit.SECONDS) + try + backgroundOperationPool.awaitTermination(timeout, TimeUnit.SECONDS) + catch { + case e: InterruptedException => + logWarning("HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT = " + timeout + + " seconds has been exceeded. RUNNING background operations will be shut down", e) + } + backgroundOperationPool = null + } + cleanupLoggingRootDir() + } + + private def cleanupLoggingRootDir(): Unit = { + if (isOperationLogEnabled) try + FileUtils.forceDelete(operationLogRootDir) + catch { + case e: Exception => + logWarning("Failed to cleanup root dir of HS2 logging: " + + operationLogRootDir.getAbsolutePath, e) + } + } + + @throws[SparkThriftServerSQLException] + def openSession(protocol: TProtocolVersion, + username: String, + password: String, + ipAddress: String, + sessionConf: Map[String, String]): SessionHandle = + openSession(protocol, username, password, ipAddress, sessionConf, false, null) + + @throws[SparkThriftServerSQLException] + def openSession(protocol: TProtocolVersion, + username: String, + password: String, + ipAddress: String, + sessionConf: Map[String, String], + withImpersonation: Boolean, + delegationToken: String): SessionHandle = { + var session: ThriftServerSession = null + // If doAs is set to true for HiveServer2, we will create a proxy object for the session impl. + // Within the proxy object, we wrap the method call in a UserGroupInformation#doAs + if (withImpersonation) { + val sessionWithUGI = + new ThriftServerSessionImplWithUgi(protocol, + username, + password, + hiveConf, + ipAddress, + delegationToken) + session = ThriftServerSessionProxy.getProxy(sessionWithUGI, sessionWithUGI.getSessionUgi) + sessionWithUGI.setProxySession(session) + } else { + session = new ThriftServerSessionImpl(protocol, username, password, hiveConf, ipAddress) + } + session.setSessionManager(this) + session.setOperationManager(operationManager) + try + session.open(sessionConf) + catch { + case e: Exception => + try + session.close + catch { + case t: Throwable => + logWarning("Error closing session", t) + } + session = null + throw new SparkThriftServerSQLException("Failed to open new session: " + e, e) + } + if (isOperationLogEnabled) { + session.setOperationLogSessionDir(operationLogRootDir) + } + handleToSession.put(session.getSessionHandle, session) + val sessionHandle = session.getSessionHandle + SparkThriftServer2.listener.onSessionCreated( + session.getIpAddress, sessionHandle.getSessionId.toString, session.getUsername) + val ctx = if (sqlContext.conf.hiveThriftServerSingleSession) { + sqlContext + } else { + sqlContext.newSession() + } + ctx.setConf(HiveUtils.FAKE_HIVE_VERSION.key, HiveUtils.builtinHiveVersion) + if (sessionConf != null && sessionConf.contains("use:database")) { + ctx.sql(s"use ${sessionConf.get("use:database").get}") + } + operationManager.sessionToContexts.put(sessionHandle, ctx) + sessionHandle + } + + + @throws[SparkThriftServerSQLException] + def closeSession(sessionHandle: SessionHandle): Unit = { + SparkThriftServer2.listener.onSessionClosed(sessionHandle.getSessionId.toString) + val session = handleToSession.remove(sessionHandle) + operationManager.sessionToActivePool.remove(sessionHandle) + operationManager.sessionToContexts.remove(sessionHandle) + if (session == null) { + throw new SparkThriftServerSQLException("Session does not exist!") + } + session.close + } + + @throws[SparkThriftServerSQLException] + def getSession(sessionHandle: SessionHandle): ThriftServerSession = { + val session = handleToSession.get(sessionHandle) + if (session == null) { + throw new SparkThriftServerSQLException("Invalid SessionHandle: " + sessionHandle) + } + session + } + + def getOperationManager: OperationManager = operationManager + + + def submitBackgroundOperation(r: Runnable): Future[_] = backgroundOperationPool.submit(r) + + def getOpenSessionCount: Int = handleToSession.size +} + +object SessionManager extends Logging { + + private val threadLocalProxyUserName = new ThreadLocal[String]() { + override protected def initialValue: String = null + } + + private val threadLocalIpAddress = new ThreadLocal[String]() { + override protected def initialValue: String = null + } + + private val threadLocalUserName = new ThreadLocal[String]() { + override protected def initialValue: String = null + } + + def setProxyUserName(userName: String): Unit = { + logDebug("setting proxy user name based on query param to: " + userName) + threadLocalProxyUserName.set(userName) + } + + def getProxyUserName: String = threadLocalProxyUserName.get + + def clearProxyUserName(): Unit = { + threadLocalProxyUserName.remove() + } + + + def setIpAddress(ipAddress: String): Unit = { + threadLocalIpAddress.set(ipAddress) + } + + def clearIpAddress(): Unit = { + threadLocalIpAddress.remove() + } + + def getIpAddress: String = threadLocalIpAddress.get + + + def setUserName(userName: String): Unit = { + threadLocalUserName.set(userName) + } + + def clearUserName(): Unit = { + threadLocalUserName.remove() + } + + def getUserName: String = threadLocalUserName.get + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala new file mode 100644 index 000000000000..a9aab9ffd81a --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala @@ -0,0 +1,214 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session + +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.types.StructType + +trait ThriftServerSession extends ThriftServerSessionBase { + + @throws[SparkThriftServerSQLException] + def open(sessionConfMap: Map[String, String]): Unit + + /** + * getInfo operation handler + * + * @param getInfoType + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getInfo(getInfoType: GetInfoType): GetInfoValue + + /** + * execute operation handler + * + * @param statement + * @param confOverlay + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def executeStatement(statement: String, + confOverlay: Map[String, String]): OperationHandle + + @throws[SparkThriftServerSQLException] + def executeStatementAsync(statement: String, + confOverlay: Map[String, String]): OperationHandle + + /** + * getTypeInfo operation handler + * + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getTypeInfo: OperationHandle + + /** + * getCatalogs operation handler + * + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getCatalogs: OperationHandle + + /** + * getSchemas operation handler + * + * @param catalogName + * @param schemaName + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getSchemas(catalogName: String, + schemaName: String): OperationHandle + + /** + * getTables operation handler + * + * @param catalogName + * @param schemaName + * @param tableName + * @param tableTypes + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getTables(catalogName: String, + schemaName: String, + tableName: String, + tableTypes: List[String]): OperationHandle + + /** + * getTableTypes operation handler + * + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getTableTypes: OperationHandle + + /** + * getColumns operation handler + * + * @param catalogName + * @param schemaName + * @param tableName + * @param columnName + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getColumns(catalogName: String, + schemaName: String, + tableName: String, + columnName: String): OperationHandle + + /** + * getFunctions operation handler + * + * @param catalogName + * @param schemaName + * @param functionName + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getFunctions(catalogName: String, + schemaName: String, + functionName: String): OperationHandle + + /** + * getPrimaryKeys operation handler + * + * @param catalog + * @param schema + * @param table + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getPrimaryKeys(catalog: String, + schema: String, + table: String): OperationHandle + + + /** + * getCrossReference operation handler + * + * @param primaryCatalog + * @param primarySchema + * @param primaryTable + * @param foreignCatalog + * @param foreignSchema + * @param foreignTable + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def getCrossReference(primaryCatalog: String, + primarySchema: String, + primaryTable: String, + foreignCatalog: String, + foreignSchema: String, + foreignTable: String): OperationHandle + + /** + * close the session + * + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + def close(): Unit + + @throws[SparkThriftServerSQLException] + def cancelOperation(opHandle: OperationHandle): Unit + + @throws[SparkThriftServerSQLException] + def closeOperation(opHandle: OperationHandle): Unit + + @throws[SparkThriftServerSQLException] + def getResultSetMetadata(opHandle: OperationHandle): StructType + + @throws[SparkThriftServerSQLException] + def fetchResults(opHandle: OperationHandle, + orientation: FetchOrientation, + maxRows: Long, + fetchType: FetchType): RowSet + + @throws[SparkThriftServerSQLException] + def getDelegationToken(authFactory: + HiveAuthFactory, + owner: String, + renewer: String, + remoteAddr: String): String + + @throws[SparkThriftServerSQLException] + def cancelDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit + + @throws[SparkThriftServerSQLException] + def renewDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit + + def closeExpiredOperations(): Unit + + def getNoOperationTime: Long +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala new file mode 100644 index 000000000000..950477e254b3 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session + +import java.io.File + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.session.SessionState + +import org.apache.spark.sql.thriftserver.cli.SessionHandle +import org.apache.spark.sql.thriftserver.cli.operation.OperationManager +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion + + +trait ThriftServerSessionBase { + + def getProtocolVersion: TProtocolVersion + + /** + * Set the session manager for the session + * + * @param sessionManager + */ + def setSessionManager(sessionManager: SessionManager): Unit + + /** + * Get the session manager for the session + */ + def getSessionManager: SessionManager + + /** + * Set operation manager for the session + * + * @param operationManager + */ + def setOperationManager(operationManager: OperationManager): Unit + + /** + * Check whether operation logging is enabled and session dir is created successfully + */ + def isOperationLogEnabled: Boolean + + /** + * Get the session dir, which is the parent dir of operation logs + * + * @return a file representing the parent directory of operation logs + */ + def getOperationLogSessionDir: File + + /** + * Set the session dir, which is the parent dir of operation logs + * + * @param operationLogRootDir the parent dir of the session dir + */ + def setOperationLogSessionDir(operationLogRootDir: File): Unit + + def getSessionHandle: SessionHandle + + def getUsername: String + + def getPassword: String + + def getHiveConf: HiveConf + + def getSessionState: SessionState + + def getUserName: String + + def setUserName(userName: String): Unit + + def getIpAddress: String + + def setIpAddress(ipAddress: String): Unit + + def getLastAccessTime: Long +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala new file mode 100644 index 000000000000..e15a740c7ac1 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -0,0 +1,790 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session + +import java.io._ +import java.util + +import scala.collection.JavaConverters._ + +import org.apache.commons.io.FileUtils +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.SystemVariables._ +import org.apache.hadoop.hive.ql.session.SessionState + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.operation.{Operation, OperationManager} +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion +import org.apache.spark.sql.thriftserver.cli.utils.VariableSubstitution +import org.apache.spark.sql.thriftserver.server.ThreadWithGarbageCleanup +import org.apache.spark.sql.types.StructType + + +class ThriftServerSessionImpl(_protocol: TProtocolVersion, + var _username: String, + var _password: String, + serverHiveConf: HiveConf, + var _ipAddress: String) extends ThriftServerSession with Logging { + + private val _sessionHandle: SessionHandle = new SessionHandle(_protocol) + private val _hiveConf: HiveConf = new HiveConf(serverHiveConf) + private var _sessionState: SessionState = null + private var _sessionManager: SessionManager = null + private var _operationManager: OperationManager = new OperationManager() + private val _opHandleSet: util.Set[OperationHandle] = new util.HashSet[OperationHandle]() + private var _isOperationLogEnabled: Boolean = false + private var _sessionLogDir: File = null + private var _lastAccessTime: Long = 0L + private var _lastIdleTime: Long = 0L + + @throws[SparkThriftServerSQLException] + override def open(sessionConfMap: Map[String, String]): Unit = { + _sessionState = new SessionState(_hiveConf, _username) + _sessionState.setUserIpAddress(_ipAddress) + _sessionState.setIsHiveServerQuery(true) + SessionState.start(_sessionState) + if (sessionConfMap != null) { + configureSession(sessionConfMap.asJava) + } + _lastAccessTime = System.currentTimeMillis + _lastIdleTime = _lastAccessTime + } + + @throws[SparkThriftServerSQLException] + private def configureSession(sessionConfMap: util.Map[String, String]): Unit = { + SessionState.setCurrentSessionState(_sessionState) + + sessionConfMap.entrySet().forEach(entry => { + val key = entry.getKey + if (key.startsWith("set:")) { + try + setVariable(key.substring(4), entry.getValue) + catch { + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } else if (key.startsWith("use:")) { + SessionState.get.setCurrentDatabase(entry.getValue) + } else { + _hiveConf.verifyAndSet(key, entry.getValue) + } + }) + } + + // Copy from org.apache.hadoop.hive.ql.processors.SetProcessor, only change: + // setConf(varname, propName, varvalue, true) when varname.startsWith(HIVECONF_PREFIX) + @throws[Exception] + def setVariable(key: String, value: String): Int = { + var varname = key + val ss = SessionState.get + if (value.contains("\n")) { + logError("Warning: Value had a \\n character in it.") + } + val substitution = new VariableSubstitution(ss.getHiveVariables) + varname = varname.trim + if (varname.startsWith(ENV_PREFIX)) { + logError("env:* variables can not be set.") + return 1 + } else if (varname.startsWith(SYSTEM_PREFIX)) { + val propName = varname.substring(SYSTEM_PREFIX.length) + System.getProperties.setProperty(propName, substitution.substitute(ss.getConf, value)) + } else if (varname.startsWith(HIVECONF_PREFIX)) { + val propName = varname.substring(HIVECONF_PREFIX.length) + setConf(varname, propName, value, true) + } else if (varname.startsWith(HIVEVAR_PREFIX)) { + val propName = varname.substring(HIVEVAR_PREFIX.length) + ss.getHiveVariables.put(propName, substitution.substitute(ss.getConf, value)) + } else if (varname.startsWith(METACONF_PREFIX)) { + logWarning("Won't set HiveMetaStoreConf here") + } else { + setConf(varname, varname, value, true) + } + 0 + } + + // returns non-null string for validation fail + @throws[IllegalArgumentException] + private def setConf(varname: String, key: String, varvalue: String, register: Boolean): Unit = { + val substitution = new VariableSubstitution(SessionState.get.getHiveVariables) + val conf = SessionState.get.getConf + val value = substitution.substitute(conf, varvalue) + if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { + val confVars = HiveConf.getConfVars(key) + if (confVars != null) { + if (!confVars.isType(value)) { + val message = new StringBuilder + message.append("'SET ").append(varname).append('=').append(varvalue) + message.append("' FAILED because ").append(key).append(" expects ") + message.append(confVars.typeString).append(" type value.") + throw new IllegalArgumentException(message.toString) + } + val fail = confVars.validate(value) + if (fail != null) { + val message = new StringBuilder + message.append("'SET ").append(varname).append('=').append(varvalue) + message.append("' FAILED in validation : ").append(fail).append('.') + throw new IllegalArgumentException(message.toString) + } + } else if (key.startsWith("hive.")) { + throw new IllegalArgumentException("hive configuration " + key + " does not exists.") + } + } + conf.verifyAndSet(key, value) + if (register) { + SessionState.get.getOverriddenConfigurations.put(key, value) + } + } + + /** + * getInfo operation handler + * + * @param getInfoType + * @return + * @throws SparkThriftServerSQLException + */ + override def getInfo(getInfoType: GetInfoType): GetInfoValue = { + import org.apache.hive.common.util.HiveVersionInfo + acquire(true) + try { + getInfoType match { + case GetInfoType.CLI_SERVER_NAME => + return new GetInfoValue("Spark Thrift Server") + case GetInfoType.CLI_DBMS_NAME => + return new GetInfoValue("Apache Spark") + case GetInfoType.CLI_DBMS_VER => + return new GetInfoValue(HiveVersionInfo.getVersion) + case _ => + throw new SparkThriftServerSQLException("Unrecognized GetInfoType value: " + + getInfoType.toString) + } + } finally { + release(true) + } + } + + /** + * execute operation handler + * + * @param statement + * @param confOverlay + * @return + * @throws SparkThriftServerSQLException + */ + override def executeStatement(statement: String, + confOverlay: Map[String, String]): OperationHandle = { + executeStatementInternal(statement, confOverlay, false) + } + + override def executeStatementAsync(statement: String, + confOverlay: Map[String, String]): OperationHandle = { + executeStatementInternal(statement, confOverlay, true) + } + + @throws[SparkThriftServerSQLException] + private def executeStatementInternal(statement: String, + confOverlay: Map[String, String], + runAsync: Boolean): OperationHandle = { + acquire(true) + val operationManager = getOperationManager + val operation = operationManager + .newExecuteStatementOperation( + getSession, + statement, + confOverlay, + runAsync) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + opHandle + } catch { + case e: SparkThriftServerSQLException => + // Referring to SQLOperation.java, there is no chance that a + // HiveSQLException throws and the asyn background operation + // submits to thread pool successfully at the same time. So, Cleanup + // opHandle directly when got SparkThriftServerSQLException + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * getTypeInfo operation handler + * + * @return + * @throws SparkThriftServerSQLException + */ + override def getTypeInfo: OperationHandle = { + acquire(true) + + val operationManager = getOperationManager + val operation = operationManager.newGetTypeInfoOperation(getSession) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + return opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * getCatalogs operation handler + * + * @return + * @throws SparkThriftServerSQLException + */ + override def getCatalogs: OperationHandle = { + acquire(true) + + val operationManager = getOperationManager + val operation = operationManager.newGetCatalogsOperation(getSession) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + return opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * getSchemas operation handler + * + * @param catalogName + * @param schemaName + * @return + * @throws SparkThriftServerSQLException + */ + override def getSchemas(catalogName: String, + schemaName: String): OperationHandle = { + acquire(true) + val operationManager = getOperationManager + val operation = operationManager.newGetSchemasOperation(getSession, catalogName, schemaName) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + return opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * getTables operation handler + * + * @param catalogName + * @param schemaName + * @param tableName + * @param tableTypes + * @return + * @throws SparkThriftServerSQLException + */ + override def getTables(catalogName: String, + schemaName: String, + tableName: String, + tableTypes: List[String]): OperationHandle = { + acquire(true) + val operationManager = getOperationManager + val operation = + operationManager.newGetTablesOperation( + getSession, + catalogName, + schemaName, + tableName, + tableTypes) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + return opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * getTableTypes operation handler + * + * @return + * @throws SparkThriftServerSQLException + */ + override def getTableTypes: OperationHandle = { + acquire(true) + + val operationManager = getOperationManager + val operation = operationManager.newGetTableTypesOperation(getSession) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + return opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * getColumns operation handler + * + * @param catalogName + * @param schemaName + * @param tableName + * @param columnName + * @return + * @throws SparkThriftServerSQLException + */ + override def getColumns(catalogName: String, + schemaName: String, + tableName: String, + columnName: String): OperationHandle = { + acquire(true) + val operationManager = getOperationManager + val operation = operationManager + .newGetColumnsOperation( + getSession, + catalogName, + schemaName, + tableName, + columnName) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * getFunctions operation handler + * + * @param catalogName + * @param schemaName + * @param functionName + * @return + * @throws SparkThriftServerSQLException + */ + override def getFunctions(catalogName: String, + schemaName: String, + functionName: String): OperationHandle = { + acquire(true) + val operationManager = getOperationManager + val operation = operationManager + .newGetFunctionsOperation( + getSession, + catalogName, + schemaName, + functionName) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + @throws[SparkThriftServerSQLException] + override def getPrimaryKeys(catalog: String, schema: String, table: String): OperationHandle = { + acquire(true) + val operationManager = getOperationManager + val operation: Operation = operationManager + .newGetPrimaryKeysOperation( + getSession, + catalog, + schema, + table) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + @throws[SparkThriftServerSQLException] + override def getCrossReference(primaryCatalog: String, + primarySchema: String, + primaryTable: String, + foreignCatalog: String, + foreignSchema: String, + foreignTable: String): OperationHandle = { + acquire(true) + val operationManager = getOperationManager + val operation: Operation = operationManager + .newGetCrossReferenceOperation( + getSession, + primaryCatalog, + primarySchema, + primaryTable, + foreignCatalog, + foreignSchema, + foreignTable) + val opHandle = operation.getHandle + try { + operation.run + _opHandleSet.add(opHandle) + opHandle + } catch { + case e: SparkThriftServerSQLException => + operationManager.closeOperation(opHandle) + throw e + } finally { + release(true) + } + } + + /** + * close the session + * + * @throws SparkThriftServerSQLException + */ + override def close(): Unit = { + try { + acquire(true) + // Iterate through the opHandles and close their operations + for (opHandle <- _opHandleSet.asScala) { + _operationManager.closeOperation(opHandle) + } + _opHandleSet.clear + // Cleanup session log directory. + cleanupSessionLogDir + val hiveHist = _sessionState.getHiveHistory + if (null != hiveHist) { + hiveHist.closeStream() + } + try { + _sessionState.close + } finally { + _sessionState = null + } + } catch { + case ioe: IOException => + throw new SparkThriftServerSQLException("Failure to close", ioe) + } finally { + if (_sessionState != null) { + try { + _sessionState.close + } catch { + case t: Throwable => + logWarning("Error closing session", t) + } + _sessionState = null + } + release(true) + } + } + + override def cancelOperation(opHandle: OperationHandle): Unit = { + acquire(true) + try { + _sessionManager.getOperationManager.cancelOperation(opHandle) + } finally { + release(true) + } + } + + override def closeOperation(opHandle: OperationHandle): Unit = { + acquire(true) + try { + _operationManager.closeOperation(opHandle) + _opHandleSet.remove(opHandle) + } finally { + release(true) + } + } + + private def cleanupSessionLogDir(): Unit = { + if (isOperationLogEnabled) { + try { + FileUtils.forceDelete(_sessionLogDir) + } + catch { + case e: Exception => + logError("Failed to cleanup session log dir: " + _sessionHandle, e) + } + } + } + + override def getResultSetMetadata(opHandle: OperationHandle): StructType = { + acquire(true) + try { + _sessionManager.getOperationManager.getOperationResultSetSchema(opHandle) + } finally { + release(true) + } + } + + override def fetchResults(opHandle: OperationHandle, + orientation: FetchOrientation, + maxRows: Long, + fetchType: FetchType): RowSet = { + acquire(true) + try { + if (fetchType eq FetchType.QUERY_OUTPUT) { + return _operationManager.getOperationNextRowSet(opHandle, orientation, maxRows) + } + return _operationManager.getOperationLogRowSet(opHandle, orientation, maxRows) + } finally { + release(true) + } + } + + override def getDelegationToken(authFactory: HiveAuthFactory, + owner: String, + renewer: String, + remoteAddr: String): String = { + HiveAuthFactory.verifyProxyAccess( + getUsername, + owner, + getIpAddress, + getHiveConf) + authFactory.getDelegationToken(owner, renewer, remoteAddr) + } + + override def cancelDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit = { + HiveAuthFactory.verifyProxyAccess( + getUsername, + getUserFromToken(authFactory, tokenStr), + getIpAddress, + getHiveConf) + authFactory.cancelDelegationToken(tokenStr) + } + + override def renewDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit = { + HiveAuthFactory.verifyProxyAccess( + getUsername, + getUserFromToken(authFactory, tokenStr), + getIpAddress, + getHiveConf) + authFactory.renewDelegationToken(tokenStr) + } + + + // extract the real user from the given token string + @throws[SparkThriftServerSQLException] + private def getUserFromToken(authFactory: HiveAuthFactory, tokenStr: String) = { + authFactory.getUserFromToken(tokenStr) + } + + protected def acquire(userAccess: Boolean): Unit = { + // Need to make sure that the this HiveServer2's session's SessionState is + // stored in the thread local for the handler thread. + SessionState.setCurrentSessionState(_sessionState) + if (userAccess) { + _lastAccessTime = System.currentTimeMillis + } + } + + /** + * 1. We'll remove the ThreadLocal SessionState as this thread might now serve + * other requests. + * 2. We'll cache the ThreadLocal RawStore object for this background thread + * for an orderly cleanup when this thread is garbage collected later. + */ + protected def release(userAccess: Boolean): Unit = { + SessionState.detachSession() + if (Thread.currentThread.isInstanceOf[ThreadWithGarbageCleanup]) { + val currentThread = Thread.currentThread.asInstanceOf[ThreadWithGarbageCleanup] + currentThread.cacheThreadLocalRawStore + } + if (userAccess) { + _lastAccessTime = System.currentTimeMillis + } + if (_opHandleSet.isEmpty) { + _lastIdleTime = System.currentTimeMillis + } else { + _lastIdleTime = 0 + } + } + + + override def closeExpiredOperations(): Unit = { + val handles = _opHandleSet.toArray(new Array[OperationHandle](_opHandleSet.size)) + if (handles.length > 0) { + val operations = _operationManager.removeExpiredOperations(handles) + if (!operations.isEmpty) { + closeTimedOutOperations(operations) + } + } + } + + private def closeTimedOutOperations(operations: List[Operation]): Unit = { + acquire(false) + try { + for (operation <- operations) { + _opHandleSet.remove(operation.getHandle) + try { + operation.close + } catch { + case e: Exception => + logWarning("Exception is thrown closing timed-out operation " + operation.getHandle, e) + } + } + } finally { + release(false) + } + } + + override def getNoOperationTime: Long = { + if (_lastIdleTime > 0) { + System.currentTimeMillis - _lastIdleTime + } else { + 0 + } + } + + override def getProtocolVersion: TProtocolVersion = _protocol + + /** + * Set the session manager for the session + * + * @param sessionManager + */ + override def setSessionManager(sessionManager: SessionManager): Unit = { + _sessionManager = sessionManager + } + + /** + * Get the session manager for the session + */ + override def getSessionManager: SessionManager = _sessionManager + + + private def getOperationManager: OperationManager = _operationManager + + /** + * Set operation manager for the session + * + * @param operationManager + */ + override def setOperationManager(operationManager: OperationManager): Unit = { + _operationManager = operationManager + } + + /** + * Check whether operation logging is enabled and session dir is created successfully + */ + override def isOperationLogEnabled: Boolean = _isOperationLogEnabled + + /** + * Get the session dir, which is the parent dir of operation logs + * + * @return a file representing the parent directory of operation logs + */ + override def getOperationLogSessionDir: File = _sessionLogDir + + /** + * Set the session dir, which is the parent dir of operation logs + * + * @param operationLogRootDir the parent dir of the session dir + */ + override def setOperationLogSessionDir(operationLogRootDir: File): Unit = { + if (!operationLogRootDir.exists) { + logWarning("The operation log root directory is removed, recreating: " + + operationLogRootDir.getAbsolutePath) + if (!operationLogRootDir.mkdirs) { + logWarning("Unable to create operation log root directory: " + + operationLogRootDir.getAbsolutePath) + } + } + if (!operationLogRootDir.canWrite) { + logWarning("The operation log root directory is not writable: " + + operationLogRootDir.getAbsolutePath) + } + _sessionLogDir = new File(operationLogRootDir, _sessionHandle.getHandleIdentifier.toString) + _isOperationLogEnabled = true + if (!_sessionLogDir.exists) { + if (!_sessionLogDir.mkdir) { + logWarning("Unable to create operation log session directory: " + + _sessionLogDir.getAbsolutePath) + _isOperationLogEnabled = false + } + } + if (isOperationLogEnabled) { + logInfo("Operation log session directory is created: " + _sessionLogDir.getAbsolutePath) + } + } + + protected def getSession: ThriftServerSession = this + + override def getSessionHandle: SessionHandle = _sessionHandle + + override def getUsername: String = _username + + override def getPassword: String = _password + + override def getHiveConf: HiveConf = _hiveConf + + override def getSessionState: SessionState = _sessionState + + override def getUserName: String = _username + + override def setUserName(userName: String): Unit = _username = userName + + override def getIpAddress: String = _ipAddress + + override def setIpAddress(ipAddress: String): Unit = _ipAddress = ipAddress + + override def getLastAccessTime: Long = _lastAccessTime + +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala new file mode 100644 index 000000000000..21f7be7e313c --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session + +import java.io.IOException + +import org.apache.hadoop.fs.FileSystem +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.metadata.{Hive, HiveException} +import org.apache.hadoop.hive.shims.Utils +import org.apache.hadoop.security.UserGroupInformation + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli.{CLIService, SparkThriftServerSQLException} +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion + +class ThriftServerSessionImplWithUgi(protocol: TProtocolVersion, + username: String, + password: String, + serverHiveConf: HiveConf, + ipAddress: String, + delegationTokenStr: String) + extends ThriftServerSessionImpl(protocol, username, password, serverHiveConf, ipAddress) + with Logging { + + val HS2TOKEN = "HiveServer2ImpersonationToken" + + private var sessionUgi: UserGroupInformation = null + private var proxySession: ThriftServerSession = null + + try { + setSessionUGI(username) + setDelegationToken + } catch { + case e: Exception => e.printStackTrace() + } + + // setup appropriate UGI for the session + @throws[SparkThriftServerSQLException] + def setSessionUGI(owner: String): Unit = { + if (owner == null) { + throw new SparkThriftServerSQLException("No username provided for impersonation") + } + if (UserGroupInformation.isSecurityEnabled) { + try { + sessionUgi = UserGroupInformation.createProxyUser(owner, UserGroupInformation.getLoginUser) + } catch { + case e: IOException => + throw new SparkThriftServerSQLException("Couldn't setup proxy user", e) + } + } else { + sessionUgi = UserGroupInformation.createRemoteUser(owner) + } + } + + def getSessionUgi: UserGroupInformation = this.sessionUgi + + def getDelegationToken: String = this.delegationTokenStr + + override protected def acquire(userAccess: Boolean): Unit = { + super.acquire(userAccess) + } + + /** + * Close the file systems for the session and remove it from the FileSystem cache. + * Cancel the session's delegation token and close the metastore connection + */ + @throws[SparkThriftServerSQLException] + override def close(): Unit = { + try { + acquire(true) + if (delegationTokenStr != null) try { + Hive.get(getHiveConf).cancelDelegationToken(delegationTokenStr) + getHiveConf.set("hive.metastore.token.signature", "") + } catch { + case e: HiveException => + throw new SparkThriftServerSQLException("Couldn't cancel delegation token", e) + } + } finally try + super.close() + finally try + FileSystem.closeAllForUGI(sessionUgi) + catch { + case ioe: IOException => + throw new SparkThriftServerSQLException("Could not clean up file-system " + + "handles for UGI: " + sessionUgi, ioe) + } + } + + /** + * Enable delegation token for the session + * save the token string and set the token.signature in hive conf. The metastore client uses + * this token.signature to determine where to use kerberos or delegation token + * + * @throws SparkThriftServerSQLException + * @throws IOException + */ + @throws[SparkThriftServerSQLException] + private def setDelegationToken(): Unit = { + if (delegationTokenStr != null) { + getHiveConf.set("hive.metastore.token.signature", HS2TOKEN) + try { + Utils.setTokenStr(sessionUgi, delegationTokenStr, HS2TOKEN) + } catch { + case e: IOException => + throw new SparkThriftServerSQLException("Couldn't setup delegation token in the ugi", e) + } + } + } + + override protected def getSession(): ThriftServerSession = { + assert(proxySession != null) + proxySession + } + + def setProxySession(proxySession: ThriftServerSession): Unit = { + this.proxySession = proxySession + } + + @throws[SparkThriftServerSQLException] + override def getDelegationToken(authFactory: HiveAuthFactory, + owner: String, + renewer: String, + remoteAddr: String): String = { + authFactory.getDelegationToken(owner, renewer, remoteAddr) + } + + @throws[SparkThriftServerSQLException] + override def cancelDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit = { + authFactory.cancelDelegationToken(tokenStr) + } + + @throws[SparkThriftServerSQLException] + override def renewDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit = { + authFactory.renewDelegationToken(tokenStr) + } + +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala new file mode 100644 index 000000000000..ade2f17d4b56 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala @@ -0,0 +1,84 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session + +import java.lang.reflect.{InvocationHandler, InvocationTargetException, Method, UndeclaredThrowableException} +import java.security.{PrivilegedActionException, PrivilegedExceptionAction} + +import org.apache.hadoop.security.UserGroupInformation + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.cli.SparkThriftServerSQLException + +class ThriftServerSessionProxy extends InvocationHandler with Logging { + private var _base: ThriftServerSession = null + private var _ugi: UserGroupInformation = _ + + def this(session: ThriftServerSession, ugi: UserGroupInformation) = { + this() + this._base = session + this._ugi = ugi + } + + def invoke(method: Method, args: Array[AnyRef]): AnyRef = { + try { + return method.invoke(_base, args: _*) + } + catch { + case e: InvocationTargetException => + if (e.getCause.isInstanceOf[SparkThriftServerSQLException]) { + throw e.getCause.asInstanceOf[SparkThriftServerSQLException] + } + throw new RuntimeException(e.getCause) + case e: IllegalArgumentException => + throw new RuntimeException(e) + case e: IllegalAccessException => + throw new RuntimeException(e) + } + } + + override def invoke(proxy: AnyRef, method: Method, args: Array[AnyRef]): AnyRef = { + try { + if (method.getDeclaringClass eq classOf[ThriftServerSessionBase]) { + invoke(method, args) + } + _ugi.doAs(new PrivilegedExceptionAction[AnyRef]() { + @throws[SparkThriftServerSQLException] + override def run: AnyRef = invoke(method, args) + }) + + } catch { + case e: UndeclaredThrowableException => + val innerException: Throwable = e.getCause + if (innerException.isInstanceOf[PrivilegedActionException]) { + throw innerException.getCause + } + else { + throw e.getCause + } + } + } +} + +object ThriftServerSessionProxy { + def getProxy(session: ThriftServerSession, ugi: UserGroupInformation): ThriftServerSession = { + java.lang.reflect.Proxy.newProxyInstance(classOf[ThriftServerSession].getClassLoader, + Array[Class[_]](classOf[ThriftServerSession]), + new ThriftServerSessionProxy(session, ugi)).asInstanceOf[ThriftServerSession] + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala new file mode 100644 index 000000000000..d3e5cc73704a --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift + +import org.apache.log4j.PatternLayout + +object CLIServiceUtils { + + private val SEARCH_STRING_ESCAPE = '\\' + val verboseLayout = new PatternLayout("%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n") + val nonVerboseLayout = new PatternLayout("%-5p : %m%n") + + /** + * Convert a SQL search pattern into an equivalent Java Regex. + * + * @param pattern input which may contain '%' or '_' wildcard characters, or + * these characters escaped using { @code getSearchStringEscape()}. + * @return replace %/_ with regex search characters, also handle escaped + * characters. + */ + def patternToRegex(pattern: String): String = { + if (pattern == null) { + ".*" + } else { + val result = new StringBuilder(pattern.length) + var escaped = false + var i = 0 + pattern.toCharArray.foreach(c => { + if (escaped) { + if (c != SEARCH_STRING_ESCAPE) { + escaped = false + } + result.append(c) + } else if (c == SEARCH_STRING_ESCAPE) { + escaped = true + } else if (c == '%') { + result.append(".*") + } else if (c == '_') { + result.append('.') + } else { + result.append(Character.toLowerCase(c)) + } + }) + result.toString() + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala new file mode 100644 index 000000000000..38f607ed9c76 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala @@ -0,0 +1,109 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift + +import java.util +import java.util.concurrent._ + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hadoop.hive.shims.ShimLoader +import org.apache.thrift.TProcessorFactory +import org.apache.thrift.protocol.TBinaryProtocol +import org.apache.thrift.server.TThreadPoolServer +import org.apache.thrift.transport.{TServerSocket, TTransportFactory} + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli.CLIService +import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup + + +class ThriftBinaryCLIService(cliService: CLIService) + extends ThriftCLIService(cliService, classOf[ThriftBinaryCLIService].getSimpleName) + with Logging { + + override def run(): Unit = { + try { // Server thread pool + val threadPoolName: String = "HiveServer2-Handler-Pool" + val executorService: ExecutorService = + new ThreadPoolExecutor(minWorkerThreads, + maxWorkerThreads, + workerKeepAliveTime, + TimeUnit.SECONDS, + new SynchronousQueue[Runnable], + new ThreadFactoryWithGarbageCleanup(threadPoolName)) + // Thrift configs + hiveAuthFactory = new HiveAuthFactory(hiveConf) + val transportFactory: TTransportFactory = hiveAuthFactory.getAuthTransFactory + val processorFactory: TProcessorFactory = hiveAuthFactory.getAuthProcFactory(this) + var serverSocket: TServerSocket = null + val sslVersionBlacklist: util.List[String] = new util.ArrayList[String] + for (sslVersion <- hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",")) { + sslVersionBlacklist.add(sslVersion) + } + if (!hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL)) { + serverSocket = HiveAuthFactory.getServerSocket(hiveHost, portNum) + } else { + val keyStorePath: String = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim + if (keyStorePath.isEmpty) { + throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + + " Not configured for SSL connection") + } + val keyStorePassword: String = ShimLoader.getHadoopShims + .getPassword(hiveConf, HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname) + serverSocket = HiveAuthFactory.getServerSSLSocket(hiveHost, portNum, keyStorePath, + keyStorePassword, sslVersionBlacklist) + } + // Server args + val maxMessageSize: Int = + hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_MAX_MESSAGE_SIZE) + val requestTimeout: Int = + hiveConf.getTimeVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_TIMEOUT, + TimeUnit.SECONDS).toInt + val beBackoffSlotLength: Int = + hiveConf.getTimeVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_BEBACKOFF_SLOT_LENGTH, + TimeUnit.MILLISECONDS).toInt + val sargs: TThreadPoolServer.Args = + new TThreadPoolServer.Args(serverSocket) + .processorFactory(processorFactory) + .transportFactory(transportFactory) + .protocolFactory(new TBinaryProtocol.Factory) + .inputProtocolFactory( + new TBinaryProtocol.Factory(true, true, maxMessageSize, maxMessageSize)) + .requestTimeout(requestTimeout) + .requestTimeoutUnit(TimeUnit.SECONDS) + .beBackoffSlotLength(beBackoffSlotLength) + .beBackoffSlotLengthUnit(TimeUnit.MILLISECONDS) + .executorService(executorService) + // TCP Server + server = new TThreadPoolServer(sargs) + server.setServerEventHandler(serverEventHandler) + val msg: String = "Starting " + classOf[ThriftBinaryCLIService].getSimpleName + + " on port " + serverSocket.getServerSocket.getLocalPort + " with " + + minWorkerThreads + "..." + maxWorkerThreads + " worker threads" + logInfo(msg) + server.serve() + } catch { + case t: Throwable => + logError("Error starting SparkThriftServer: could not start " + + classOf[ThriftBinaryCLIService].getSimpleName, t) + System.exit(-1) + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala new file mode 100644 index 000000000000..60e8d1130430 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala @@ -0,0 +1,807 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift + +import java.io.IOException +import java.net.{InetAddress, UnknownHostException} +import java.util +import java.util.concurrent.TimeUnit +import javax.security.auth.login.LoginException + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.thrift.TException +import org.apache.thrift.protocol.TProtocol +import org.apache.thrift.server.{ServerContext, TServer, TServerEventHandler} +import org.apache.thrift.transport.TTransport + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.{AbstractService, ServiceException, ServiceUtils} +import org.apache.spark.sql.thriftserver.auth.{HiveAuthFactory, KERBEROS, NONE, TSetIpAddressProcessor} +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.thriftserver.cli.session.SessionManager +import org.apache.spark.sql.thriftserver.server.SparkThriftServer +import org.apache.spark.sql.types.StructType + + +abstract class ThriftCLIService(cliService: CLIService, serviceName: String) + extends AbstractService(serviceName) + with TCLIService.Iface + with Runnable + with Logging { + + + private val OK_STATUS = new TStatus(TStatusCode.SUCCESS_STATUS) + protected var hiveAuthFactory: HiveAuthFactory = new HiveAuthFactory() + + protected var portNum: Int = 0 + protected var serverIPAddress: InetAddress = null + protected var hiveHost: String = null + protected var server: TServer = null + protected var httpServer: org.eclipse.jetty.server.Server = null + + private var isStarted = false + protected var isEmbedded = false + + protected var hiveConf: HiveConf = null + + protected var minWorkerThreads: Int = 0 + protected var maxWorkerThreads: Int = 0 + protected var workerKeepAliveTime: Long = 0L + + private class ThriftCLIServerContext extends ServerContext { + private var sessionHandle: SessionHandle = null + + def setSessionHandle(sessionHandle: SessionHandle): Unit = { + this.sessionHandle = sessionHandle + } + + def getSessionHandle: SessionHandle = sessionHandle + } + + protected var currentServerContext = new ThreadLocal[ServerContext] + + protected var serverEventHandler: TServerEventHandler = new TServerEventHandler { + def createContext(input: TProtocol, output: TProtocol): ServerContext = { + new ThriftCLIServerContext() + } + + def deleteContext(serverContext: ServerContext, input: TProtocol, output: TProtocol): Unit = { + val context: ThriftCLIServerContext = serverContext.asInstanceOf[ThriftCLIServerContext] + val sessionHandle = context.getSessionHandle + if (sessionHandle != null) { + logInfo("Session disconnected without closing properly, close it now") + try { + cliService.closeSession(sessionHandle) + } catch { + case e: SparkThriftServerSQLException => + logWarning("Failed to close session: " + e, e) + } + } + } + + def preServe(): Unit = {} + + def processContext(serverContext: ServerContext, + input: TTransport, + output: TTransport): Unit = { + currentServerContext.set(serverContext) + } + } + + + override def init(hiveConf: HiveConf): Unit = { + this.hiveConf = hiveConf + // Initialize common server configs needed in both binary & http modes + var portString: String = null + hiveHost = System.getenv("HIVE_SERVER2_THRIFT_BIND_HOST") + if (hiveHost == null) { + hiveHost = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST) + } + try { + if (hiveHost != null && !hiveHost.isEmpty) { + serverIPAddress = InetAddress.getByName(hiveHost) + } else { + serverIPAddress = InetAddress.getLocalHost + } + } catch { + case e: UnknownHostException => + throw new ServiceException(e) + } + // HTTP mode + if (SparkThriftServer.isHTTPTransportMode(hiveConf)) { + workerKeepAliveTime = hiveConf.getTimeVar( + ConfVars.HIVE_SERVER2_THRIFT_HTTP_WORKER_KEEPALIVE_TIME, + TimeUnit.SECONDS) + portString = System.getenv("HIVE_SERVER2_THRIFT_HTTP_PORT") + if (portString != null) { + portNum = Integer.valueOf(portString) + } else { + portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT) + } + } else { // Binary mode + workerKeepAliveTime = hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_WORKER_KEEPALIVE_TIME, + TimeUnit.SECONDS) + portString = System.getenv("HIVE_SERVER2_THRIFT_PORT") + if (portString != null) { + portNum = Integer.valueOf(portString) + } else { + portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_PORT) + } + } + minWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS) + maxWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS) + super.init(hiveConf) + } + + override def start(): Unit = { + super.start() + if (!isStarted && !isEmbedded) { + new Thread(this).start() + isStarted = true + } + } + + override def stop(): Unit = { + if (isStarted && !isEmbedded) { + if (server != null) { + server.stop() + logInfo("Thrift server has stopped") + } + if ((httpServer != null) && httpServer.isStarted) { + try { + httpServer.stop() + logInfo("Http server has stopped") + } catch { + case e: Exception => + logError("Error stopping Http server: ", e) + } + } + isStarted = false + } + super.stop() + } + + def getPortNumber: Int = portNum + + def getServerIPAddress: InetAddress = serverIPAddress + + @throws[TException] + override def GetDelegationToken(req: TGetDelegationTokenReq): TGetDelegationTokenResp = { + val resp: TGetDelegationTokenResp = new TGetDelegationTokenResp + if (hiveAuthFactory == null) { + resp.setStatus(notSupportTokenErrorStatus) + } else { + try { + val token = cliService.getDelegationToken( + new SessionHandle(req.getSessionHandle), + hiveAuthFactory, + req.getOwner, + req.getRenewer, + getIpAddress) + resp.setDelegationToken(token) + resp.setStatus(OK_STATUS) + } catch { + case e: SparkThriftServerSQLException => + logError("Error obtaining delegation token", e) + val tokenErrorStatus = SparkThriftServerSQLException.toTStatus(e) + tokenErrorStatus.setSqlState(e.getSQLState) + tokenErrorStatus.setErrorCode(e.getErrorCode) + tokenErrorStatus.setErrorMessage(e.getMessage) + resp.setStatus(tokenErrorStatus) + } + } + resp + } + + @throws[TException] + override def CancelDelegationToken(req: TCancelDelegationTokenReq): TCancelDelegationTokenResp = { + val resp: TCancelDelegationTokenResp = new TCancelDelegationTokenResp + if (hiveAuthFactory == null) { + resp.setStatus(notSupportTokenErrorStatus) + } else { + try { + cliService.cancelDelegationToken( + new SessionHandle(req.getSessionHandle), + hiveAuthFactory, + req.getDelegationToken) + resp.setStatus(OK_STATUS) + } catch { + case e: SparkThriftServerSQLException => + logError("Error cancel delegation token", e) + val tokenErrorStatus = SparkThriftServerSQLException.toTStatus(e) + tokenErrorStatus.setSqlState(e.getSQLState) + tokenErrorStatus.setErrorCode(e.getErrorCode) + tokenErrorStatus.setErrorMessage(e.getMessage) + resp.setStatus(tokenErrorStatus) + } + } + resp + } + + @throws[TException] + override def RenewDelegationToken(req: TRenewDelegationTokenReq): TRenewDelegationTokenResp = { + val resp: TRenewDelegationTokenResp = new TRenewDelegationTokenResp + if (hiveAuthFactory == null) { + resp.setStatus(notSupportTokenErrorStatus) + } else { + try { + cliService.renewDelegationToken( + new SessionHandle(req.getSessionHandle), + hiveAuthFactory, + req.getDelegationToken) + resp.setStatus(OK_STATUS) + } catch { + case e: SparkThriftServerSQLException => + logError("Error renew delegation token", e) + val tokenErrorStatus = SparkThriftServerSQLException.toTStatus(e) + tokenErrorStatus.setSqlState(e.getSQLState) + tokenErrorStatus.setErrorCode(e.getErrorCode) + tokenErrorStatus.setErrorMessage(e.getMessage) + resp.setStatus(tokenErrorStatus) + } + } + resp + } + + private def notSupportTokenErrorStatus: TStatus = { + val errorStatus: TStatus = new TStatus(TStatusCode.ERROR_STATUS) + errorStatus.setErrorMessage("Delegation token is not supported") + errorStatus + } + + @throws[TException] + override def OpenSession(req: TOpenSessionReq): TOpenSessionResp = { + logInfo("Client protocol version: " + req.getClient_protocol) + val resp: TOpenSessionResp = new TOpenSessionResp + try { + val sessionHandle: SessionHandle = getSessionHandle(req, resp) + resp.setSessionHandle(sessionHandle.toTSessionHandle) + // TODO: set real configuration map + resp.setConfiguration(new util.HashMap[String, String]) + resp.setStatus(OK_STATUS) + val context: ThriftCLIServerContext = + currentServerContext.get.asInstanceOf[ThriftCLIServerContext] + if (context != null) { + context.setSessionHandle(sessionHandle) + } + } catch { + case e: Exception => + logWarning("Error opening session: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + private def getIpAddress: String = { + var clientIpAddress: String = null + // Http transport mode. + // We set the thread local ip address, in ThriftHttpServlet. + if (cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE) + .equalsIgnoreCase("http")) { + clientIpAddress = SessionManager.getIpAddress + } else { // Kerberos + if (isKerberosAuthMode) { + clientIpAddress = hiveAuthFactory.getIpAddress + } else { // Except kerberos, NOSASL + clientIpAddress = TSetIpAddressProcessor.getUserIpAddress + } + } + logDebug("Client's IP Address: " + clientIpAddress) + clientIpAddress + } + + /** + * Returns the effective username. + * 1. If hive.server2.allow.user.substitution = false: the username of the connecting user + * 2. If hive.server2.allow.user.substitution = true: the username of the end user, + * that the connecting user is trying to proxy for. + * This includes a check whether the connecting user is allowed to proxy for the end user. + * + * @param req + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + private def getUserName(req: TOpenSessionReq): String = { + var userName: String = null + if (isKerberosAuthMode) { + userName = hiveAuthFactory.getRemoteUser + } + if (userName == null) { + userName = TSetIpAddressProcessor.getUserName + } + // We set the thread local username, in ThriftHttpServlet. + if (cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE) + .equalsIgnoreCase("http")) { + userName = SessionManager.getUserName + } + if (userName == null) { + userName = req.getUsername + } + userName = getShortName(userName) + val effectiveClientUser: String = getProxyUser(userName, req.getConfiguration, getIpAddress) + logDebug("Client's username: " + effectiveClientUser) + effectiveClientUser + } + + private def getShortName(userName: String): String = { + var ret: String = null + if (userName != null) { + val indexOfDomainMatch: Int = ServiceUtils.indexOfDomainMatch(userName) + ret = if (indexOfDomainMatch <= 0) { + userName + } else { + userName.substring(0, indexOfDomainMatch) + } + } + ret + } + + /** + * Create a session handle + * + * @param req + * @param res + * @return + * @throws SparkThriftServerSQLException + * @throws LoginException + * @throws IOException + */ + @throws[SparkThriftServerSQLException] + @throws[LoginException] + @throws[IOException] + private[thrift] def getSessionHandle(req: TOpenSessionReq, + res: TOpenSessionResp): SessionHandle = { + val userName: String = getUserName(req) + val ipAddress: String = getIpAddress + val protocol: TProtocolVersion = + getMinVersion(CLIService.SERVER_VERSION, req.getClient_protocol) + res.setServerProtocolVersion(protocol) + var sessionHandle: SessionHandle = null + if (cliService.getHiveConf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && + (userName != null)) { + val delegationTokenStr: String = getDelegationToken(userName) + sessionHandle = cliService.openSessionWithImpersonation( + protocol, + userName, + req.getPassword, + ipAddress, + req.getConfiguration.asScala.toMap, + delegationTokenStr) + } else sessionHandle = cliService.openSession( + protocol, + userName, + req.getPassword, + ipAddress, + req.getConfiguration.asScala.toMap) + sessionHandle + } + + + @throws[SparkThriftServerSQLException] + @throws[LoginException] + @throws[IOException] + private def getDelegationToken(userName: String): String = { + if (userName == null || + !cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) + .equalsIgnoreCase(KERBEROS.toString)) { + return null + } + try { + return cliService.getDelegationTokenFromMetaStore(userName) + } catch { + case e: UnsupportedOperationException => + // The delegation token is not applicable in the given deployment mode + } + null + } + + private def getMinVersion(versions: TProtocolVersion*): TProtocolVersion = { + val values: Array[TProtocolVersion] = TProtocolVersion.values + var current: Int = values(values.length - 1).getValue + for (version <- versions) { + if (current > version.getValue) { + current = version.getValue + } + } + for (version <- values) { + if (version.getValue == current) { + return version + } + } + throw new IllegalArgumentException("never") + } + + @throws[TException] + override def CloseSession(req: TCloseSessionReq): TCloseSessionResp = { + val resp: TCloseSessionResp = new TCloseSessionResp + try { + val sessionHandle: SessionHandle = new SessionHandle(req.getSessionHandle) + cliService.closeSession(sessionHandle) + resp.setStatus(OK_STATUS) + val context: ThriftCLIServerContext = + currentServerContext.get.asInstanceOf[ThriftCLIServerContext] + if (context != null) { + context.setSessionHandle(null) + } + } catch { + case e: Exception => + logWarning("Error closing session: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetInfo(req: TGetInfoReq): TGetInfoResp = { + val resp: TGetInfoResp = new TGetInfoResp + try { + val getInfoValue: GetInfoValue = + cliService.getInfo( + new SessionHandle(req.getSessionHandle), + GetInfoType.getGetInfoType(req.getInfoType)) + resp.setInfoValue(getInfoValue.toTGetInfoValue) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting info: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def ExecuteStatement(req: TExecuteStatementReq): TExecuteStatementResp = { + val resp: TExecuteStatementResp = new TExecuteStatementResp + try { + val sessionHandle: SessionHandle = new SessionHandle(req.getSessionHandle) + val statement: String = req.getStatement + val confOverlay: util.Map[String, String] = req.getConfOverlay + val runAsync: Boolean = req.isRunAsync + val operationHandle: OperationHandle = if (runAsync) { + cliService.executeStatementAsync(sessionHandle, statement, confOverlay.asScala.toMap) + } else { + cliService.executeStatement(sessionHandle, statement, confOverlay.asScala.toMap) + } + resp.setOperationHandle(operationHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error executing statement: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetTypeInfo(req: TGetTypeInfoReq): TGetTypeInfoResp = { + val resp: TGetTypeInfoResp = new TGetTypeInfoResp + try { + val operationHandle: OperationHandle = + cliService.getTypeInfo(new SessionHandle(req.getSessionHandle)) + resp.setOperationHandle(operationHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting type info: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetCatalogs(req: TGetCatalogsReq): TGetCatalogsResp = { + val resp: TGetCatalogsResp = new TGetCatalogsResp + try { + val opHandle: OperationHandle = + cliService.getCatalogs(new SessionHandle(req.getSessionHandle)) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting catalogs: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetSchemas(req: TGetSchemasReq): TGetSchemasResp = { + val resp: TGetSchemasResp = new TGetSchemasResp + try { + val opHandle: OperationHandle = + cliService.getSchemas(new SessionHandle(req.getSessionHandle), + req.getCatalogName, req.getSchemaName) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting schemas: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetTables(req: TGetTablesReq): TGetTablesResp = { + val resp: TGetTablesResp = new TGetTablesResp + try { + val opHandle: OperationHandle = + cliService.getTables( + new SessionHandle(req.getSessionHandle), + req.getCatalogName, + req.getSchemaName, + req.getTableName, + req.getTableTypes.asScala.toList) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting tables: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetTableTypes(req: TGetTableTypesReq): TGetTableTypesResp = { + val resp: TGetTableTypesResp = new TGetTableTypesResp + try { + val opHandle: OperationHandle = + cliService.getTableTypes(new SessionHandle(req.getSessionHandle)) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting table types: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetColumns(req: TGetColumnsReq): TGetColumnsResp = { + val resp: TGetColumnsResp = new TGetColumnsResp + try { + val opHandle: OperationHandle = + cliService.getColumns( + new SessionHandle(req.getSessionHandle), + req.getCatalogName, + req.getSchemaName, + req.getTableName, + req.getColumnName) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting columns: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetFunctions(req: TGetFunctionsReq): TGetFunctionsResp = { + val resp: TGetFunctionsResp = new TGetFunctionsResp + try { + val opHandle: OperationHandle = cliService.getFunctions( + new SessionHandle(req.getSessionHandle), + req.getCatalogName, + req.getSchemaName, + req.getFunctionName) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting functions: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + override def GetPrimaryKeys(req: TGetPrimaryKeysReq): TGetPrimaryKeysResp = { + val resp = new TGetPrimaryKeysResp + try { + val opHandle: OperationHandle = + cliService.getPrimaryKeys(new SessionHandle(req.getSessionHandle), + req.getCatalogName, + req.getSchemaName, + req.getTableName) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting functions: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + override def GetCrossReference(req: TGetCrossReferenceReq): TGetCrossReferenceResp = { + val resp = new TGetCrossReferenceResp + try { + val opHandle = + cliService.getCrossReference( + new SessionHandle(req.getSessionHandle), + req.getParentCatalogName, + req.getParentSchemaName, + req.getParentTableName, + req.getForeignCatalogName, + req.getForeignSchemaName, + req.getForeignTableName) + resp.setOperationHandle(opHandle.toTOperationHandle) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logInfo("Error getting functions: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + override def GetQueryId(req: TGetQueryIdReq): TGetQueryIdResp = { + try { + new TGetQueryIdResp(cliService.getQueryId(req.getOperationHandle)) + } catch { + case e: SparkThriftServerSQLException => throw new TException(e) + } + } + + override def SetClientInfo(req: TSetClientInfoReq): TSetClientInfoResp = { + throw new TException("Method not implemented") + } + + @throws[TException] + override def GetOperationStatus(req: TGetOperationStatusReq): TGetOperationStatusResp = { + val resp: TGetOperationStatusResp = new TGetOperationStatusResp + try { + val operationStatus: OperationStatus = + cliService.getOperationStatus(new OperationHandle(req.getOperationHandle)) + resp.setOperationState(operationStatus.getState.toTOperationState) + val opException: SparkThriftServerSQLException = operationStatus.getOperationException + if (opException != null) { + resp.setSqlState(opException.getSQLState) + resp.setErrorCode(opException.getErrorCode) + resp.setErrorMessage(opException.getMessage) + } + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting operation status: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def CancelOperation(req: TCancelOperationReq): TCancelOperationResp = { + val resp: TCancelOperationResp = new TCancelOperationResp + try { + cliService.cancelOperation(new OperationHandle(req.getOperationHandle)) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error cancelling operation: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def CloseOperation(req: TCloseOperationReq): TCloseOperationResp = { + val resp: TCloseOperationResp = new TCloseOperationResp + try { + cliService.closeOperation(new OperationHandle(req.getOperationHandle)) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error closing operation: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def GetResultSetMetadata(req: TGetResultSetMetadataReq): TGetResultSetMetadataResp = { + val resp: TGetResultSetMetadataResp = new TGetResultSetMetadataResp + try { + val schema: StructType = + cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle)) + resp.setSchema(SchemaMapper.toTTableSchema(schema)) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error getting result set metadata: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + @throws[TException] + override def FetchResults(req: TFetchResultsReq): TFetchResultsResp = { + val resp: TFetchResultsResp = new TFetchResultsResp + try { + val rowSet: RowSet = + cliService.fetchResults( + new OperationHandle(req.getOperationHandle), + FetchOrientation.getFetchOrientation(req.getOrientation), + req.getMaxRows, + FetchType.getFetchType(req.getFetchType)) + resp.setResults(rowSet.toTRowSet) + resp.setHasMoreRows(false) + resp.setStatus(OK_STATUS) + } catch { + case e: Exception => + logWarning("Error fetching results: ", e) + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) + } + resp + } + + override def run(): Unit + + /** + * If the proxy user name is provided then check privileges to substitute the user. + * + * @param realUser + * @param sessionConf + * @param ipAddress + * @return + * @throws SparkThriftServerSQLException + */ + @throws[SparkThriftServerSQLException] + private def getProxyUser(realUser: String, + sessionConf: util.Map[String, String], + ipAddress: String): String = { + var proxyUser: String = null + // We set the thread local proxy username, in ThriftHttpServlet. + if (cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE) + .equalsIgnoreCase("http")) { + proxyUser = SessionManager.getProxyUserName + logDebug("Proxy user from query string: " + proxyUser) + } + if (proxyUser == null && + sessionConf != null && + sessionConf.containsKey(HiveAuthFactory.HS2_PROXY_USER)) { + val proxyUserFromThriftBody: String = sessionConf.get(HiveAuthFactory.HS2_PROXY_USER) + logDebug("Proxy user from thrift body: " + proxyUserFromThriftBody) + proxyUser = proxyUserFromThriftBody + } + if (proxyUser == null) return realUser + // check whether substitution is allowed + if (!hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ALLOW_USER_SUBSTITUTION)) { + throw new SparkThriftServerSQLException("Proxy user substitution is not allowed") + } + // If there's no authentication, then directly substitute the user + if (NONE.toString.equalsIgnoreCase(hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION))) { + return proxyUser + } + // Verify proxy user privilege of the realUser for the proxyUser + HiveAuthFactory.verifyProxyAccess(realUser, proxyUser, ipAddress, hiveConf) + logDebug("Verified proxy user: " + proxyUser) + proxyUser + } + + private def isKerberosAuthMode: Boolean = { + cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) + .equalsIgnoreCase(KERBEROS.toString) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala new file mode 100644 index 000000000000..18d97876b537 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala @@ -0,0 +1,165 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift + +import java.util.concurrent.{SynchronousQueue, ThreadPoolExecutor, TimeUnit} + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hadoop.hive.shims.ShimLoader +import org.apache.hadoop.security.UserGroupInformation +import org.apache.hadoop.util.Shell +import org.apache.thrift.TProcessor +import org.apache.thrift.protocol.{TBinaryProtocol, TProtocolFactory} +import org.apache.thrift.server.TServlet +import org.eclipse.jetty.server._ +import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder} +import org.eclipse.jetty.util.ssl.SslContextFactory +import org.eclipse.jetty.util.thread.{ExecutorThreadPool, ScheduledExecutorScheduler} + +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli.CLIService +import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup + + +class ThriftHttpCLIService(cliService: CLIService) + extends ThriftCLIService(cliService, classOf[ThriftHttpCLIService].getSimpleName) { + /** + * Configure Jetty to serve http requests. Example of a client connection URL: + * http://localhost:10000/servlets/thrifths2/ A gateway may cause actual target URL to differ, + * e.g. http://gateway:port/hive2/servlets/thrifths2/ + */ + override def run(): Unit = { + try { // Server thread pool + // Start with minWorkerThreads, expand till maxWorkerThreads and reject subsequent requests + val threadPoolName: String = "HiveServer2-HttpHandler-Pool" + val executorService: ThreadPoolExecutor = + new ThreadPoolExecutor(minWorkerThreads, + maxWorkerThreads, + workerKeepAliveTime, + TimeUnit.SECONDS, + new SynchronousQueue[Runnable], + new ThreadFactoryWithGarbageCleanup(threadPoolName)) + val threadPool: ExecutorThreadPool = new ExecutorThreadPool(executorService) + // HTTP Server + httpServer = new org.eclipse.jetty.server.Server(threadPool) + // Connector configs + var connectionFactories: Array[ConnectionFactory] = null + val useSsl: Boolean = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL) + val schemeName: String = if (useSsl) { + "https" + } else { + "http" + } + // Change connector if SSL is used + if (useSsl) { + val keyStorePath: String = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim + val keyStorePassword: String = + ShimLoader.getHadoopShims + .getPassword(hiveConf, HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname) + if (keyStorePath.isEmpty) { + throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + + " Not configured for SSL connection") + } + val sslContextFactory: SslContextFactory = new SslContextFactory.Server + val excludedProtocols: Array[String] = + hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",") + logInfo("HTTP Server SSL: adding excluded protocols: " + excludedProtocols.mkString(",")) + sslContextFactory.addExcludeProtocols(excludedProtocols: _*) + logInfo("HTTP Server SSL: SslContextFactory.getExcludeProtocols = " + + sslContextFactory.getExcludeProtocols.mkString(",")) + sslContextFactory.setKeyStorePath(keyStorePath) + sslContextFactory.setKeyStorePassword(keyStorePassword) + connectionFactories = + AbstractConnectionFactory.getFactories(sslContextFactory, new HttpConnectionFactory) + } else { + connectionFactories = Array[ConnectionFactory](new HttpConnectionFactory) + } + val connector: ServerConnector = + new ServerConnector( + httpServer, + null, + new ScheduledExecutorScheduler("SparkThriftServer-HttpHandler-JettyScheduler", true), + null, + -1, + -1, + connectionFactories: _*) + connector.setPort(portNum) + // Linux:yes, Windows:no + connector.setReuseAddress(!Shell.WINDOWS) + val maxIdleTime: Int = hiveConf.getTimeVar( + ConfVars.HIVE_SERVER2_THRIFT_HTTP_MAX_IDLE_TIME, + TimeUnit.MILLISECONDS).toInt + connector.setIdleTimeout(maxIdleTime) + httpServer.addConnector(connector) + // Thrift configs + hiveAuthFactory = new HiveAuthFactory(hiveConf) + val processor: TProcessor = new TCLIService.Processor[TCLIService.Iface](this) + val protocolFactory: TProtocolFactory = new TBinaryProtocol.Factory + // Set during the init phase of HiveServer2 if auth mode is kerberos + // UGI for the hive/_HOST (kerberos) principal + val serviceUGI: UserGroupInformation = cliService.getServiceUGI + // UGI for the http/_HOST (SPNego) principal + val httpUGI: UserGroupInformation = cliService.getHttpUGI + val authType: String = hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) + val thriftHttpServlet: TServlet = + new ThriftHttpServlet(processor, protocolFactory, authType, serviceUGI, httpUGI) + // Context handler + val context: ServletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS) + context.setContextPath("/") + val httpPath: String = + getHttpPath(hiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH)) + httpServer.setHandler(context) + context.addServlet(new ServletHolder(thriftHttpServlet), httpPath) + // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc. + // Finally, start the server + httpServer.start() + val msg: String = "Started " + classOf[ThriftHttpCLIService].getSimpleName + + " in " + schemeName + " mode on port " + connector.getLocalPort + + " path=" + httpPath + " with " + minWorkerThreads + "..." + + maxWorkerThreads + " worker threads" + logInfo(msg) + httpServer.join() + } catch { + case t: Throwable => + logError("Error starting SparkThriftServer: could not start " + + classOf[ThriftHttpCLIService].getSimpleName, t) + System.exit(-1) + } + } + + private def getHttpPath(path: String): String = { + var httpPath = path + if (httpPath == null || httpPath == "") { + httpPath = "/*" + } + else { + if (!httpPath.startsWith("/")) { + httpPath = "/" + httpPath + } + if (httpPath.endsWith("/")) { + httpPath = httpPath + "*" + } + if (!httpPath.endsWith("/*")) { + httpPath = httpPath + "/*" + } + } + httpPath + } + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala new file mode 100644 index 000000000000..7f9ecdc23c87 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala @@ -0,0 +1,490 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift + +import java.io.{IOException, UnsupportedEncodingException} +import java.security.PrivilegedExceptionAction +import java.util +import java.util.concurrent.TimeUnit +import javax.servlet.ServletException +import javax.servlet.http.{Cookie, HttpServletRequest, HttpServletResponse} +import javax.ws.rs.core.NewCookie + +import scala.collection.JavaConverters._ +import scala.util.control.NonFatal + +import org.apache.commons.codec.binary.{Base64, StringUtils} +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hadoop.hive.shims.{HadoopShims, ShimLoader} +import org.apache.hadoop.security.UserGroupInformation +import org.apache.thrift.TProcessor +import org.apache.thrift.protocol.TProtocolFactory +import org.apache.thrift.server.TServlet +import org.ietf.jgss._ + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.CookieSigner +import org.apache.spark.sql.thriftserver.auth._ +import org.apache.spark.sql.thriftserver.auth.AuthenticationProviderFactory.AuthMethods +import org.apache.spark.sql.thriftserver.cli.session.SessionManager + +class ThriftHttpServlet(processor: TProcessor, + protocolFactory: TProtocolFactory, + authType: String, + serviceUGI: UserGroupInformation, + httpUGI: UserGroupInformation) + extends TServlet(processor, protocolFactory) with Logging { + private val hiveConf: HiveConf = new HiveConf + // Class members for cookie based authentication. + private var signer: CookieSigner = null + val AUTH_COOKIE = "hive.server2.auth" + private val RAN = new util.Random + private val isCookieAuthEnabled: Boolean = + hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_AUTH_ENABLED) + + private var cookieDomain: String = null + private var cookiePath: String = null + private var cookieMaxAge: Int = 0 + private var isCookieSecure: Boolean = false + private var isHttpOnlyCookie: Boolean = false + + try { + // Initialize the cookie based authentication related variables. + if (isCookieAuthEnabled) { + // Generate the signer with secret. + val secret = RAN.nextLong.toString + logDebug("Using the random number as the secret for cookie generation " + secret) + this.signer = new CookieSigner(secret.getBytes) + this.cookieMaxAge = + hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_MAX_AGE, + TimeUnit.SECONDS).toInt + this.cookieDomain = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_DOMAIN) + this.cookiePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_PATH) + this.isCookieSecure = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_SECURE) + this.isHttpOnlyCookie = + hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_HTTPONLY) + } + } catch { + case NonFatal(e) => + logError("Error initializing ThriftHttpServlet.", e) + } + + @throws[ServletException] + @throws[IOException] + override protected def doPost(request: HttpServletRequest, + response: HttpServletResponse): Unit = { + var clientUserName: String = null + var clientIpAddress: String = null + var requireNewCookie: Boolean = false + try { // If the cookie based authentication is already enabled, parse the + // request and validate the request cookies. + if (isCookieAuthEnabled) { + clientUserName = validateCookie(request) + requireNewCookie = clientUserName == null + if (requireNewCookie) { + logInfo("Could not validate cookie sent, will try to generate a new cookie") + } + } + // If the cookie based authentication is not enabled or the request does + // not have a valid cookie, use the kerberos or password based authentication + // depending on the server setup. + if (clientUserName == null) { // For a kerberos setup + if (isKerberosAuthMode(authType)) clientUserName = doKerberosAuth(request) + else { // For password based authentication + clientUserName = doPasswdAuth(request, authType) + } + } + logDebug("Client username: " + clientUserName) + // Set the thread local username to be used for doAs if true + SessionManager.setUserName(clientUserName) + // find proxy user if any from query param + val doAsQueryParam: String = getDoAsQueryParam(request.getQueryString) + if (doAsQueryParam != null) { + SessionManager.setProxyUserName(doAsQueryParam) + } + clientIpAddress = request.getRemoteAddr + logDebug("Client IP Address: " + clientIpAddress) + // Set the thread local ip address + SessionManager.setIpAddress(clientIpAddress) + // Generate new cookie and add it to the response + if (requireNewCookie && !authType.equalsIgnoreCase(NOSASL.toString)) { + val cookieToken: String = HttpAuthUtils.createCookieToken(clientUserName) + val hs2Cookie: Cookie = createCookie(signer.signCookie(cookieToken)) + if (isHttpOnlyCookie) { + response.setHeader("SET-COOKIE", getHttpOnlyCookieHeader(hs2Cookie)) + } else { + response.addCookie(hs2Cookie) + } + logInfo("Cookie added for clientUserName " + clientUserName) + } + super.doPost(request, response) + } catch { + case e: HttpAuthenticationException => + logError("Error: ", e) + // Send a 401 to the client + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED) + if (isKerberosAuthMode(authType)) { + response.addHeader(HttpAuthUtils.WWW_AUTHENTICATE, HttpAuthUtils.NEGOTIATE) + } + // scalastyle:off + response.getWriter.println("Authentication Error: " + e.getMessage) + // scalastyle:on + } finally { + // Clear the thread locals + SessionManager.clearUserName + SessionManager.clearIpAddress + SessionManager.clearProxyUserName + } + } + + /** + * Retrieves the client name from cookieString. If the cookie does not + * correspond to a valid client, the function returns null. + * + * @param cookies HTTP Request cookies. + * @return Client Username if cookieString has a HS2 Generated cookie that is currently valid. + * Else, returns null. + */ + private def getClientNameFromCookie(cookies: Array[Cookie]): String = { + // Current Cookie Name, Current Cookie Value + var currName: String = null + var currValue: String = null + // Following is the main loop which iterates through all the cookies send by the client. + // The HS2 generated cookies are of the format hive.server2.auth= + // A cookie which is identified as a hiveserver2 generated cookie is validated + // by calling signer.verifyAndExtract(). If the validation passes, send the + // username for which the cookie is validated to the caller. If no client side + // cookie passes the validation, return null to the caller. + for (currCookie <- cookies) { // Get the cookie name + currName = currCookie.getName + if (currName == AUTH_COOKIE) { + // If we reached here, we have match for HS2 generated cookie + currValue = currCookie.getValue + // Validate the value. + currValue = signer.verifyAndExtract(currValue) + // Retrieve the user name, do the final validation step. + if (currValue != null) { + val userName: String = HttpAuthUtils.getUserNameFromCookieToken(currValue) + if (userName == null) { + logWarning("Invalid cookie token " + currValue) + } else { + // We have found a valid cookie in the client request. + logDebug("Validated the cookie for user " + userName) + return userName + } + } + } + } + // No valid HS2 generated cookies found, return null + null + } + + /** + * Convert cookie array to human readable cookie string + * + * @param cookies Cookie Array + * @return String containing all the cookies separated by a newline character. + * Each cookie is of the format [key]=[value] + */ + private def toCookieStr(cookies: Array[Cookie]): String = { + var cookieStr: String = "" + for (c <- cookies) { + cookieStr += c.getName + "=" + c.getValue + " ;\n" + } + cookieStr + } + + /** + * Validate the request cookie. This function iterates over the request cookie headers + * and finds a cookie that represents a valid client/server session. If it finds one, it + * returns the client name associated with the session. Else, it returns null. + * + * @param request The HTTP Servlet Request send by the client + * @return Client Username if the request has valid HS2 cookie, else returns null + * @throws UnsupportedEncodingException + */ + @throws[UnsupportedEncodingException] + private def validateCookie(request: HttpServletRequest): String = { + // Find all the valid cookies associated with the request. + val cookies: Array[Cookie] = request.getCookies + if (cookies == null) { + logDebug("No valid cookies associated with the request " + request) + return null + } + logDebug("Received cookies: " + toCookieStr(cookies)) + getClientNameFromCookie(cookies) + } + + /** + * Generate a server side cookie given the cookie value as the input. + * + * @param str Input string token. + * @return The generated cookie. + * @throws UnsupportedEncodingException + */ + @throws[UnsupportedEncodingException] + private def createCookie(str: String): Cookie = { + logDebug("Cookie name = " + AUTH_COOKIE + " value = " + str) + val cookie: Cookie = new Cookie(AUTH_COOKIE, str) + cookie.setMaxAge(cookieMaxAge) + if (cookieDomain != null) { + cookie.setDomain(cookieDomain) + } + if (cookiePath != null) { + cookie.setPath(cookiePath) + } + cookie.setSecure(isCookieSecure) + cookie + } + + /** + * Generate httponly cookie from HS2 cookie + * + * @param cookie HS2 generated cookie + * @return The httponly cookie + */ + private def getHttpOnlyCookieHeader(cookie: Cookie): String = { + val newCookie: NewCookie = + new NewCookie(cookie.getName, + cookie.getValue, + cookie.getPath, + cookie.getDomain, + cookie.getVersion, + cookie.getComment, + cookie.getMaxAge, + cookie.getSecure) + newCookie + "; HttpOnly" + } + + /** + * Do the LDAP/PAM authentication + * + * @param request + * @param authType + * @throws HttpAuthenticationException + */ + @throws[HttpAuthenticationException] + private def doPasswdAuth(request: HttpServletRequest, authType: String): String = { + val userName: String = getUsername(request, authType) + // No-op when authType is NOSASL + if (!authType.equalsIgnoreCase(NOSASL.toString)) { + try { + val authMethod: AuthMethods = + AuthMethods.getValidAuthMethod(authType) + val provider: PasswdAuthenticationProvider = + AuthenticationProviderFactory.getAuthenticationProvider(authMethod) + provider.Authenticate(userName, getPassword(request, authType)) + } catch { + case e: Exception => + throw new HttpAuthenticationException(e) + } + } + userName + } + + /** + * Do the GSS-API kerberos authentication. + * We already have a logged in subject in the form of serviceUGI, + * which GSS-API will extract information from. + * In case of a SPNego request we use the httpUGI, + * for the authenticating service tickets. + * + * @param request + * @return + * @throws HttpAuthenticationException + */ + @throws[HttpAuthenticationException] + private def doKerberosAuth(request: HttpServletRequest): String = { + // Try authenticating with the http/_HOST principal + if (httpUGI != null) { + try + return httpUGI.doAs(new HttpKerberosServerAction(request, httpUGI)) + catch { + case e: Exception => + logInfo("Failed to authenticate with http/_HOST kerberos principal, " + + "trying with hive/_HOST kerberos principal") + } + } + // Now try with hive/_HOST principal + try { + serviceUGI.doAs(new HttpKerberosServerAction(request, serviceUGI)) + } catch { + case e: Exception => + logError("Failed to authenticate with hive/_HOST kerberos principal") + throw new HttpAuthenticationException(e) + } + } + + private[thrift] class HttpKerberosServerAction(var request: HttpServletRequest, + var serviceUGI: UserGroupInformation) + extends PrivilegedExceptionAction[String] { + @throws[HttpAuthenticationException] + override def run: String = { // Get own Kerberos credentials for accepting connection + val manager: GSSManager = GSSManager.getInstance + var gssContext: GSSContext = null + val serverPrincipal: String = getPrincipalWithoutRealm(serviceUGI.getUserName) + try { // This Oid for Kerberos GSS-API mechanism. + val kerberosMechOid: Oid = new Oid("1.2.840.113554.1.2.2") + // Oid for SPNego GSS-API mechanism. + val spnegoMechOid: Oid = new Oid("1.3.6.1.5.5.2") + // Oid for kerberos principal name + val krb5PrincipalOid: Oid = new Oid("1.2.840.113554.1.2.2.1") + // GSS name for server + val serverName: GSSName = manager.createName(serverPrincipal, krb5PrincipalOid) + // GSS credentials for server + val serverCreds: GSSCredential = manager.createCredential(serverName, + GSSCredential.DEFAULT_LIFETIME, + Array[Oid](kerberosMechOid, + spnegoMechOid), + GSSCredential.ACCEPT_ONLY) + // Create a GSS context + gssContext = manager.createContext(serverCreds) + // Get service ticket from the authorization header + val serviceTicketBase64: String = getAuthHeader(request, authType) + val inToken: Array[Byte] = Base64.decodeBase64(serviceTicketBase64.getBytes) + gssContext.acceptSecContext(inToken, 0, inToken.length) + // Authenticate or deny based on its context completion + if (!gssContext.isEstablished) { + throw new HttpAuthenticationException("Kerberos authentication failed: " + + "unable to establish context with the service ticket " + "provided by the client.") + } + else getPrincipalWithoutRealmAndHost(gssContext.getSrcName.toString) + } catch { + case e: GSSException => + throw new HttpAuthenticationException("Kerberos authentication failed: ", e) + } finally if (gssContext != null) try + gssContext.dispose() + catch { + case e: GSSException => + + // No-op + } + } + + @throws[HttpAuthenticationException] + private def getPrincipalWithoutRealm(fullPrincipal: String): String = { + var fullKerberosName: HadoopShims.KerberosNameShim = null + try + fullKerberosName = ShimLoader.getHadoopShims.getKerberosNameShim(fullPrincipal) + catch { + case e: IOException => + throw new HttpAuthenticationException(e) + } + val serviceName: String = fullKerberosName.getServiceName + val hostName: String = fullKerberosName.getHostName + var principalWithoutRealm: String = serviceName + if (hostName != null) principalWithoutRealm = serviceName + "/" + hostName + principalWithoutRealm + } + + @throws[HttpAuthenticationException] + private def getPrincipalWithoutRealmAndHost(fullPrincipal: String): String = { + var fullKerberosName: HadoopShims.KerberosNameShim = null + try { + fullKerberosName = ShimLoader.getHadoopShims.getKerberosNameShim(fullPrincipal) + fullKerberosName.getShortName + } catch { + case e: IOException => + throw new HttpAuthenticationException(e) + } + } + } + + @throws[HttpAuthenticationException] + private def getUsername(request: HttpServletRequest, authType: String): String = { + val creds: Array[String] = getAuthHeaderTokens(request, authType) + // Username must be present + if (creds(0) == null || creds(0).isEmpty) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client does not contain username.") + } + creds(0) + } + + @throws[HttpAuthenticationException] + private def getPassword(request: HttpServletRequest, authType: String): String = { + val creds: Array[String] = getAuthHeaderTokens(request, authType) + // Password must be present + if (creds(1) == null || creds(1).isEmpty) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client does not contain username.") + } + creds(1) + } + + @throws[HttpAuthenticationException] + private def getAuthHeaderTokens(request: HttpServletRequest, authType: String): Array[String] = { + val authHeaderBase64: String = getAuthHeader(request, authType) + val authHeaderString: String = + StringUtils.newStringUtf8(Base64.decodeBase64(authHeaderBase64.getBytes)) + val creds: Array[String] = authHeaderString.split(":") + creds + } + + /** + * Returns the base64 encoded auth header payload + * + * @param request + * @param authType + * @return + * @throws HttpAuthenticationException + */ + @throws[HttpAuthenticationException] + private def getAuthHeader(request: HttpServletRequest, authType: String): String = { + val authHeader: String = request.getHeader(HttpAuthUtils.AUTHORIZATION) + // Each http request must have an Authorization header + if (authHeader == null || authHeader.isEmpty) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client is empty.") + } + var authHeaderBase64String: String = null + var beginIndex: Int = 0 + if (isKerberosAuthMode(authType)) { + beginIndex = (HttpAuthUtils.NEGOTIATE + " ").length + } else { + beginIndex = (HttpAuthUtils.BASIC + " ").length + } + authHeaderBase64String = authHeader.substring(beginIndex) + // Authorization header must have a payload + if (authHeaderBase64String == null || authHeaderBase64String.isEmpty) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client does not contain any data.") + } + authHeaderBase64String + } + + private def isKerberosAuthMode(authType: String): Boolean = + authType.equalsIgnoreCase(KERBEROS.toString) + + private def getDoAsQueryParam(queryString: String): String = { + logDebug("URL query string:" + queryString) + if (queryString == null) { + return null + } + val params: util.Hashtable[String, Array[String]] = + javax.servlet.http.HttpUtils.parseQueryString(queryString) + val keySet: Seq[String] = params.keySet.asScala.toSeq + keySet.foreach(key => { + if (key.equalsIgnoreCase("doAs")) { + return params.get(key)(0) + } + }) + null + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala new file mode 100644 index 000000000000..20c68b86ed34 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala @@ -0,0 +1,131 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.utils + +import java.io.PrintStream + +import org.apache.commons.lang.StringUtils +import org.apache.hadoop.hive.ql.session.SessionState +import org.slf4j.Logger + + +/** + * This class provides helper routines to emit informational and error + * messages to the user and log4j files while obeying the current session's + * verbosity levels. + * + * NEVER write directly to the SessionStates standard output other than to + * emit result data DO use printInfo and printError provided by LogHelper to + * emit non result data strings. + * + * It is perfectly acceptable to have global static LogHelper objects (for + * example - once per module) LogHelper always emits info/error to current + * session as required. + */ +object LogHelper { + def getInfoStream: PrintStream = { + val ss = SessionState.get + if ((ss != null) && (ss.info != null)) ss.info + else getErrStream + } + + def getErrStream: PrintStream = { + val ss = SessionState.get + if ((ss != null) && (ss.err != null)) ss.err + else System.err + } +} + +class LogHelper(var LOG: Logger, var isSilent: Boolean) { + def this(LOG: Nothing) { + this(LOG, false) + } + + def getOutStream: PrintStream = { + val ss = SessionState.get + if ((ss != null) && (ss.out != null)) ss.out + else System.out + } + + def getChildOutStream: PrintStream = { + val ss = SessionState.get + if ((ss != null) && (ss.childOut != null)) ss.childOut + else System.out + } + + def getChildErrStream: PrintStream = { + val ss = SessionState.get + if ((ss != null) && (ss.childErr != null)) ss.childErr + else System.err + } + + def getIsSilent: Boolean = { + val ss = SessionState.get + // use the session or the one supplied in constructor + if (ss != null) ss.getIsSilent + else isSilent + } + + def logInfo(info: String): Unit = { + logInfo(info, null) + } + + def logInfo(info: String, detail: String): Unit = { + LOG.info(info + StringUtils.defaultString(detail)) + } + + def printInfo(info: String): Unit = { + printInfo(info, null) + } + + def printInfo(info: String, isSilent: Boolean): Unit = { + printInfo(info, null, isSilent) + } + + def printInfo(info: String, detail: String): Unit = { + printInfo(info, detail, getIsSilent) + } + + def printInfo(info: String, detail: String, isSilent: Boolean): Unit = { + if (!isSilent) { + // scalastyle:off + LogHelper.getInfoStream.println(info) + // scalastyle:on + } + LOG.info(info + StringUtils.defaultString(detail)) + } + + def printInfoNoLog(info: String): Unit = { + if (!getIsSilent) { + // scalastyle:off + LogHelper.getInfoStream.println(info) + // scalastyle:on + } + } + + def printError(error: String): Unit = { + printError(error, null) + } + + def printError(error: String, detail: String): Unit = { + // scalastyle:off + LogHelper.getErrStream.println(error) + // scalastyle:on + LOG.error(error + StringUtils.defaultString(detail)) + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala new file mode 100644 index 000000000000..fb06f460ac68 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.utils + +import java.util + +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.hive.conf.{HiveConf, SystemVariables} +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hadoop.hive.conf.SystemVariables._ +import org.apache.hadoop.hive.ql.session.SessionState + +import org.apache.spark.internal.Logging + +class VariableSubstitution(hiveVariableSource: util.Map[String, String]) + extends SystemVariables with Logging { + + override protected def getSubstitute(conf: Configuration, variable: String): String = { + var value: String = super.getSubstitute(conf, variable) + if (value == null && SessionState.get != null) { + if (variable.startsWith(HIVEVAR_PREFIX)) { + value = hiveVariableSource.get(variable.substring(HIVEVAR_PREFIX.length)) + } else { + value = hiveVariableSource.get(variable) + } + } + value + } + + def substitute(conf: HiveConf, expr: String): String = { + if (expr == null) return expr + if (HiveConf.getBoolVar(conf, ConfVars.HIVEVARIABLESUBSTITUTE)) { + logDebug("Substitution is on: " + expr) + } else { + return expr + } + val depth = HiveConf.getIntVar(conf, ConfVars.HIVEVARIABLESUBSTITUTEDEPTH) + substitute(conf, expr, depth) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala new file mode 100644 index 000000000000..95f5597c7229 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala @@ -0,0 +1,295 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.server + +import java.util + +import scala.collection.JavaConverters._ + +import org.apache.commons.cli._ +import org.apache.hadoop.hive.common.LogUtils +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hive.common.util.{HiveStringUtils, HiveVersionInfo} + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.thriftserver.{CompositeService, SparkSQLEnv} +import org.apache.spark.sql.thriftserver.cli.CLIService +import org.apache.spark.sql.thriftserver.cli.thrift.{ThriftBinaryCLIService, ThriftCLIService, ThriftHttpCLIService} +import org.apache.spark.util.ShutdownHookManager + +class SparkThriftServer(sqlContext: SQLContext) + extends CompositeService(classOf[SparkThriftServer].getSimpleName) + with Logging { + + private var cliService: CLIService = null + private var thriftCLIService: ThriftCLIService = null + + try { + HiveConf.setLoadHiveServer2Config(true) + } catch { + case e: Throwable => e.printStackTrace() + } + + override def init(hiveConf: HiveConf): Unit = { + cliService = new CLIService(this, sqlContext) + addService(cliService) + if (SparkThriftServer.isHTTPTransportMode(hiveConf)) { + thriftCLIService = new ThriftHttpCLIService(cliService) + } else { + thriftCLIService = new ThriftBinaryCLIService(cliService) + } + addService(thriftCLIService) + super.init(hiveConf) + // Add a shutdown hook for catching SIGTERM & SIGINT + // this must be higher than the Hadoop Filesystem priority of 10, + // which the default priority is. + // The signature of the callback must match that of a scala () -> Unit + // function + ShutdownHookManager.addShutdownHook(() => { + try { + logInfo("Hive Server Shutdown hook invoked") + stop() + } catch { + case e: Throwable => + logWarning("Ignoring Exception while stopping Hive Server from shutdown hook", e) + } + }) + } + + + override def start(): Unit = { + super.start() + } + + override def stop(): Unit = { + logInfo("Shutting down HiveServer2") + super.stop() + } +} + +object SparkThriftServer extends Logging { + @throws[Throwable] + private def startHiveServer2(): Unit = { + var attempts = 0 + var maxAttempts: Long = 1 + while (true) { + logInfo("Starting HiveServer2") + val hiveConf = new HiveConf + maxAttempts = hiveConf.getLongVar(HiveConf.ConfVars.HIVE_SERVER2_MAX_START_ATTEMPTS) + var server: SparkThriftServer = null + try { + server = new SparkThriftServer(SparkSQLEnv.sqlContext) + server.init(hiveConf) + server.start() + + // ToDo add a JVMPauseMonitor for spark + + } catch { + case throwable: Throwable => + if (server != null) { + try + server.stop() + catch { + case t: Throwable => + logInfo("Exception caught when calling stop of HiveServer2 " + + "before retrying start", t) + } finally server = null + } + if ( { + attempts += 1; + attempts + } >= maxAttempts) { + throw new Error("Max start attempts " + maxAttempts + " exhausted", throwable) + } else { + logWarning("Error starting HiveServer2 on attempt " + + attempts + ", will retry in 60 seconds", throwable) + try + Thread.sleep(60L * 1000L) + catch { + case e: InterruptedException => + Thread.currentThread.interrupt() + } + } + } + } + } + + def isHTTPTransportMode(hiveConf: HiveConf): Boolean = { + var transportMode = System.getenv("HIVE_SERVER2_TRANSPORT_MODE") + if (transportMode == null) { + transportMode = hiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE) + } + if (transportMode != null && transportMode.equalsIgnoreCase("http")) { + return true + } + false + } + + def main(args: Array[String]): Unit = { + HiveConf.setLoadHiveServer2Config(true) + try { + val oproc = new ServerOptionsProcessor("hiveserver2") + val oprocResponse = oproc.parse(args) + // NOTE: It is critical to do this here so that log4j is reinitialized + // before any of the other core hive classes are loaded + val initLog4jMessage = LogUtils.initHiveLog4j + val classname = classOf[SparkThriftServer].getSimpleName + logDebug(initLog4jMessage) + logInfo(toStartupShutdownString("STARTUP_MSG: ", + Array[String]("Starting " + classname, + " host = " + HiveStringUtils.getHostname, + " args = " + util.Arrays.asList(args), + " version = " + HiveVersionInfo.getVersion, + " classpath = " + System.getProperty("java.class.path"), + " build = " + HiveVersionInfo.getUrl + + " -r " + HiveVersionInfo.getRevision + + "; compiled by '" + HiveVersionInfo.getUser + + "' on " + HiveVersionInfo.getDate))) + ShutdownHookManager.addShutdownHook(0)(() => { + logInfo(toStartupShutdownString( + "SHUTDOWN_MSG: ", + Array[String]("Shutting down " + classname + + " at " + HiveStringUtils.getHostname))) + }) + // Log debug message from "oproc" after log4j initialize properly + logDebug(oproc.getDebugMessage.toString) + // Call the executor which will execute the appropriate command based on the parsed options + oprocResponse.getServerOptionsExecutor.execute() + } catch { + case e: LogUtils.LogInitializationException => + logError("Error initializing log: " + e.getMessage, e) + System.exit(-1) + } + } + + + private def toStartupShutdownString(prefix: String, msg: Array[String]) = { + val b = new StringBuilder(prefix) + b.append("\n/************************************************************") + val arr = msg + val len = msg.length + var i = 0 + while (i < len) { + val s = arr(i) + b.append("\n" + prefix + s) + i += 1 + } + b.append("\n************************************************************/") + b.toString + } + + /** + * ServerOptionsProcessor. + * Process arguments given to HiveServer2 (-hiveconf property=value) + * Set properties in System properties + * Create an appropriate response object, + * which has executor to execute the appropriate command based on the parsed options. + */ + @SuppressWarnings(Array("static-access")) + class ServerOptionsProcessor(val serverName: String) { + // -hiveconf x=y + final private val options = new Options + private var commandLine: CommandLine = null + final private val debugMessage = new StringBuilder + OptionBuilder.withValueSeparator + OptionBuilder.hasArgs(2) + OptionBuilder.withArgName("property=value") + OptionBuilder.withLongOpt("hiveconf") + OptionBuilder.withDescription("Use value for given property") + options.addOption(OptionBuilder.create) + options.addOption( + new Option("H", + "help", + false, + "Print help information")) + + + def parse(argv: Array[String]): ServerOptionsProcessorResponse = { + try { + commandLine = new GnuParser().parse(options, argv) + // Process --hiveconf + // Get hiveconf param values and set the System property values + val confProps = commandLine.getOptionProperties("hiveconf") + for (propKey <- confProps.stringPropertyNames.asScala) { + // save logging message for log4j output latter after log4j initialize properly + debugMessage.append("Setting " + propKey + "=" + confProps.getProperty(propKey) + ";\n") + System.setProperty(propKey, confProps.getProperty(propKey)) + } + // Process --help + if (commandLine.hasOption('H')) { + return new ServerOptionsProcessorResponse(new HelpOptionExecutor(serverName, options)) + } + } catch { + case e: ParseException => + // Error out & exit - we were not able to parse the args successfully + logError("Error starting HiveServer2 with given arguments: ") + logError(e.getMessage) + System.exit(-1) + } + // Default executor, when no option is specified + new ServerOptionsProcessorResponse(new StartOptionExecutor) + } + + private[server] def getDebugMessage = debugMessage + } + + /** + * The response sent back from {@link ServerOptionsProcessor#parse(String[])} + */ + private[server] class ServerOptionsProcessorResponse( + val serverOptionsExecutor: ServerOptionsExecutor) { + private[server] def getServerOptionsExecutor = serverOptionsExecutor + } + + /** + * The executor interface for running the appropriate HiveServer2 command based on parsed options + */ + private[server] trait ServerOptionsExecutor { + def execute(): Unit + } + + /** + * HelpOptionExecutor: executes the --help option by printing out the usage + */ + private[server] class HelpOptionExecutor(val serverName: String, + val options: Options) + extends ServerOptionsExecutor { + override def execute(): Unit = { + new HelpFormatter().printHelp(serverName, options) + System.exit(0) + } + } + + /** + * StartOptionExecutor: starts HiveServer2. + * This is the default executor, when no option is specified. + */ + private[server] class StartOptionExecutor extends ServerOptionsExecutor { + override def execute(): Unit = { + try + startHiveServer2() + catch { + case t: Throwable => + logError("Error starting HiveServer2", t) + System.exit(-1) + } + } + } + +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala new file mode 100644 index 000000000000..39b1b17cf73c --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala @@ -0,0 +1,196 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.ui + +import java.util.Calendar +import javax.servlet.http.HttpServletRequest + +import scala.xml.Node + +import org.apache.commons.text.StringEscapeUtils + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.SparkThriftServer2.{ExecutionInfo, SessionInfo} +import org.apache.spark.ui._ +import org.apache.spark.ui.UIUtils._ + + +/** Page for Spark Web UI that shows statistics of the thrift server */ +private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage("") with Logging { + + private val listener = parent.listener + private val startTime = Calendar.getInstance().getTime() + private val emptyCell = "-" + + /** Render the page */ + def render(request: HttpServletRequest): Seq[Node] = { + val content = + listener.synchronized { // make sure all parts in this page are consistent + generateBasicStats() ++ +
++ +

+ {listener.getOnlineSessionNum} session(s) are online, + running {listener.getTotalRunning} SQL statement(s) +

++ + generateSessionStatsTable(request) ++ + generateSQLStatsTable(request) + } + UIUtils.headerSparkPage(request, "JDBC/ODBC Server", content, parent) + } + + /** Generate basic stats of the thrift server program */ + private def generateBasicStats(): Seq[Node] = { + val timeSinceStart = System.currentTimeMillis() - startTime.getTime +
    +
  • + Started at: {formatDate(startTime)} +
  • +
  • + Time since start: {formatDurationVerbose(timeSinceStart)} +
  • +
+ } + + /** Generate stats of batch statements of the thrift server program */ + private def generateSQLStatsTable(request: HttpServletRequest): Seq[Node] = { + val numStatement = listener.getExecutionList.size + val table = if (numStatement > 0) { + val headerRow = Seq("User", "JobID", "GroupID", "Start Time", "Finish Time", "Close Time", + "Execution Time", "Duration", "Statement", "State", "Detail") + val dataRows = listener.getExecutionList.sortBy(_.startTimestamp).reverse + + def generateDataRow(info: ExecutionInfo): Seq[Node] = { + val jobLink = info.jobId.map { id: String => + + [{id}] + + } + val detail = Option(info.detail).filter(!_.isEmpty).getOrElse(info.executePlan) + + {info.userName} + + {jobLink} + + {info.groupId} + {formatDate(info.startTimestamp)} + {if (info.finishTimestamp > 0) formatDate(info.finishTimestamp)} + {if (info.closeTimestamp > 0) formatDate(info.closeTimestamp)} + {formatDurationOption(Some(info.totalTime(info.finishTimestamp)))} + {formatDurationOption(Some(info.totalTime(info.closeTimestamp)))} + {info.statement} + {info.state} + {errorMessageCell(detail)} + + } + + Some(UIUtils.listingTable(headerRow, generateDataRow, + dataRows, false, None, Seq(null), false)) + } else { + None + } + + val content = +
SQL Statistics ({numStatement})
++ +
+
    + {table.getOrElse("No statistics have been generated yet.")} +
+
+ + content + } + + private def errorMessageCell(errorMessage: String): Seq[Node] = { + val isMultiline = errorMessage.indexOf('\n') >= 0 + val errorSummary = StringEscapeUtils.escapeHtml4( + if (isMultiline) { + errorMessage.substring(0, errorMessage.indexOf('\n')) + } else { + errorMessage + }) + val details = if (isMultiline) { + // scalastyle:off + + + details + ++ + + // scalastyle:on + } else { + "" + } + {errorSummary}{details} + } + + /** Generate stats of batch sessions of the thrift server program */ + private def generateSessionStatsTable(request: HttpServletRequest): Seq[Node] = { + val sessionList = listener.getSessionList + val numBatches = sessionList.size + val table = if (numBatches > 0) { + val dataRows = sessionList.sortBy(_.startTimestamp).reverse + val headerRow = Seq("User", "IP", "Session ID", "Start Time", "Finish Time", "Duration", + "Total Execute") + def generateDataRow(session: SessionInfo): Seq[Node] = { + val sessionLink = "%s/%s/session/?id=%s".format( + UIUtils.prependBaseUri(request, parent.basePath), parent.prefix, session.sessionId) + + {session.userName} + {session.ip} + {session.sessionId} + {formatDate(session.startTimestamp)} + {if (session.finishTimestamp > 0) formatDate(session.finishTimestamp)} + {formatDurationOption(Some(session.totalTime))} + {session.totalExecution.toString} + + } + Some(UIUtils.listingTable(headerRow, generateDataRow, dataRows, true, None, Seq(null), false)) + } else { + None + } + + val content = +
Session Statistics ({numBatches})
++ +
+
    + {table.getOrElse("No statistics have been generated yet.")} +
+
+ + content + } + + + /** + * Returns a human-readable string representing a duration such as "5 second 35 ms" + */ + private def formatDurationOption(msOption: Option[Long]): String = { + msOption.map(formatDurationVerbose).getOrElse(emptyCell) + } + + /** Generate HTML table from string data */ + private def listingTable(headers: Seq[String], data: Seq[Seq[String]]) = { + def generateDataRow(data: Seq[String]): Seq[Node] = { + {data.map(d => {d})} + } + UIUtils.listingTable(headers, generateDataRow, data, fixedWidth = true) + } +} + diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala new file mode 100644 index 000000000000..37b564ac77ae --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala @@ -0,0 +1,166 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.ui + +import java.util.Calendar +import javax.servlet.http.HttpServletRequest + +import scala.xml.Node + +import org.apache.commons.text.StringEscapeUtils + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.SparkThriftServer2.ExecutionInfo +import org.apache.spark.ui._ +import org.apache.spark.ui.UIUtils._ + +/** Page for Spark Web UI that shows statistics of jobs running in the thrift server */ +private[ui] class ThriftServerSessionPage(parent: ThriftServerTab) + extends WebUIPage("session") with Logging { + + private val listener = parent.listener + private val startTime = Calendar.getInstance().getTime() + private val emptyCell = "-" + + /** Render the page */ + def render(request: HttpServletRequest): Seq[Node] = { + val parameterId = request.getParameter("id") + require(parameterId != null && parameterId.nonEmpty, "Missing id parameter") + + val content = + listener.synchronized { // make sure all parts in this page are consistent + val sessionStat = listener.getSession(parameterId).getOrElse(null) + require(sessionStat != null, "Invalid sessionID[" + parameterId + "]") + + generateBasicStats() ++ +
++ +

+ User {sessionStat.userName}, + IP {sessionStat.ip}, + Session created at {formatDate(sessionStat.startTimestamp)}, + Total run {sessionStat.totalExecution} SQL +

++ + generateSQLStatsTable(request, sessionStat.sessionId) + } + UIUtils.headerSparkPage(request, "JDBC/ODBC Session", content, parent) + } + + /** Generate basic stats of the thrift server program */ + private def generateBasicStats(): Seq[Node] = { + val timeSinceStart = System.currentTimeMillis() - startTime.getTime +
    +
  • + Started at: {formatDate(startTime)} +
  • +
  • + Time since start: {formatDurationVerbose(timeSinceStart)} +
  • +
+ } + + /** Generate stats of batch statements of the thrift server program */ + private def generateSQLStatsTable(request: HttpServletRequest, sessionID: String): Seq[Node] = { + val executionList = listener.getExecutionList + .filter(_.sessionId == sessionID) + val numStatement = executionList.size + val table = if (numStatement > 0) { + val headerRow = Seq("User", "JobID", "GroupID", "Start Time", "Finish Time", "Close Time", + "Execution Time", "Duration", "Statement", "State", "Detail") + val dataRows = executionList.sortBy(_.startTimestamp).reverse + + def generateDataRow(info: ExecutionInfo): Seq[Node] = { + val jobLink = info.jobId.map { id: String => + + [{id}] + + } + val detail = Option(info.detail).filter(!_.isEmpty).getOrElse(info.executePlan) + + {info.userName} + + {jobLink} + + {info.groupId} + {formatDate(info.startTimestamp)} + {formatDate(info.finishTimestamp)} + {formatDate(info.closeTimestamp)} + {formatDurationOption(Some(info.totalTime(info.finishTimestamp)))} + {formatDurationOption(Some(info.totalTime(info.closeTimestamp)))} + {info.statement} + {info.state} + {errorMessageCell(detail)} + + } + + Some(UIUtils.listingTable(headerRow, generateDataRow, + dataRows, false, None, Seq(null), false)) + } else { + None + } + + val content = +
SQL Statistics
++ +
+
    + {table.getOrElse("No statistics have been generated yet.")} +
+
+ + content + } + + private def errorMessageCell(errorMessage: String): Seq[Node] = { + val isMultiline = errorMessage.indexOf('\n') >= 0 + val errorSummary = StringEscapeUtils.escapeHtml4( + if (isMultiline) { + errorMessage.substring(0, errorMessage.indexOf('\n')) + } else { + errorMessage + }) + val details = if (isMultiline) { + // scalastyle:off + + + details + ++ + + // scalastyle:on + } else { + "" + } + {errorSummary}{details} + } + + /** + * Returns a human-readable string representing a duration such as "5 second 35 ms" + */ + private def formatDurationOption(msOption: Option[Long]): String = { + msOption.map(formatDurationVerbose).getOrElse(emptyCell) + } + + /** Generate HTML table from string data */ + private def listingTable(headers: Seq[String], data: Seq[Seq[String]]) = { + def generateDataRow(data: Seq[String]): Seq[Node] = { + {data.map(d => {d})} + } + UIUtils.listingTable(headers, generateDataRow, data, fixedWidth = true) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala new file mode 100644 index 000000000000..e818625c8040 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala @@ -0,0 +1,52 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.ui + +import org.apache.spark.{SparkContext, SparkException} +import org.apache.spark.internal.Logging +import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.ui.ThriftServerTab._ +import org.apache.spark.ui.{SparkUI, SparkUITab} +/** + * Spark Web UI tab that shows statistics of jobs running in the thrift server. + * This assumes the given SparkContext has enabled its SparkUI. + */ +private[thriftserver] class ThriftServerTab(sparkContext: SparkContext) + extends SparkUITab(getSparkUI(sparkContext), "sqlserver") with Logging { + + override val name = "JDBC/ODBC Server" + + val parent = getSparkUI(sparkContext) + val listener = SparkThriftServer2.listener + + attachPage(new ThriftServerPage(this)) + attachPage(new ThriftServerSessionPage(this)) + parent.attachTab(this) + + def detach() { + getSparkUI(sparkContext).detachTab(this) + } +} + +private[thriftserver] object ThriftServerTab { + def getSparkUI(sparkContext: SparkContext): SparkUI = { + sparkContext.ui.getOrElse { + throw new SparkException("Parent SparkUI to attach this tab to not found!") + } + } +} From 24fce6bb934e0dbbc7ed5b5faa68a68bf26675c8 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Mon, 28 Oct 2019 20:37:11 +0800 Subject: [PATCH 12/55] save code --- .../sql/thriftserver/SparkThriftServer2.scala | 41 ++++--------------- .../server/SparkThriftServer.scala | 12 +++++- 2 files changed, 18 insertions(+), 35 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala index 344ecfa0a8c6..8783f9658806 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql.thriftserver -import java.util.concurrent.atomic.AtomicBoolean - import scala.collection.mutable import scala.collection.mutable.ArrayBuffer @@ -43,19 +41,19 @@ import org.apache.spark.util.{ShutdownHookManager, Utils} */ object SparkThriftServer2 extends Logging { var uiTab: Option[ThriftServerTab] = None - var listener: SparkThriftServer2Listener = _ + var listener: SparkThriftServerListener = _ /** * :: DeveloperApi :: * Starts a new thrift server with the given context. */ @DeveloperApi - def startWithContext(sqlContext: SQLContext): SparkThriftServer2 = { - val server = new SparkThriftServer2(sqlContext) + def startWithContext(sqlContext: SQLContext): SparkThriftServer = { + val server = new SparkThriftServer(sqlContext) server.init(new HiveConf()) server.start() - listener = new SparkThriftServer2Listener(server, sqlContext.conf) + listener = new SparkThriftServerListener(server, sqlContext.conf) sqlContext.sparkContext.addSparkListener(listener) uiTab = if (sqlContext.sparkContext.getConf.get(UI_ENABLED)) { Some(new ThriftServerTab(sqlContext.sparkContext)) @@ -86,11 +84,11 @@ object SparkThriftServer2 extends Logging { } try { - val server = new SparkThriftServer2(SparkSQLEnv.sqlContext) + val server = new SparkThriftServer(SparkSQLEnv.sqlContext) server.init(new HiveConf()) server.start() logInfo("HiveThriftServer2 started") - listener = new SparkThriftServer2Listener(server, SparkSQLEnv.sqlContext.conf) + listener = new SparkThriftServerListener(server, SparkSQLEnv.sqlContext.conf) SparkSQLEnv.sparkContext.addSparkListener(listener) uiTab = if (SparkSQLEnv.sparkContext.getConf.get(UI_ENABLED)) { Some(new ThriftServerTab(SparkSQLEnv.sparkContext)) @@ -159,8 +157,8 @@ object SparkThriftServer2 extends Logging { /** * An inner sparkListener called in sc.stop to clean up the HiveThriftServer2 */ - private[thriftserver] class SparkThriftServer2Listener(val server: SparkThriftServer, - val conf: SQLConf) extends SparkListener { + private[thriftserver] class SparkThriftServerListener(val server: SparkThriftServer, + val conf: SQLConf) extends SparkListener { override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd): Unit = { server.stop() @@ -290,27 +288,4 @@ object SparkThriftServer2 extends Logging { } } - -} - -private[thriftserver] class SparkThriftServer2(sqlContext: SQLContext) - extends SparkThriftServer(sqlContext) { - // state is tracked internally so that the server only attempts to shut down if it successfully - // started, and then once only. - private val started = new AtomicBoolean(false) - - override def init(hiveConf: HiveConf) { - super.init(hiveConf) - } - - override def start(): Unit = { - super.start() - started.set(true) - } - - override def stop(): Unit = { - if (started.getAndSet(false)) { - super.stop() - } - } } \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala index 95f5597c7229..983130ff6447 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala @@ -18,6 +18,7 @@ package org.apache.spark.sql.thriftserver.server import java.util +import java.util.concurrent.atomic.AtomicBoolean import scala.collection.JavaConverters._ @@ -37,6 +38,10 @@ class SparkThriftServer(sqlContext: SQLContext) extends CompositeService(classOf[SparkThriftServer].getSimpleName) with Logging { + // state is tracked internally so that the server only attempts to shut down if it successfully + // started, and then once only. + private val started = new AtomicBoolean(false) + private var cliService: CLIService = null private var thriftCLIService: ThriftCLIService = null @@ -75,11 +80,14 @@ class SparkThriftServer(sqlContext: SQLContext) override def start(): Unit = { super.start() + started.set(true) } override def stop(): Unit = { - logInfo("Shutting down HiveServer2") - super.stop() + if (started.getAndSet(false)) { + logInfo("Shutting down HiveServer2") + super.stop() + } } } From bc36bdfb41252967c8d05b3dac81bacdc1b91deb Mon Sep 17 00:00:00 2001 From: angerszhu Date: Mon, 28 Oct 2019 22:40:05 +0800 Subject: [PATCH 13/55] change --- .../cli/SparkThriftServerSQLException.java | 249 ++++++++++++++++++ .../sql/thriftserver/AbstractService.scala | 2 +- ...eServices.scala => CompositeService.scala} | 0 .../cli/SparkThriftServerSQLException.scala | 119 --------- .../operation/ClassicTableTypeMapping.scala | 76 ------ .../cli/operation/HiveTableTypeMapping.scala | 30 --- .../cli/operation/HiveTableTypes.scala | 22 -- .../cli/operation/Operation.scala | 11 +- .../cli/operation/OperationManager.scala | 2 +- .../SparkGetTableTypesOperation.scala | 8 +- .../operation/SparkGetTablesOperation.scala | 8 +- .../operation/SparkMetadataOperation.scala | 13 +- .../SparkMetadataOperationUtils.scala | 34 --- .../cli/operation/TableTypeMapping.scala | 44 ---- .../operation/TableTypeMappingFactory.scala | 37 --- .../cli/session/SessionManager.scala | 16 +- .../cli/session/ThriftServerSession.scala | 2 +- .../cli/session/ThriftServerSessionImpl.scala | 4 +- 18 files changed, 282 insertions(+), 395 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java rename sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/{CompositeServices.scala => CompositeService.scala} (100%) delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java new file mode 100644 index 000000000000..f9fca1c4cb90 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java @@ -0,0 +1,249 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; + +import org.apache.spark.sql.thriftserver.cli.thrift.TStatus; +import org.apache.spark.sql.thriftserver.cli.thrift.TStatusCode; + +/** + * SparkThriftServerSQLException. + * + */ +public class SparkThriftServerSQLException extends SQLException { + + /** + * + */ + private static final long serialVersionUID = -6095254671958748094L; + + /** + * + */ + public SparkThriftServerSQLException() { + super(); + } + + /** + * @param reason + */ + public SparkThriftServerSQLException(String reason) { + super(reason); + } + + /** + * @param cause + */ + public SparkThriftServerSQLException(Throwable cause) { + super(cause); + } + + /** + * @param reason + * @param sqlState + */ + public SparkThriftServerSQLException(String reason, String sqlState) { + super(reason, sqlState); + } + + /** + * @param reason + * @param cause + */ + public SparkThriftServerSQLException(String reason, Throwable cause) { + super(reason, cause); + } + + /** + * @param reason + * @param sqlState + * @param vendorCode + */ + public SparkThriftServerSQLException(String reason, String sqlState, int vendorCode) { + super(reason, sqlState, vendorCode); + } + + /** + * @param reason + * @param sqlState + * @param cause + */ + public SparkThriftServerSQLException(String reason, String sqlState, Throwable cause) { + super(reason, sqlState, cause); + } + + /** + * @param reason + * @param sqlState + * @param vendorCode + * @param cause + */ + public SparkThriftServerSQLException(String reason, String sqlState, int vendorCode, Throwable cause) { + super(reason, sqlState, vendorCode, cause); + } + + public SparkThriftServerSQLException(TStatus status) { + // TODO: set correct vendorCode field + super(status.getErrorMessage(), status.getSqlState(), status.getErrorCode()); + if (status.getInfoMessages() != null) { + initCause(toCause(status.getInfoMessages())); + } + } + + /** + * Converts current object to a {@link TStatus} object + * @return a {@link TStatus} object + */ + public TStatus toTStatus() { + // TODO: convert sqlState, etc. + TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS); + tStatus.setSqlState(getSQLState()); + tStatus.setErrorCode(getErrorCode()); + tStatus.setErrorMessage(getMessage()); + tStatus.setInfoMessages(toString(this)); + return tStatus; + } + + /** + * Converts the specified {@link Exception} object into a {@link TStatus} object + * @param e a {@link Exception} object + * @return a {@link TStatus} object + */ + public static TStatus toTStatus(Exception e) { + if (e instanceof SparkThriftServerSQLException) { + return ((SparkThriftServerSQLException)e).toTStatus(); + } + TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS); + tStatus.setErrorMessage(e.getMessage()); + tStatus.setInfoMessages(toString(e)); + return tStatus; + } + + /** + * Converts a {@link Throwable} object into a flattened list of texts including its stack trace + * and the stack traces of the nested causes. + * @param ex a {@link Throwable} object + * @return a flattened list of texts including the {@link Throwable} object's stack trace + * and the stack traces of the nested causes. + */ + public static List toString(Throwable ex) { + return toString(ex, null); + } + + private static List toString(Throwable cause, StackTraceElement[] parent) { + StackTraceElement[] trace = cause.getStackTrace(); + int m = trace.length - 1; + if (parent != null) { + int n = parent.length - 1; + while (m >= 0 && n >= 0 && trace[m].equals(parent[n])) { + m--; + n--; + } + } + List detail = enroll(cause, trace, m); + cause = cause.getCause(); + if (cause != null) { + detail.addAll(toString(cause, trace)); + } + return detail; + } + + private static List enroll(Throwable ex, StackTraceElement[] trace, int max) { + List details = new ArrayList(); + StringBuilder builder = new StringBuilder(); + builder.append('*').append(ex.getClass().getName()).append(':'); + builder.append(ex.getMessage()).append(':'); + builder.append(trace.length).append(':').append(max); + details.add(builder.toString()); + for (int i = 0; i <= max; i++) { + builder.setLength(0); + builder.append(trace[i].getClassName()).append(':'); + builder.append(trace[i].getMethodName()).append(':'); + String fileName = trace[i].getFileName(); + builder.append(fileName == null ? "" : fileName).append(':'); + builder.append(trace[i].getLineNumber()); + details.add(builder.toString()); + } + return details; + } + + /** + * Converts a flattened list of texts including the stack trace and the stack + * traces of the nested causes into a {@link Throwable} object. + * @param details a flattened list of texts including the stack trace and the stack + * traces of the nested causes + * @return a {@link Throwable} object + */ + public static Throwable toCause(List details) { + return toStackTrace(details, null, 0); + } + + private static Throwable toStackTrace(List details, StackTraceElement[] parent, int index) { + String detail = details.get(index++); + if (!detail.startsWith("*")) { + return null; // should not be happened. ignore remaining + } + int i1 = detail.indexOf(':'); + int i3 = detail.lastIndexOf(':'); + int i2 = detail.substring(0, i3).lastIndexOf(':'); + String exceptionClass = detail.substring(1, i1); + String exceptionMessage = detail.substring(i1 + 1, i2); + Throwable ex = newInstance(exceptionClass, exceptionMessage); + + Integer length = Integer.valueOf(detail.substring(i2 + 1, i3)); + Integer unique = Integer.valueOf(detail.substring(i3 + 1)); + + int i = 0; + StackTraceElement[] trace = new StackTraceElement[length]; + for (; i <= unique; i++) { + detail = details.get(index++); + int j1 = detail.indexOf(':'); + int j3 = detail.lastIndexOf(':'); + int j2 = detail.substring(0, j3).lastIndexOf(':'); + String className = detail.substring(0, j1); + String methodName = detail.substring(j1 + 1, j2); + String fileName = detail.substring(j2 + 1, j3); + if (fileName.isEmpty()) { + fileName = null; + } + int lineNumber = Integer.valueOf(detail.substring(j3 + 1)); + trace[i] = new StackTraceElement(className, methodName, fileName, lineNumber); + } + int common = trace.length - i; + if (common > 0) { + System.arraycopy(parent, parent.length - common, trace, trace.length - common, common); + } + if (details.size() > index) { + ex.initCause(toStackTrace(details, trace, index)); + } + ex.setStackTrace(trace); + return ex; + } + + private static Throwable newInstance(String className, String message) { + try { + return (Throwable)Class.forName(className).getConstructor(String.class).newInstance(message); + } catch (Exception e) { + return new RuntimeException(className + ":" + message); + } + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala index 2008fe453868..602fc70e45d6 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala @@ -45,7 +45,7 @@ abstract class AbstractService(val name: String) extends Service with Logging { /** * The configuration. Will be null until the service is initialized. */ - private var hiveConf: HiveConf = null + private var hiveConf: HiveConf = _ /** * List of state change listeners; it is final to ensure * that it will never be null. diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala similarity index 100% rename from sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeServices.scala rename to sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala deleted file mode 100644 index 104b1d78bd32..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.scala +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.sql.SQLException - -import scala.collection.JavaConverters._ - -import org.apache.spark.sql.thriftserver.cli.thrift.{TStatus, TStatusCode} - -class SparkThriftServerSQLException(reason: String, - sqlState: String, - vendorCode: Int, - cause: Throwable) - extends SQLException(reason, sqlState, vendorCode, cause) { - - def this(reason: String, sqlState: String, cause: Throwable) = this(reason, sqlState, 0, cause) - - def this(reason: String, sqlState: String, vendorCode: Int) = - this(reason, sqlState, vendorCode, null) - - def this(reason: String, cause: Throwable) = this(reason, null, 0, cause) - - def this(reason: String, sqlState: String) = this(reason, sqlState, vendorCode = 0) - - def this(reason: String) = this(reason, sqlState = null) - - def this(cause: Throwable) = this(cause.toString, cause) - - def this(status: TStatus) { - // TODO: set correct vendorCode field - this(status.getErrorMessage, status.getSqlState, status.getErrorCode) - // if (status.getInfoMessages != null) { - // initCause(toCause(status.getInfoMessages.asScala.toArray)) - // } - } - - /** - * Converts current object to a [[TStatus]] object - * - * @return a { @link TStatus} object - */ - def toTStatus: TStatus = { - val tStatus = new TStatus(TStatusCode.ERROR_STATUS) - tStatus.setSqlState(getSQLState) - tStatus.setErrorCode(getErrorCode) - tStatus.setErrorMessage(getMessage) - tStatus.setInfoMessages(SparkThriftServerSQLException.toString(this).asJava) - tStatus - } - - // def toCause(details: Array[String]): Throwable = { - // toStackTrace(details, null, 0) - // } - -} - -object SparkThriftServerSQLException { - - def toTStatus(e: Exception): TStatus = e match { - case k: SparkThriftServerSQLException => k.toTStatus - case _ => - val tStatus = new TStatus(TStatusCode.ERROR_STATUS) - tStatus.setErrorMessage(e.getMessage) - tStatus.setInfoMessages(toString(e).asJava) - tStatus - } - - - def toString(cause: Throwable): List[String] = { - toString(cause, null) - } - - def toString(cause: Throwable, parent: Array[StackTraceElement]): List[String] = { - val trace = cause.getStackTrace - var m = trace.length - 1 - if (parent != null) { - var n = parent.length - 1 - while (m >= 0 && n >= 0 && trace(m).equals(parent(n))) { - m = m - 1 - n = n - 1 - } - } - - enroll(cause, trace, m) ++ - Option(cause.getCause).map(toString(_, trace)).getOrElse(Nil) - } - - private[this] def enroll(ex: Throwable, - trace: Array[StackTraceElement], max: Int): List[String] = { - val builder = new StringBuilder - builder.append('*').append(ex.getClass.getName).append(':') - builder.append(ex.getMessage).append(':') - builder.append(trace.length).append(':').append(max) - List(builder.toString) ++ (0 to max).map { i => - builder.setLength(0) - builder.append(trace(i).getClassName).append(":") - builder.append(trace(i).getMethodName).append(":") - builder.append(Option(trace(i).getFileName).getOrElse("")).append(':') - builder.append(trace(i).getLineNumber) - builder.toString - }.toList - } -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala deleted file mode 100644 index e568008c8d2f..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/ClassicTableTypeMapping.scala +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.operation - -import java.util.Locale - -import com.google.common.collect.{ArrayListMultimap, Iterables, Multimap} -import java.util -import org.apache.hadoop.hive.metastore.TableType - -import org.apache.spark.internal.Logging - -class ClassicTableTypeMapping extends TableTypeMapping with Logging { - - object ClassicTableTypes extends Enumeration { - type ClassicTableTypes = Value - val TABLE, VIEW, MATERIALIZED_VIEW = Value - } - - private val hiveToClientMap = new util.HashMap[String, String] - private val clientToHiveMap: ArrayListMultimap[String, String] = ArrayListMultimap.create() - - try { - hiveToClientMap.put(HiveTableTypes.MANAGED_TABLE.toString, ClassicTableTypes.TABLE.toString) - hiveToClientMap.put(HiveTableTypes.EXTERNAL_TABLE.toString, ClassicTableTypes.TABLE.toString) - hiveToClientMap.put(HiveTableTypes.VIRTUAL_VIEW.toString, ClassicTableTypes.VIEW.toString) - hiveToClientMap.put(HiveTableTypes.MATERIALIZED_VIEW.toString, - ClassicTableTypes.MATERIALIZED_VIEW.toString) - - clientToHiveMap.putAll(ClassicTableTypes.TABLE.toString, - util.Arrays.asList(TableType.MANAGED_TABLE.toString, - HiveTableTypes.EXTERNAL_TABLE.toString)) - clientToHiveMap.put(ClassicTableTypes.VIEW.toString, HiveTableTypes.VIRTUAL_VIEW.toString) - clientToHiveMap.put(ClassicTableTypes.MATERIALIZED_VIEW.toString, - HiveTableTypes.MATERIALIZED_VIEW.toString) - } catch { - case e: Throwable => e.printStackTrace() - } - - override def mapToHiveType(clientTypeName: String): Array[String] = { - val hiveTableType: util.Collection[String] = - clientToHiveMap.get(clientTypeName.toUpperCase(Locale.ROOT)) - if (hiveTableType == null) { - logWarning("Not supported client table type " + clientTypeName) - return Array[String](clientTypeName) - } - return Iterables.toArray(hiveTableType, classOf[String]) - } - - override def mapToClientType(hiveTypeName: String): String = - if (hiveToClientMap.containsKey(hiveTypeName)) { - hiveToClientMap.get(hiveTypeName) - } else { - logWarning("Invalid hive table type " + hiveTypeName) - hiveTypeName - } - - override def getTableTypeNames: Set[String] = { - ClassicTableTypes.values.map(_.toString) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala deleted file mode 100644 index 88dec4c15cb3..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypeMapping.scala +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.operation - -class HiveTableTypeMapping extends TableTypeMapping { - - def mapToHiveType(clientTypeName: String): Array[String] = - Array[String](mapToClientType(clientTypeName)) - - def mapToClientType(hiveTypeName: String): String = hiveTypeName - - def getTableTypeNames: Set[String] = { - HiveTableTypes.values.map(_.toString) - } -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala deleted file mode 100644 index 11462be765ea..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/HiveTableTypes.scala +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.spark.sql.thriftserver.cli.operation - -object HiveTableTypes extends Enumeration { - type TableType = Value - val MANAGED_TABLE, EXTERNAL_TABLE, VIRTUAL_VIEW, INDEX_TABLE, MATERIALIZED_VIEW = Value -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala index 3217fb776272..a31bda7704cd 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala @@ -31,9 +31,10 @@ import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion import org.apache.spark.sql.types.StructType import org.apache.spark.util.Utils -abstract class Operation(session: ThriftServerSession, - opType: OperationType, - runInBackground: Boolean) extends Logging { +private[thriftserver] abstract class Operation( + session: ThriftServerSession, + opType: OperationType, + runInBackground: Boolean) extends Logging { private[this] var _state: OperationState = INITIALIZED private[this] val _opHandle: OperationHandle = new OperationHandle(opType, session.getProtocolVersion) @@ -282,8 +283,8 @@ abstract class Operation(session: ThriftServerSession, } protected def toSQLException( - prefix: String, - response: CommandProcessorResponse): SparkThriftServerSQLException = { + prefix: String, + response: CommandProcessorResponse): SparkThriftServerSQLException = { val ex = new SparkThriftServerSQLException(prefix + ": " + response.getErrorMessage, response.getSQLState, response.getResponseCode) if (response.getException != null) { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala index 95fc4784e0ab..66eafb1c294e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala @@ -39,7 +39,7 @@ import org.apache.spark.sql.types.StructType private[thriftserver] class OperationManager extends AbstractService(classOf[OperationManager].getSimpleName) - with Logging { + with Logging { private[this] lazy val logSchema: StructType = new StructType().add("operation_log", "string") private[this] val handleToOperation = new ConcurrentHashMap[OperationHandle, Operation] diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala index 10116a579492..84e44ae4df95 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala @@ -42,17 +42,11 @@ private[thriftserver] class SparkGetTableTypesOperation( sqlContext: SQLContext, parentSession: ThriftServerSession) extends SparkMetadataOperation(parentSession, GET_TABLE_TYPES) - with SparkMetadataOperationUtils with Logging { + with Logging { RESULT_SET_SCHEMA = new StructType() .add(StructField("TABLE_TYPE", StringType)) - private var tableTypeMapping: TableTypeMapping = { - val tableMappingStr = - parentSession.getHiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING) - TableTypeMappingFactory.getTableTypeMapping(tableMappingStr) - } - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) override def close(): Unit = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala index de10050cc328..8c74558ac188 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -54,7 +54,7 @@ private[thriftserver] class SparkGetTablesOperation( tableName: String, tableTypes: JList[String]) extends SparkMetadataOperation(parentSession, GET_TABLES) - with SparkMetadataOperationUtils with Logging { + with Logging { RESULT_SET_SCHEMA = new StructType() .add(StructField("TABLE_CAT", StringType)) @@ -65,12 +65,6 @@ private[thriftserver] class SparkGetTablesOperation( private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) - private val tableTypeMapping: TableTypeMapping = { - val tableMappingStr = parentSession.getHiveConf - .getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING) - TableTypeMappingFactory.getTableTypeMapping(tableMappingStr) - } - override def close(): Unit = { super.close() SparkThriftServer2.listener.onOperationClosed(_statementId) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala index 32c76dc32a24..a8bacdaa20e5 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala @@ -24,12 +24,16 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin._ import org.apache.hadoop.hive.ql.session.SessionState import org.apache.spark.internal.Logging +import org.apache.spark.sql.catalyst.catalog.CatalogTableType +import org.apache.spark.sql.catalyst.catalog.CatalogTableType.{EXTERNAL, MANAGED, VIEW} import org.apache.spark.sql.thriftserver.cli.{CLOSED, OperationType, SparkThriftServerSQLException} import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession import org.apache.spark.sql.types.StructType -abstract class SparkMetadataOperation(session: ThriftServerSession, opType: OperationType) +private[thriftserver] abstract class SparkMetadataOperation( + session: ThriftServerSession, + opType: OperationType) extends Operation(session, opType, false) with Logging { protected val DEFAULT_HIVE_CATALOG: String = "" @@ -47,6 +51,13 @@ abstract class SparkMetadataOperation(session: ThriftServerSession, opType: Oper cleanupOperationLog() } + def tableTypeString(tableType: CatalogTableType): String = tableType match { + case EXTERNAL | MANAGED => "TABLE" + case VIEW => "VIEW" + case t => + throw new IllegalArgumentException(s"Unknown table type is found: $t") + } + /** * Convert wildchars and escape sequence from JDBC format to datanucleous/regex */ diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala deleted file mode 100644 index f9feaf084a8d..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperationUtils.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.operation - -import org.apache.spark.sql.catalyst.catalog.CatalogTableType -import org.apache.spark.sql.catalyst.catalog.CatalogTableType.{EXTERNAL, MANAGED, VIEW} - -/** - * Utils for metadata operations. - */ -private[thriftserver] trait SparkMetadataOperationUtils { - - def tableTypeString(tableType: CatalogTableType): String = tableType match { - case EXTERNAL | MANAGED => "TABLE" - case VIEW => "VIEW" - case t => - throw new IllegalArgumentException(s"Unknown table type is found: $t") - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala deleted file mode 100644 index f335702d1faa..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMapping.scala +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.operation - - -trait TableTypeMapping { - /** - * Map client's table type name to hive's table type - * - * @param clientTypeName - * @return - */ - def mapToHiveType(clientTypeName: String): Array[String] - - /** - * Map hive's table type name to client's table type - * - * @param hiveTypeName - * @return - */ - def mapToClientType(hiveTypeName: String): String - - /** - * Get all the table types of this mapping - * - * @return - */ - def getTableTypeNames: Set[String] -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala deleted file mode 100644 index e4cb8956f66d..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/TableTypeMappingFactory.scala +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.operation - -object TableTypeMappingFactory { - - object TableTypeMappings extends Enumeration { - type TableTypeMappings = Value - val HIVE, CLASSIC = Value - } - - private val hiveTableTypeMapping = new HiveTableTypeMapping - private val classicTableTypeMapping = new ClassicTableTypeMapping - - def getTableTypeMapping(mappingType: String): TableTypeMapping = - if (TableTypeMappings.CLASSIC.toString.equalsIgnoreCase(mappingType)) { - classicTableTypeMapping - } else { - hiveTableTypeMapping - } - -} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index 64ca223db7f5..0b22baafbad7 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -31,21 +31,21 @@ import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.thriftserver.{CompositeService, SparkThriftServer2} import org.apache.spark.sql.thriftserver.cli.{SessionHandle, SparkThriftServerSQLException} import org.apache.spark.sql.thriftserver.cli.operation.OperationManager -import org.apache.spark.sql.thriftserver.server.{ThreadFactoryWithGarbageCleanup, ThreadWithGarbageCleanup} import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion import org.apache.spark.sql.thriftserver.server.SparkThriftServer +import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup -class SessionManager(hiveServer2: SparkThriftServer, sqlContext: SQLContext) +private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlContext: SQLContext) extends CompositeService(classOf[SessionManager].getSimpleName) - with Logging { + with Logging { - private var hiveConf: HiveConf = null + private var hiveConf: HiveConf = _ private val handleToSession: ConcurrentHashMap[SessionHandle, ThriftServerSession] = new ConcurrentHashMap[SessionHandle, ThriftServerSession] private val operationManager: OperationManager = new OperationManager() - private var backgroundOperationPool: ThreadPoolExecutor = null + private var backgroundOperationPool: ThreadPoolExecutor = _ private var isOperationLogEnabled: Boolean = false - private var operationLogRootDir: File = null + private var operationLogRootDir: File = _ private var checkInterval: Long = 0L private var sessionTimeout: Long = 0L @@ -58,9 +58,9 @@ class SessionManager(hiveServer2: SparkThriftServer, sqlContext: SQLContext) this.hiveConf = hiveConf // Create operation log root directory, if operation logging is enabled if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { - initOperationLogRootDir + initOperationLogRootDir() } - createBackgroundOperationPool + createBackgroundOperationPool() addService(operationManager) super.init(hiveConf) } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala index a9aab9ffd81a..8e39d38e26f9 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala @@ -21,7 +21,7 @@ import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.types.StructType -trait ThriftServerSession extends ThriftServerSessionBase { +private[thriftserver] trait ThriftServerSession extends ThriftServerSessionBase { @throws[SparkThriftServerSQLException] def open(sessionConfMap: Map[String, String]): Unit diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index e15a740c7ac1..f30cf7ea1646 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -50,7 +50,7 @@ class ThriftServerSessionImpl(_protocol: TProtocolVersion, private var _operationManager: OperationManager = new OperationManager() private val _opHandleSet: util.Set[OperationHandle] = new util.HashSet[OperationHandle]() private var _isOperationLogEnabled: Boolean = false - private var _sessionLogDir: File = null + private var _sessionLogDir: File = _ private var _lastAccessTime: Long = 0L private var _lastIdleTime: Long = 0L @@ -217,7 +217,7 @@ class ThriftServerSessionImpl(_protocol: TProtocolVersion, } catch { case e: SparkThriftServerSQLException => // Referring to SQLOperation.java, there is no chance that a - // HiveSQLException throws and the asyn background operation + // SparkThriftServerSQLException throws and the asyn background operation // submits to thread pool successfully at the same time. So, Cleanup // opHandle directly when got SparkThriftServerSQLException operationManager.closeOperation(opHandle) From c4386731b43c84bf2508273ef5ff7c3c41de62cd Mon Sep 17 00:00:00 2001 From: angerszhu Date: Mon, 28 Oct 2019 23:06:37 +0800 Subject: [PATCH 14/55] format code --- .../sql/thriftserver/AbstractService.scala | 3 +- .../sql/thriftserver/CompositeService.scala | 4 +- .../spark/sql/thriftserver/CookieSigner.scala | 4 +- .../spark/sql/thriftserver/Service.scala | 4 +- .../sql/thriftserver/ServiceException.scala | 2 +- .../sql/thriftserver/ServiceOperations.scala | 2 +- .../ServiceStateChangeListener.scala | 2 +- .../spark/sql/thriftserver/ServiceUtils.scala | 2 +- .../sql/thriftserver/SparkThriftServer2.scala | 2 +- .../sql/thriftserver/cli/CLIService.scala | 75 +------------------ .../sql/thriftserver/cli/ColumnBasedSet.scala | 7 +- .../thriftserver/cli/ColumnDescriptor.scala | 2 +- .../thriftserver/cli/FetchOrientation.scala | 4 +- .../sql/thriftserver/cli/FetchType.scala | 4 +- .../spark/sql/thriftserver/cli/Handle.scala | 2 +- .../thriftserver/cli/HandleIdentifier.scala | 2 +- .../sql/thriftserver/cli/ICLIService.scala | 12 ++- .../thriftserver/cli/OperationHandle.scala | 7 +- .../sql/thriftserver/cli/OperationState.scala | 22 +++--- .../thriftserver/cli/OperationStatus.scala | 5 +- .../sql/thriftserver/cli/OperationType.scala | 22 +++--- .../cli/PatternOrIdentifier.scala | 2 +- .../sql/thriftserver/cli/RowBasedSet.scala | 2 +- .../spark/sql/thriftserver/cli/RowSet.scala | 2 +- .../sql/thriftserver/cli/RowSetFactory.scala | 2 +- .../sql/thriftserver/cli/SchemaMapper.scala | 2 +- .../sql/thriftserver/cli/SessionHandle.scala | 2 +- .../spark/sql/thriftserver/cli/Type.scala | 2 +- .../sql/thriftserver/cli/TypeDescriptor.scala | 2 +- .../sql/thriftserver/cli/TypeQualifiers.scala | 4 +- .../cli/operation/Operation.scala | 4 +- .../operation/SparkGetCatalogsOperation.scala | 4 +- .../cli/session/ThriftServerSessionBase.scala | 2 +- .../cli/session/ThriftServerSessionImpl.scala | 33 ++++---- .../ThriftServerSessionImplWithUgi.scala | 13 ++-- .../cli/thrift/CLIServiceUtils.scala | 2 +- .../cli/thrift/ThriftBinaryCLIService.scala | 4 +- .../cli/thrift/ThriftCLIService.scala | 21 +++--- .../cli/thrift/ThriftHttpCLIService.scala | 2 +- .../cli/thrift/ThriftHttpServlet.scala | 10 +-- .../thriftserver/cli/utils/LogHelper.scala | 4 +- .../cli/utils/VariableSubstitution.scala | 5 +- .../server/SparkThriftServer.scala | 4 +- 43 files changed, 131 insertions(+), 186 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala index 602fc70e45d6..07a0ba52e02f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala @@ -32,7 +32,8 @@ import org.apache.spark.sql.thriftserver.Service._ * @param name * service name */ -abstract class AbstractService(val name: String) extends Service with Logging { +private[thriftserver] abstract class AbstractService(val name: String) + extends Service with Logging { /** * Service state: initially {@link STATE#NOTINITED}. diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala index 9142a99b2f8f..40965dafc482 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala @@ -27,7 +27,9 @@ import org.apache.hadoop.hive.conf.HiveConf import org.apache.spark.internal.Logging import org.apache.spark.sql.thriftserver.Service.STOPPED -class CompositeService(name: String) extends AbstractService(name) with Logging { +private[thriftserver] class CompositeService(name: String) + extends AbstractService(name) + with Logging { private val serviceList: util.ArrayList[Service] = new util.ArrayList[Service] diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala index de4bd0ed22ae..ac303771cb95 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala @@ -28,12 +28,12 @@ import org.apache.spark.internal.Logging * and appends it to the cookie value generated at the * server side. It uses SHA digest algorithm to sign and verify signatures. */ -object CookieSigner { +private[thriftserver] object CookieSigner { private val SIGNATURE = "&s=" private val SHA_STRING = "SHA" } -class CookieSigner extends Logging { +private[thriftserver] class CookieSigner extends Logging { private var secretBytes: Array[Byte] = null def this(secret: Array[Byte]) { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala index 52ac32fde739..54f5038848d4 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql.thriftserver import org.apache.hadoop.hive.conf.HiveConf -trait Service { +private[thriftserver] trait Service { /** * Initialize the service. * @@ -98,7 +98,7 @@ trait Service { def getStartTime: Long } -object Service { +private[thriftserver] object Service { trait STATE diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala index e7d1ef3438fe..bf9b02df4372 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala @@ -18,7 +18,7 @@ package org.apache.spark.sql.thriftserver -class ServiceException(msg: String, cause: Throwable) +private[thriftserver] class ServiceException(msg: String, cause: Throwable) extends RuntimeException(msg, cause) { def this(cause: Throwable) = this(null, cause) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala index 1a79105533e7..5bbf99aca763 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala @@ -22,7 +22,7 @@ import org.apache.hadoop.hive.conf.HiveConf import org.apache.spark.internal.Logging import org.apache.spark.sql.thriftserver.Service._ -object ServiceOperations extends Logging { +private[thriftserver] object ServiceOperations extends Logging { /** * Verify that a service is in a given state. diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala index 1b9010b42aa5..f36e0eaa9a14 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala @@ -22,7 +22,7 @@ package org.apache.spark.sql.thriftserver * ServiceStateChangeListener. * */ -trait ServiceStateChangeListener { +private[thriftserver] trait ServiceStateChangeListener { /** * Callback to notify of a state change. The service will already diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala index 0ebc1bb444c2..f5a0d9af24f1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala @@ -21,7 +21,7 @@ import java.io.{Closeable, IOException} import org.slf4j.Logger -object ServiceUtils { +private[thriftserver] object ServiceUtils { /* * Get the index separating the user name from domain name (the user's name up diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala index 8783f9658806..e37a285b8af4 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala @@ -39,7 +39,7 @@ import org.apache.spark.util.{ShutdownHookManager, Utils} * The main entry point for the Spark SQL port of HiveServer2. Starts up a `SparkSQLContext` and a * `HiveThriftServer2` thrift server. */ -object SparkThriftServer2 extends Logging { +private[thriftserver] object SparkThriftServer2 extends Logging { var uiTab: Option[ThriftServerTab] = None var listener: SparkThriftServerListener = _ diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala index 61ee223c7ee8..d8b45588fe6f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -37,11 +37,9 @@ import org.apache.spark.sql.thriftserver.cli.thrift._ import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types.StructType -class CLIService(hiveServer2: SparkThriftServer, sqlContext: SQLContext) +private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContext: SQLContext) extends CompositeService(classOf[CLIService].getSimpleName) - with ICLIService with Logging { - - import CLIService._ + with ICLIService with Logging { private var hiveConf: HiveConf = null private var sessionManager: SessionManager = null @@ -100,23 +98,7 @@ class CLIService(hiveServer2: SparkThriftServer, sqlContext: SQLContext) def getHttpUGI: UserGroupInformation = this.httpUGI - def openSession(protocol: TProtocolVersion, - username: String, - password: String, - configuration: Predef.Map[String, String]): SessionHandle = { - val sessionHandle: SessionHandle = - sessionManager.openSession(protocol, - username, - password, - null, - configuration, - false, - null) - logDebug(sessionHandle + ": openSession()") - sessionHandle - } - - def openSession(protocol: TProtocolVersion, + override def openSession(protocol: TProtocolVersion, username: String, password: String, ipAddress: String, @@ -133,24 +115,7 @@ class CLIService(hiveServer2: SparkThriftServer, sqlContext: SQLContext) sessionHandle } - def openSessionWithImpersonation(protocol: TProtocolVersion, - username: String, - password: String, - configuration: Predef.Map[String, String], - delegationToken: String): SessionHandle = { - val sessionHandle = - sessionManager.openSession(protocol, - username, - password, - null, - configuration, - true, - delegationToken) - logDebug(sessionHandle + ": openSessionWithImpersonation()") - sessionHandle - } - - def openSessionWithImpersonation(protocol: TProtocolVersion, + override def openSessionWithImpersonation(protocol: TProtocolVersion, username: String, password: String, ipAddress: String, @@ -168,38 +133,6 @@ class CLIService(hiveServer2: SparkThriftServer, sqlContext: SQLContext) sessionHandle } - override def openSession(username: String, - password: String, - configuration: Predef.Map[String, String]): SessionHandle = { - val sessionHandle = - sessionManager.openSession( - SERVER_VERSION, - username, - password, - null, - configuration, - false, - null) - logDebug(sessionHandle + ": openSession()") - sessionHandle - } - - override def openSessionWithImpersonation(username: String, - password: String, - configuration: Predef.Map[String, String], - delegationToken: String): SessionHandle = { - val sessionHandle = - sessionManager.openSession(SERVER_VERSION, - username, - password, - null, - configuration, - true, - delegationToken) - logDebug(sessionHandle + ": openSessionWithImpersonation()") - sessionHandle - } - override def closeSession(sessionHandle: SessionHandle): Unit = { sessionManager.closeSession(sessionHandle) logDebug(sessionHandle + ": closeSession()") diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index c741cbd21395..3aeb70601af7 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -28,9 +28,10 @@ import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.thriftserver.cli.thrift._ import org.apache.spark.sql.types.{BinaryType, _} -case class ColumnBasedSet(types: StructType, - rows: ArrayBuffer[Row], - initStartOffset: Long) +private[thriftserver] case class ColumnBasedSet( + types: StructType, + rows: ArrayBuffer[Row], + initStartOffset: Long) extends RowSet { var startOffset: Long = initStartOffset diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala index 0e6756da631c..28399ac84ced 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala @@ -24,7 +24,7 @@ import org.apache.spark.sql.types.StructField * A wrapper class for Spark's [[StructField]] with a column position, * and can be transform to [[TColumnDesc]] */ -case class ColumnDescriptor(field: StructField, pos: Int) { +private[thriftserver] case class ColumnDescriptor(field: StructField, pos: Int) { /** * Transform a [[ColumnDescriptor]] to a [[TColumnDesc]] instance. */ diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala index 3ee326f7d42b..6c47bfaffc81 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala @@ -19,11 +19,11 @@ package org.apache.spark.sql.thriftserver.cli import org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation -trait FetchOrientation { +private[thriftserver] trait FetchOrientation { def toTFetchOrientation: TFetchOrientation } -object FetchOrientation { +private[thriftserver] object FetchOrientation { case object FETCH_NEXT extends FetchOrientation { override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_NEXT diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala index 05a8fb4dbd44..760a5fff52f8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala @@ -17,11 +17,11 @@ package org.apache.spark.sql.thriftserver.cli -trait FetchType { +private[thriftserver] trait FetchType { def toTFetchType: Short } -object FetchType { +private[thriftserver] object FetchType { case object QUERY_OUTPUT extends FetchType { override val toTFetchType: Short = 0 diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala index 1416b845257e..6a92718c4483 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql.thriftserver.cli import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier -abstract class Handle(val handleId: HandleIdentifier) { +private[thriftserver] abstract class Handle(val handleId: HandleIdentifier) { def this() = this(new HandleIdentifier()) def this(tHandleIdentifier: THandleIdentifier) = this(new HandleIdentifier(tHandleIdentifier)) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala index bdef1031131a..ee8493b4ce6f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala @@ -22,7 +22,7 @@ import java.util.UUID import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier -class HandleIdentifier(val publicId: UUID, val secretId: UUID) { +private[thriftserver] class HandleIdentifier(val publicId: UUID, val secretId: UUID) { def this() = this(UUID.randomUUID(), UUID.randomUUID()) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala index 9eaf7e5ac04c..4c66b03a8b03 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala @@ -18,20 +18,24 @@ package org.apache.spark.sql.thriftserver.cli import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory -import org.apache.spark.sql.thriftserver.cli.thrift.{TGetQueryIdReq, TGetQueryIdResp, TSetClientInfoReq, TSetClientInfoResp} +import org.apache.spark.sql.thriftserver.cli.thrift._ import org.apache.spark.sql.types.StructType -trait ICLIService { +private[thriftserver] trait ICLIService { @throws[SparkThriftServerSQLException] - def openSession(username: String, + def openSession(protocol: TProtocolVersion, + username: String, password: String, + ipAddress: String, configuration: Map[String, String]): SessionHandle @throws[SparkThriftServerSQLException] - def openSessionWithImpersonation(username: String, + def openSessionWithImpersonation(protocol: TProtocolVersion, + username: String, password: String, + ipAddress: String, configuration: Map[String, String], delegationToken: String): SessionHandle diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala index 6466f63c4902..c05e311ba3b5 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala @@ -19,9 +19,10 @@ package org.apache.spark.sql.thriftserver.cli import org.apache.spark.sql.thriftserver.cli.thrift.{TOperationHandle, TProtocolVersion} -class OperationHandle private(val opType: OperationType, - protocol: TProtocolVersion, - handleId: HandleIdentifier) extends Handle(handleId) { +private[thriftserver] class OperationHandle private( + val opType: OperationType, + protocol: TProtocolVersion, + handleId: HandleIdentifier) extends Handle(handleId) { private[this] var hasResultSet: Boolean = false diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala index 9d456eb7adf1..b834fdcfb67f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.thriftserver.cli import org.apache.spark.sql.thriftserver.cli.thrift.TOperationState -trait OperationState { +private[thriftserver] trait OperationState { def toTOperationState(): TOperationState @@ -33,7 +33,7 @@ trait OperationState { "Illegal Operation state transition " + this + " -> " + state, "ServerError", 1000) } -case object INITIALIZED extends OperationState { +private[thriftserver] case object INITIALIZED extends OperationState { override def toTOperationState(): TOperationState = TOperationState.INITIALIZED_STATE override def validateTransition(newState: OperationState): Unit = newState match { @@ -42,7 +42,7 @@ case object INITIALIZED extends OperationState { } } -case object PENDING extends OperationState { +private[thriftserver] case object PENDING extends OperationState { override def toTOperationState(): TOperationState = TOperationState.PENDING_STATE override def validateTransition(newState: OperationState): Unit = newState match { @@ -51,7 +51,7 @@ case object PENDING extends OperationState { } } -case object RUNNING extends OperationState { +private[thriftserver] case object RUNNING extends OperationState { override def toTOperationState(): TOperationState = TOperationState.RUNNING_STATE override def validateTransition(newState: OperationState): Unit = newState match { @@ -60,7 +60,7 @@ case object RUNNING extends OperationState { } } -case object TIMEOUT extends OperationState { +private[thriftserver] case object TIMEOUT extends OperationState { override def toTOperationState(): TOperationState = TOperationState.TIMEDOUT_STATE override def validateTransition(newState: OperationState): Unit = newState match { @@ -69,7 +69,7 @@ case object TIMEOUT extends OperationState { } } -case object FINISHED extends OperationState { +private[thriftserver] case object FINISHED extends OperationState { override def toTOperationState(): TOperationState = TOperationState.FINISHED_STATE override def isTerminal(): Boolean = true @@ -80,7 +80,7 @@ case object FINISHED extends OperationState { } } -case object CANCELED extends OperationState { +private[thriftserver] case object CANCELED extends OperationState { override def toTOperationState(): TOperationState = TOperationState.CANCELED_STATE override def isTerminal(): Boolean = true @@ -91,13 +91,13 @@ case object CANCELED extends OperationState { } } -case object CLOSED extends OperationState { +private[thriftserver] case object CLOSED extends OperationState { override def toTOperationState(): TOperationState = TOperationState.CLOSED_STATE override def isTerminal(): Boolean = true } -case object ERROR extends OperationState { +private[thriftserver] case object ERROR extends OperationState { override def toTOperationState(): TOperationState = TOperationState.ERROR_STATE override def isTerminal(): Boolean = true @@ -108,12 +108,12 @@ case object ERROR extends OperationState { } } -case object UNKNOWN extends OperationState { +private[thriftserver] case object UNKNOWN extends OperationState { override def toTOperationState(): TOperationState = TOperationState.UKNOWN_STATE } -object OperationState { +private[thriftserver] object OperationState { def getOperationState(tOperationState: TOperationState): OperationState = { tOperationState match { case TOperationState.INITIALIZED_STATE => INITIALIZED diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala index 05aea20acd4f..6931fff906f8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala @@ -23,8 +23,9 @@ package org.apache.spark.sql.thriftserver.cli * OperationStatus * */ -class OperationStatus(val state: OperationState, - val operationException: SparkThriftServerSQLException) { +private[thriftserver] class OperationStatus( + val state: OperationState, + val operationException: SparkThriftServerSQLException) { def getState: OperationState = state diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala index 7597d8d823d1..bc37adfe3b53 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala @@ -23,47 +23,47 @@ import org.apache.spark.sql.thriftserver.cli.thrift.TOperationType /** * OperationType. */ -abstract class OperationType { +private[thriftserver] abstract class OperationType { def toTOperationType: TOperationType } -case object EXECUTE_STATEMENT extends OperationType { +private[thriftserver] case object EXECUTE_STATEMENT extends OperationType { override def toTOperationType: TOperationType = TOperationType.EXECUTE_STATEMENT } -case object GET_TYPE_INFO extends OperationType { +private[thriftserver] case object GET_TYPE_INFO extends OperationType { override def toTOperationType: TOperationType = TOperationType.GET_TYPE_INFO } -case object GET_CATALOGS extends OperationType { +private[thriftserver] case object GET_CATALOGS extends OperationType { override def toTOperationType: TOperationType = TOperationType.GET_CATALOGS } -case object GET_SCHEMAS extends OperationType { +private[thriftserver] case object GET_SCHEMAS extends OperationType { override def toTOperationType: TOperationType = TOperationType.GET_SCHEMAS } -case object GET_TABLES extends OperationType { +private[thriftserver] case object GET_TABLES extends OperationType { override def toTOperationType: TOperationType = TOperationType.GET_TABLES } -case object GET_TABLE_TYPES extends OperationType { +private[thriftserver] case object GET_TABLE_TYPES extends OperationType { override def toTOperationType: TOperationType = TOperationType.GET_TABLE_TYPES } -case object GET_COLUMNS extends OperationType { +private[thriftserver] case object GET_COLUMNS extends OperationType { override def toTOperationType: TOperationType = TOperationType.GET_COLUMNS } -case object GET_FUNCTIONS extends OperationType { +private[thriftserver] case object GET_FUNCTIONS extends OperationType { override def toTOperationType: TOperationType = TOperationType.GET_FUNCTIONS } -case object UNKNOWN_OPERATION extends OperationType { +private[thriftserver] case object UNKNOWN_OPERATION extends OperationType { override def toTOperationType: TOperationType = TOperationType.UNKNOWN } -object OperationType { +private[thriftserver] object OperationType { def getOperationType(tOperationType: TOperationType): OperationType = tOperationType match { case TOperationType.EXECUTE_STATEMENT => EXECUTE_STATEMENT diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala index 2240cc0bc3a4..7e6de323199d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala @@ -21,7 +21,7 @@ package org.apache.spark.sql.thriftserver.cli * PatternOrIdentifier. * */ -class PatternOrIdentifier(var text: String) { +private[thriftserver] class PatternOrIdentifier(var text: String) { var isPt: Boolean = false diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala index b53453dbbaf9..3fd6cee2cf64 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala @@ -30,7 +30,7 @@ import org.apache.spark.sql.types._ * with the ability of * transform to [[TRowSet]]. */ -case class RowBasedSet(types: StructType, +private[thriftserver] case class RowBasedSet(types: StructType, rows: ArrayBuffer[Row], initStartOffset: Long) extends RowSet { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala index 17a3ec210f50..5eea085cea09 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql.thriftserver.cli import org.apache.spark.sql.Row import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet -trait RowSet { +private[thriftserver] trait RowSet { def addRow(row: Row): RowSet def extractSubset(maxRows: Int): RowSet diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala index 0188055484c9..395c70fa196e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala @@ -24,7 +24,7 @@ import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion._ import org.apache.spark.sql.types.StructType -object RowSetFactory { +private[thriftserver] object RowSetFactory { def create(types: StructType, rows: Seq[Row], version: TProtocolVersion): RowSet = { if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { ColumnBasedSet(types, ArrayBuffer(rows: _*), 0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index c8798b011afc..22e6492f4ac1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql.thriftserver.cli import org.apache.spark.sql.thriftserver.cli.thrift.{TTableSchema, TTypeId} import org.apache.spark.sql.types._ -object SchemaMapper { +private[thriftserver] object SchemaMapper { def toTTableSchema(fields: StructType): TTableSchema = { val tTableSchema = new TTableSchema diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala index aba1823dcd46..274c194f3bbf 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala @@ -21,7 +21,7 @@ import java.util.UUID import org.apache.spark.sql.thriftserver.cli.thrift.{TProtocolVersion, TSessionHandle} -class SessionHandle private(handleId: HandleIdentifier, protocol: TProtocolVersion) +private[thriftserver] class SessionHandle(handleId: HandleIdentifier, protocol: TProtocolVersion) extends Handle(handleId) { def this(tSessionHandle: TSessionHandle) = diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala index f3769ece89d2..42cbdcbb4916 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala @@ -23,7 +23,7 @@ import java.util.Locale import org.apache.spark.sql.thriftserver.cli.thrift.TTypeId import org.apache.spark.sql.types.DecimalType -trait Type { +private[thriftserver] trait Type { def getName: String diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala index e88c455092b8..2ab8098246e5 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala @@ -24,7 +24,7 @@ import org.apache.spark.sql.types.{DataType, DecimalType} * A wrapper class of Spark's [[DataType]] with [[TypeQualifiers]] for [[DecimalType]]s, and could * be transformed to [[TTypeDesc]]. */ -case class TypeDescriptor(typ: DataType) { +private[thriftserver] case class TypeDescriptor(typ: DataType) { private[this] val typeQualifiers: Option[TypeQualifiers] = typ match { case d: DecimalType => Some(TypeQualifiers.fromTypeInfo(d)) case _ => None diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala index dcc4e993fa78..e2d6e4cef98c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala @@ -22,7 +22,7 @@ import scala.collection.JavaConverters._ import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIServiceConstants, TTypeQualifiers, TTypeQualifierValue} import org.apache.spark.sql.types.{DataType, DecimalType} -class TypeQualifiers private() { +private[thriftserver] class TypeQualifiers private() { private[this] var precision: Option[Int] = None private[this] var scale: Option[Int] = None @@ -44,7 +44,7 @@ class TypeQualifiers private() { .toMap.asJava) } -object TypeQualifiers { +private[thriftserver] object TypeQualifiers { def fromTypeInfo(typ: DataType): TypeQualifiers = { val result = new TypeQualifiers typ match { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala index a31bda7704cd..56a7752e741e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala @@ -283,8 +283,8 @@ private[thriftserver] abstract class Operation( } protected def toSQLException( - prefix: String, - response: CommandProcessorResponse): SparkThriftServerSQLException = { + prefix: String, + response: CommandProcessorResponse): SparkThriftServerSQLException = { val ex = new SparkThriftServerSQLException(prefix + ": " + response.getErrorMessage, response.getSQLState, response.getResponseCode) if (response.getException != null) { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala index 07ebd2396bba..2fa8e3349cb6 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala @@ -37,8 +37,8 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param parentSession a HiveSession from SessionManager */ private[thriftserver] class SparkGetCatalogsOperation( - sqlContext: SQLContext, - parentSession: ThriftServerSession) + sqlContext: SQLContext, + parentSession: ThriftServerSession) extends SparkMetadataOperation(parentSession, GET_CATALOGS) with Logging { RESULT_SET_SCHEMA = new StructType() diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala index 950477e254b3..baae2eb47eae 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala @@ -27,7 +27,7 @@ import org.apache.spark.sql.thriftserver.cli.operation.OperationManager import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion -trait ThriftServerSessionBase { +private[thriftserver] trait ThriftServerSessionBase { def getProtocolVersion: TProtocolVersion diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index f30cf7ea1646..cfcb17575486 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -37,13 +37,14 @@ import org.apache.spark.sql.thriftserver.server.ThreadWithGarbageCleanup import org.apache.spark.sql.types.StructType -class ThriftServerSessionImpl(_protocol: TProtocolVersion, - var _username: String, - var _password: String, - serverHiveConf: HiveConf, - var _ipAddress: String) extends ThriftServerSession with Logging { - - private val _sessionHandle: SessionHandle = new SessionHandle(_protocol) +private[thriftserver] class ThriftServerSessionImpl( + protocol: TProtocolVersion, + var username: String, + var password: String, + serverHiveConf: HiveConf, + var ipAddress: String) extends ThriftServerSession with Logging { + + private val _sessionHandle: SessionHandle = new SessionHandle(protocol) private val _hiveConf: HiveConf = new HiveConf(serverHiveConf) private var _sessionState: SessionState = null private var _sessionManager: SessionManager = null @@ -56,8 +57,8 @@ class ThriftServerSessionImpl(_protocol: TProtocolVersion, @throws[SparkThriftServerSQLException] override def open(sessionConfMap: Map[String, String]): Unit = { - _sessionState = new SessionState(_hiveConf, _username) - _sessionState.setUserIpAddress(_ipAddress) + _sessionState = new SessionState(_hiveConf, username) + _sessionState.setUserIpAddress(ipAddress) _sessionState.setIsHiveServerQuery(true) SessionState.start(_sessionState) if (sessionConfMap != null) { @@ -693,7 +694,7 @@ class ThriftServerSessionImpl(_protocol: TProtocolVersion, } } - override def getProtocolVersion: TProtocolVersion = _protocol + override def getProtocolVersion: TProtocolVersion = protocol /** * Set the session manager for the session @@ -769,21 +770,21 @@ class ThriftServerSessionImpl(_protocol: TProtocolVersion, override def getSessionHandle: SessionHandle = _sessionHandle - override def getUsername: String = _username + override def getUsername: String = username - override def getPassword: String = _password + override def getPassword: String = password override def getHiveConf: HiveConf = _hiveConf override def getSessionState: SessionState = _sessionState - override def getUserName: String = _username + override def getUserName: String = username - override def setUserName(userName: String): Unit = _username = userName + override def setUserName(userName: String): Unit = username = userName - override def getIpAddress: String = _ipAddress + override def getIpAddress: String = ipAddress - override def setIpAddress(ipAddress: String): Unit = _ipAddress = ipAddress + override def setIpAddress(ipAddress: String): Unit = ipAddress = ipAddress override def getLastAccessTime: Long = _lastAccessTime diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala index 21f7be7e313c..d2ea8716eb5c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala @@ -30,12 +30,13 @@ import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory import org.apache.spark.sql.thriftserver.cli.{CLIService, SparkThriftServerSQLException} import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion -class ThriftServerSessionImplWithUgi(protocol: TProtocolVersion, - username: String, - password: String, - serverHiveConf: HiveConf, - ipAddress: String, - delegationTokenStr: String) +private[thriftserver] class ThriftServerSessionImplWithUgi( + protocol: TProtocolVersion, + username: String, + password: String, + serverHiveConf: HiveConf, + ipAddress: String, + delegationTokenStr: String) extends ThriftServerSessionImpl(protocol, username, password, serverHiveConf, ipAddress) with Logging { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala index d3e5cc73704a..a45ffb435604 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.thriftserver.cli.thrift import org.apache.log4j.PatternLayout -object CLIServiceUtils { +private[thriftserver] object CLIServiceUtils { private val SEARCH_STRING_ESCAPE = '\\' val verboseLayout = new PatternLayout("%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n") diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala index 38f607ed9c76..deb63bcb5db6 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala @@ -34,9 +34,9 @@ import org.apache.spark.sql.thriftserver.cli.CLIService import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup -class ThriftBinaryCLIService(cliService: CLIService) +private[thriftserver] class ThriftBinaryCLIService(cliService: CLIService) extends ThriftCLIService(cliService, classOf[ThriftBinaryCLIService].getSimpleName) - with Logging { + with Logging { override def run(): Unit = { try { // Server thread pool diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala index 60e8d1130430..6448ec8d01fe 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala @@ -41,33 +41,32 @@ import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types.StructType -abstract class ThriftCLIService(cliService: CLIService, serviceName: String) +private[thriftserver] abstract class ThriftCLIService(cliService: CLIService, serviceName: String) extends AbstractService(serviceName) - with TCLIService.Iface - with Runnable - with Logging { - + with TCLIService.Iface + with Runnable + with Logging { private val OK_STATUS = new TStatus(TStatusCode.SUCCESS_STATUS) protected var hiveAuthFactory: HiveAuthFactory = new HiveAuthFactory() protected var portNum: Int = 0 - protected var serverIPAddress: InetAddress = null - protected var hiveHost: String = null - protected var server: TServer = null - protected var httpServer: org.eclipse.jetty.server.Server = null + protected var serverIPAddress: InetAddress = _ + protected var hiveHost: String = _ + protected var server: TServer = _ + protected var httpServer: org.eclipse.jetty.server.Server = _ private var isStarted = false protected var isEmbedded = false - protected var hiveConf: HiveConf = null + protected var hiveConf: HiveConf = _ protected var minWorkerThreads: Int = 0 protected var maxWorkerThreads: Int = 0 protected var workerKeepAliveTime: Long = 0L private class ThriftCLIServerContext extends ServerContext { - private var sessionHandle: SessionHandle = null + private var sessionHandle: SessionHandle = _ def setSessionHandle(sessionHandle: SessionHandle): Unit = { this.sessionHandle = sessionHandle diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala index 18d97876b537..bf40882f9e11 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala @@ -37,7 +37,7 @@ import org.apache.spark.sql.thriftserver.cli.CLIService import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup -class ThriftHttpCLIService(cliService: CLIService) +private[thriftserver] class ThriftHttpCLIService(cliService: CLIService) extends ThriftCLIService(cliService, classOf[ThriftHttpCLIService].getSimpleName) { /** * Configure Jetty to serve http requests. Example of a client connection URL: diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala index 7f9ecdc23c87..c2fb94dcb5b0 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala @@ -44,11 +44,11 @@ import org.apache.spark.sql.thriftserver.auth._ import org.apache.spark.sql.thriftserver.auth.AuthenticationProviderFactory.AuthMethods import org.apache.spark.sql.thriftserver.cli.session.SessionManager -class ThriftHttpServlet(processor: TProcessor, - protocolFactory: TProtocolFactory, - authType: String, - serviceUGI: UserGroupInformation, - httpUGI: UserGroupInformation) +private[thriftserver] class ThriftHttpServlet(processor: TProcessor, + protocolFactory: TProtocolFactory, + authType: String, + serviceUGI: UserGroupInformation, + httpUGI: UserGroupInformation) extends TServlet(processor, protocolFactory) with Logging { private val hiveConf: HiveConf = new HiveConf // Class members for cookie based authentication. diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala index 20c68b86ed34..c841a1b27eb0 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala @@ -37,7 +37,7 @@ import org.slf4j.Logger * example - once per module) LogHelper always emits info/error to current * session as required. */ -object LogHelper { +private[thriftserver] object LogHelper { def getInfoStream: PrintStream = { val ss = SessionState.get if ((ss != null) && (ss.info != null)) ss.info @@ -51,7 +51,7 @@ object LogHelper { } } -class LogHelper(var LOG: Logger, var isSilent: Boolean) { +private[thriftserver] class LogHelper(var LOG: Logger, var isSilent: Boolean) { def this(LOG: Nothing) { this(LOG, false) } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala index fb06f460ac68..d1a481841e80 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala @@ -28,8 +28,9 @@ import org.apache.hadoop.hive.ql.session.SessionState import org.apache.spark.internal.Logging -class VariableSubstitution(hiveVariableSource: util.Map[String, String]) - extends SystemVariables with Logging { +private[thriftserver] class VariableSubstitution(hiveVariableSource: util.Map[String, String]) + extends SystemVariables + with Logging { override protected def getSubstitute(conf: Configuration, variable: String): String = { var value: String = super.getSubstitute(conf, variable) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala index 983130ff6447..baac75eafa01 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala @@ -34,9 +34,9 @@ import org.apache.spark.sql.thriftserver.cli.CLIService import org.apache.spark.sql.thriftserver.cli.thrift.{ThriftBinaryCLIService, ThriftCLIService, ThriftHttpCLIService} import org.apache.spark.util.ShutdownHookManager -class SparkThriftServer(sqlContext: SQLContext) +private[thriftserver] class SparkThriftServer(sqlContext: SQLContext) extends CompositeService(classOf[SparkThriftServer].getSimpleName) - with Logging { + with Logging { // state is tracked internally so that the server only attempts to shut down if it successfully // started, and then once only. From a7ec8b044fa4679b3cefe35bd50b3dd0b70e3ace Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 09:47:23 +0800 Subject: [PATCH 15/55] format code --- .../cli/operation/Operation.scala | 6 +++- .../SparkExecuteStatementOperation.scala | 32 +++++++++---------- .../operation/SparkGetCatalogsOperation.scala | 14 ++++---- .../operation/SparkGetColumnsOperation.scala | 14 ++++---- .../SparkGetFunctionsOperation.scala | 14 ++++---- .../operation/SparkGetSchemasOperation.scala | 14 ++++---- .../SparkGetTableTypesOperation.scala | 14 ++++---- .../operation/SparkGetTablesOperation.scala | 14 ++++---- .../operation/SparkGetTypeInfoOperation.scala | 14 ++++---- .../cli/session/ThriftServerSessionBase.scala | 2 +- .../cli/session/ThriftServerSessionImpl.scala | 2 +- 11 files changed, 72 insertions(+), 68 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala index 56a7752e741e..d025ddb08e4b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala @@ -79,7 +79,11 @@ private[thriftserver] abstract class Operation( def getStatus: OperationStatus = new OperationStatus(_state, _operationException) - def statementId: String = _statementId + def setStatementId(statementId: String): Unit = _statementId = statementId + + def getStatementId: String = _statementId + + def statementId: String = getStatementId def hasResultSet: Boolean = _hasResultSet diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala index 619a3302b596..2e092b37adb9 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala @@ -80,7 +80,7 @@ private[thriftserver] class SparkExecuteStatementOperation( def getNextRowSet(order: FetchOrientation, maxRowsL: Long): RowSet = withSchedulerPool { logInfo(s"Received getNextRowSet request order=${order} and maxRowsL=${maxRowsL} " + - s"with ${_statementId}") + s"with ${statementId}") validateDefaultFetchOrientation(order) assertState(FINISHED) setHasResultSet(true) @@ -154,13 +154,13 @@ private[thriftserver] class SparkExecuteStatementOperation( override def runInternal(): Unit = { setState(PENDING) - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) logInfo(s"Submitting query '$statement' with $statementId") SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, statement, - _statementId, + statementId, parentSession.getUsername) setHasResultSet(true) // avoid no resultset for async run @@ -207,14 +207,14 @@ private[thriftserver] class SparkExecuteStatementOperation( logError("Error submitting query in background, query rejected", rejected) setState(ERROR) SparkThriftServer2.listener.onStatementError( - _statementId, rejected.getMessage, SparkUtils.exceptionString(rejected)) + statementId, rejected.getMessage, SparkUtils.exceptionString(rejected)) throw new SparkThriftServerSQLException("The background threadpool cannot accept" + " new task for execution, please retry the operation", rejected) case NonFatal(e) => logError(s"Error executing query in background", e) setState(ERROR) SparkThriftServer2.listener.onStatementError( - _statementId, e.getMessage, SparkUtils.exceptionString(e)) + statementId, e.getMessage, SparkUtils.exceptionString(e)) throw new SparkThriftServerSQLException(e) } } @@ -235,7 +235,7 @@ private[thriftserver] class SparkExecuteStatementOperation( val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) - sqlContext.sparkContext.setJobGroup(_statementId, statement) + sqlContext.sparkContext.setJobGroup(statementId, statement) result = sqlContext.sql(statement) logDebug(result.queryExecution.toString()) result.queryExecution.logical match { @@ -245,7 +245,7 @@ private[thriftserver] class SparkExecuteStatementOperation( "in this session.") case _ => } - SparkThriftServer2.listener.onStatementParsed(_statementId, result.queryExecution.toString()) + SparkThriftServer2.listener.onStatementParsed(statementId, result.queryExecution.toString()) iter = { if (sqlContext.getConf(SQLConf.THRIFTSERVER_INCREMENTAL_COLLECT.key).toBoolean) { resultList = None @@ -264,8 +264,8 @@ private[thriftserver] class SparkExecuteStatementOperation( // then they may both call cleanup() before Spark Jobs are started. But before background // task interrupted, it may have start some spark job, so we need to cancel again to // make sure job was cancelled when background thread was interrupted - if (_statementId != null) { - sqlContext.sparkContext.cancelJobGroup(_statementId) + if (statementId != null) { + sqlContext.sparkContext.cancelJobGroup(statementId) } val currentState = getStatus.getState if (currentState.isTerminal) { @@ -277,12 +277,12 @@ private[thriftserver] class SparkExecuteStatementOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error running query: " + root.toString, root) } } @@ -290,7 +290,7 @@ private[thriftserver] class SparkExecuteStatementOperation( synchronized { if (!getStatus.getState.isTerminal) { setState(FINISHED) - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } } sqlContext.sparkContext.clearJobGroup() @@ -302,7 +302,7 @@ private[thriftserver] class SparkExecuteStatementOperation( if (!getStatus.getState.isTerminal) { logInfo(s"Cancel query with $statementId") cleanup(CANCELED) - SparkThriftServer2.listener.onStatementCanceled(_statementId) + SparkThriftServer2.listener.onStatementCanceled(statementId) } } } @@ -315,8 +315,8 @@ private[thriftserver] class SparkExecuteStatementOperation( backgroundHandle.cancel(true) } } - if (_statementId != null) { - sqlContext.sparkContext.cancelJobGroup(_statementId) + if (statementId != null) { + sqlContext.sparkContext.cancelJobGroup(statementId) } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala index 2fa8e3349cb6..4e59ad4bef92 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala @@ -48,11 +48,11 @@ private[thriftserver] class SparkGetCatalogsOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(_statementId) + SparkThriftServer2.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) val logMsg = "Listing catalogs" logInfo(s"$logMsg with $statementId") setState(RUNNING) @@ -61,10 +61,10 @@ private[thriftserver] class SparkGetCatalogsOperation( Thread.currentThread().setContextClassLoader(executionHiveClassLoader) SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, - _statementId, + statementId, parentSession.getUsername) try { @@ -79,17 +79,17 @@ private[thriftserver] class SparkGetCatalogsOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting catalogs: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala index b3eeecdcf03d..bd53dbfeb48d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala @@ -86,11 +86,11 @@ private[thriftserver] class SparkGetColumnsOperation( private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(_statementId) + SparkThriftServer2.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName, tablePattern : $tableName" val logMsg = s"Listing columns '$cmdStr, columnName : $columnName'" @@ -102,10 +102,10 @@ private[thriftserver] class SparkGetColumnsOperation( Thread.currentThread().setContextClassLoader(executionHiveClassLoader) SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, - _statementId, + statementId, parentSession.getUsername) val schemaPattern = convertSchemaPattern(schemaName) @@ -159,16 +159,16 @@ private[thriftserver] class SparkGetColumnsOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting columns: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } private def addToRowSet( diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala index 92c49ca09aff..6b9f145f3a0a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala @@ -62,11 +62,11 @@ private[thriftserver] class SparkGetFunctionsOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(_statementId) + SparkThriftServer2.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing functions '$cmdStr, functionName : $functionName'" @@ -90,10 +90,10 @@ private[thriftserver] class SparkGetFunctionsOperation( } SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, - _statementId, + statementId, parentSession.getUsername) try { @@ -119,17 +119,17 @@ private[thriftserver] class SparkGetFunctionsOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting functions: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala index 1a65df10322c..f3aade7a981a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala @@ -55,11 +55,11 @@ private[thriftserver] class SparkGetSchemasOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(_statementId) + SparkThriftServer2.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing databases '$cmdStr'" @@ -74,10 +74,10 @@ private[thriftserver] class SparkGetSchemasOperation( } SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, - _statementId, + statementId, parentSession.getUsername) try { @@ -99,16 +99,16 @@ private[thriftserver] class SparkGetSchemasOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting schemas: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala index 84e44ae4df95..82455e28ab1c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala @@ -51,11 +51,11 @@ private[thriftserver] class SparkGetTableTypesOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(_statementId) + SparkThriftServer2.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) val logMsg = "Listing table types" logInfo(s"$logMsg with $statementId") setState(RUNNING) @@ -68,10 +68,10 @@ private[thriftserver] class SparkGetTableTypesOperation( } SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, - _statementId, + statementId, parentSession.getUsername) try { @@ -87,17 +87,17 @@ private[thriftserver] class SparkGetTableTypesOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting table types: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala index 8c74558ac188..43d773220dba 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -67,11 +67,11 @@ private[thriftserver] class SparkGetTablesOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(_statementId) + SparkThriftServer2.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val tableTypesStr = if (tableTypes == null) "null" else tableTypes.asScala.mkString(",") @@ -94,10 +94,10 @@ private[thriftserver] class SparkGetTablesOperation( } SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, - _statementId, + statementId, parentSession.getUsername) try { @@ -133,16 +133,16 @@ private[thriftserver] class SparkGetTablesOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting tables: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } private def addToRowSet( diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala index 1cd24052f7dc..9786c2fe4666 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala @@ -66,11 +66,11 @@ private[thriftserver] class SparkGetTypeInfoOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(_statementId) + SparkThriftServer2.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - _statementId = UUID.randomUUID().toString + setStatementId(UUID.randomUUID().toString) val logMsg = "Listing type info" logInfo(s"$logMsg with $statementId") setState(RUNNING) @@ -83,10 +83,10 @@ private[thriftserver] class SparkGetTypeInfoOperation( } SparkThriftServer2.listener.onStatementStart( - _statementId, + statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, - _statementId, + statementId, parentSession.getUsername) try { @@ -121,17 +121,17 @@ private[thriftserver] class SparkGetTypeInfoOperation( e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( - _statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) + statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) SparkThriftServer2.listener.onStatementError( - _statementId, root.getMessage, SparkUtils.exceptionString(root)) + statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting type info: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(_statementId) + SparkThriftServer2.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala index baae2eb47eae..78bffea4487c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala @@ -85,7 +85,7 @@ private[thriftserver] trait ThriftServerSessionBase { def getIpAddress: String - def setIpAddress(ipAddress: String): Unit + def setIpAddress(ipAddr: String): Unit def getLastAccessTime: Long } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index cfcb17575486..9dd837d00fab 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -784,7 +784,7 @@ private[thriftserver] class ThriftServerSessionImpl( override def getIpAddress: String = ipAddress - override def setIpAddress(ipAddress: String): Unit = ipAddress = ipAddress + override def setIpAddress(ipAddr: String): Unit = ipAddress = ipAddr override def getLastAccessTime: Long = _lastAccessTime From 5cf7eb071809610d9d705f014396eac7342df4a7 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 11:53:05 +0800 Subject: [PATCH 16/55] Update SparkSQLEnv.scala --- .../scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala index 05609bed7ab6..2cf94e1c4349 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala @@ -24,6 +24,7 @@ import org.apache.spark.{SparkConf, SparkContext} import org.apache.spark.internal.Logging import org.apache.spark.sql.{SparkSession, SQLContext} import org.apache.spark.sql.hive.{HiveExternalCatalog, HiveUtils} +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.util.Utils /** A singleton object for the master program. The slaves should not access this. */ @@ -41,7 +42,7 @@ private[thriftserver] object SparkSQLEnv extends Logging { val maybeAppName = sparkConf .getOption("spark.app.name") // .filterNot(_ == classOf[SparkSQLCLIDriver].getName) - .filterNot(_ == classOf[SparkThriftServer2].getName) + .filterNot(_ == classOf[SparkThriftServer].getName) sparkConf .setAppName(maybeAppName.getOrElse(s"SparkSQL::${Utils.localHostName()}")) From 0023bcb4aa8d5aff7bf5096ef387d5b50aa0d3e9 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 13:28:10 +0800 Subject: [PATCH 17/55] fix logger conflict --- .../spark/sql/thriftserver/server/SparkThriftServer.scala | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala index baac75eafa01..ac1b3692c127 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala @@ -154,11 +154,7 @@ object SparkThriftServer extends Logging { try { val oproc = new ServerOptionsProcessor("hiveserver2") val oprocResponse = oproc.parse(args) - // NOTE: It is critical to do this here so that log4j is reinitialized - // before any of the other core hive classes are loaded - val initLog4jMessage = LogUtils.initHiveLog4j val classname = classOf[SparkThriftServer].getSimpleName - logDebug(initLog4jMessage) logInfo(toStartupShutdownString("STARTUP_MSG: ", Array[String]("Starting " + classname, " host = " + HiveStringUtils.getHostname, From 723450be70dbd0ae00c5867fc94259ad7ec6ba08 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 15:21:58 +0800 Subject: [PATCH 18/55] fix scala style --- .../sql/thriftserver/AbstractService.scala | 1 + .../sql/thriftserver/CompositeService.scala | 2 +- .../spark/sql/thriftserver/CookieSigner.scala | 2 +- .../sql/thriftserver/ReflectionUtils.scala | 1 + .../apache/spark/sql/thriftserver/Service.scala | 2 +- .../sql/thriftserver/ServiceException.scala | 17 ++++++++--------- .../sql/thriftserver/ServiceOperations.scala | 2 +- .../ServiceStateChangeListener.scala | 17 ++++++++--------- .../spark/sql/thriftserver/ServiceUtils.scala | 2 +- .../spark/sql/thriftserver/SparkSQLEnv.scala | 2 +- .../sql/thriftserver/SparkThriftServer2.scala | 2 +- .../spark/sql/thriftserver/auth/AuthType.scala | 2 +- .../sql/thriftserver/auth/PlainSaslHelper.scala | 2 +- .../auth/TSetIpAddressProcessor.scala | 1 - .../ThriftserverDelegationTokenManager.scala | 2 +- .../spark/sql/thriftserver/cli/CLIService.scala | 2 +- .../sql/thriftserver/cli/ColumnBasedSet.scala | 2 +- .../sql/thriftserver/cli/ColumnDescriptor.scala | 2 +- .../spark/sql/thriftserver/cli/Handle.scala | 2 +- .../sql/thriftserver/cli/ICLIService.scala | 3 +-- .../sql/thriftserver/cli/OperationHandle.scala | 2 +- .../sql/thriftserver/cli/OperationType.scala | 2 +- .../thriftserver/cli/PatternOrIdentifier.scala | 2 +- .../sql/thriftserver/cli/RowBasedSet.scala | 2 +- .../spark/sql/thriftserver/cli/RowSet.scala | 2 +- .../sql/thriftserver/cli/RowSetFactory.scala | 2 +- .../sql/thriftserver/cli/SchemaMapper.scala | 2 +- .../sql/thriftserver/cli/SessionHandle.scala | 2 +- .../spark/sql/thriftserver/cli/Type.scala | 2 +- .../sql/thriftserver/cli/TypeDescriptor.scala | 2 +- .../sql/thriftserver/cli/TypeQualifiers.scala | 2 +- .../cli/operation/OperationManager.scala | 6 ++++-- .../cli/operation/SparkMetadataOperation.scala | 2 +- .../cli/session/SessionManager.scala | 2 +- .../cli/thrift/ThriftHttpCLIService.scala | 2 +- .../sql/thriftserver/cli/utils/LogHelper.scala | 2 +- .../cli/utils/VariableSubstitution.scala | 5 +++-- .../thriftserver/server/SparkThriftServer.scala | 2 +- 38 files changed, 56 insertions(+), 55 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala index 07a0ba52e02f..76730d4c8678 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala @@ -136,3 +136,4 @@ private[thriftserver] abstract class AbstractService(val name: String) } } } + diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala index 40965dafc482..5f91dc1bfc1d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala @@ -112,4 +112,4 @@ private[thriftserver] class CompositeService(name: String) } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala index ac303771cb95..9c14e7d208f3 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala @@ -99,4 +99,4 @@ private[thriftserver] class CookieSigner extends Logging { throw new RuntimeException("Invalid SHA digest String: " + CookieSigner.SHA_STRING + " " + ex.getMessage, ex) } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala index d3937e43108b..d7a73aeea19a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ReflectionUtils.scala @@ -56,3 +56,4 @@ private[thriftserver] object ReflectionUtils { method.invoke(obj, values.toSeq: _*) } } + diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala index 54f5038848d4..a6ba54474082 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala @@ -110,4 +110,4 @@ private[thriftserver] object Service { case object STOPPED extends STATE -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala index bf9b02df4372..e52cfe35788e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -24,4 +23,4 @@ private[thriftserver] class ServiceException(msg: String, cause: Throwable) def this(cause: Throwable) = this(null, cause) def this(message: String) = this(message, null) -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala index 5bbf99aca763..bc8627b05c2a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala @@ -129,4 +129,4 @@ private[thriftserver] object ServiceOperations extends Logging { } null } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala index f36e0eaa9a14..a3e8461d5dd1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -41,4 +40,4 @@ private[thriftserver] trait ServiceStateChangeListener { * @param service the service that has changed. */ def stateChanged(service: Service): Unit -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala index f5a0d9af24f1..d065d4960fb7 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala @@ -66,4 +66,4 @@ private[thriftserver] object ServiceUtils { } } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala index 2cf94e1c4349..c3e6b6e1202d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkSQLEnv.scala @@ -70,4 +70,4 @@ private[thriftserver] object SparkSQLEnv extends Logging { sqlContext = null } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala index e37a285b8af4..16c4fdb9962c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala @@ -288,4 +288,4 @@ private[thriftserver] object SparkThriftServer2 extends Logging { } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala index 307d9acddb6d..972cfd3909fe 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala @@ -34,4 +34,4 @@ case object KERBEROS extends AuthType("KERBEROS") case object CUSTOM extends AuthType("CUSTOM") -case object PAM extends AuthType("PAM") \ No newline at end of file +case object PAM extends AuthType("PAM") diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala index 3d87be31bdfe..9079fe6b9eeb 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala @@ -133,4 +133,4 @@ class PlainCallbackHandler(val username: String, val password: String) extends C else throw new UnsupportedCallbackException(callback) } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala index 1b1a3a67365a..1c51256a506c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala @@ -91,4 +91,3 @@ class TSetIpAddressProcessor[I <: Iface](val iface: Iface) } } - diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala index c835ebfb3050..4297e3e362f1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala @@ -157,4 +157,4 @@ class ThriftserverDelegationTokenManager { } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala index d8b45588fe6f..f980807a70b9 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -412,4 +412,4 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex object CLIService { val protocols: Array[TProtocolVersion] = TProtocolVersion.values() val SERVER_VERSION: TProtocolVersion = protocols(protocols.length - 1) -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index 3aeb70601af7..5fe096c0e817 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -151,4 +151,4 @@ private[thriftserver] case class ColumnBasedSet( object ColumnBasedSet { private val EMPTY_STRING = "" private val EMPTY_BINARY = ByteBuffer.allocate(0) -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala index 28399ac84ced..a9a495ce1869 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala @@ -38,4 +38,4 @@ private[thriftserver] case class ColumnDescriptor(field: StructField, pos: Int) tColumnDesc.setPosition(pos) tColumnDesc } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala index 6a92718c4483..12333a001d3c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala @@ -58,4 +58,4 @@ private[thriftserver] abstract class Handle(val handleId: HandleIdentifier) { true } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala index 4c66b03a8b03..0b16f4fa9bbf 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala @@ -147,5 +147,4 @@ private[thriftserver] trait ICLIService { def renewDelegationToken(sessionHandle: SessionHandle, authFactory: HiveAuthFactory, tokenStr: String): Unit - -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala index c05e311ba3b5..4845752bf350 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala @@ -79,4 +79,4 @@ private[thriftserver] class OperationHandle private( override def toString: String = "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier + "]" -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala index bc37adfe3b53..573ae7834390 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala @@ -76,4 +76,4 @@ private[thriftserver] object OperationType { case TOperationType.GET_FUNCTIONS => GET_FUNCTIONS case _ => UNKNOWN_OPERATION } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala index 7e6de323199d..9708a5c089b4 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala @@ -30,4 +30,4 @@ private[thriftserver] class PatternOrIdentifier(var text: String) { def isIdentifier: Boolean = !isPt override def toString: String = text -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala index 3fd6cee2cf64..76aad123c306 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala @@ -150,4 +150,4 @@ private[thriftserver] case class RowBasedSet(types: StructType, override def setStartOffset(startOffset: Long): Unit = this.startOffset = startOffset -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala index 5eea085cea09..68f8fb6f77a4 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala @@ -34,4 +34,4 @@ private[thriftserver] trait RowSet { def setStartOffset(startOffset: Long): Unit def toTRowSet: TRowSet -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala index 395c70fa196e..fe04a5436472 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala @@ -40,4 +40,4 @@ private[thriftserver] object RowSetFactory { RowBasedSet(types, new ArrayBuffer[Row](), 0) } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index 22e6492f4ac1..79a2c475753c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -58,4 +58,4 @@ private[thriftserver] object SchemaMapper { } throw new IllegalArgumentException("Unrecognized type name: " + catalogString) } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala index 274c194f3bbf..7e5ca0993e98 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala @@ -45,4 +45,4 @@ private[thriftserver] class SessionHandle(handleId: HandleIdentifier, protocol: def getProtocolVersion: TProtocolVersion = protocol override def toString: String = "SessionHandle [" + getHandleIdentifier + "]" -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala index 42cbdcbb4916..7355d603cd0d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala @@ -498,4 +498,4 @@ object Type { override def javaSQLType: Int = java.sql.Types.OTHER } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala index 2ab8098246e5..db8eb3dab6d7 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala @@ -38,4 +38,4 @@ private[thriftserver] case class TypeDescriptor(typ: DataType) { desc.addToTypes(entry) desc } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala index e2d6e4cef98c..87c18b43bd6c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala @@ -55,4 +55,4 @@ private[thriftserver] object TypeQualifiers { } result } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala index 66eafb1c294e..9c7b618e0b57 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala @@ -299,7 +299,9 @@ private[thriftserver] class OperationManager throw new SparkThriftServerSQLException(e.getMessage, e.getCause) } // convert logs to RowSet - val rowSet: RowSet = RowSetFactory.create(logSchema, logs.asScala.map(Row(_)), getOperation(opHandle).getProtocolVersion) + val rowSet: RowSet = + RowSetFactory.create(logSchema, logs.asScala.map(Row(_)), + getOperation(opHandle).getProtocolVersion) rowSet } @@ -327,4 +329,4 @@ private[thriftserver] class OperationManager }) removed.asScala.toList } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala index a8bacdaa20e5..36515bab7b4e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala @@ -130,4 +130,4 @@ private[thriftserver] abstract class SparkMetadataOperation( throw new SparkThriftServerSQLException(e.getMessage, e) } } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index 0b22baafbad7..001a16987b3a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -344,4 +344,4 @@ object SessionManager extends Logging { def getUserName: String = threadLocalUserName.get -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala index bf40882f9e11..2479d4c7d143 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala @@ -162,4 +162,4 @@ private[thriftserver] class ThriftHttpCLIService(cliService: CLIService) httpPath } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala index c841a1b27eb0..895746d91f1e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala @@ -128,4 +128,4 @@ private[thriftserver] class LogHelper(var LOG: Logger, var isSilent: Boolean) { // scalastyle:on LOG.error(error + StringUtils.defaultString(detail)) } -} \ No newline at end of file +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala index d1a481841e80..138fdc64fd00 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala @@ -31,7 +31,6 @@ import org.apache.spark.internal.Logging private[thriftserver] class VariableSubstitution(hiveVariableSource: util.Map[String, String]) extends SystemVariables with Logging { - override protected def getSubstitute(conf: Configuration, variable: String): String = { var value: String = super.getSubstitute(conf, variable) if (value == null && SessionState.get != null) { @@ -45,7 +44,9 @@ private[thriftserver] class VariableSubstitution(hiveVariableSource: util.Map[St } def substitute(conf: HiveConf, expr: String): String = { - if (expr == null) return expr + if (expr == null) { + return expr + } if (HiveConf.getBoolVar(conf, ConfVars.HIVEVARIABLESUBSTITUTE)) { logDebug("Substitution is on: " + expr) } else { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala index ac1b3692c127..2b4e976b1442 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala @@ -296,4 +296,4 @@ object SparkThriftServer extends Logging { } } -} \ No newline at end of file +} From 3eb7672324e9afc0fbeda80e62fd0bf1827250a2 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 16:51:12 +0800 Subject: [PATCH 19/55] start with execution hive --- .../sql/thriftserver/SparkThriftServer2.scala | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala index 16c4fdb9962c..a756f8dcf33b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala @@ -17,6 +17,7 @@ package org.apache.spark.sql.thriftserver +import scala.collection.JavaConverters._ import scala.collection.mutable import scala.collection.mutable.ArrayBuffer @@ -28,6 +29,7 @@ import org.apache.spark.internal.Logging import org.apache.spark.internal.config.UI.UI_ENABLED import org.apache.spark.scheduler.{SparkListener, SparkListenerApplicationEnd, SparkListenerJobStart} import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.thriftserver.ui.ThriftServerTab @@ -43,6 +45,16 @@ private[thriftserver] object SparkThriftServer2 extends Logging { var uiTab: Option[ThriftServerTab] = None var listener: SparkThriftServerListener = _ + def hiveConfForExecution(): HiveConf = { + val extraConfig = HiveUtils.newTemporaryConfiguration(true) + val hiveConf: HiveConf = new HiveConf() + (SparkSQLEnv.sparkContext.hadoopConfiguration + .iterator().asScala.map(kv => kv.getKey -> kv.getValue) + ++ SparkSQLEnv.sparkContext.conf.getAll.toMap ++ extraConfig).toMap + .foreach { case (k, v) => hiveConf.set(k, v) } + hiveConf + } + /** * :: DeveloperApi :: * Starts a new thrift server with the given context. @@ -51,7 +63,7 @@ private[thriftserver] object SparkThriftServer2 extends Logging { def startWithContext(sqlContext: SQLContext): SparkThriftServer = { val server = new SparkThriftServer(sqlContext) - server.init(new HiveConf()) + server.init(hiveConfForExecution()) server.start() listener = new SparkThriftServerListener(server, sqlContext.conf) sqlContext.sparkContext.addSparkListener(listener) @@ -85,7 +97,7 @@ private[thriftserver] object SparkThriftServer2 extends Logging { try { val server = new SparkThriftServer(SparkSQLEnv.sqlContext) - server.init(new HiveConf()) + server.init(hiveConfForExecution()) server.start() logInfo("HiveThriftServer2 started") listener = new SparkThriftServerListener(server, SparkSQLEnv.sqlContext.conf) From 5aa4d9d5b514a07c456e30143f5aaeb0a39920c4 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 17:59:23 +0800 Subject: [PATCH 20/55] format code add file header --- .../apache/spark/sql/thriftserver/Service.scala | 15 +++++++-------- .../spark/sql/thriftserver/auth/AuthType.scala | 2 +- .../sql/thriftserver/auth/HiveAuthFactory.scala | 2 +- .../sql/thriftserver/auth/HttpAuthUtils.scala | 2 +- .../thriftserver/auth/KerberosSaslHelper.scala | 2 +- .../sql/thriftserver/auth/PlainSaslHelper.scala | 2 +- .../auth/TSetIpAddressProcessor.scala | 2 +- .../auth/ThriftserverDelegationTokenManager.scala | 2 +- .../sql/thriftserver/cli/ColumnBasedSet.scala | 2 +- .../sql/thriftserver/cli/ColumnDescriptor.scala | 2 +- .../sql/thriftserver/cli/FetchOrientation.scala | 2 +- .../spark/sql/thriftserver/cli/FetchType.scala | 2 +- .../spark/sql/thriftserver/cli/Handle.scala | 2 +- .../sql/thriftserver/cli/HandleIdentifier.scala | 2 +- .../spark/sql/thriftserver/cli/ICLIService.scala | 2 +- .../sql/thriftserver/cli/OperationHandle.scala | 2 +- .../sql/thriftserver/cli/OperationState.scala | 2 +- .../sql/thriftserver/cli/OperationStatus.scala | 15 +++++++-------- .../sql/thriftserver/cli/OperationType.scala | 2 +- .../spark/sql/thriftserver/cli/RowBasedSet.scala | 2 +- .../sql/thriftserver/cli/RowSetFactory.scala | 2 +- .../spark/sql/thriftserver/cli/SchemaMapper.scala | 2 +- .../sql/thriftserver/cli/SessionHandle.scala | 2 +- .../sql/thriftserver/cli/TypeDescriptor.scala | 2 +- .../sql/thriftserver/cli/TypeQualifiers.scala | 2 +- .../thriftserver/cli/operation/Operation.scala | 2 +- .../thriftserver/cli/session/SessionManager.scala | 2 +- .../cli/session/ThriftServerSession.scala | 2 +- .../cli/session/ThriftServerSessionBase.scala | 2 +- .../cli/session/ThriftServerSessionImpl.scala | 2 +- .../session/ThriftServerSessionImplWithUgi.scala | 2 +- .../thriftserver/cli/thrift/CLIServiceUtils.scala | 2 +- .../cli/thrift/ThriftBinaryCLIService.scala | 2 +- .../cli/thrift/ThriftCLIService.scala | 2 +- .../cli/thrift/ThriftHttpCLIService.scala | 2 +- .../cli/thrift/ThriftHttpServlet.scala | 2 +- 36 files changed, 48 insertions(+), 50 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala index a6ba54474082..82b5fc43bdc9 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala index 972cfd3909fe..490715bb46c8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala index 725a2e46b24b..e288e9346dba 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala index 8d867c71a44c..d946281a2b52 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala index 4eaa7b5e71f4..b3ea4777c352 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala index 9079fe6b9eeb..e60984df70a2 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala index 1c51256a506c..88856e667fe5 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala index 4297e3e362f1..2d1f096ae5f2 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index 5fe096c0e817..778ef63f111d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala index a9a495ce1869..81a8c83faadb 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala index 6c47bfaffc81..9ada8e98656b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala index 760a5fff52f8..90d46b324072 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala index 12333a001d3c..7ee73dabec04 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala index ee8493b4ce6f..29fa92e97e53 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala index 0b16f4fa9bbf..a3886dde2673 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala index 4845752bf350..503e6427b6f8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala index b834fdcfb67f..e81b50cd438b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala index 6931fff906f8..ba47b394a794 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala index 573ae7834390..4f1e0cefe58f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala index 76aad123c306..9ebf18f3b1d3 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala index fe04a5436472..a984c7fb8894 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index 79a2c475753c..d9b82220d599 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala index 7e5ca0993e98..1bec82bfd555 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala index db8eb3dab6d7..d0d4a989272f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala index 87c18b43bd6c..538eee15f077 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala index d025ddb08e4b..c2628ad5f464 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index 001a16987b3a..2b24e25c2696 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala index 8e39d38e26f9..867594ed8804 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala index 78bffea4487c..318b1edb55ff 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index 9dd837d00fab..74292e062706 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala index d2ea8716eb5c..1abf93a73797 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala index a45ffb435604..53c6a889534f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala index deb63bcb5db6..0cb96c0877d6 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala index 6448ec8d01fe..f06944b09053 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala index 2479d4c7d143..fe363dca7904 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala index c2fb94dcb5b0..c4d28cba04ee 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala @@ -6,7 +6,7 @@ * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, From 782d36b141721342cb69eaf1541e86704e01083d Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 18:04:39 +0800 Subject: [PATCH 21/55] FOR BUILD spark-thriftserver --- .github/workflows/master.yml | 2 +- .gitignore | 1 + assembly/pom.xml | 10 ++++ .../org/apache/spark/deploy/SparkSubmit.scala | 3 +- dev/create-release/release-build.sh | 2 +- dev/lint-java | 2 +- dev/mima | 2 +- dev/run-tests.py | 2 +- dev/sbt-checkstyle | 2 +- dev/scalastyle | 2 +- dev/test-dependencies.sh | 2 +- .../launcher/AbstractCommandBuilder.java | 1 + .../launcher/SparkSubmitCommandBuilder.java | 5 +- project/SparkBuild.scala | 6 +- sbin/start-spark-thriftserver.sh | 60 +++++++++++++++++++ sbin/stop-spark-thriftserver.sh | 26 ++++++++ 16 files changed, 115 insertions(+), 13 deletions(-) create mode 100755 sbin/start-spark-thriftserver.sh create mode 100755 sbin/stop-spark-thriftserver.sh diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index e2eb0683b6e5..fb636af7558a 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -31,7 +31,7 @@ jobs: run: | export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN" export MAVEN_CLI_OPTS="--no-transfer-progress" - ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -P${{ matrix.hadoop }} -Phadoop-cloud -Djava.version=${{ matrix.java }} package + ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Pspark-thriftserver -P${{ matrix.hadoop }} -Phadoop-cloud -Djava.version=${{ matrix.java }} package lint: diff --git a/.gitignore b/.gitignore index ae20c85ebe35..06f47161b5f3 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ TempStatsStore/ metastore/ metastore_db/ sql/hive-thriftserver/test_warehouses +sql/thriftserver/test_warehouse warehouse/ spark-warehouse/ diff --git a/assembly/pom.xml b/assembly/pom.xml index ef916fb99a04..33e1ca6ac464 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -183,6 +183,16 @@
+ + spark-thriftserver + + + org.apache.spark + spark-thriftserver_${scala.binary.version} + ${project.version} + + + spark-ganglia-lgpl diff --git a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala index 8a03af5e38c9..b16614675e4c 100644 --- a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala +++ b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala @@ -1041,7 +1041,8 @@ object SparkSubmit extends CommandLineUtils with Logging { * Return whether the given main class represents a thrift server. */ private def isThriftServer(mainClass: String): Boolean = { - mainClass == "org.apache.spark.sql.hive.thriftserver.HiveThriftServer2" + mainClass == "org.apache.spark.sql.hive.thriftserver.HiveThriftServer2" || + mainClass == "org.apache.spark.sql.thriftserver.SparkThriftServer2" } /** diff --git a/dev/create-release/release-build.sh b/dev/create-release/release-build.sh index 61951e73f4ba..91882e8494c9 100755 --- a/dev/create-release/release-build.sh +++ b/dev/create-release/release-build.sh @@ -136,7 +136,7 @@ if [[ $SPARK_VERSION > "2.4" ]]; then fi # Hive-specific profiles for some builds -HIVE_PROFILES="-Phive -Phive-thriftserver" +HIVE_PROFILES="-Phive -Phive-thriftserver -Pspark-thriftserver" # Profiles for publishing snapshots and release to Maven Central PUBLISH_PROFILES="$BASE_PROFILES $HIVE_PROFILES -Pspark-ganglia-lgpl -Pkinesis-asl" # Profiles for building binary releases diff --git a/dev/lint-java b/dev/lint-java index 1f0b0c8379ed..f2bf4ce5d2a7 100755 --- a/dev/lint-java +++ b/dev/lint-java @@ -20,7 +20,7 @@ SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" SPARK_ROOT_DIR="$(dirname $SCRIPT_DIR)" -ERRORS=$($SCRIPT_DIR/../build/mvn -Pkinesis-asl -Pmesos -Pkubernetes -Pyarn -Phive -Phive-thriftserver checkstyle:check | grep ERROR) +ERRORS=$($SCRIPT_DIR/../build/mvn -Pkinesis-asl -Pmesos -Pkubernetes -Pyarn -Phive -Phive-thriftserver -Pspark-thriftserver checkstyle:check | grep ERROR) if test ! -z "$ERRORS"; then echo -e "Checkstyle checks failed at following occurrences:\n$ERRORS" diff --git a/dev/mima b/dev/mima index f324c5c00a45..9712d449c275 100755 --- a/dev/mima +++ b/dev/mima @@ -24,7 +24,7 @@ set -e FWDIR="$(cd "`dirname "$0"`"/..; pwd)" cd "$FWDIR" -SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"} +SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Pspark-thriftserver -Phive"} TOOLS_CLASSPATH="$(build/sbt -DcopyDependencies=false "export tools/fullClasspath" | tail -n1)" OLD_DEPS_CLASSPATH="$(build/sbt -DcopyDependencies=false $SPARK_PROFILES "export oldDeps/fullClasspath" | tail -n1)" diff --git a/dev/run-tests.py b/dev/run-tests.py index ea515708124d..652c6dee3fd9 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -113,7 +113,7 @@ def determine_modules_to_test(changed_modules): >>> x = [x.name for x in determine_modules_to_test([modules.sql])] >>> x # doctest: +NORMALIZE_WHITESPACE ['sql', 'avro', 'hive', 'mllib', 'sql-kafka-0-10', 'examples', 'hive-thriftserver', - 'pyspark-sql', 'repl', 'sparkr', 'pyspark-mllib', 'pyspark-ml'] + 'spark-thriftserver', 'pyspark-sql', 'repl', 'sparkr', 'pyspark-mllib', 'pyspark-ml'] """ modules_to_test = set() for module in changed_modules: diff --git a/dev/sbt-checkstyle b/dev/sbt-checkstyle index 415155fd1bb1..35cd1e71b6b6 100755 --- a/dev/sbt-checkstyle +++ b/dev/sbt-checkstyle @@ -17,7 +17,7 @@ # limitations under the License. # -SPARK_PROFILES=${1:-"-Pkinesis-asl -Pmesos -Pkubernetes -Pyarn -Phive -Phive-thriftserver"} +SPARK_PROFILES=${1:-"-Pkinesis-asl -Pmesos -Pkubernetes -Pyarn -Phive -Phive-thriftserver -Pspark-thriftserver"} # NOTE: echo "q" is needed because SBT prompts the user for input on encountering a build file # with failure (either resolution or compilation); the "q" makes SBT quit. diff --git a/dev/scalastyle b/dev/scalastyle index 212ef900eb9b..e86ff5c1a507 100755 --- a/dev/scalastyle +++ b/dev/scalastyle @@ -17,7 +17,7 @@ # limitations under the License. # -SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"} +SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Pspark-thriftserver -Phive"} # NOTE: echo "q" is needed because SBT prompts the user for input on encountering a build file # with failure (either resolution or compilation); the "q" makes SBT quit. diff --git a/dev/test-dependencies.sh b/dev/test-dependencies.sh index cc0292e9c2ea..69ed7e2000ba 100755 --- a/dev/test-dependencies.sh +++ b/dev/test-dependencies.sh @@ -29,7 +29,7 @@ export LC_ALL=C # TODO: This would be much nicer to do in SBT, once SBT supports Maven-style resolution. # NOTE: These should match those in the release publishing script -HADOOP2_MODULE_PROFILES="-Phive-thriftserver -Pmesos -Pkubernetes -Pyarn -Phive" +HADOOP2_MODULE_PROFILES="-Phive-thriftserver -Pspark-thriftserver -Pmesos -Pkubernetes -Pyarn -Phive" MVN="build/mvn" HADOOP_PROFILES=( hadoop-2.7 diff --git a/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java b/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java index 3ae4633c79b0..bcdae10920a0 100644 --- a/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java +++ b/launcher/src/main/java/org/apache/spark/launcher/AbstractCommandBuilder.java @@ -167,6 +167,7 @@ List buildClassPath(String appClassPath) throws IOException { "sql/core", "sql/hive", "sql/hive-thriftserver", + "sql/thriftserver", "streaming" ); if (prependClasses) { diff --git a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java index 383c3f60a595..e7653e25005b 100644 --- a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java +++ b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java @@ -86,6 +86,8 @@ class SparkSubmitCommandBuilder extends AbstractCommandBuilder { SparkLauncher.NO_RESOURCE); specialClasses.put("org.apache.spark.sql.hive.thriftserver.HiveThriftServer2", SparkLauncher.NO_RESOURCE); + specialClasses.put("org.apache.spark.sql.thriftserver.SparkThriftServer2", + SparkLauncher.NO_RESOURCE); } final List userArgs; @@ -398,7 +400,8 @@ boolean isClientMode(Map userProps) { */ private boolean isThriftServer(String mainClass) { return (mainClass != null && - mainClass.equals("org.apache.spark.sql.hive.thriftserver.HiveThriftServer2")); + (mainClass.equals("org.apache.spark.sql.hive.thriftserver.HiveThriftServer2") || + mainClass.equals("org.apache.spark.sql.thriftserver.SparkThriftServer2"))); } private List findExamplesJars() { diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala index 88f756b75789..4e7122968550 100644 --- a/project/SparkBuild.scala +++ b/project/SparkBuild.scala @@ -42,8 +42,8 @@ object BuildCommons { private val buildLocation = file(".").getAbsoluteFile.getParentFile - val sqlProjects@Seq(catalyst, sql, hive, hiveThriftServer, tokenProviderKafka010, sqlKafka010, avro) = Seq( - "catalyst", "sql", "hive", "hive-thriftserver", "token-provider-kafka-0-10", "sql-kafka-0-10", "avro" + val sqlProjects@Seq(catalyst, sql, hive, hiveThriftServer, sparkThriftServer, tokenProviderKafka010, sqlKafka010, avro) = Seq( + "catalyst", "sql", "hive", "hive-thriftserver", "thriftserver", "token-provider-kafka-0-10", "sql-kafka-0-10", "avro" ).map(ProjectRef(buildLocation, _)) val streamingProjects@Seq(streaming, streamingKafka010) = @@ -335,7 +335,7 @@ object SparkBuild extends PomBuild { val mimaProjects = allProjects.filterNot { x => Seq( - spark, hive, hiveThriftServer, catalyst, repl, networkCommon, networkShuffle, networkYarn, + spark, hive, hiveThriftServer, sparkThriftServer, catalyst, repl, networkCommon, networkShuffle, networkYarn, unsafe, tags, tokenProviderKafka010, sqlKafka010, kvstore, avro, graph, graphApi, cypher ).contains(x) } diff --git a/sbin/start-spark-thriftserver.sh b/sbin/start-spark-thriftserver.sh new file mode 100755 index 000000000000..e0dff53e43e6 --- /dev/null +++ b/sbin/start-spark-thriftserver.sh @@ -0,0 +1,60 @@ +#!/usr/bin/env bash + +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# Shell script for starting the Spark SQL Thrift server + +# Enter posix mode for bash +set -o posix + +if [ -z "${SPARK_HOME}" ]; then + export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi + +# NOTE: This exact class name is matched downstream by SparkSubmit. +# Any changes need to be reflected there. +CLASS="org.apache.spark.sql.thriftserver.SparkThriftServer2" + +function usage { + echo "Usage: ./sbin/start-spark-thriftserver [options] [thrift server options]" + pattern="usage" + pattern+="\|Spark assembly has been built with Hive" + pattern+="\|NOTE: SPARK_PREPEND_CLASSES is set" + pattern+="\|Spark Command: " + pattern+="\|=======" + pattern+="\|--help" + pattern+="\|Using Spark's default log4j profile:" + pattern+="\|^log4j:" + pattern+="\|Started daemon with process name" + pattern+="\|Registered signal handler for" + + "${SPARK_HOME}"/bin/spark-submit --help 2>&1 | grep -v Usage 1>&2 + echo + echo "Thrift server options:" + "${SPARK_HOME}"/bin/spark-class $CLASS --help 2>&1 | grep -v "$pattern" 1>&2 +} + +if [[ "$@" = *--help ]] || [[ "$@" = *-h ]]; then + usage + exit 1 +fi + +export SUBMIT_USAGE_FUNCTION=usage + +exec "${SPARK_HOME}"/sbin/spark-daemon.sh submit $CLASS 1 --name "Thrift JDBC/ODBC Server" "$@" diff --git a/sbin/stop-spark-thriftserver.sh b/sbin/stop-spark-thriftserver.sh new file mode 100755 index 000000000000..294cd6de3dd8 --- /dev/null +++ b/sbin/stop-spark-thriftserver.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Stops the thrift server on the machine this script is executed on. + +if [ -z "${SPARK_HOME}" ]; then + export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)" +fi + +"${SPARK_HOME}/sbin"/spark-daemon.sh stop org.apache.spark.sql.thriftserver.SparkThriftServer2 1 From f2b534616a2ab3bed28176b11a4dd181c7113f31 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 18:22:38 +0800 Subject: [PATCH 22/55] add UT class --- .../apache/spark/sql/hive/test/TestHive.scala | 2 +- .../sql/thriftserver/SparkThriftServer2.scala | 2 +- .../src/test/resources/TestUDTF.jar | Bin 0 -> 1328 bytes .../test/resources/data/files/small_kv.txt | 5 + .../data/files/small_kv_with_null.txt | 10 + ...HiveMetastoreLazyInitializationSuite.scala | 71 + .../spark/sql/thriftserver/CliSuite.scala | 396 ++++++ .../HiveCliSessionStateSuite.scala | 64 + .../HiveThriftServer2Suites.scala | 1203 +++++++++++++++++ .../thriftserver/JdbcConnectionUriSuite.scala | 70 + .../SparkMetadataOperationSuite.scala | 250 ++++ ...arkThriftServerProtocolVersionsSuite.scala | 323 +++++ .../ThriftServerQueryTestSuite.scala | 388 ++++++ .../sql/thriftserver/UISeleniumSuite.scala | 106 ++ 14 files changed, 2888 insertions(+), 2 deletions(-) create mode 100644 sql/thriftserver/src/test/resources/TestUDTF.jar create mode 100644 sql/thriftserver/src/test/resources/data/files/small_kv.txt create mode 100644 sql/thriftserver/src/test/resources/data/files/small_kv_with_null.txt create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/HiveMetastoreLazyInitializationSuite.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/CliSuite.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveCliSessionStateSuite.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala create mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala index 5fceab3105e8..fd85cadc4f24 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala @@ -648,7 +648,7 @@ private[sql] class TestHiveSessionStateBuilder( override protected def newBuilder: NewBuilder = new TestHiveSessionStateBuilder(_, _) } -private[hive] object HiveTestJars { +object HiveTestJars { private val repository = SQLConf.ADDITIONAL_REMOTE_REPOSITORIES.defaultValueString.split(",")(0) private val hiveTestJarsDir = Utils.createTempDir() diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala index a756f8dcf33b..fcd271f10996 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala @@ -41,7 +41,7 @@ import org.apache.spark.util.{ShutdownHookManager, Utils} * The main entry point for the Spark SQL port of HiveServer2. Starts up a `SparkSQLContext` and a * `HiveThriftServer2` thrift server. */ -private[thriftserver] object SparkThriftServer2 extends Logging { +object SparkThriftServer2 extends Logging { var uiTab: Option[ThriftServerTab] = None var listener: SparkThriftServerListener = _ diff --git a/sql/thriftserver/src/test/resources/TestUDTF.jar b/sql/thriftserver/src/test/resources/TestUDTF.jar new file mode 100644 index 0000000000000000000000000000000000000000..514f2d5d26fd358ad5647e0e75edb8ce77b69e30 GIT binary patch literal 1328 zcmWIWW@Zs#;Nak3xSr7K#()Gk8CV#6T|*poJ^kGD|D9rBU}gyLX6FE@V1g9+ zP&U6PT|coPF*zeuzqlZ=C|kd{Fh@Tlvn*9VwIVgSv?Mb>Pv1Q?FSRH$In*V@%{jj` zuf#|%IVZ8WcxlK>KjA=;e|ow+J<2CuHJwts5Oyj+z|m2lF^e}kXqra-9v}VG4QH-I z3e+&hyZ7o`e8K!9;8^kPO%YMTk5r1!#h&{#_wB!5f8VM%C>{yDve5geZOQcoVzyjW zs{AWm4sj`IiIjvs-uI-|v|~|xYaioEfnb9b2_6TT+q@2c)9qham^b@gU-(}S?-_u{zB$yU{&~h%g<;U5!%kr`i_rG&( z1=D`Ixp}xt-d0_A?wzF4>zUi0YDp~H8)9C0?2p5AdFR)~+a_PDoF*OZbpMg&?Q^f9 zpRKzP`*6vT1$oc^%$hb^HO-n;rgQS&h#!-Fd7l5syZ%O3Q#+5>wT-+Fck$>h6k2#X zcLjSfwFen_YXhGm z^=`M1UD-x;p7>=k`xz!GhN&ekd9&Q?Yf0SWJ!;Oue2X$)dsxC;)*?8E^F7HIkJ4tmi@{)@8^X5ZB1KR^!8JazLNx?@F#6Qh=oqF?F^3mU?`(NA31m#>^_H^wjyAyleIZG~N zN3cs-gj`tdxtaav#WjMwmn?hLF23F(t;XrL$Fhh;j8kUuBZfwg5A03sEB^S1^O$#B zQ*zkSJH>jz!pVO5lRCTRbb9WZtQMslA1J9HGa0HDESi2z@s87s ze>SVae&s**JNU+?Q1kX**;A{PL(Yr;aEf<6t9WJW3-OqVd-SV#-d $line" + + // If we haven't found all expected answers and another expected answer comes up... + if (next < expectedAnswers.size && line.contains(expectedAnswers(next))) { + next += 1 + // If all expected answers have been found... + if (next == expectedAnswers.size) { + foundAllExpectedAnswers.trySuccess(()) + } + } else { + errorResponses.foreach { r => + if (line.contains(r)) { + foundAllExpectedAnswers.tryFailure( + new RuntimeException(s"Failed with error line '$line'")) + } + } + } + } + + val process = new ProcessBuilder(command: _*).start() + + val stdinWriter = new OutputStreamWriter(process.getOutputStream, StandardCharsets.UTF_8) + stdinWriter.write(queriesString) + stdinWriter.flush() + stdinWriter.close() + + new ProcessOutputCapturer(process.getInputStream, captureOutput("stdout")).start() + new ProcessOutputCapturer(process.getErrorStream, captureOutput("stderr")).start() + + try { + ThreadUtils.awaitResult(foundAllExpectedAnswers.future, timeout) + } catch { case cause: Throwable => + val message = + s""" + |======================= + |CliSuite failure output + |======================= + |Spark SQL CLI command line: ${command.mkString(" ")} + |Exception: $cause + |Executed query $next "${queries(next)}", + |But failed to capture expected output "${expectedAnswers(next)}" within $timeout. + | + |${buffer.mkString("\n")} + |=========================== + |End CliSuite failure output + |=========================== + """.stripMargin + logError(message, cause) + fail(message, cause) + } finally { + process.destroy() + } + } + + test("Simple commands") { + val dataFilePath = + Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") + + runCliWithin(3.minute)( + "CREATE TABLE hive_test(key INT, val STRING);" + -> "", + "SHOW TABLES;" + -> "hive_test", + s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE hive_test;" + -> "", + "CACHE TABLE hive_test;" + -> "", + "SELECT COUNT(*) FROM hive_test;" + -> "5", + "DROP TABLE hive_test;" + -> "" + ) + } + + test("Single command with -e") { + runCliWithin(2.minute, Seq("-e", "SHOW DATABASES;"))("" -> "") + } + + test("Single command with --database") { + runCliWithin(2.minute)( + "CREATE DATABASE hive_test_db;" + -> "", + "USE hive_test_db;" + -> "", + "CREATE TABLE hive_test(key INT, val STRING);" + -> "", + "SHOW TABLES;" + -> "hive_test" + ) + + runCliWithin(2.minute, Seq("--database", "hive_test_db", "-e", "SHOW TABLES;"))( + "" -> "hive_test" + ) + } + + test("Commands using SerDe provided in --jars") { + val jarFile = HiveTestJars.getHiveHcatalogCoreJar().getCanonicalPath + + val dataFilePath = + Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") + + runCliWithin(3.minute, Seq("--jars", s"$jarFile"))( + """CREATE TABLE t1(key string, val string) + |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'; + """.stripMargin + -> "", + "CREATE TABLE sourceTable (key INT, val STRING);" + -> "", + s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE sourceTable;" + -> "", + "INSERT INTO TABLE t1 SELECT key, val FROM sourceTable;" + -> "", + "SELECT collect_list(array(val)) FROM t1;" + -> """[["val_238"],["val_86"],["val_311"],["val_27"],["val_165"]]""", + "DROP TABLE t1;" + -> "", + "DROP TABLE sourceTable;" + -> "" + ) + } + + test("SPARK-29022: Commands using SerDe provided in --hive.aux.jars.path") { + val dataFilePath = + Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") + val hiveContribJar = HiveTestJars.getHiveHcatalogCoreJar().getCanonicalPath + runCliWithin( + 3.minute, + Seq("--conf", s"spark.hadoop.${ConfVars.HIVEAUXJARS}=$hiveContribJar"))( + """CREATE TABLE addJarWithHiveAux(key string, val string) + |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'; + """.stripMargin + -> "", + "CREATE TABLE sourceTableForWithHiveAux (key INT, val STRING);" + -> "", + s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE sourceTableForWithHiveAux;" + -> "", + "INSERT INTO TABLE addJarWithHiveAux SELECT key, val FROM sourceTableForWithHiveAux;" + -> "", + "SELECT collect_list(array(val)) FROM addJarWithHiveAux;" + -> """[["val_238"],["val_86"],["val_311"],["val_27"],["val_165"]]""", + "DROP TABLE addJarWithHiveAux;" + -> "", + "DROP TABLE sourceTableForWithHiveAux;" + -> "" + ) + } + + test("SPARK-11188 Analysis error reporting") { + runCliWithin(timeout = 2.minute, + errorResponses = Seq("AnalysisException"))( + "select * from nonexistent_table;" + -> "Error in query: Table or view not found: nonexistent_table;" + ) + } + + test("SPARK-11624 Spark SQL CLI should set sessionState only once") { + runCliWithin(2.minute, Seq("-e", "!echo \"This is a test for Spark-11624\";"))( + "" -> "This is a test for Spark-11624") + } + + test("list jars") { + val jarFile = Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar") + runCliWithin(2.minute)( + s"ADD JAR $jarFile;" -> "", + s"LIST JARS;" -> "TestUDTF.jar" + ) + } + + test("list jar ") { + val jarFile = Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar") + runCliWithin(2.minute)( + s"ADD JAR $jarFile;" -> "", + s"List JAR $jarFile;" -> "TestUDTF.jar" + ) + } + + test("list files") { + val dataFilePath = Thread.currentThread(). + getContextClassLoader.getResource("data/files/small_kv.txt") + runCliWithin(2.minute)( + s"ADD FILE $dataFilePath;" -> "", + s"LIST FILES;" -> "small_kv.txt" + ) + } + + test("list file ") { + val dataFilePath = Thread.currentThread(). + getContextClassLoader.getResource("data/files/small_kv.txt") + runCliWithin(2.minute)( + s"ADD FILE $dataFilePath;" -> "", + s"LIST FILE $dataFilePath;" -> "small_kv.txt" + ) + } + + test("apply hiveconf from cli command") { + runCliWithin(2.minute)( + "SET conf1;" -> "conftest", + "SET conf2;" -> "1", + "SET conf3=${hiveconf:conf1};" -> "conftest", + "SET conf3;" -> "conftest" + ) + } + + test("SPARK-21451: spark.sql.warehouse.dir should respect options in --hiveconf") { + runCliWithin(1.minute)("set spark.sql.warehouse.dir;" -> warehousePath.getAbsolutePath) + } + + test("SPARK-21451: Apply spark.hadoop.* configurations") { + val tmpDir = Utils.createTempDir(namePrefix = "SPARK-21451") + runCliWithin( + 1.minute, + Seq("--conf", s"spark.hadoop.${ConfVars.METASTOREWAREHOUSE}=$tmpDir"))( + "set spark.sql.warehouse.dir;" -> tmpDir.getAbsolutePath) + tmpDir.delete() + } + + test("Support hive.aux.jars.path") { + val hiveContribJar = HiveTestJars.getHiveContribJar().getCanonicalPath + runCliWithin( + 1.minute, + Seq("--conf", s"spark.hadoop.${ConfVars.HIVEAUXJARS}=$hiveContribJar"))( + "CREATE TEMPORARY FUNCTION example_format AS " + + "'org.apache.hadoop.hive.contrib.udf.example.UDFExampleFormat';" -> "", + "SELECT example_format('%o', 93);" -> "135" + ) + } + + test("SPARK-28840 test --jars command") { + val jarFile = new File("../../sql/hive/src/test/resources/SPARK-21101-1.0.jar").getCanonicalPath + runCliWithin( + 1.minute, + Seq("--jars", s"$jarFile"))( + "CREATE TEMPORARY FUNCTION testjar AS" + + " 'org.apache.spark.sql.hive.execution.UDTFStack';" -> "", + "SELECT testjar(1,'TEST-SPARK-TEST-jar', 28840);" -> "TEST-SPARK-TEST-jar\t28840" + ) + } + + test("SPARK-28840 test --jars and hive.aux.jars.path command") { + val jarFile = new File("../../sql/hive/src/test/resources/SPARK-21101-1.0.jar").getCanonicalPath + val hiveContribJar = HiveTestJars.getHiveContribJar().getCanonicalPath + runCliWithin( + 1.minute, + Seq("--jars", s"$jarFile", "--conf", + s"spark.hadoop.${ConfVars.HIVEAUXJARS}=$hiveContribJar"))( + "CREATE TEMPORARY FUNCTION testjar AS" + + " 'org.apache.spark.sql.hive.execution.UDTFStack';" -> "", + "SELECT testjar(1,'TEST-SPARK-TEST-jar', 28840);" -> "TEST-SPARK-TEST-jar\t28840", + "CREATE TEMPORARY FUNCTION example_max AS " + + "'org.apache.hadoop.hive.contrib.udaf.example.UDAFExampleMax';" -> "", + "SELECT concat_ws(',', 'First', example_max(1234321), 'Third');" -> "First,1234321,Third" + ) + } + + test("SPARK-29022 Commands using SerDe provided in ADD JAR sql") { + val dataFilePath = + Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") + val hiveContribJar = HiveTestJars.getHiveHcatalogCoreJar().getCanonicalPath + runCliWithin( + 3.minute)( + s"ADD JAR ${hiveContribJar};" -> "", + """CREATE TABLE addJarWithSQL(key string, val string) + |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'; + """.stripMargin + -> "", + "CREATE TABLE sourceTableForWithSQL(key INT, val STRING);" + -> "", + s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE sourceTableForWithSQL;" + -> "", + "INSERT INTO TABLE addJarWithSQL SELECT key, val FROM sourceTableForWithSQL;" + -> "", + "SELECT collect_list(array(val)) FROM addJarWithSQL;" + -> """[["val_238"],["val_86"],["val_311"],["val_27"],["val_165"]]""", + "DROP TABLE addJarWithSQL;" + -> "", + "DROP TABLE sourceTableForWithSQL;" + -> "" + ) + } + + test("SPARK-26321 Should not split semicolon within quoted string literals") { + runCliWithin(3.minute)( + """select 'Test1', "^;^";""" -> "Test1\t^;^", + """select 'Test2', "\";";""" -> "Test2\t\";", + """select 'Test3', "\';";""" -> "Test3\t';", + "select concat('Test4', ';');" -> "Test4;" + ) + } +} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveCliSessionStateSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveCliSessionStateSuite.scala new file mode 100644 index 000000000000..d1dc8d8c20c0 --- /dev/null +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveCliSessionStateSuite.scala @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import org.apache.hadoop.hive.cli.CliSessionState +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.ql.session.SessionState + +import org.apache.spark.{SparkConf, SparkFunSuite} +import org.apache.spark.deploy.SparkHadoopUtil +import org.apache.spark.sql.hive.HiveUtils + +class HiveCliSessionStateSuite extends SparkFunSuite { + + def withSessionClear(f: () => Unit): Unit = { + try f() finally SessionState.detachSession() + } + + test("CliSessionState will be reused") { + withSessionClear { () => + val hiveConf = new HiveConf(classOf[SessionState]) + HiveUtils.newTemporaryConfiguration(useInMemoryDerby = false).foreach { + case (key, value) => hiveConf.set(key, value) + } + val sessionState: SessionState = new CliSessionState(hiveConf) + SessionState.start(sessionState) + val s1 = SessionState.get + val sparkConf = new SparkConf() + val hadoopConf = SparkHadoopUtil.get.newConfiguration(sparkConf) + val s2 = HiveUtils.newClientForMetadata(sparkConf, hadoopConf).getState + assert(s1 === s2) + assert(s2.isInstanceOf[CliSessionState]) + } + } + + test("SessionState will not be reused") { + withSessionClear { () => + val sparkConf = new SparkConf() + val hadoopConf = SparkHadoopUtil.get.newConfiguration(sparkConf) + HiveUtils.newTemporaryConfiguration(useInMemoryDerby = false).foreach { + case (key, value) => hadoopConf.set(key, value) + } + val hiveClient = HiveUtils.newClientForMetadata(sparkConf, hadoopConf) + val s1 = hiveClient.getState + val s2 = hiveClient.newSession().getState + assert(s1 !== s2) + } + } +} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala new file mode 100644 index 000000000000..2b9df67af0d5 --- /dev/null +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala @@ -0,0 +1,1203 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.io.{File, FilenameFilter} +import java.net.URL +import java.nio.charset.StandardCharsets +import java.sql.{Date, DriverManager, SQLException, Statement} +import java.util.{Locale, UUID} + +import scala.collection.JavaConverters._ +import scala.collection.mutable +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.{ExecutionContext, Future, Promise} +import scala.concurrent.duration._ +import scala.io.Source +import scala.util.{Random, Try} + +import com.google.common.io.Files +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hive.jdbc.HiveDriver +import org.apache.thrift.protocol.TBinaryProtocol +import org.apache.thrift.transport.TSocket +import org.scalatest.BeforeAndAfterAll +import org.apache.spark.{SparkException, SparkFunSuite} + +import org.apache.spark.internal.Logging +import org.apache.spark.sql.hive.HiveUtils +import org.apache.spark.sql.hive.test.HiveTestJars +import org.apache.spark.sql.internal.StaticSQLConf.HIVE_THRIFT_SERVER_SINGLESESSION +import org.apache.spark.sql.test.ProcessTestUtils.ProcessOutputCapturer +import org.apache.spark.sql.thriftserver.auth.PlainSaslHelper +import org.apache.spark.util.{ThreadUtils, Utils} + +object TestData { + def getTestDataFilePath(name: String): URL = { + Thread.currentThread().getContextClassLoader.getResource(s"data/files/$name") + } + + val smallKv = getTestDataFilePath("small_kv.txt") + val smallKvWithNull = getTestDataFilePath("small_kv_with_null.txt") +} + +class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { + override def mode: ServerMode.Value = ServerMode.binary + + private def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { + // Transport creation logic below mimics HiveConnection.createBinaryTransport + val rawTransport = new TSocket("localhost", serverPort) + val user = System.getProperty("user.name") + val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) + val protocol = new TBinaryProtocol(transport) + val client = new ThriftCLIServiceClient(new ThriftserverShimUtils.Client(protocol)) + + transport.open() + try f(client) finally transport.close() + } + + test("GetInfo Thrift API") { + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + + assertResult("Spark SQL", "Wrong GetInfo(CLI_DBMS_NAME) result") { + client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_NAME).getStringValue + } + + assertResult("Spark SQL", "Wrong GetInfo(CLI_SERVER_NAME) result") { + client.getInfo(sessionHandle, GetInfoType.CLI_SERVER_NAME).getStringValue + } + + assertResult(true, "Spark version shouldn't be \"Unknown\"") { + val version = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER).getStringValue + logInfo(s"Spark version: $version") + version != "Unknown" + } + } + } + + test("SPARK-16563 ThriftCLIService FetchResults repeat fetching result") { + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + + withJdbcStatement("test_16563") { statement => + val queries = Seq( + "CREATE TABLE test_16563(key INT, val STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_16563") + + queries.foreach(statement.execute) + val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] + val operationHandle = client.executeStatement( + sessionHandle, + "SELECT * FROM test_16563", + confOverlay) + + // Fetch result first time + assertResult(5, "Fetching result first time from next row") { + + val rows_next = client.fetchResults( + operationHandle, + FetchOrientation.FETCH_NEXT, + 1000, + FetchType.QUERY_OUTPUT) + + rows_next.numRows() + } + + // Fetch result second time from first row + assertResult(5, "Repeat fetching result from first row") { + + val rows_first = client.fetchResults( + operationHandle, + FetchOrientation.FETCH_FIRST, + 1000, + FetchType.QUERY_OUTPUT) + + rows_first.numRows() + } + } + } + } + + test("Support beeline --hiveconf and --hivevar") { + withJdbcStatement() { statement => + executeTest(hiveConfList) + executeTest(hiveVarList) + def executeTest(hiveList: String): Unit = { + hiveList.split(";").foreach{ m => + val kv = m.split("=") + val k = kv(0) + val v = kv(1) + val modValue = s"${v}_MOD_VALUE" + // select '${a}'; ---> avalue + val resultSet = statement.executeQuery(s"select '$${$k}'") + resultSet.next() + assert(resultSet.getString(1) === v) + statement.executeQuery(s"set $k=$modValue") + val modResultSet = statement.executeQuery(s"select '$${$k}'") + modResultSet.next() + assert(modResultSet.getString(1) === s"$modValue") + } + } + } + } + + test("JDBC query execution") { + withJdbcStatement("test") { statement => + val queries = Seq( + "SET spark.sql.shuffle.partitions=3", + "CREATE TABLE test(key INT, val STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test", + "CACHE TABLE test") + + queries.foreach(statement.execute) + + assertResult(5, "Row count mismatch") { + val resultSet = statement.executeQuery("SELECT COUNT(*) FROM test") + resultSet.next() + resultSet.getInt(1) + } + } + } + + test("Checks Hive version") { + withJdbcStatement() { statement => + val resultSet = statement.executeQuery("SET spark.sql.hive.version") + resultSet.next() + assert(resultSet.getString(1) === "spark.sql.hive.version") + assert(resultSet.getString(2) === HiveUtils.builtinHiveVersion) + } + } + + test("SPARK-3004 regression: result set containing NULL") { + withJdbcStatement("test_null") { statement => + val queries = Seq( + "CREATE TABLE test_null(key INT, val STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKvWithNull}' OVERWRITE INTO TABLE test_null") + + queries.foreach(statement.execute) + + val resultSet = statement.executeQuery("SELECT * FROM test_null WHERE key IS NULL") + + (0 until 5).foreach { _ => + resultSet.next() + assert(resultSet.getInt(1) === 0) + assert(resultSet.wasNull()) + } + + assert(!resultSet.next()) + } + } + + test("SPARK-4292 regression: result set iterator issue") { + withJdbcStatement("test_4292") { statement => + val queries = Seq( + "CREATE TABLE test_4292(key INT, val STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_4292") + + queries.foreach(statement.execute) + + val resultSet = statement.executeQuery("SELECT key FROM test_4292") + + Seq(238, 86, 311, 27, 165).foreach { key => + resultSet.next() + assert(resultSet.getInt(1) === key) + } + } + } + + test("SPARK-4309 regression: Date type support") { + withJdbcStatement("test_date") { statement => + val queries = Seq( + "CREATE TABLE test_date(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_date") + + queries.foreach(statement.execute) + + assertResult(Date.valueOf("2011-01-01")) { + val resultSet = statement.executeQuery( + "SELECT CAST('2011-01-01' as date) FROM test_date LIMIT 1") + resultSet.next() + resultSet.getDate(1) + } + } + } + + test("SPARK-4407 regression: Complex type support") { + withJdbcStatement("test_map") { statement => + val queries = Seq( + "CREATE TABLE test_map(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_map") + + queries.foreach(statement.execute) + + assertResult("""{238:"val_238"}""") { + val resultSet = statement.executeQuery("SELECT MAP(key, value) FROM test_map LIMIT 1") + resultSet.next() + resultSet.getString(1) + } + + assertResult("""["238","val_238"]""") { + val resultSet = statement.executeQuery( + "SELECT ARRAY(CAST(key AS STRING), value) FROM test_map LIMIT 1") + resultSet.next() + resultSet.getString(1) + } + } + } + + test("SPARK-12143 regression: Binary type support") { + withJdbcStatement("test_binary") { statement => + val queries = Seq( + "CREATE TABLE test_binary(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_binary") + + queries.foreach(statement.execute) + + val expected: Array[Byte] = "val_238".getBytes + assertResult(expected) { + val resultSet = statement.executeQuery( + "SELECT CAST(value as BINARY) FROM test_binary LIMIT 1") + resultSet.next() + resultSet.getObject(1) + } + } + } + + test("test multiple session") { + import org.apache.spark.sql.internal.SQLConf + var defaultV1: String = null + var defaultV2: String = null + var data: ArrayBuffer[Int] = null + + withMultipleConnectionJdbcStatement("test_map", "db1.test_map2")( + // create table + { statement => + + val queries = Seq( + "CREATE TABLE test_map(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_map", + "CACHE TABLE test_table AS SELECT key FROM test_map ORDER BY key DESC", + "CREATE DATABASE db1") + + queries.foreach(statement.execute) + + val plan = statement.executeQuery("explain select * from test_table") + plan.next() + plan.next() + assert(plan.getString(1).contains("Scan In-memory table `test_table`")) + + val rs1 = statement.executeQuery("SELECT key FROM test_table ORDER BY KEY DESC") + val buf1 = new collection.mutable.ArrayBuffer[Int]() + while (rs1.next()) { + buf1 += rs1.getInt(1) + } + rs1.close() + + val rs2 = statement.executeQuery("SELECT key FROM test_map ORDER BY KEY DESC") + val buf2 = new collection.mutable.ArrayBuffer[Int]() + while (rs2.next()) { + buf2 += rs2.getInt(1) + } + rs2.close() + + assert(buf1 === buf2) + + data = buf1 + }, + + // first session, we get the default value of the session status + { statement => + + val rs1 = statement.executeQuery(s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}") + rs1.next() + defaultV1 = rs1.getString(1) + assert(defaultV1 != "200") + rs1.close() + + val rs2 = statement.executeQuery("SET hive.cli.print.header") + rs2.next() + + defaultV2 = rs2.getString(1) + assert(defaultV1 != "true") + rs2.close() + }, + + // second session, we update the session status + { statement => + + val queries = Seq( + s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}=291", + "SET hive.cli.print.header=true" + ) + + queries.map(statement.execute) + val rs1 = statement.executeQuery(s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}") + rs1.next() + assert("spark.sql.shuffle.partitions" === rs1.getString(1)) + assert("291" === rs1.getString(2)) + rs1.close() + + val rs2 = statement.executeQuery("SET hive.cli.print.header") + rs2.next() + assert("hive.cli.print.header" === rs2.getString(1)) + assert("true" === rs2.getString(2)) + rs2.close() + }, + + // third session, we get the latest session status, supposed to be the + // default value + { statement => + + val rs1 = statement.executeQuery(s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}") + rs1.next() + assert(defaultV1 === rs1.getString(1)) + rs1.close() + + val rs2 = statement.executeQuery("SET hive.cli.print.header") + rs2.next() + assert(defaultV2 === rs2.getString(1)) + rs2.close() + }, + + // try to access the cached data in another session + { statement => + + // Cached temporary table can't be accessed by other sessions + intercept[SQLException] { + statement.executeQuery("SELECT key FROM test_table ORDER BY KEY DESC") + } + + val plan = statement.executeQuery("explain select key from test_map ORDER BY key DESC") + plan.next() + plan.next() + assert(plan.getString(1).contains("Scan In-memory table `test_table`")) + + val rs = statement.executeQuery("SELECT key FROM test_map ORDER BY KEY DESC") + val buf = new collection.mutable.ArrayBuffer[Int]() + while (rs.next()) { + buf += rs.getInt(1) + } + rs.close() + assert(buf === data) + }, + + // switch another database + { statement => + statement.execute("USE db1") + + // there is no test_map table in db1 + intercept[SQLException] { + statement.executeQuery("SELECT key FROM test_map ORDER BY KEY DESC") + } + + statement.execute("CREATE TABLE test_map2(key INT, value STRING)") + }, + + // access default database + { statement => + + // current database should still be `default` + intercept[SQLException] { + statement.executeQuery("SELECT key FROM test_map2") + } + + statement.execute("USE db1") + // access test_map2 + statement.executeQuery("SELECT key from test_map2") + } + ) + } + + // This test often hangs and then times out, leaving the hanging processes. + // Let's ignore it and improve the test. + ignore("test jdbc cancel") { + withJdbcStatement("test_map") { statement => + val queries = Seq( + "CREATE TABLE test_map(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_map") + + queries.foreach(statement.execute) + implicit val ec = ExecutionContext.fromExecutorService( + ThreadUtils.newDaemonSingleThreadExecutor("test-jdbc-cancel")) + try { + // Start a very-long-running query that will take hours to finish, then cancel it in order + // to demonstrate that cancellation works. + val f = Future { + statement.executeQuery( + "SELECT COUNT(*) FROM test_map " + + List.fill(10)("join test_map").mkString(" ")) + } + // Note that this is slightly race-prone: if the cancel is issued before the statement + // begins executing then we'll fail with a timeout. As a result, this fixed delay is set + // slightly more conservatively than may be strictly necessary. + Thread.sleep(1000) + statement.cancel() + val e = intercept[SparkException] { + ThreadUtils.awaitResult(f, 3.minute) + }.getCause + assert(e.isInstanceOf[SQLException]) + assert(e.getMessage.contains("cancelled")) + + // Cancellation is a no-op if spark.sql.hive.thriftServer.async=false + statement.executeQuery("SET spark.sql.hive.thriftServer.async=false") + try { + val sf = Future { + statement.executeQuery( + "SELECT COUNT(*) FROM test_map " + + List.fill(4)("join test_map").mkString(" ") + ) + } + // Similarly, this is also slightly race-prone on fast machines where the query above + // might race and complete before we issue the cancel. + Thread.sleep(1000) + statement.cancel() + val rs1 = ThreadUtils.awaitResult(sf, 3.minute) + rs1.next() + assert(rs1.getInt(1) === math.pow(5, 5)) + rs1.close() + + val rs2 = statement.executeQuery("SELECT COUNT(*) FROM test_map") + rs2.next() + assert(rs2.getInt(1) === 5) + rs2.close() + } finally { + statement.executeQuery("SET spark.sql.hive.thriftServer.async=true") + } + } finally { + ec.shutdownNow() + } + } + } + + test("test add jar") { + withMultipleConnectionJdbcStatement("smallKV", "addJar")( + { + statement => + val jarFile = HiveTestJars.getHiveHcatalogCoreJar().getCanonicalPath + + statement.executeQuery(s"ADD JAR $jarFile") + }, + + { + statement => + val queries = Seq( + "CREATE TABLE smallKV(key INT, val STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE smallKV", + """CREATE TABLE addJar(key string) + |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe' + """.stripMargin) + + queries.foreach(statement.execute) + + statement.executeQuery( + """ + |INSERT INTO TABLE addJar SELECT 'k1' as key FROM smallKV limit 1 + """.stripMargin) + + val actualResult = + statement.executeQuery("SELECT key FROM addJar") + val actualResultBuffer = new collection.mutable.ArrayBuffer[String]() + while (actualResult.next()) { + actualResultBuffer += actualResult.getString(1) + } + actualResult.close() + + val expectedResult = + statement.executeQuery("SELECT 'k1'") + val expectedResultBuffer = new collection.mutable.ArrayBuffer[String]() + while (expectedResult.next()) { + expectedResultBuffer += expectedResult.getString(1) + } + expectedResult.close() + + assert(expectedResultBuffer === actualResultBuffer) + } + ) + } + + test("Checks Hive version via SET -v") { + withJdbcStatement() { statement => + val resultSet = statement.executeQuery("SET -v") + + val conf = mutable.Map.empty[String, String] + while (resultSet.next()) { + conf += resultSet.getString(1) -> resultSet.getString(2) + } + + if (HiveUtils.isHive23) { + assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("2.3.6")) + } else { + assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("1.2.1")) + } + } + } + + test("Checks Hive version via SET") { + withJdbcStatement() { statement => + val resultSet = statement.executeQuery("SET") + + val conf = mutable.Map.empty[String, String] + while (resultSet.next()) { + conf += resultSet.getString(1) -> resultSet.getString(2) + } + + if (HiveUtils.isHive23) { + assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("2.3.6")) + } else { + assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("1.2.1")) + } + } + } + + test("SPARK-11595 ADD JAR with input path having URL scheme") { + withJdbcStatement("test_udtf") { statement => + try { + val jarPath = "../hive/src/test/resources/TestUDTF.jar" + val jarURL = s"file://${System.getProperty("user.dir")}/$jarPath" + + Seq( + s"ADD JAR $jarURL", + s"""CREATE TEMPORARY FUNCTION udtf_count2 + |AS 'org.apache.spark.sql.hive.execution.GenericUDTFCount2' + """.stripMargin + ).foreach(statement.execute) + + val rs1 = statement.executeQuery("DESCRIBE FUNCTION udtf_count2") + + assert(rs1.next()) + assert(rs1.getString(1) === "Function: udtf_count2") + + assert(rs1.next()) + assertResult("Class: org.apache.spark.sql.hive.execution.GenericUDTFCount2") { + rs1.getString(1) + } + + assert(rs1.next()) + assert(rs1.getString(1) === "Usage: N/A.") + + val dataPath = "../hive/src/test/resources/data/files/kv1.txt" + + Seq( + "CREATE TABLE test_udtf(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '$dataPath' OVERWRITE INTO TABLE test_udtf" + ).foreach(statement.execute) + + val rs2 = statement.executeQuery( + "SELECT key, cc FROM test_udtf LATERAL VIEW udtf_count2(value) dd AS cc") + + assert(rs2.next()) + assert(rs2.getInt(1) === 97) + assert(rs2.getInt(2) === 500) + + assert(rs2.next()) + assert(rs2.getInt(1) === 97) + assert(rs2.getInt(2) === 500) + } finally { + statement.executeQuery("DROP TEMPORARY FUNCTION udtf_count2") + } + } + } + + test("SPARK-11043 check operation log root directory") { + val expectedLine = + "Operation log root directory is created: " + operationLogPath.getAbsoluteFile + val bufferSrc = Source.fromFile(logPath) + Utils.tryWithSafeFinally { + assert(bufferSrc.getLines().exists(_.contains(expectedLine))) + } { + bufferSrc.close() + } + } + + test("SPARK-23547 Cleanup the .pipeout file when the Hive Session closed") { + def pipeoutFileList(sessionID: UUID): Array[File] = { + lScratchDir.listFiles(new FilenameFilter { + override def accept(dir: File, name: String): Boolean = { + name.startsWith(sessionID.toString) && name.endsWith(".pipeout") + } + }) + } + + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + val sessionID = sessionHandle.getSessionId + + if (HiveUtils.isHive23) { + assert(pipeoutFileList(sessionID).length == 2) + } else { + assert(pipeoutFileList(sessionID).length == 1) + } + + client.closeSession(sessionHandle) + + assert(pipeoutFileList(sessionID).length == 0) + } + } + + test("SPARK-24829 Checks cast as float") { + withJdbcStatement() { statement => + val resultSet = statement.executeQuery("SELECT CAST('4.56' AS FLOAT)") + resultSet.next() + assert(resultSet.getString(1) === "4.56") + } + } + + test("SPARK-28463: Thriftserver throws BigDecimal incompatible with HiveDecimal") { + withJdbcStatement() { statement => + val rs = statement.executeQuery("SELECT CAST(1 AS decimal(38, 18))") + assert(rs.next()) + assert(rs.getBigDecimal(1) === new java.math.BigDecimal("1.000000000000000000")) + } + } + + test("Support interval type") { + withJdbcStatement() { statement => + val rs = statement.executeQuery("SELECT interval 3 months 1 hours") + assert(rs.next()) + assert(rs.getString(1) === "interval 3 months 1 hours") + } + // Invalid interval value + withJdbcStatement() { statement => + val e = intercept[SQLException] { + statement.executeQuery("SELECT interval 3 months 1 hou") + } + assert(e.getMessage.contains("org.apache.spark.sql.catalyst.parser.ParseException")) + } + } + + test("ThriftCLIService FetchResults FETCH_FIRST, FETCH_NEXT, FETCH_PRIOR") { + def checkResult(rows: RowSet, start: Long, end: Long): Unit = { + assert(rows.getStartOffset() == start) + assert(rows.numRows() == end - start) + rows.iterator.asScala.zip((start until end).iterator).foreach { case (row, v) => + assert(row(0).asInstanceOf[Long] === v) + } + } + + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + + val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] + val operationHandle = client.executeStatement( + sessionHandle, + "SELECT * FROM range(10)", + confOverlay) // 10 rows result with sequence 0, 1, 2, ..., 9 + var rows: RowSet = null + + // Fetch 5 rows with FETCH_NEXT + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 5) // fetched [0, 5) + + // Fetch another 2 rows with FETCH_NEXT + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) + checkResult(rows, 5, 7) // fetched [5, 7) + + // FETCH_PRIOR 3 rows + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) + checkResult(rows, 2, 5) // fetched [2, 5) + + // FETCH_PRIOR again will scroll back to 0, and then the returned result + // may overlap the results of previous FETCH_PRIOR + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 3) // fetched [0, 3) + + // FETCH_PRIOR again will stay at 0 + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 4, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 4) // fetched [0, 4) + + // FETCH_NEXT will continue moving forward from offset 4 + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 10, FetchType.QUERY_OUTPUT) + checkResult(rows, 4, 10) // fetched [4, 10) until the end of results + + // FETCH_NEXT is at end of results + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + + // FETCH_NEXT is at end of results again + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) + checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + + // FETCH_PRIOR 1 rows yet again + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 1, FetchType.QUERY_OUTPUT) + checkResult(rows, 9, 10) // fetched [9, 10) + + // FETCH_NEXT will return 0 yet again + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + + // FETCH_FIRST results from first row + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_FIRST, 3, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 3) // fetch [0, 3) + + // Fetch till the end rows with FETCH_NEXT" + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 1000, FetchType.QUERY_OUTPUT) + checkResult(rows, 3, 10) // fetched [3, 10) + + client.closeOperation(operationHandle) + client.closeSession(sessionHandle) + } + } +} + +class SingleSessionSuite extends SparkThriftJdbcTest { + override def mode: ServerMode.Value = ServerMode.binary + + override protected def extraConf: Seq[String] = + s"--conf ${HIVE_THRIFT_SERVER_SINGLESESSION.key}=true" :: Nil + + test("share the temporary functions across JDBC connections") { + withMultipleConnectionJdbcStatement()( + { statement => + val jarPath = "../hive/src/test/resources/TestUDTF.jar" + val jarURL = s"file://${System.getProperty("user.dir")}/$jarPath" + + // Configurations and temporary functions added in this session should be visible to all + // the other sessions. + Seq( + "SET foo=bar", + s"ADD JAR $jarURL", + s"""CREATE TEMPORARY FUNCTION udtf_count2 + |AS 'org.apache.spark.sql.hive.execution.GenericUDTFCount2' + """.stripMargin + ).foreach(statement.execute) + }, + + { statement => + try { + val rs1 = statement.executeQuery("SET foo") + + assert(rs1.next()) + assert(rs1.getString(1) === "foo") + assert(rs1.getString(2) === "bar") + + val rs2 = statement.executeQuery("DESCRIBE FUNCTION udtf_count2") + + assert(rs2.next()) + assert(rs2.getString(1) === "Function: udtf_count2") + + assert(rs2.next()) + assertResult("Class: org.apache.spark.sql.hive.execution.GenericUDTFCount2") { + rs2.getString(1) + } + + assert(rs2.next()) + assert(rs2.getString(1) === "Usage: N/A.") + } finally { + statement.executeQuery("DROP TEMPORARY FUNCTION udtf_count2") + } + } + ) + } + + test("unable to changing spark.sql.hive.thriftServer.singleSession using JDBC connections") { + withJdbcStatement() { statement => + // JDBC connections are not able to set the conf spark.sql.hive.thriftServer.singleSession + val e = intercept[SQLException] { + statement.executeQuery("SET spark.sql.hive.thriftServer.singleSession=false") + }.getMessage + assert(e.contains( + "Cannot modify the value of a static config: spark.sql.hive.thriftServer.singleSession")) + } + } + + test("share the current database and temporary tables across JDBC connections") { + withMultipleConnectionJdbcStatement()( + { statement => + statement.execute("CREATE DATABASE IF NOT EXISTS db1") + }, + + { statement => + val rs1 = statement.executeQuery("SELECT current_database()") + assert(rs1.next()) + assert(rs1.getString(1) === "default") + + statement.execute("USE db1") + + val rs2 = statement.executeQuery("SELECT current_database()") + assert(rs2.next()) + assert(rs2.getString(1) === "db1") + + statement.execute("CREATE TEMP VIEW tempView AS SELECT 123") + }, + + { statement => + // the current database is set to db1 by another JDBC connection. + val rs1 = statement.executeQuery("SELECT current_database()") + assert(rs1.next()) + assert(rs1.getString(1) === "db1") + + val rs2 = statement.executeQuery("SELECT * from tempView") + assert(rs2.next()) + assert(rs2.getString(1) === "123") + + statement.execute("USE default") + statement.execute("DROP VIEW tempView") + statement.execute("DROP DATABASE db1 CASCADE") + } + ) + } +} + +class SparkThriftHttpServerSuite extends SparkThriftJdbcTest { + override def mode: ServerMode.Value = ServerMode.http + + test("JDBC query execution") { + withJdbcStatement("test") { statement => + val queries = Seq( + "SET spark.sql.shuffle.partitions=3", + "CREATE TABLE test(key INT, val STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test", + "CACHE TABLE test") + + queries.foreach(statement.execute) + + assertResult(5, "Row count mismatch") { + val resultSet = statement.executeQuery("SELECT COUNT(*) FROM test") + resultSet.next() + resultSet.getInt(1) + } + } + } + + test("Checks Hive version") { + withJdbcStatement() { statement => + val resultSet = statement.executeQuery("SET spark.sql.hive.version") + resultSet.next() + assert(resultSet.getString(1) === "spark.sql.hive.version") + assert(resultSet.getString(2) === HiveUtils.builtinHiveVersion) + } + } + + test("SPARK-24829 Checks cast as float") { + withJdbcStatement() { statement => + val resultSet = statement.executeQuery("SELECT CAST('4.56' AS FLOAT)") + resultSet.next() + assert(resultSet.getString(1) === "4.56") + } + } +} + +object ServerMode extends Enumeration { + val binary, http = Value +} + +abstract class SparkThriftJdbcTest extends SparkThriftServer2Test { + Utils.classForName(classOf[HiveDriver].getCanonicalName) + + private def jdbcUri = if (mode == ServerMode.http) { + s"""jdbc:hive2://localhost:$serverPort/ + |default? + |hive.server2.transport.mode=http; + |hive.server2.thrift.http.path=cliservice; + |${hiveConfList}#${hiveVarList} + """.stripMargin.split("\n").mkString.trim + } else { + s"jdbc:hive2://localhost:$serverPort/?${hiveConfList}#${hiveVarList}" + } + + def withMultipleConnectionJdbcStatement(tableNames: String*)(fs: (Statement => Unit)*): Unit = { + val user = System.getProperty("user.name") + val connections = fs.map { _ => DriverManager.getConnection(jdbcUri, user, "") } + val statements = connections.map(_.createStatement()) + + try { + statements.zip(fs).foreach { case (s, f) => f(s) } + } finally { + tableNames.foreach { name => + // TODO: Need a better way to drop the view. + if (name.toUpperCase(Locale.ROOT).startsWith("VIEW")) { + statements(0).execute(s"DROP VIEW IF EXISTS $name") + } else { + statements(0).execute(s"DROP TABLE IF EXISTS $name") + } + } + statements.foreach(_.close()) + connections.foreach(_.close()) + } + } + + def withDatabase(dbNames: String*)(fs: (Statement => Unit)*): Unit = { + val user = System.getProperty("user.name") + val connections = fs.map { _ => DriverManager.getConnection(jdbcUri, user, "") } + val statements = connections.map(_.createStatement()) + + try { + statements.zip(fs).foreach { case (s, f) => f(s) } + } finally { + dbNames.foreach { name => + statements(0).execute(s"DROP DATABASE IF EXISTS $name") + } + statements.foreach(_.close()) + connections.foreach(_.close()) + } + } + + def withJdbcStatement(tableNames: String*)(f: Statement => Unit): Unit = { + withMultipleConnectionJdbcStatement(tableNames: _*)(f) + } +} + +abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterAll with Logging { + def mode: ServerMode.Value + + private val CLASS_NAME = SparkThriftServer2.getClass.getCanonicalName.stripSuffix("$") + private val LOG_FILE_MARK = s"starting $CLASS_NAME, logging to " + + protected val startScript = + "../../sbin/start-spark-thriftserver.sh".split("/").mkString(File.separator) + protected val stopScript = + "../../sbin/stop-spark-thriftserver.sh".split("/").mkString(File.separator) + + private var listeningPort: Int = _ + protected def serverPort: Int = listeningPort + + protected val hiveConfList = "a=avalue;b=bvalue" + protected val hiveVarList = "c=cvalue;d=dvalue" + protected def user = System.getProperty("user.name") + + protected var warehousePath: File = _ + protected var metastorePath: File = _ + protected def metastoreJdbcUri = s"jdbc:derby:;databaseName=$metastorePath;create=true" + + private val pidDir: File = Utils.createTempDir(namePrefix = "thriftserver-pid") + protected var logPath: File = _ + protected var operationLogPath: File = _ + protected var lScratchDir: File = _ + private var logTailingProcess: Process = _ + private var diagnosisBuffer: ArrayBuffer[String] = ArrayBuffer.empty[String] + + protected def extraConf: Seq[String] = Nil + + protected def serverStartCommand(port: Int) = { + val portConf = if (mode == ServerMode.binary) { + ConfVars.HIVE_SERVER2_THRIFT_PORT + } else { + ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT + } + + val driverClassPath = { + // Writes a temporary log4j.properties and prepend it to driver classpath, so that it + // overrides all other potential log4j configurations contained in other dependency jar files. + val tempLog4jConf = Utils.createTempDir().getCanonicalPath + + Files.write( + """log4j.rootCategory=DEBUG, console + |log4j.appender.console=org.apache.log4j.ConsoleAppender + |log4j.appender.console.target=System.err + |log4j.appender.console.layout=org.apache.log4j.PatternLayout + |log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n + """.stripMargin, + new File(s"$tempLog4jConf/log4j.properties"), + StandardCharsets.UTF_8) + + tempLog4jConf + } + + s"""$startScript + | --master local + | --hiveconf ${ConfVars.METASTORECONNECTURLKEY}=$metastoreJdbcUri + | --hiveconf ${ConfVars.METASTOREWAREHOUSE}=$warehousePath + | --hiveconf ${ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST}=localhost + | --hiveconf ${ConfVars.HIVE_SERVER2_TRANSPORT_MODE}=$mode + | --hiveconf ${ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LOG_LOCATION}=$operationLogPath + | --hiveconf ${ConfVars.LOCALSCRATCHDIR}=$lScratchDir + | --hiveconf $portConf=$port + | --driver-class-path $driverClassPath + | --driver-java-options -Dlog4j.debug + | --conf spark.ui.enabled=false + | ${extraConf.mkString("\n")} + """.stripMargin.split("\\s+").toSeq + } + + /** + * String to scan for when looking for the thrift binary endpoint running. + * This can change across Hive versions. + */ + val THRIFT_BINARY_SERVICE_LIVE = "Starting ThriftBinaryCLIService on port" + + /** + * String to scan for when looking for the thrift HTTP endpoint running. + * This can change across Hive versions. + */ + val THRIFT_HTTP_SERVICE_LIVE = "Started ThriftHttpCLIService in http" + + val SERVER_STARTUP_TIMEOUT = 3.minutes + + private def startThriftServer(port: Int, attempt: Int) = { + warehousePath = Utils.createTempDir() + warehousePath.delete() + metastorePath = Utils.createTempDir() + metastorePath.delete() + operationLogPath = Utils.createTempDir() + operationLogPath.delete() + lScratchDir = Utils.createTempDir() + lScratchDir.delete() + logPath = null + logTailingProcess = null + + val command = serverStartCommand(port) + + diagnosisBuffer ++= + s""" + |### Attempt $attempt ### + |SparkThriftServer2 command line: $command + |Listening port: $port + |System user: $user + """.stripMargin.split("\n") + + logInfo(s"Trying to start SparkThriftServer2: port=$port, mode=$mode, attempt=$attempt") + + logPath = { + val lines = Utils.executeAndGetOutput( + command = command, + extraEnvironment = Map( + // Disables SPARK_TESTING to exclude log4j.properties in test directories. + "SPARK_TESTING" -> "0", + // But set SPARK_SQL_TESTING to make spark-class happy. + "SPARK_SQL_TESTING" -> "1", + // Points SPARK_PID_DIR to SPARK_HOME, otherwise only 1 Thrift server instance can be + // started at a time, which is not Jenkins friendly. + "SPARK_PID_DIR" -> pidDir.getCanonicalPath), + redirectStderr = true) + + logInfo(s"COMMAND: $command") + logInfo(s"OUTPUT: $lines") + lines.split("\n").collectFirst { + case line if line.contains(LOG_FILE_MARK) => new File(line.drop(LOG_FILE_MARK.length)) + }.getOrElse { + throw new RuntimeException("Failed to find SparkThriftServer2 log file.") + } + } + + val serverStarted = Promise[Unit]() + + // Ensures that the following "tail" command won't fail. + logPath.createNewFile() + val successLines = Seq(THRIFT_BINARY_SERVICE_LIVE, THRIFT_HTTP_SERVICE_LIVE) + + logTailingProcess = { + val command = s"/usr/bin/env tail -n +0 -f ${logPath.getCanonicalPath}".split(" ") + // Using "-n +0" to make sure all lines in the log file are checked. + val builder = new ProcessBuilder(command: _*) + val captureOutput = (line: String) => diagnosisBuffer.synchronized { + diagnosisBuffer += line + + successLines.foreach { r => + if (line.contains(r)) { + serverStarted.trySuccess(()) + } + } + } + + val process = builder.start() + + new ProcessOutputCapturer(process.getInputStream, captureOutput).start() + new ProcessOutputCapturer(process.getErrorStream, captureOutput).start() + process + } + + ThreadUtils.awaitResult(serverStarted.future, SERVER_STARTUP_TIMEOUT) + } + + private def stopThriftServer(): Unit = { + // The `spark-daemon.sh' script uses kill, which is not synchronous, have to wait for a while. + Utils.executeAndGetOutput( + command = Seq(stopScript), + extraEnvironment = Map("SPARK_PID_DIR" -> pidDir.getCanonicalPath)) + Thread.sleep(3.seconds.toMillis) + + warehousePath.delete() + warehousePath = null + + metastorePath.delete() + metastorePath = null + + operationLogPath.delete() + operationLogPath = null + + lScratchDir.delete() + lScratchDir = null + + Option(logPath).foreach(_.delete()) + logPath = null + + Option(logTailingProcess).foreach(_.destroy()) + logTailingProcess = null + } + + private def dumpLogs(): Unit = { + logError( + s""" + |===================================== + |SparkThriftServer2Suite failure output + |===================================== + |${diagnosisBuffer.mkString("\n")} + |========================================= + |End SparkThriftServer2Suite failure output + |========================================= + """.stripMargin) + } + + override protected def beforeAll(): Unit = { + super.beforeAll() + // Chooses a random port between 10000 and 19999 + listeningPort = 10000 + Random.nextInt(10000) + diagnosisBuffer.clear() + + // Retries up to 3 times with different port numbers if the server fails to start + (1 to 3).foldLeft(Try(startThriftServer(listeningPort, 0))) { case (started, attempt) => + started.orElse { + listeningPort += 1 + stopThriftServer() + Try(startThriftServer(listeningPort, attempt)) + } + }.recover { + case cause: Throwable => + dumpLogs() + throw cause + }.get + + logInfo(s"SparkThriftServer2 started successfully") + } + + override protected def afterAll(): Unit = { + try { + stopThriftServer() + logInfo("SparkThriftServer2 stopped") + } finally { + super.afterAll() + } + } +} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala new file mode 100644 index 000000000000..928f4cef6495 --- /dev/null +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.sql.DriverManager + +import org.apache.hive.jdbc.HiveDriver + +import org.apache.spark.util.Utils + +class JdbcConnectionUriSuite extends SparkThriftServer2Test { + Utils.classForName(classOf[HiveDriver].getCanonicalName) + + override def mode: ServerMode.Value = ServerMode.binary + + val JDBC_TEST_DATABASE = "jdbc_test_database" + val USER = System.getProperty("user.name") + val PASSWORD = "" + + override protected def beforeAll(): Unit = { + super.beforeAll() + + val jdbcUri = s"jdbc:hive2://localhost:$serverPort/" + val connection = DriverManager.getConnection(jdbcUri, USER, PASSWORD) + val statement = connection.createStatement() + statement.execute(s"CREATE DATABASE $JDBC_TEST_DATABASE") + connection.close() + } + + override protected def afterAll(): Unit = { + try { + val jdbcUri = s"jdbc:hive2://localhost:$serverPort/" + val connection = DriverManager.getConnection(jdbcUri, USER, PASSWORD) + val statement = connection.createStatement() + statement.execute(s"DROP DATABASE $JDBC_TEST_DATABASE") + connection.close() + } finally { + super.afterAll() + } + } + + test("SPARK-17819 Support default database in connection URIs") { + val jdbcUri = s"jdbc:hive2://localhost:$serverPort/$JDBC_TEST_DATABASE" + val connection = DriverManager.getConnection(jdbcUri, USER, PASSWORD) + val statement = connection.createStatement() + try { + val resultSet = statement.executeQuery("select current_database()") + resultSet.next() + assert(resultSet.getString(1) === JDBC_TEST_DATABASE) + } finally { + statement.close() + connection.close() + } + } +} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala new file mode 100644 index 000000000000..478475fdb396 --- /dev/null +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala @@ -0,0 +1,250 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.sql.{DatabaseMetaData, ResultSet} + +class SparkMetadataOperationSuite extends SparkThriftJdbcTest { + + override def mode: ServerMode.Value = ServerMode.binary + + test("Spark's own GetSchemasOperation(SparkGetSchemasOperation)") { + def checkResult(rs: ResultSet, dbNames: Seq[String]): Unit = { + for (i <- dbNames.indices) { + assert(rs.next()) + assert(rs.getString("TABLE_SCHEM") === dbNames(i)) + } + // Make sure there are no more elements + assert(!rs.next()) + } + + withDatabase("db1", "db2") { statement => + Seq("CREATE DATABASE db1", "CREATE DATABASE db2").foreach(statement.execute) + + val metaData = statement.getConnection.getMetaData + + checkResult(metaData.getSchemas(null, "%"), Seq("db1", "db2", "default", "global_temp")) + checkResult(metaData.getSchemas(null, "db1"), Seq("db1")) + checkResult(metaData.getSchemas(null, "db_not_exist"), Seq.empty) + checkResult(metaData.getSchemas(null, "db*"), Seq("db1", "db2")) + } + } + + test("Spark's own GetTablesOperation(SparkGetTablesOperation)") { + def checkResult(rs: ResultSet, tableNames: Seq[String]): Unit = { + for (i <- tableNames.indices) { + assert(rs.next()) + assert(rs.getString("TABLE_NAME") === tableNames(i)) + } + // Make sure there are no more elements + assert(!rs.next()) + } + + withJdbcStatement("table1", "table2", "view1") { statement => + Seq( + "CREATE TABLE table1(key INT, val STRING)", + "CREATE TABLE table2(key INT, val STRING)", + "CREATE VIEW view1 AS SELECT * FROM table2", + "CREATE OR REPLACE GLOBAL TEMPORARY VIEW view_global_temp_1 AS SELECT 1 AS col1", + "CREATE OR REPLACE TEMPORARY VIEW view_temp_1 AS SELECT 1 as col1" + ).foreach(statement.execute) + + val metaData = statement.getConnection.getMetaData + + checkResult(metaData.getTables(null, "%", "%", null), + Seq("table1", "table2", "view1", "view_global_temp_1", "view_temp_1")) + + checkResult(metaData.getTables(null, "%", "table1", null), Seq("table1")) + + checkResult(metaData.getTables(null, "%", "table_not_exist", null), Seq.empty) + + checkResult(metaData.getTables(null, "%", "%", Array("TABLE")), + Seq("table1", "table2")) + + checkResult(metaData.getTables(null, "%", "%", Array("VIEW")), + Seq("view1", "view_global_temp_1", "view_temp_1")) + + checkResult(metaData.getTables(null, "%", "view_global_temp_1", null), + Seq("view_global_temp_1")) + + checkResult(metaData.getTables(null, "%", "view_temp_1", null), + Seq("view_temp_1")) + + checkResult(metaData.getTables(null, "%", "%", Array("TABLE", "VIEW")), + Seq("table1", "table2", "view1", "view_global_temp_1", "view_temp_1")) + + checkResult(metaData.getTables(null, "%", "table_not_exist", Array("TABLE", "VIEW")), + Seq.empty) + } + } + + test("Spark's own GetColumnsOperation(SparkGetColumnsOperation)") { + def checkResult( + rs: ResultSet, + columns: Seq[(String, String, String, String, String)]) : Unit = { + for (i <- columns.indices) { + assert(rs.next()) + val col = columns(i) + assert(rs.getString("TABLE_NAME") === col._1) + assert(rs.getString("COLUMN_NAME") === col._2) + assert(rs.getString("DATA_TYPE") === col._3) + assert(rs.getString("TYPE_NAME") === col._4) + assert(rs.getString("REMARKS") === col._5) + } + // Make sure there are no more elements + assert(!rs.next()) + } + + withJdbcStatement("table1", "table2", "view1") { statement => + Seq( + "CREATE TABLE table1(key INT comment 'Int column', val STRING comment 'String column')", + "CREATE TABLE table2(key INT, val DECIMAL comment 'Decimal column')", + "CREATE VIEW view1 AS SELECT key FROM table1", + "CREATE OR REPLACE GLOBAL TEMPORARY VIEW view_global_temp_1 AS SELECT 2 AS col2", + "CREATE OR REPLACE TEMPORARY VIEW view_temp_1 AS SELECT 2 as col2" + ).foreach(statement.execute) + + val metaData = statement.getConnection.getMetaData + + checkResult(metaData.getColumns(null, "%", "%", null), + Seq( + ("table1", "key", "4", "INT", "Int column"), + ("table1", "val", "12", "STRING", "String column"), + ("table2", "key", "4", "INT", ""), + ("table2", "val", "3", "DECIMAL(10,0)", "Decimal column"), + ("view1", "key", "4", "INT", "Int column"), + ("view_global_temp_1", "col2", "4", "INT", ""), + ("view_temp_1", "col2", "4", "INT", ""))) + + checkResult(metaData.getColumns(null, "%", "table1", null), + Seq( + ("table1", "key", "4", "INT", "Int column"), + ("table1", "val", "12", "STRING", "String column"))) + + checkResult(metaData.getColumns(null, "%", "table1", "key"), + Seq(("table1", "key", "4", "INT", "Int column"))) + + checkResult(metaData.getColumns(null, "%", "view%", null), + Seq( + ("view1", "key", "4", "INT", "Int column"), + ("view_global_temp_1", "col2", "4", "INT", ""), + ("view_temp_1", "col2", "4", "INT", ""))) + + checkResult(metaData.getColumns(null, "%", "view_global_temp_1", null), + Seq(("view_global_temp_1", "col2", "4", "INT", ""))) + + checkResult(metaData.getColumns(null, "%", "view_temp_1", null), + Seq(("view_temp_1", "col2", "4", "INT", ""))) + + checkResult(metaData.getColumns(null, "%", "view_temp_1", "col2"), + Seq(("view_temp_1", "col2", "4", "INT", ""))) + + checkResult(metaData.getColumns(null, "default", "%", null), + Seq( + ("table1", "key", "4", "INT", "Int column"), + ("table1", "val", "12", "STRING", "String column"), + ("table2", "key", "4", "INT", ""), + ("table2", "val", "3", "DECIMAL(10,0)", "Decimal column"), + ("view1", "key", "4", "INT", "Int column"), + ("view_temp_1", "col2", "4", "INT", ""))) + + checkResult(metaData.getColumns(null, "%", "table_not_exist", null), Seq.empty) + } + } + + test("Spark's own GetTableTypesOperation(SparkGetTableTypesOperation)") { + def checkResult(rs: ResultSet, tableTypes: Seq[String]): Unit = { + for (i <- tableTypes.indices) { + assert(rs.next()) + assert(rs.getString("TABLE_TYPE") === tableTypes(i)) + } + // Make sure there are no more elements + assert(!rs.next()) + } + + withJdbcStatement() { statement => + val metaData = statement.getConnection.getMetaData + checkResult(metaData.getTableTypes, Seq("TABLE", "VIEW")) + } + } + + test("Spark's own GetFunctionsOperation(SparkGetFunctionsOperation)") { + def checkResult(rs: ResultSet, functionName: Seq[String]): Unit = { + for (i <- functionName.indices) { + assert(rs.next()) + assert(rs.getString("FUNCTION_SCHEM") === "default") + assert(rs.getString("FUNCTION_NAME") === functionName(i)) + assert(rs.getString("REMARKS").startsWith(s"${functionName(i)}(")) + assert(rs.getInt("FUNCTION_TYPE") === DatabaseMetaData.functionResultUnknown) + assert(rs.getString("SPECIFIC_NAME").startsWith("org.apache.spark.sql.catalyst")) + } + // Make sure there are no more elements + assert(!rs.next()) + } + + withJdbcStatement() { statement => + val metaData = statement.getConnection.getMetaData + // Hive does not have an overlay function, we use overlay to test. + checkResult(metaData.getFunctions(null, null, "overlay"), Seq("overlay")) + checkResult(metaData.getFunctions(null, null, "overla*"), Seq("overlay")) + checkResult(metaData.getFunctions(null, "", "overla*"), Seq("overlay")) + checkResult(metaData.getFunctions(null, null, "does-not-exist*"), Seq.empty) + checkResult(metaData.getFunctions(null, "default", "overlay"), Seq("overlay")) + checkResult(metaData.getFunctions(null, "default", "shift*"), + Seq("shiftleft", "shiftright", "shiftrightunsigned")) + } + + withJdbcStatement() { statement => + val metaData = statement.getConnection.getMetaData + val rs = metaData.getFunctions(null, "default", "upPer") + assert(rs.next()) + assert(rs.getString("FUNCTION_SCHEM") === "default") + assert(rs.getString("FUNCTION_NAME") === "upper") + assert(rs.getString("REMARKS") === + "upper(str) - Returns `str` with all characters changed to uppercase.") + assert(rs.getInt("FUNCTION_TYPE") === DatabaseMetaData.functionResultUnknown) + assert(rs.getString("SPECIFIC_NAME") === "org.apache.spark.sql.catalyst.expressions.Upper") + // Make sure there are no more elements + assert(!rs.next()) + } + } + + test("Spark's own GetCatalogsOperation(SparkGetCatalogsOperation)") { + withJdbcStatement() { statement => + val metaData = statement.getConnection.getMetaData + val rs = metaData.getCatalogs + assert(!rs.next()) + } + } + + test("GetTypeInfo Thrift API") { + def checkResult(rs: ResultSet, typeNames: Seq[String]): Unit = { + for (i <- typeNames.indices) { + assert(rs.next()) + assert(rs.getString("TYPE_NAME") === typeNames(i)) + } + // Make sure there are no more elements + assert(!rs.next()) + } + + withJdbcStatement() { statement => + val metaData = statement.getConnection.getMetaData + checkResult(metaData.getTypeInfo, ThriftserverShimUtils.supportedType().map(_.getName)) + } + } +} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala new file mode 100644 index 000000000000..c3d0da7a448e --- /dev/null +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala @@ -0,0 +1,323 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.sql.{Date, Timestamp} +import java.util.{Properties, List => JList} + +import org.apache.hive.jdbc.{HiveConnection, HiveQueryResultSet} +import org.apache.thrift.protocol.TBinaryProtocol +import org.apache.thrift.transport.TSocket + +import org.apache.spark.sql.catalyst.util.NumberConverter +import org.apache.spark.sql.thriftserver.auth.PlainSaslHelper +import org.apache.spark.unsafe.types.UTF8String + +class SparkThriftServerProtocolVersionsSuite extends SparkThriftJdbcTest { + + override def mode: ServerMode.Value = ServerMode.binary + + def testExecuteStatementWithProtocolVersion( + version: ThriftserverShimUtils.TProtocolVersion, + sql: String)(f: HiveQueryResultSet => Unit): Unit = { + val rawTransport = new TSocket("localhost", serverPort) + val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) + val user = System.getProperty("user.name") + val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) + val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) + transport.open() + var rs: HiveQueryResultSet = null + try { + val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) + val openResp = client.OpenSession(clientProtocol) + val sessHandle = openResp.getSessionHandle + val execReq = new ThriftserverShimUtils.TExecuteStatementReq(sessHandle, sql) + val execResp = client.ExecuteStatement(execReq) + val stmtHandle = execResp.getOperationHandle + + // Set the HiveConnection protocol to our testing protocol version. + // RowSetFactory uses this protocol version to construct different RowSet. + val protocol = connection.getClass.getDeclaredField("protocol") + protocol.setAccessible(true) + protocol.set(connection, version) + assert(connection.getProtocol === version) + + rs = new HiveQueryResultSet.Builder(connection) + .setClient(client) + .setSessionHandle(sessHandle) + .setStmtHandle(stmtHandle).setMaxRows(Int.MaxValue).setFetchSize(Int.MaxValue) + .build() + f(rs) + } finally { + rs.close() + connection.close() + transport.close() + rawTransport.close() + } + } + + def testGetInfoWithProtocolVersion(version: ThriftserverShimUtils.TProtocolVersion): Unit = { + val rawTransport = new TSocket("localhost", serverPort) + val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) + val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) + val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) + transport.open() + try { + val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) + val openResp = client.OpenSession(clientProtocol) + val sessHandle = openResp.getSessionHandle + + val dbVersionReq = + new ThriftserverShimUtils.TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_VER.toTGetInfoType) + val dbVersion = client.GetInfo(dbVersionReq).getInfoValue.getStringValue + + val dbNameReq = + new ThriftserverShimUtils.TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_NAME.toTGetInfoType) + val dbName = client.GetInfo(dbNameReq).getInfoValue.getStringValue + + assert(dbVersion === org.apache.spark.SPARK_VERSION) + assert(dbName === "Spark SQL") + } finally { + connection.close() + transport.close() + rawTransport.close() + } + } + + def testGetTablesWithProtocolVersion( + version: ThriftserverShimUtils.TProtocolVersion, + schema: String, + tableNamePattern: String, + tableTypes: JList[String])(f: HiveQueryResultSet => Unit): Unit = { + val rawTransport = new TSocket("localhost", serverPort) + val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) + val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) + val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) + transport.open() + var rs: HiveQueryResultSet = null + try { + val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) + val openResp = client.OpenSession(clientProtocol) + val sessHandle = openResp.getSessionHandle + val getTableReq = new ThriftserverShimUtils.TGetTablesReq(sessHandle) + getTableReq.setSchemaName(schema) + getTableReq.setTableName(tableNamePattern) + getTableReq.setTableTypes(tableTypes) + + val getTableResp = client.GetTables(getTableReq) + + // Set the HiveConnection protocol to our testing protocol version. + // RowSetFactory uses this protocol version to construct different RowSet. + val protocol = connection.getClass.getDeclaredField("protocol") + protocol.setAccessible(true) + protocol.set(connection, version) + assert(connection.getProtocol === version) + + rs = new HiveQueryResultSet.Builder(connection) + .setClient(client) + .setSessionHandle(sessHandle) + .setStmtHandle(getTableResp.getOperationHandle) + .build() + f(rs) + } finally { + rs.close() + connection.close() + transport.close() + rawTransport.close() + } + } + + ThriftserverShimUtils.testedProtocolVersions.foreach { version => + test(s"$version get byte type") { + testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as byte)") { rs => + assert(rs.next()) + assert(rs.getByte(1) === 1.toByte) + } + } + + test(s"$version get short type") { + testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as short)") { rs => + assert(rs.next()) + assert(rs.getShort(1) === 1.toShort) + } + } + + test(s"$version get int type") { + testExecuteStatementWithProtocolVersion(version, "SELECT 1") { rs => + assert(rs.next()) + assert(rs.getInt(1) === 1) + } + } + + test(s"$version get bigint type") { + testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as bigint)") { rs => + assert(rs.next()) + assert(rs.getLong(1) === 1L) + } + } + + test(s"$version get float type") { + testExecuteStatementWithProtocolVersion(version, "SELECT cast(1.2 as float)") { rs => + assert(rs.next()) + assert(rs.getFloat(1) === 1.2F) + } + } + + test(s"$version get double type") { + testExecuteStatementWithProtocolVersion(version, "SELECT cast(1.2 as double)") { rs => + assert(rs.next()) + assert(rs.getDouble(1) === 1.2D) + } + } + + test(s"$version get decimal type") { + testExecuteStatementWithProtocolVersion(version, + "SELECT cast(1 as decimal(18, 2)) as c") { rs => + assert(rs.next()) + assert(rs.getBigDecimal(1) === new java.math.BigDecimal("1.00")) + } + } + + test(s"$version get string type") { + testExecuteStatementWithProtocolVersion(version, "SELECT 'str'") { rs => + assert(rs.next()) + assert(rs.getString(1) === "str") + } + } + + test(s"$version get char type") { + testExecuteStatementWithProtocolVersion(version, + "SELECT cast('char-str' as char(10))") { rs => + assert(rs.next()) + assert(rs.getString(1) === "char-str") + } + } + + test(s"$version get varchar type") { + testExecuteStatementWithProtocolVersion(version, + "SELECT cast('varchar-str' as varchar(10))") { rs => + assert(rs.next()) + assert(rs.getString(1) === "varchar-str") + } + } + + test(s"$version get binary type") { + testExecuteStatementWithProtocolVersion(version, "SELECT cast('ABC' as binary)") { rs => + assert(rs.next()) + assert(rs.getString(1) === "ABC") + } + testExecuteStatementWithProtocolVersion(version, "SELECT cast(49960 as binary)") { rs => + assert(rs.next()) + assert(rs.getString(1) === UTF8String.fromBytes(NumberConverter.toBinary(49960)).toString) + } + testExecuteStatementWithProtocolVersion(version, "SELECT cast(null as binary)") { rs => + assert(rs.next()) + assert(rs.getString(1) === null) + } + } + + test(s"$version get boolean type") { + testExecuteStatementWithProtocolVersion(version, "SELECT true") { rs => + assert(rs.next()) + assert(rs.getBoolean(1) === true) + } + } + + test(s"$version get date type") { + testExecuteStatementWithProtocolVersion(version, "SELECT cast('2019-07-22' as date)") { rs => + assert(rs.next()) + assert(rs.getDate(1) === Date.valueOf("2019-07-22")) + } + } + + test(s"$version get timestamp type") { + testExecuteStatementWithProtocolVersion(version, + "SELECT cast('2019-07-22 18:14:00' as timestamp)") { rs => + assert(rs.next()) + assert(rs.getTimestamp(1) === Timestamp.valueOf("2019-07-22 18:14:00")) + } + } + + test(s"$version get void") { + testExecuteStatementWithProtocolVersion(version, "SELECT null") { rs => + assert(rs.next()) + assert(rs.getString(1) === null) + } + } + + test(s"$version get interval type") { + testExecuteStatementWithProtocolVersion(version, "SELECT interval '1' year '2' day") { rs => + assert(rs.next()) + assert(rs.getString(1) === "interval 1 years 2 days") + } + } + + test(s"$version get array type") { + testExecuteStatementWithProtocolVersion(version, "SELECT array(1, 2)") { rs => + assert(rs.next()) + assert(rs.getString(1) === "[1,2]") + } + } + + test(s"$version get map type") { + testExecuteStatementWithProtocolVersion(version, "SELECT map(1, 2)") { rs => + assert(rs.next()) + assert(rs.getString(1) === "{1:2}") + } + } + + test(s"$version get struct type") { + testExecuteStatementWithProtocolVersion(version, + "SELECT struct('alpha' AS A, 'beta' AS B)") { rs => + assert(rs.next()) + assert(rs.getString(1) === """{"A":"alpha","B":"beta"}""") + } + } + + test(s"$version get info") { + testGetInfoWithProtocolVersion(version) + } + + test(s"$version get tables") { + def checkResult(tableNames: Seq[String], rs: HiveQueryResultSet): Unit = { + if (tableNames.nonEmpty) { + for (i <- tableNames.indices) { + assert(rs.next()) + assert(rs.getString("TABLE_NAME") === tableNames(i)) + } + } else { + assert(!rs.next()) + } + } + + withJdbcStatement("table1", "table2") { statement => + Seq( + "CREATE TABLE table1(key INT, val STRING)", + "CREATE TABLE table2(key INT, val STRING)").foreach(statement.execute) + + testGetTablesWithProtocolVersion(version, "%", "%", null) { rs => + checkResult(Seq("table1", "table2"), rs) + } + + testGetTablesWithProtocolVersion(version, "%", "table1", null) { rs => + checkResult(Seq("table1"), rs) + } + } + } + } +} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala new file mode 100644 index 000000000000..aced0283896c --- /dev/null +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala @@ -0,0 +1,388 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import java.io.File +import java.sql.{DriverManager, Statement, Timestamp} +import java.util.{Locale, MissingFormatArgumentException} + +import scala.util.{Random, Try} +import scala.util.control.NonFatal + +import org.apache.commons.lang3.exception.ExceptionUtils +import org.apache.hadoop.hive.conf.HiveConf.ConfVars + +import org.apache.spark.{SparkConf, SparkException} +import org.apache.spark.sql.SQLQueryTestSuite +import org.apache.spark.sql.catalyst.analysis.NoSuchTableException +import org.apache.spark.sql.catalyst.util.fileToString +import org.apache.spark.sql.execution.HiveResult +import org.apache.spark.sql.hive.HiveUtils +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types._ + +/** + * Re-run all the tests in SQLQueryTestSuite via Thrift Server. + * Note that this TestSuite does not support maven. + * + * TODO: + * 1. Support UDF testing. + * 2. Support DESC command. + * 3. Support SHOW command. + */ +class ThriftServerQueryTestSuite extends SQLQueryTestSuite { + + private var hiveServer2: SparkThriftServer2 = _ + + override def beforeAll(): Unit = { + super.beforeAll() + // Chooses a random port between 10000 and 19999 + var listeningPort = 10000 + Random.nextInt(10000) + + // Retries up to 3 times with different port numbers if the server fails to start + (1 to 3).foldLeft(Try(startThriftServer(listeningPort, 0))) { case (started, attempt) => + started.orElse { + listeningPort += 1 + Try(startThriftServer(listeningPort, attempt)) + } + }.recover { + case cause: Throwable => + throw cause + }.get + logInfo("HiveThriftServer2 started successfully") + } + + override def afterAll(): Unit = { + try { + hiveServer2.stop() + } finally { + super.afterAll() + } + } + + override def sparkConf: SparkConf = super.sparkConf + // Hive Thrift server should not executes SQL queries in an asynchronous way + // because we may set session configuration. + .set(HiveUtils.HIVE_THRIFT_SERVER_ASYNC, false) + + override val isTestWithConfigSets = false + + /** List of test cases to ignore, in lower cases. */ + override def blackList: Set[String] = super.blackList ++ Set( + // Missing UDF + "postgreSQL/boolean.sql", + "postgreSQL/case.sql", + // SPARK-28624 + "date.sql", + // SPARK-28620 + "postgreSQL/float4.sql", + // SPARK-28636 + "decimalArithmeticOperations.sql", + "literals.sql", + "subquery/scalar-subquery/scalar-subquery-predicate.sql", + "subquery/in-subquery/in-limit.sql", + "subquery/in-subquery/in-group-by.sql", + "subquery/in-subquery/simple-in.sql", + "subquery/in-subquery/in-order-by.sql", + "subquery/in-subquery/in-set-operations.sql" + ) + + override def runQueries( + queries: Seq[String], + testCase: TestCase, + configSet: Option[Seq[(String, String)]]): Unit = { + // We do not test with configSet. + withJdbcStatement { statement => + + loadTestData(statement) + + testCase match { + case _: PgSQLTest => + // PostgreSQL enabled cartesian product by default. + statement.execute(s"SET ${SQLConf.CROSS_JOINS_ENABLED.key} = true") + statement.execute(s"SET ${SQLConf.ANSI_ENABLED.key} = true") + statement.execute(s"SET ${SQLConf.DIALECT.key} = ${SQLConf.Dialect.POSTGRESQL.toString}") + case _ => + } + + // Run the SQL queries preparing them for comparison. + val outputs: Seq[QueryOutput] = queries.map { sql => + val (_, output) = handleExceptions(getNormalizedResult(statement, sql)) + // We might need to do some query canonicalization in the future. + QueryOutput( + sql = sql, + schema = "", + output = output.mkString("\n").replaceAll("\\s+$", "")) + } + + // Read back the golden file. + val expectedOutputs: Seq[QueryOutput] = { + val goldenOutput = fileToString(new File(testCase.resultFile)) + val segments = goldenOutput.split("-- !query.+\n") + + // each query has 3 segments, plus the header + assert(segments.size == outputs.size * 3 + 1, + s"Expected ${outputs.size * 3 + 1} blocks in result file but got ${segments.size}. " + + "Try regenerate the result files.") + Seq.tabulate(outputs.size) { i => + val sql = segments(i * 3 + 1).trim + val schema = segments(i * 3 + 2).trim + val originalOut = segments(i * 3 + 3) + val output = if (schema != emptySchema && isNeedSort(sql)) { + originalOut.split("\n").sorted.mkString("\n") + } else { + originalOut + } + QueryOutput( + sql = sql, + schema = "", + output = output.replaceAll("\\s+$", "") + ) + } + } + + // Compare results. + assertResult(expectedOutputs.size, s"Number of queries should be ${expectedOutputs.size}") { + outputs.size + } + + outputs.zip(expectedOutputs).zipWithIndex.foreach { case ((output, expected), i) => + assertResult(expected.sql, s"SQL query did not match for query #$i\n${expected.sql}") { + output.sql + } + + expected match { + // Skip desc command, see HiveResult.hiveResultString + case d if d.sql.toUpperCase(Locale.ROOT).startsWith("DESC ") + || d.sql.toUpperCase(Locale.ROOT).startsWith("DESC\n") + || d.sql.toUpperCase(Locale.ROOT).startsWith("DESCRIBE ") + || d.sql.toUpperCase(Locale.ROOT).startsWith("DESCRIBE\n") => + + // Skip show command, see HiveResult.hiveResultString + case s if s.sql.toUpperCase(Locale.ROOT).startsWith("SHOW ") + || s.sql.toUpperCase(Locale.ROOT).startsWith("SHOW\n") => + + case _ if output.output.startsWith(classOf[NoSuchTableException].getPackage.getName) => + assert(expected.output.startsWith(classOf[NoSuchTableException].getPackage.getName), + s"Exception did not match for query #$i\n${expected.sql}, " + + s"expected: ${expected.output}, but got: ${output.output}") + + case _ if output.output.startsWith(classOf[SparkException].getName) && + output.output.contains("overflow") => + assert(expected.output.contains(classOf[ArithmeticException].getName) && + expected.output.contains("overflow"), + s"Exception did not match for query #$i\n${expected.sql}, " + + s"expected: ${expected.output}, but got: ${output.output}") + + case _ if output.output.startsWith(classOf[RuntimeException].getName) => + assert(expected.output.contains("Exception"), + s"Exception did not match for query #$i\n${expected.sql}, " + + s"expected: ${expected.output}, but got: ${output.output}") + + case _ if output.output.startsWith(classOf[ArithmeticException].getName) && + output.output.contains("causes overflow") => + assert(expected.output.contains(classOf[ArithmeticException].getName) && + expected.output.contains("causes overflow"), + s"Exception did not match for query #$i\n${expected.sql}, " + + s"expected: ${expected.output}, but got: ${output.output}") + + case _ if output.output.startsWith(classOf[MissingFormatArgumentException].getName) && + output.output.contains("Format specifier") => + assert(expected.output.contains(classOf[MissingFormatArgumentException].getName) && + expected.output.contains("Format specifier"), + s"Exception did not match for query #$i\n${expected.sql}, " + + s"expected: ${expected.output}, but got: ${output.output}") + + case _ => + assertResult(expected.output, s"Result did not match for query #$i\n${expected.sql}") { + output.output + } + } + } + } + } + + override def createScalaTestCase(testCase: TestCase): Unit = { + if (blackList.exists(t => + testCase.name.toLowerCase(Locale.ROOT).contains(t.toLowerCase(Locale.ROOT)))) { + // Create a test case to ignore this case. + ignore(testCase.name) { /* Do nothing */ } + } else { + // Create a test case to run this case. + test(testCase.name) { + runTest(testCase) + } + } + } + + override def listTestCases(): Seq[TestCase] = { + listFilesRecursively(new File(inputFilePath)).flatMap { file => + val resultFile = file.getAbsolutePath.replace(inputFilePath, goldenFilePath) + ".out" + val absPath = file.getAbsolutePath + val testCaseName = absPath.stripPrefix(inputFilePath).stripPrefix(File.separator) + + if (file.getAbsolutePath.startsWith(s"$inputFilePath${File.separator}udf")) { + Seq.empty + } else if (file.getAbsolutePath.startsWith(s"$inputFilePath${File.separator}postgreSQL")) { + PgSQLTestCase(testCaseName, absPath, resultFile) :: Nil + } else { + RegularTestCase(testCaseName, absPath, resultFile) :: Nil + } + } + } + + test("Check if ThriftServer can work") { + withJdbcStatement { statement => + val rs = statement.executeQuery("select 1L") + rs.next() + assert(rs.getLong(1) === 1L) + } + } + + /** ThriftServer wraps the root exception, so it needs to be extracted. */ + override def handleExceptions(result: => (String, Seq[String])): (String, Seq[String]) = { + super.handleExceptions { + try { + result + } catch { + case NonFatal(e) => throw ExceptionUtils.getRootCause(e) + } + } + } + + private def getNormalizedResult(statement: Statement, sql: String): (String, Seq[String]) = { + val rs = statement.executeQuery(sql) + val cols = rs.getMetaData.getColumnCount + val buildStr = () => (for (i <- 1 to cols) yield { + getHiveResult(rs.getObject(i)) + }).mkString("\t") + + val answer = Iterator.continually(rs.next()).takeWhile(identity).map(_ => buildStr()).toSeq + .map(replaceNotIncludedMsg) + if (isNeedSort(sql)) { + ("", answer.sorted) + } else { + ("", answer) + } + } + + private def startThriftServer(port: Int, attempt: Int): Unit = { + logInfo(s"Trying to start HiveThriftServer2: port=$port, attempt=$attempt") + val sqlContext = spark.newSession().sqlContext + sqlContext.setConf(ConfVars.HIVE_SERVER2_THRIFT_PORT.varname, port.toString) + hiveServer2 = HiveThriftServer2.startWithContext(sqlContext) + } + + private def withJdbcStatement(fs: (Statement => Unit)*): Unit = { + val user = System.getProperty("user.name") + + val serverPort = hiveServer2.getHiveConf.get(ConfVars.HIVE_SERVER2_THRIFT_PORT.varname) + val connections = + fs.map { _ => DriverManager.getConnection(s"jdbc:hive2://localhost:$serverPort", user, "") } + val statements = connections.map(_.createStatement()) + + try { + statements.zip(fs).foreach { case (s, f) => f(s) } + } finally { + statements.foreach(_.close()) + connections.foreach(_.close()) + } + } + + /** Load built-in test tables. */ + private def loadTestData(statement: Statement): Unit = { + // Prepare the data + statement.execute( + """ + |CREATE OR REPLACE TEMPORARY VIEW testdata as + |SELECT id AS key, CAST(id AS string) AS value FROM range(1, 101) + """.stripMargin) + statement.execute( + """ + |CREATE OR REPLACE TEMPORARY VIEW arraydata as + |SELECT * FROM VALUES + |(ARRAY(1, 2, 3), ARRAY(ARRAY(1, 2, 3))), + |(ARRAY(2, 3, 4), ARRAY(ARRAY(2, 3, 4))) AS v(arraycol, nestedarraycol) + """.stripMargin) + statement.execute( + """ + |CREATE OR REPLACE TEMPORARY VIEW mapdata as + |SELECT * FROM VALUES + |MAP(1, 'a1', 2, 'b1', 3, 'c1', 4, 'd1', 5, 'e1'), + |MAP(1, 'a2', 2, 'b2', 3, 'c2', 4, 'd2'), + |MAP(1, 'a3', 2, 'b3', 3, 'c3'), + |MAP(1, 'a4', 2, 'b4'), + |MAP(1, 'a5') AS v(mapcol) + """.stripMargin) + statement.execute( + s""" + |CREATE TEMPORARY VIEW aggtest + | (a int, b float) + |USING csv + |OPTIONS (path '${baseResourcePath.getParent}/test-data/postgresql/agg.data', + | header 'false', delimiter '\t') + """.stripMargin) + statement.execute( + s""" + |CREATE OR REPLACE TEMPORARY VIEW onek + | (unique1 int, unique2 int, two int, four int, ten int, twenty int, hundred int, + | thousand int, twothousand int, fivethous int, tenthous int, odd int, even int, + | stringu1 string, stringu2 string, string4 string) + |USING csv + |OPTIONS (path '${baseResourcePath.getParent}/test-data/postgresql/onek.data', + | header 'false', delimiter '\t') + """.stripMargin) + statement.execute( + s""" + |CREATE OR REPLACE TEMPORARY VIEW tenk1 + | (unique1 int, unique2 int, two int, four int, ten int, twenty int, hundred int, + | thousand int, twothousand int, fivethous int, tenthous int, odd int, even int, + | stringu1 string, stringu2 string, string4 string) + |USING csv + | OPTIONS (path '${baseResourcePath.getParent}/test-data/postgresql/tenk.data', + | header 'false', delimiter '\t') + """.stripMargin) + } + + // Returns true if sql is retrieving data. + private def isNeedSort(sql: String): Boolean = { + val upperCase = sql.toUpperCase(Locale.ROOT) + upperCase.startsWith("SELECT ") || upperCase.startsWith("SELECT\n") || + upperCase.startsWith("WITH ") || upperCase.startsWith("WITH\n") || + upperCase.startsWith("VALUES ") || upperCase.startsWith("VALUES\n") || + // postgreSQL/union.sql + upperCase.startsWith("(") + } + + private def getHiveResult(obj: Object): String = { + obj match { + case null => + HiveResult.toHiveString((null, StringType)) + case d: java.sql.Date => + HiveResult.toHiveString((d, DateType)) + case t: Timestamp => + HiveResult.toHiveString((t, TimestampType)) + case d: java.math.BigDecimal => + HiveResult.toHiveString((d, DecimalType.fromBigDecimal(d))) + case bin: Array[Byte] => + HiveResult.toHiveString((bin, BinaryType)) + case other => + other.toString + } + } +} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala new file mode 100644 index 000000000000..f13afbce5cd4 --- /dev/null +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala @@ -0,0 +1,106 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver + +import scala.util.Random + +import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.openqa.selenium.WebDriver +import org.openqa.selenium.htmlunit.HtmlUnitDriver +import org.scalatest.{BeforeAndAfterAll, Matchers} +import org.scalatest.concurrent.Eventually._ +import org.scalatest.time.SpanSugar._ +import org.scalatestplus.selenium.WebBrowser + +import org.apache.spark.ui.SparkUICssErrorHandler + +class UISeleniumSuite + extends SparkThriftJdbcTest + with WebBrowser with Matchers with BeforeAndAfterAll { + + implicit var webDriver: WebDriver = _ + var server: SparkThriftServer2 = _ + val uiPort = 20000 + Random.nextInt(10000) + override def mode: ServerMode.Value = ServerMode.binary + + override def beforeAll(): Unit = { + webDriver = new HtmlUnitDriver { + getWebClient.setCssErrorHandler(new SparkUICssErrorHandler) + } + super.beforeAll() + } + + override def afterAll(): Unit = { + try { + if (webDriver != null) { + webDriver.quit() + } + } finally { + super.afterAll() + } + } + + override protected def serverStartCommand(port: Int) = { + val portConf = if (mode == ServerMode.binary) { + ConfVars.HIVE_SERVER2_THRIFT_PORT + } else { + ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT + } + + s"""$startScript + | --master local + | --hiveconf hive.root.logger=INFO,console + | --hiveconf ${ConfVars.METASTORECONNECTURLKEY}=$metastoreJdbcUri + | --hiveconf ${ConfVars.METASTOREWAREHOUSE}=$warehousePath + | --hiveconf ${ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST}=localhost + | --hiveconf ${ConfVars.HIVE_SERVER2_TRANSPORT_MODE}=$mode + | --hiveconf $portConf=$port + | --driver-class-path ${sys.props("java.class.path")} + | --conf spark.ui.enabled=true + | --conf spark.ui.port=$uiPort + """.stripMargin.split("\\s+").toSeq + } + + ignore("thrift server ui test") { + withJdbcStatement("test_map") { statement => + val baseURL = s"http://localhost:$uiPort" + + val queries = Seq( + "CREATE TABLE test_map(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_map") + + queries.foreach(statement.execute) + + eventually(timeout(10.seconds), interval(50.milliseconds)) { + go to baseURL + find(cssSelector("""ul li a[href*="sql"]""")) should not be None + } + + eventually(timeout(10.seconds), interval(50.milliseconds)) { + go to (baseURL + "/sql") + find(id("sessionstat")) should not be None + find(id("sqlstat")) should not be None + + // check whether statements exists + queries.foreach { line => + findAll(cssSelector("""ul table tbody tr td""")).map(_.text).toList should contain (line) + } + } + } + } +} From a14a9e923489ef3730cfeaa4f19c910a6fb54aed Mon Sep 17 00:00:00 2001 From: angerszhu Date: Tue, 29 Oct 2019 18:48:11 +0800 Subject: [PATCH 23/55] fix UT case, remove can't supported UT --- .../org/apache/spark/sql/hive/HiveUtils.scala | 2 +- .../spark/sql/thriftserver/cli/Type.scala | 19 +- ...HiveMetastoreLazyInitializationSuite.scala | 1 - .../spark/sql/thriftserver/CliSuite.scala | 396 ----------------- .../HiveThriftServer2Suites.scala | 402 +++++++++--------- .../SparkMetadataOperationSuite.scala | 4 +- ...arkThriftServerProtocolVersionsSuite.scala | 323 -------------- .../ThriftServerQueryTestSuite.scala | 5 +- .../sql/thriftserver/UISeleniumSuite.scala | 3 +- 9 files changed, 214 insertions(+), 941 deletions(-) delete mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/CliSuite.scala delete mode 100644 sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala index 9c4b8a5819a3..201175d337c5 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala @@ -307,7 +307,7 @@ private[spark] object HiveUtils extends Logging { * The version of the Hive client that is used here must match the metastore that is configured * in the hive-site.xml file. */ - protected[hive] def newClientForMetadata( + def newClientForMetadata( conf: SparkConf, hadoopConf: Configuration): HiveClient = { val configurations = formatTimeVarsForHiveClient(hadoopConf) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala index 7355d603cd0d..ee158aabcfd9 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala @@ -182,8 +182,7 @@ object Type { BINARY.getName -> BINARY, ARRAY.getName -> ARRAY, MAP.getName -> MAP, - STRUCT.getName -> STRUCT, - USER_DEFINED.getName -> USER_DEFINED + STRUCT.getName -> STRUCT ) def values: Seq[Type] = typeMap.values.toSeq @@ -482,20 +481,4 @@ object Type { override def javaSQLType: Int = java.sql.Types.STRUCT } - case object USER_DEFINED extends Type { - override def getName: String = "USER_DEFINED" - - override def tTypeId: TTypeId = TTypeId.USER_DEFINED_TYPE - - override def isComplex: Boolean = true - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.OTHER - } - } diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/HiveMetastoreLazyInitializationSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/HiveMetastoreLazyInitializationSuite.scala index d8ee4a9ae611..63cf542328ea 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/HiveMetastoreLazyInitializationSuite.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/HiveMetastoreLazyInitializationSuite.scala @@ -18,7 +18,6 @@ package org.apache.spark.sql import org.apache.spark.SparkFunSuite - import org.apache.spark.util.Utils class HiveMetastoreLazyInitializationSuite extends SparkFunSuite { diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/CliSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/CliSuite.scala deleted file mode 100644 index 3ad00bbba668..000000000000 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/CliSuite.scala +++ /dev/null @@ -1,396 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.io._ -import java.nio.charset.StandardCharsets -import java.sql.Timestamp -import java.util.Date - -import scala.collection.mutable.ArrayBuffer -import scala.concurrent.Promise -import scala.concurrent.duration._ - -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.scalatest.BeforeAndAfterAll - -import org.apache.spark.SparkFunSuite -import org.apache.spark.internal.Logging -import org.apache.spark.sql.hive.test.HiveTestJars -import org.apache.spark.sql.test.ProcessTestUtils.ProcessOutputCapturer -import org.apache.spark.util.{ThreadUtils, Utils} - -/** - * A test suite for the `spark-sql` CLI tool. Note that all test cases share the same temporary - * Hive metastore and warehouse. - */ -class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { - val warehousePath = Utils.createTempDir() - val metastorePath = Utils.createTempDir() - val scratchDirPath = Utils.createTempDir() - - override def beforeAll(): Unit = { - super.beforeAll() - warehousePath.delete() - metastorePath.delete() - scratchDirPath.delete() - } - - override def afterAll(): Unit = { - try { - warehousePath.delete() - metastorePath.delete() - scratchDirPath.delete() - } finally { - super.afterAll() - } - } - - /** - * Run a CLI operation and expect all the queries and expected answers to be returned. - * - * @param timeout maximum time for the commands to complete - * @param extraArgs any extra arguments - * @param errorResponses a sequence of strings whose presence in the stdout of the forked process - * is taken as an immediate error condition. That is: if a line containing - * with one of these strings is found, fail the test immediately. - * The default value is `Seq("Error:")` - * @param queriesAndExpectedAnswers one or more tuples of query + answer - */ - def runCliWithin( - timeout: FiniteDuration, - extraArgs: Seq[String] = Seq.empty, - errorResponses: Seq[String] = Seq("Error:"))( - queriesAndExpectedAnswers: (String, String)*): Unit = { - - val (queries, expectedAnswers) = queriesAndExpectedAnswers.unzip - // Explicitly adds ENTER for each statement to make sure they are actually entered into the CLI. - val queriesString = queries.map(_ + "\n").mkString - - val command = { - val cliScript = "../../bin/spark-sql".split("/").mkString(File.separator) - val jdbcUrl = s"jdbc:derby:;databaseName=$metastorePath;create=true" - s"""$cliScript - | --master local - | --driver-java-options -Dderby.system.durability=test - | --conf spark.ui.enabled=false - | --hiveconf ${ConfVars.METASTORECONNECTURLKEY}=$jdbcUrl - | --hiveconf ${ConfVars.METASTOREWAREHOUSE}=$warehousePath - | --hiveconf ${ConfVars.SCRATCHDIR}=$scratchDirPath - | --hiveconf conf1=conftest - | --hiveconf conf2=1 - """.stripMargin.split("\\s+").toSeq ++ extraArgs - } - - var next = 0 - val foundAllExpectedAnswers = Promise.apply[Unit]() - val buffer = new ArrayBuffer[String]() - val lock = new Object - - def captureOutput(source: String)(line: String): Unit = lock.synchronized { - // This test suite sometimes gets extremely slow out of unknown reason on Jenkins. Here we - // add a timestamp to provide more diagnosis information. - buffer += s"${new Timestamp(new Date().getTime)} - $source> $line" - - // If we haven't found all expected answers and another expected answer comes up... - if (next < expectedAnswers.size && line.contains(expectedAnswers(next))) { - next += 1 - // If all expected answers have been found... - if (next == expectedAnswers.size) { - foundAllExpectedAnswers.trySuccess(()) - } - } else { - errorResponses.foreach { r => - if (line.contains(r)) { - foundAllExpectedAnswers.tryFailure( - new RuntimeException(s"Failed with error line '$line'")) - } - } - } - } - - val process = new ProcessBuilder(command: _*).start() - - val stdinWriter = new OutputStreamWriter(process.getOutputStream, StandardCharsets.UTF_8) - stdinWriter.write(queriesString) - stdinWriter.flush() - stdinWriter.close() - - new ProcessOutputCapturer(process.getInputStream, captureOutput("stdout")).start() - new ProcessOutputCapturer(process.getErrorStream, captureOutput("stderr")).start() - - try { - ThreadUtils.awaitResult(foundAllExpectedAnswers.future, timeout) - } catch { case cause: Throwable => - val message = - s""" - |======================= - |CliSuite failure output - |======================= - |Spark SQL CLI command line: ${command.mkString(" ")} - |Exception: $cause - |Executed query $next "${queries(next)}", - |But failed to capture expected output "${expectedAnswers(next)}" within $timeout. - | - |${buffer.mkString("\n")} - |=========================== - |End CliSuite failure output - |=========================== - """.stripMargin - logError(message, cause) - fail(message, cause) - } finally { - process.destroy() - } - } - - test("Simple commands") { - val dataFilePath = - Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") - - runCliWithin(3.minute)( - "CREATE TABLE hive_test(key INT, val STRING);" - -> "", - "SHOW TABLES;" - -> "hive_test", - s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE hive_test;" - -> "", - "CACHE TABLE hive_test;" - -> "", - "SELECT COUNT(*) FROM hive_test;" - -> "5", - "DROP TABLE hive_test;" - -> "" - ) - } - - test("Single command with -e") { - runCliWithin(2.minute, Seq("-e", "SHOW DATABASES;"))("" -> "") - } - - test("Single command with --database") { - runCliWithin(2.minute)( - "CREATE DATABASE hive_test_db;" - -> "", - "USE hive_test_db;" - -> "", - "CREATE TABLE hive_test(key INT, val STRING);" - -> "", - "SHOW TABLES;" - -> "hive_test" - ) - - runCliWithin(2.minute, Seq("--database", "hive_test_db", "-e", "SHOW TABLES;"))( - "" -> "hive_test" - ) - } - - test("Commands using SerDe provided in --jars") { - val jarFile = HiveTestJars.getHiveHcatalogCoreJar().getCanonicalPath - - val dataFilePath = - Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") - - runCliWithin(3.minute, Seq("--jars", s"$jarFile"))( - """CREATE TABLE t1(key string, val string) - |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'; - """.stripMargin - -> "", - "CREATE TABLE sourceTable (key INT, val STRING);" - -> "", - s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE sourceTable;" - -> "", - "INSERT INTO TABLE t1 SELECT key, val FROM sourceTable;" - -> "", - "SELECT collect_list(array(val)) FROM t1;" - -> """[["val_238"],["val_86"],["val_311"],["val_27"],["val_165"]]""", - "DROP TABLE t1;" - -> "", - "DROP TABLE sourceTable;" - -> "" - ) - } - - test("SPARK-29022: Commands using SerDe provided in --hive.aux.jars.path") { - val dataFilePath = - Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") - val hiveContribJar = HiveTestJars.getHiveHcatalogCoreJar().getCanonicalPath - runCliWithin( - 3.minute, - Seq("--conf", s"spark.hadoop.${ConfVars.HIVEAUXJARS}=$hiveContribJar"))( - """CREATE TABLE addJarWithHiveAux(key string, val string) - |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'; - """.stripMargin - -> "", - "CREATE TABLE sourceTableForWithHiveAux (key INT, val STRING);" - -> "", - s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE sourceTableForWithHiveAux;" - -> "", - "INSERT INTO TABLE addJarWithHiveAux SELECT key, val FROM sourceTableForWithHiveAux;" - -> "", - "SELECT collect_list(array(val)) FROM addJarWithHiveAux;" - -> """[["val_238"],["val_86"],["val_311"],["val_27"],["val_165"]]""", - "DROP TABLE addJarWithHiveAux;" - -> "", - "DROP TABLE sourceTableForWithHiveAux;" - -> "" - ) - } - - test("SPARK-11188 Analysis error reporting") { - runCliWithin(timeout = 2.minute, - errorResponses = Seq("AnalysisException"))( - "select * from nonexistent_table;" - -> "Error in query: Table or view not found: nonexistent_table;" - ) - } - - test("SPARK-11624 Spark SQL CLI should set sessionState only once") { - runCliWithin(2.minute, Seq("-e", "!echo \"This is a test for Spark-11624\";"))( - "" -> "This is a test for Spark-11624") - } - - test("list jars") { - val jarFile = Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar") - runCliWithin(2.minute)( - s"ADD JAR $jarFile;" -> "", - s"LIST JARS;" -> "TestUDTF.jar" - ) - } - - test("list jar ") { - val jarFile = Thread.currentThread().getContextClassLoader.getResource("TestUDTF.jar") - runCliWithin(2.minute)( - s"ADD JAR $jarFile;" -> "", - s"List JAR $jarFile;" -> "TestUDTF.jar" - ) - } - - test("list files") { - val dataFilePath = Thread.currentThread(). - getContextClassLoader.getResource("data/files/small_kv.txt") - runCliWithin(2.minute)( - s"ADD FILE $dataFilePath;" -> "", - s"LIST FILES;" -> "small_kv.txt" - ) - } - - test("list file ") { - val dataFilePath = Thread.currentThread(). - getContextClassLoader.getResource("data/files/small_kv.txt") - runCliWithin(2.minute)( - s"ADD FILE $dataFilePath;" -> "", - s"LIST FILE $dataFilePath;" -> "small_kv.txt" - ) - } - - test("apply hiveconf from cli command") { - runCliWithin(2.minute)( - "SET conf1;" -> "conftest", - "SET conf2;" -> "1", - "SET conf3=${hiveconf:conf1};" -> "conftest", - "SET conf3;" -> "conftest" - ) - } - - test("SPARK-21451: spark.sql.warehouse.dir should respect options in --hiveconf") { - runCliWithin(1.minute)("set spark.sql.warehouse.dir;" -> warehousePath.getAbsolutePath) - } - - test("SPARK-21451: Apply spark.hadoop.* configurations") { - val tmpDir = Utils.createTempDir(namePrefix = "SPARK-21451") - runCliWithin( - 1.minute, - Seq("--conf", s"spark.hadoop.${ConfVars.METASTOREWAREHOUSE}=$tmpDir"))( - "set spark.sql.warehouse.dir;" -> tmpDir.getAbsolutePath) - tmpDir.delete() - } - - test("Support hive.aux.jars.path") { - val hiveContribJar = HiveTestJars.getHiveContribJar().getCanonicalPath - runCliWithin( - 1.minute, - Seq("--conf", s"spark.hadoop.${ConfVars.HIVEAUXJARS}=$hiveContribJar"))( - "CREATE TEMPORARY FUNCTION example_format AS " + - "'org.apache.hadoop.hive.contrib.udf.example.UDFExampleFormat';" -> "", - "SELECT example_format('%o', 93);" -> "135" - ) - } - - test("SPARK-28840 test --jars command") { - val jarFile = new File("../../sql/hive/src/test/resources/SPARK-21101-1.0.jar").getCanonicalPath - runCliWithin( - 1.minute, - Seq("--jars", s"$jarFile"))( - "CREATE TEMPORARY FUNCTION testjar AS" + - " 'org.apache.spark.sql.hive.execution.UDTFStack';" -> "", - "SELECT testjar(1,'TEST-SPARK-TEST-jar', 28840);" -> "TEST-SPARK-TEST-jar\t28840" - ) - } - - test("SPARK-28840 test --jars and hive.aux.jars.path command") { - val jarFile = new File("../../sql/hive/src/test/resources/SPARK-21101-1.0.jar").getCanonicalPath - val hiveContribJar = HiveTestJars.getHiveContribJar().getCanonicalPath - runCliWithin( - 1.minute, - Seq("--jars", s"$jarFile", "--conf", - s"spark.hadoop.${ConfVars.HIVEAUXJARS}=$hiveContribJar"))( - "CREATE TEMPORARY FUNCTION testjar AS" + - " 'org.apache.spark.sql.hive.execution.UDTFStack';" -> "", - "SELECT testjar(1,'TEST-SPARK-TEST-jar', 28840);" -> "TEST-SPARK-TEST-jar\t28840", - "CREATE TEMPORARY FUNCTION example_max AS " + - "'org.apache.hadoop.hive.contrib.udaf.example.UDAFExampleMax';" -> "", - "SELECT concat_ws(',', 'First', example_max(1234321), 'Third');" -> "First,1234321,Third" - ) - } - - test("SPARK-29022 Commands using SerDe provided in ADD JAR sql") { - val dataFilePath = - Thread.currentThread().getContextClassLoader.getResource("data/files/small_kv.txt") - val hiveContribJar = HiveTestJars.getHiveHcatalogCoreJar().getCanonicalPath - runCliWithin( - 3.minute)( - s"ADD JAR ${hiveContribJar};" -> "", - """CREATE TABLE addJarWithSQL(key string, val string) - |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'; - """.stripMargin - -> "", - "CREATE TABLE sourceTableForWithSQL(key INT, val STRING);" - -> "", - s"LOAD DATA LOCAL INPATH '$dataFilePath' OVERWRITE INTO TABLE sourceTableForWithSQL;" - -> "", - "INSERT INTO TABLE addJarWithSQL SELECT key, val FROM sourceTableForWithSQL;" - -> "", - "SELECT collect_list(array(val)) FROM addJarWithSQL;" - -> """[["val_238"],["val_86"],["val_311"],["val_27"],["val_165"]]""", - "DROP TABLE addJarWithSQL;" - -> "", - "DROP TABLE sourceTableForWithSQL;" - -> "" - ) - } - - test("SPARK-26321 Should not split semicolon within quoted string literals") { - runCliWithin(3.minute)( - """select 'Test1', "^;^";""" -> "Test1\t^;^", - """select 'Test2', "\";";""" -> "Test2\t\";", - """select 'Test3', "\';";""" -> "Test3\t';", - "select concat('Test4', ';');" -> "Test4;" - ) - } -} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala index 2b9df67af0d5..6a647b8a86dc 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala @@ -34,17 +34,19 @@ import scala.util.{Random, Try} import com.google.common.io.Files import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.hive.jdbc.HiveDriver +import org.apache.hive.service.cli.thrift.ThriftCLIServiceClient import org.apache.thrift.protocol.TBinaryProtocol import org.apache.thrift.transport.TSocket import org.scalatest.BeforeAndAfterAll -import org.apache.spark.{SparkException, SparkFunSuite} +import org.apache.spark.{SparkException, SparkFunSuite} import org.apache.spark.internal.Logging import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.hive.test.HiveTestJars import org.apache.spark.sql.internal.StaticSQLConf.HIVE_THRIFT_SERVER_SINGLESESSION import org.apache.spark.sql.test.ProcessTestUtils.ProcessOutputCapturer import org.apache.spark.sql.thriftserver.auth.PlainSaslHelper +import org.apache.spark.sql.thriftserver.cli.RowSet import org.apache.spark.util.{ThreadUtils, Utils} object TestData { @@ -59,89 +61,90 @@ object TestData { class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { override def mode: ServerMode.Value = ServerMode.binary - private def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { - // Transport creation logic below mimics HiveConnection.createBinaryTransport - val rawTransport = new TSocket("localhost", serverPort) - val user = System.getProperty("user.name") - val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - val protocol = new TBinaryProtocol(transport) - val client = new ThriftCLIServiceClient(new ThriftserverShimUtils.Client(protocol)) - - transport.open() - try f(client) finally transport.close() - } - - test("GetInfo Thrift API") { - withCLIServiceClient { client => - val user = System.getProperty("user.name") - val sessionHandle = client.openSession(user, "") - - assertResult("Spark SQL", "Wrong GetInfo(CLI_DBMS_NAME) result") { - client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_NAME).getStringValue - } - - assertResult("Spark SQL", "Wrong GetInfo(CLI_SERVER_NAME) result") { - client.getInfo(sessionHandle, GetInfoType.CLI_SERVER_NAME).getStringValue - } - - assertResult(true, "Spark version shouldn't be \"Unknown\"") { - val version = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER).getStringValue - logInfo(s"Spark version: $version") - version != "Unknown" - } - } - } - - test("SPARK-16563 ThriftCLIService FetchResults repeat fetching result") { - withCLIServiceClient { client => - val user = System.getProperty("user.name") - val sessionHandle = client.openSession(user, "") - - withJdbcStatement("test_16563") { statement => - val queries = Seq( - "CREATE TABLE test_16563(key INT, val STRING)", - s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_16563") - - queries.foreach(statement.execute) - val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] - val operationHandle = client.executeStatement( - sessionHandle, - "SELECT * FROM test_16563", - confOverlay) - - // Fetch result first time - assertResult(5, "Fetching result first time from next row") { - - val rows_next = client.fetchResults( - operationHandle, - FetchOrientation.FETCH_NEXT, - 1000, - FetchType.QUERY_OUTPUT) - - rows_next.numRows() - } - - // Fetch result second time from first row - assertResult(5, "Repeat fetching result from first row") { - - val rows_first = client.fetchResults( - operationHandle, - FetchOrientation.FETCH_FIRST, - 1000, - FetchType.QUERY_OUTPUT) - - rows_first.numRows() - } - } - } - } + // private def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { + // // Transport creation logic below mimics HiveConnection.createBinaryTransport + // val rawTransport = new TSocket("localhost", serverPort) + // val user = System.getProperty("user.name") + // val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) + // val protocol = new TBinaryProtocol(transport) + // val client = new ThriftCLIServiceClient(new TCLIService.Client(protocol)) + // + // transport.open() + // try f(client) finally transport.close() + // } + + // test("GetInfo Thrift API") { + // withCLIServiceClient { client => + // val user = System.getProperty("user.name") + // val sessionHandle = client.openSession(user, "") + // + // assertResult("Spark SQL", "Wrong GetInfo(CLI_DBMS_NAME) result") { + // client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_NAME).getStringValue + // } + // + // assertResult("Spark SQL", "Wrong GetInfo(CLI_SERVER_NAME) result") { + // client.getInfo(sessionHandle, GetInfoType.CLI_SERVER_NAME).getStringValue + // } + // + // assertResult(true, "Spark version shouldn't be \"Unknown\"") { + // val version = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER).getStringValue + // logInfo(s"Spark version: $version") + // version != "Unknown" + // } + // } + // } + + // test("SPARK-16563 ThriftCLIService FetchResults repeat fetching result") { + // withCLIServiceClient { client => + // val user = System.getProperty("user.name") + // val sessionHandle = client.openSession(user, "") + // + // withJdbcStatement("test_16563") { statement => + // val queries = Seq( + // "CREATE TABLE test_16563(key INT, val STRING)", + // s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_16563") + // + // queries.foreach(statement.execute) + // val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] + // val operationHandle = client.executeStatement( + // sessionHandle, + // "SELECT * FROM test_16563", + // confOverlay) + // + // // Fetch result first time + // assertResult(5, "Fetching result first time from next row") { + // + // val rows_next = client.fetchResults( + // operationHandle, + // FetchOrientation.FETCH_NEXT, + // 1000, + // FetchType.QUERY_OUTPUT) + // + // rows_next.numRows() + // } + // + // // Fetch result second time from first row + // assertResult(5, "Repeat fetching result from first row") { + // + // val rows_first = client.fetchResults( + // operationHandle, + // FetchOrientation.FETCH_FIRST, + // 1000, + // FetchType.QUERY_OUTPUT) + // + // rows_first.numRows() + // } + // } + // } + // } test("Support beeline --hiveconf and --hivevar") { withJdbcStatement() { statement => executeTest(hiveConfList) executeTest(hiveVarList) + def executeTest(hiveList: String): Unit = { - hiveList.split(";").foreach{ m => + hiveList.split(";").foreach { m => val kv = m.split("=") val k = kv(0) val v = kv(1) @@ -292,10 +295,10 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { { statement => val queries = Seq( - "CREATE TABLE test_map(key INT, value STRING)", - s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_map", - "CACHE TABLE test_table AS SELECT key FROM test_map ORDER BY key DESC", - "CREATE DATABASE db1") + "CREATE TABLE test_map(key INT, value STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_map", + "CACHE TABLE test_table AS SELECT key FROM test_map ORDER BY key DESC", + "CREATE DATABASE db1") queries.foreach(statement.execute) @@ -344,9 +347,9 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { { statement => val queries = Seq( - s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}=291", - "SET hive.cli.print.header=true" - ) + s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}=291", + "SET hive.cli.print.header=true" + ) queries.map(statement.execute) val rs1 = statement.executeQuery(s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}") @@ -443,7 +446,7 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { val f = Future { statement.executeQuery( "SELECT COUNT(*) FROM test_map " + - List.fill(10)("join test_map").mkString(" ")) + List.fill(10)("join test_map").mkString(" ")) } // Note that this is slightly race-prone: if the cancel is issued before the statement // begins executing then we'll fail with a timeout. As a result, this fixed delay is set @@ -627,31 +630,31 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { } } - test("SPARK-23547 Cleanup the .pipeout file when the Hive Session closed") { - def pipeoutFileList(sessionID: UUID): Array[File] = { - lScratchDir.listFiles(new FilenameFilter { - override def accept(dir: File, name: String): Boolean = { - name.startsWith(sessionID.toString) && name.endsWith(".pipeout") - } - }) - } - - withCLIServiceClient { client => - val user = System.getProperty("user.name") - val sessionHandle = client.openSession(user, "") - val sessionID = sessionHandle.getSessionId - - if (HiveUtils.isHive23) { - assert(pipeoutFileList(sessionID).length == 2) - } else { - assert(pipeoutFileList(sessionID).length == 1) - } - - client.closeSession(sessionHandle) - - assert(pipeoutFileList(sessionID).length == 0) - } - } + // test("SPARK-23547 Cleanup the .pipeout file when the Hive Session closed") { + // def pipeoutFileList(sessionID: UUID): Array[File] = { + // lScratchDir.listFiles(new FilenameFilter { + // override def accept(dir: File, name: String): Boolean = { + // name.startsWith(sessionID.toString) && name.endsWith(".pipeout") + // } + // }) + // } + // + // withCLIServiceClient { client => + // val user = System.getProperty("user.name") + // val sessionHandle = client.openSession(user, "") + // val sessionID = sessionHandle.getSessionId + // + // if (HiveUtils.isHive23) { + // assert(pipeoutFileList(sessionID).length == 2) + // } else { + // assert(pipeoutFileList(sessionID).length == 1) + // } + // + // client.closeSession(sessionHandle) + // + // assert(pipeoutFileList(sessionID).length == 0) + // } + // } test("SPARK-24829 Checks cast as float") { withJdbcStatement() { statement => @@ -684,91 +687,91 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { } } - test("ThriftCLIService FetchResults FETCH_FIRST, FETCH_NEXT, FETCH_PRIOR") { - def checkResult(rows: RowSet, start: Long, end: Long): Unit = { - assert(rows.getStartOffset() == start) - assert(rows.numRows() == end - start) - rows.iterator.asScala.zip((start until end).iterator).foreach { case (row, v) => - assert(row(0).asInstanceOf[Long] === v) - } - } - - withCLIServiceClient { client => - val user = System.getProperty("user.name") - val sessionHandle = client.openSession(user, "") - - val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] - val operationHandle = client.executeStatement( - sessionHandle, - "SELECT * FROM range(10)", - confOverlay) // 10 rows result with sequence 0, 1, 2, ..., 9 - var rows: RowSet = null - - // Fetch 5 rows with FETCH_NEXT - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) - checkResult(rows, 0, 5) // fetched [0, 5) - - // Fetch another 2 rows with FETCH_NEXT - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) - checkResult(rows, 5, 7) // fetched [5, 7) - - // FETCH_PRIOR 3 rows - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) - checkResult(rows, 2, 5) // fetched [2, 5) - - // FETCH_PRIOR again will scroll back to 0, and then the returned result - // may overlap the results of previous FETCH_PRIOR - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) - checkResult(rows, 0, 3) // fetched [0, 3) - - // FETCH_PRIOR again will stay at 0 - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_PRIOR, 4, FetchType.QUERY_OUTPUT) - checkResult(rows, 0, 4) // fetched [0, 4) - - // FETCH_NEXT will continue moving forward from offset 4 - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_NEXT, 10, FetchType.QUERY_OUTPUT) - checkResult(rows, 4, 10) // fetched [4, 10) until the end of results - - // FETCH_NEXT is at end of results - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) - checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) - - // FETCH_NEXT is at end of results again - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) - checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) - - // FETCH_PRIOR 1 rows yet again - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_PRIOR, 1, FetchType.QUERY_OUTPUT) - checkResult(rows, 9, 10) // fetched [9, 10) - - // FETCH_NEXT will return 0 yet again - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) - checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) - - // FETCH_FIRST results from first row - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_FIRST, 3, FetchType.QUERY_OUTPUT) - checkResult(rows, 0, 3) // fetch [0, 3) - - // Fetch till the end rows with FETCH_NEXT" - rows = client.fetchResults( - operationHandle, FetchOrientation.FETCH_NEXT, 1000, FetchType.QUERY_OUTPUT) - checkResult(rows, 3, 10) // fetched [3, 10) - - client.closeOperation(operationHandle) - client.closeSession(sessionHandle) - } - } + // test("ThriftCLIService FetchResults FETCH_FIRST, FETCH_NEXT, FETCH_PRIOR") { + // def checkResult(rows: RowSet, start: Long, end: Long): Unit = { + // assert(rows.getStartOffset == start) + // assert(rows.numRows == end - start) + // rows.iterator.asScala.zip((start until end).iterator).foreach { case (row, v) => + // assert(row(0).asInstanceOf[Long] === v) + // } + // } + // + // withCLIServiceClient { client => + // val user = System.getProperty("user.name") + // val sessionHandle = client.openSession(user, "") + // + // val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] + // val operationHandle = client.executeStatement( + // sessionHandle, + // "SELECT * FROM range(10)", + // confOverlay) // 10 rows result with sequence 0, 1, 2, ..., 9 + // var rows: RowSet = null + // + // // Fetch 5 rows with FETCH_NEXT + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + // checkResult(rows, 0, 5) // fetched [0, 5) + // + // // Fetch another 2 rows with FETCH_NEXT + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) + // checkResult(rows, 5, 7) // fetched [5, 7) + // + // // FETCH_PRIOR 3 rows + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) + // checkResult(rows, 2, 5) // fetched [2, 5) + // + // // FETCH_PRIOR again will scroll back to 0, and then the returned result + // // may overlap the results of previous FETCH_PRIOR + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) + // checkResult(rows, 0, 3) // fetched [0, 3) + // + // // FETCH_PRIOR again will stay at 0 + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_PRIOR, 4, FetchType.QUERY_OUTPUT) + // checkResult(rows, 0, 4) // fetched [0, 4) + // + // // FETCH_NEXT will continue moving forward from offset 4 + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_NEXT, 10, FetchType.QUERY_OUTPUT) + // checkResult(rows, 4, 10) // fetched [4, 10) until the end of results + // + // // FETCH_NEXT is at end of results + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + // checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + // + // // FETCH_NEXT is at end of results again + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) + // checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + // + // // FETCH_PRIOR 1 rows yet again + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_PRIOR, 1, FetchType.QUERY_OUTPUT) + // checkResult(rows, 9, 10) // fetched [9, 10) + // + // // FETCH_NEXT will return 0 yet again + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + // checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + // + // // FETCH_FIRST results from first row + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_FIRST, 3, FetchType.QUERY_OUTPUT) + // checkResult(rows, 0, 3) // fetch [0, 3) + // + // // Fetch till the end rows with FETCH_NEXT" + // rows = client.fetchResults( + // operationHandle, FetchOrientation.FETCH_NEXT, 1000, FetchType.QUERY_OUTPUT) + // checkResult(rows, 3, 10) // fetched [3, 10) + // + // client.closeOperation(operationHandle) + // client.closeSession(sessionHandle) + // } + // } } class SingleSessionSuite extends SparkThriftJdbcTest { @@ -789,7 +792,7 @@ class SingleSessionSuite extends SparkThriftJdbcTest { "SET foo=bar", s"ADD JAR $jarURL", s"""CREATE TEMPORARY FUNCTION udtf_count2 - |AS 'org.apache.spark.sql.hive.execution.GenericUDTFCount2' + |AS 'org.apache.spark.sql.hive.execution.GenericUDTFCount2' """.stripMargin ).foreach(statement.execute) }, @@ -981,14 +984,17 @@ abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterA "../../sbin/stop-spark-thriftserver.sh".split("/").mkString(File.separator) private var listeningPort: Int = _ + protected def serverPort: Int = listeningPort protected val hiveConfList = "a=avalue;b=bvalue" protected val hiveVarList = "c=cvalue;d=dvalue" + protected def user = System.getProperty("user.name") protected var warehousePath: File = _ protected var metastorePath: File = _ + protected def metastoreJdbcUri = s"jdbc:derby:;databaseName=$metastorePath;create=true" private val pidDir: File = Utils.createTempDir(namePrefix = "thriftserver-pid") @@ -1121,7 +1127,7 @@ abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterA } } - val process = builder.start() + val process = builder.start() new ProcessOutputCapturer(process.getInputStream, captureOutput).start() new ProcessOutputCapturer(process.getErrorStream, captureOutput).start() diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala index 478475fdb396..76d4fb1ad716 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkMetadataOperationSuite.scala @@ -19,6 +19,8 @@ package org.apache.spark.sql.thriftserver import java.sql.{DatabaseMetaData, ResultSet} +import org.apache.spark.sql.thriftserver.cli.Type + class SparkMetadataOperationSuite extends SparkThriftJdbcTest { override def mode: ServerMode.Value = ServerMode.binary @@ -244,7 +246,7 @@ class SparkMetadataOperationSuite extends SparkThriftJdbcTest { withJdbcStatement() { statement => val metaData = statement.getConnection.getMetaData - checkResult(metaData.getTypeInfo, ThriftserverShimUtils.supportedType().map(_.getName)) + checkResult(metaData.getTypeInfo, Type.values.map(_.getName)) } } } diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala deleted file mode 100644 index c3d0da7a448e..000000000000 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerProtocolVersionsSuite.scala +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.sql.{Date, Timestamp} -import java.util.{Properties, List => JList} - -import org.apache.hive.jdbc.{HiveConnection, HiveQueryResultSet} -import org.apache.thrift.protocol.TBinaryProtocol -import org.apache.thrift.transport.TSocket - -import org.apache.spark.sql.catalyst.util.NumberConverter -import org.apache.spark.sql.thriftserver.auth.PlainSaslHelper -import org.apache.spark.unsafe.types.UTF8String - -class SparkThriftServerProtocolVersionsSuite extends SparkThriftJdbcTest { - - override def mode: ServerMode.Value = ServerMode.binary - - def testExecuteStatementWithProtocolVersion( - version: ThriftserverShimUtils.TProtocolVersion, - sql: String)(f: HiveQueryResultSet => Unit): Unit = { - val rawTransport = new TSocket("localhost", serverPort) - val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) - val user = System.getProperty("user.name") - val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) - transport.open() - var rs: HiveQueryResultSet = null - try { - val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) - val openResp = client.OpenSession(clientProtocol) - val sessHandle = openResp.getSessionHandle - val execReq = new ThriftserverShimUtils.TExecuteStatementReq(sessHandle, sql) - val execResp = client.ExecuteStatement(execReq) - val stmtHandle = execResp.getOperationHandle - - // Set the HiveConnection protocol to our testing protocol version. - // RowSetFactory uses this protocol version to construct different RowSet. - val protocol = connection.getClass.getDeclaredField("protocol") - protocol.setAccessible(true) - protocol.set(connection, version) - assert(connection.getProtocol === version) - - rs = new HiveQueryResultSet.Builder(connection) - .setClient(client) - .setSessionHandle(sessHandle) - .setStmtHandle(stmtHandle).setMaxRows(Int.MaxValue).setFetchSize(Int.MaxValue) - .build() - f(rs) - } finally { - rs.close() - connection.close() - transport.close() - rawTransport.close() - } - } - - def testGetInfoWithProtocolVersion(version: ThriftserverShimUtils.TProtocolVersion): Unit = { - val rawTransport = new TSocket("localhost", serverPort) - val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) - val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) - transport.open() - try { - val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) - val openResp = client.OpenSession(clientProtocol) - val sessHandle = openResp.getSessionHandle - - val dbVersionReq = - new ThriftserverShimUtils.TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_VER.toTGetInfoType) - val dbVersion = client.GetInfo(dbVersionReq).getInfoValue.getStringValue - - val dbNameReq = - new ThriftserverShimUtils.TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_NAME.toTGetInfoType) - val dbName = client.GetInfo(dbNameReq).getInfoValue.getStringValue - - assert(dbVersion === org.apache.spark.SPARK_VERSION) - assert(dbName === "Spark SQL") - } finally { - connection.close() - transport.close() - rawTransport.close() - } - } - - def testGetTablesWithProtocolVersion( - version: ThriftserverShimUtils.TProtocolVersion, - schema: String, - tableNamePattern: String, - tableTypes: JList[String])(f: HiveQueryResultSet => Unit): Unit = { - val rawTransport = new TSocket("localhost", serverPort) - val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) - val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) - transport.open() - var rs: HiveQueryResultSet = null - try { - val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) - val openResp = client.OpenSession(clientProtocol) - val sessHandle = openResp.getSessionHandle - val getTableReq = new ThriftserverShimUtils.TGetTablesReq(sessHandle) - getTableReq.setSchemaName(schema) - getTableReq.setTableName(tableNamePattern) - getTableReq.setTableTypes(tableTypes) - - val getTableResp = client.GetTables(getTableReq) - - // Set the HiveConnection protocol to our testing protocol version. - // RowSetFactory uses this protocol version to construct different RowSet. - val protocol = connection.getClass.getDeclaredField("protocol") - protocol.setAccessible(true) - protocol.set(connection, version) - assert(connection.getProtocol === version) - - rs = new HiveQueryResultSet.Builder(connection) - .setClient(client) - .setSessionHandle(sessHandle) - .setStmtHandle(getTableResp.getOperationHandle) - .build() - f(rs) - } finally { - rs.close() - connection.close() - transport.close() - rawTransport.close() - } - } - - ThriftserverShimUtils.testedProtocolVersions.foreach { version => - test(s"$version get byte type") { - testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as byte)") { rs => - assert(rs.next()) - assert(rs.getByte(1) === 1.toByte) - } - } - - test(s"$version get short type") { - testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as short)") { rs => - assert(rs.next()) - assert(rs.getShort(1) === 1.toShort) - } - } - - test(s"$version get int type") { - testExecuteStatementWithProtocolVersion(version, "SELECT 1") { rs => - assert(rs.next()) - assert(rs.getInt(1) === 1) - } - } - - test(s"$version get bigint type") { - testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as bigint)") { rs => - assert(rs.next()) - assert(rs.getLong(1) === 1L) - } - } - - test(s"$version get float type") { - testExecuteStatementWithProtocolVersion(version, "SELECT cast(1.2 as float)") { rs => - assert(rs.next()) - assert(rs.getFloat(1) === 1.2F) - } - } - - test(s"$version get double type") { - testExecuteStatementWithProtocolVersion(version, "SELECT cast(1.2 as double)") { rs => - assert(rs.next()) - assert(rs.getDouble(1) === 1.2D) - } - } - - test(s"$version get decimal type") { - testExecuteStatementWithProtocolVersion(version, - "SELECT cast(1 as decimal(18, 2)) as c") { rs => - assert(rs.next()) - assert(rs.getBigDecimal(1) === new java.math.BigDecimal("1.00")) - } - } - - test(s"$version get string type") { - testExecuteStatementWithProtocolVersion(version, "SELECT 'str'") { rs => - assert(rs.next()) - assert(rs.getString(1) === "str") - } - } - - test(s"$version get char type") { - testExecuteStatementWithProtocolVersion(version, - "SELECT cast('char-str' as char(10))") { rs => - assert(rs.next()) - assert(rs.getString(1) === "char-str") - } - } - - test(s"$version get varchar type") { - testExecuteStatementWithProtocolVersion(version, - "SELECT cast('varchar-str' as varchar(10))") { rs => - assert(rs.next()) - assert(rs.getString(1) === "varchar-str") - } - } - - test(s"$version get binary type") { - testExecuteStatementWithProtocolVersion(version, "SELECT cast('ABC' as binary)") { rs => - assert(rs.next()) - assert(rs.getString(1) === "ABC") - } - testExecuteStatementWithProtocolVersion(version, "SELECT cast(49960 as binary)") { rs => - assert(rs.next()) - assert(rs.getString(1) === UTF8String.fromBytes(NumberConverter.toBinary(49960)).toString) - } - testExecuteStatementWithProtocolVersion(version, "SELECT cast(null as binary)") { rs => - assert(rs.next()) - assert(rs.getString(1) === null) - } - } - - test(s"$version get boolean type") { - testExecuteStatementWithProtocolVersion(version, "SELECT true") { rs => - assert(rs.next()) - assert(rs.getBoolean(1) === true) - } - } - - test(s"$version get date type") { - testExecuteStatementWithProtocolVersion(version, "SELECT cast('2019-07-22' as date)") { rs => - assert(rs.next()) - assert(rs.getDate(1) === Date.valueOf("2019-07-22")) - } - } - - test(s"$version get timestamp type") { - testExecuteStatementWithProtocolVersion(version, - "SELECT cast('2019-07-22 18:14:00' as timestamp)") { rs => - assert(rs.next()) - assert(rs.getTimestamp(1) === Timestamp.valueOf("2019-07-22 18:14:00")) - } - } - - test(s"$version get void") { - testExecuteStatementWithProtocolVersion(version, "SELECT null") { rs => - assert(rs.next()) - assert(rs.getString(1) === null) - } - } - - test(s"$version get interval type") { - testExecuteStatementWithProtocolVersion(version, "SELECT interval '1' year '2' day") { rs => - assert(rs.next()) - assert(rs.getString(1) === "interval 1 years 2 days") - } - } - - test(s"$version get array type") { - testExecuteStatementWithProtocolVersion(version, "SELECT array(1, 2)") { rs => - assert(rs.next()) - assert(rs.getString(1) === "[1,2]") - } - } - - test(s"$version get map type") { - testExecuteStatementWithProtocolVersion(version, "SELECT map(1, 2)") { rs => - assert(rs.next()) - assert(rs.getString(1) === "{1:2}") - } - } - - test(s"$version get struct type") { - testExecuteStatementWithProtocolVersion(version, - "SELECT struct('alpha' AS A, 'beta' AS B)") { rs => - assert(rs.next()) - assert(rs.getString(1) === """{"A":"alpha","B":"beta"}""") - } - } - - test(s"$version get info") { - testGetInfoWithProtocolVersion(version) - } - - test(s"$version get tables") { - def checkResult(tableNames: Seq[String], rs: HiveQueryResultSet): Unit = { - if (tableNames.nonEmpty) { - for (i <- tableNames.indices) { - assert(rs.next()) - assert(rs.getString("TABLE_NAME") === tableNames(i)) - } - } else { - assert(!rs.next()) - } - } - - withJdbcStatement("table1", "table2") { statement => - Seq( - "CREATE TABLE table1(key INT, val STRING)", - "CREATE TABLE table2(key INT, val STRING)").foreach(statement.execute) - - testGetTablesWithProtocolVersion(version, "%", "%", null) { rs => - checkResult(Seq("table1", "table2"), rs) - } - - testGetTablesWithProtocolVersion(version, "%", "table1", null) { rs => - checkResult(Seq("table1"), rs) - } - } - } - } -} diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala index aced0283896c..4622bec8f046 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala @@ -34,6 +34,7 @@ import org.apache.spark.sql.catalyst.util.fileToString import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types._ /** @@ -47,7 +48,7 @@ import org.apache.spark.sql.types._ */ class ThriftServerQueryTestSuite extends SQLQueryTestSuite { - private var hiveServer2: SparkThriftServer2 = _ + private var hiveServer2: SparkThriftServer = _ override def beforeAll(): Unit = { super.beforeAll() @@ -285,7 +286,7 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite { logInfo(s"Trying to start HiveThriftServer2: port=$port, attempt=$attempt") val sqlContext = spark.newSession().sqlContext sqlContext.setConf(ConfVars.HIVE_SERVER2_THRIFT_PORT.varname, port.toString) - hiveServer2 = HiveThriftServer2.startWithContext(sqlContext) + hiveServer2 = SparkThriftServer2.startWithContext(sqlContext) } private def withJdbcStatement(fs: (Statement => Unit)*): Unit = { diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala index f13afbce5cd4..648162eea2cf 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/UISeleniumSuite.scala @@ -27,6 +27,7 @@ import org.scalatest.concurrent.Eventually._ import org.scalatest.time.SpanSugar._ import org.scalatestplus.selenium.WebBrowser +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.ui.SparkUICssErrorHandler class UISeleniumSuite @@ -34,7 +35,7 @@ class UISeleniumSuite with WebBrowser with Matchers with BeforeAndAfterAll { implicit var webDriver: WebDriver = _ - var server: SparkThriftServer2 = _ + var server: SparkThriftServer = _ val uiPort = 20000 + Random.nextInt(10000) override def mode: ServerMode.Value = ServerMode.binary From e1bb6e1f846e5195992734efd8d113cb62499d2b Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 30 Oct 2019 00:59:46 +0800 Subject: [PATCH 24/55] fix for UT --- sql/thriftserver/pom.xml | 52 +++++++++++++++++++ .../sql/thriftserver/auth/HttpAuthUtils.scala | 6 +-- .../sql/thriftserver/cli/CLIService.scala | 13 ++--- .../sql/thriftserver/cli/ICLIService.scala | 12 +++-- .../sql/thriftserver/cli/SchemaMapper.scala | 1 + .../cli/operation/OperationManager.scala | 7 +-- .../SparkExecuteStatementOperation.scala | 2 +- .../operation/SparkGetColumnsOperation.scala | 2 +- .../operation/SparkGetTablesOperation.scala | 33 +++++++++--- .../cli/session/SessionManager.scala | 10 ++-- .../cli/session/ThriftServerSession.scala | 12 +++-- .../cli/session/ThriftServerSessionImpl.scala | 15 +++--- .../cli/thrift/ThriftCLIService.scala | 10 ++-- .../cli/utils/VariableSubstitution.scala | 16 +++--- 14 files changed, 133 insertions(+), 58 deletions(-) diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index d935e67b2b64..8d5b2adf0851 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -77,6 +77,58 @@ ${hive.group} hive-beeline + + ${hive.group} + hive-service + ${hive.version} + test + + + ${hive.group} + hive-exec + + + ${hive.group} + hive-metastore + + + org.eclipse.jetty.aggregate + jetty-all + + + commons-codec + commons-codec + + + commons-cli + commons-cli + + + commons-lang + commons-lang + + + commons-logging + commons-logging + + + org.apache.thrift + libfb303 + + + org.apache.thrift + libthrift + + + org.apache.curator + curator-framework + + + org.apache.curator + curator-recipes + + + org.eclipse.jetty jetty-server diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala index d946281a2b52..84c68214858b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala @@ -159,11 +159,9 @@ object HttpAuthUtils { class HttpKerberosClientAction(val serverPrincipal: String, val serverHttpUrl: String) extends PrivilegedExceptionAction[String] { - base64codec = new Base64(0) - httpContext = new BasicHttpContext + final private val base64codec: Base64 = new Base64(0) + final private val httpContext: HttpContext = new BasicHttpContext httpContext.setAttribute(HttpKerberosClientAction.SERVER_HTTP_URL, serverHttpUrl) - final private var base64codec: Base64 = null - final private var httpContext: HttpContext = null @throws[Exception] override def run: String = { // This Oid for Kerberos GSS-API mechanism. diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala index f980807a70b9..436de8a8c070 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -18,6 +18,7 @@ package org.apache.spark.sql.thriftserver.cli import java.io.IOException +import java.util.{List => JList, Map => JMap} import java.util.concurrent.{CancellationException, ExecutionException, TimeoutException, TimeUnit} import javax.security.auth.login.LoginException @@ -102,7 +103,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex username: String, password: String, ipAddress: String, - configuration: Predef.Map[String, String]): SessionHandle = { + configuration: JMap[String, String]): SessionHandle = { val sessionHandle = sessionManager.openSession(protocol, username, @@ -119,7 +120,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex username: String, password: String, ipAddress: String, - configuration: Predef.Map[String, String], + configuration: JMap[String, String], delegationToken: String): SessionHandle = { val sessionHandle = sessionManager.openSession(protocol, @@ -148,7 +149,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex override def executeStatement(sessionHandle: SessionHandle, statement: String, - confOverlay: Predef.Map[String, String]): OperationHandle = { + confOverlay: JMap[String, String]): OperationHandle = { val session = sessionManager.getSession(sessionHandle) val opHandle: OperationHandle = session.executeStatement(statement, confOverlay) logDebug(sessionHandle + ": executeStatement()") @@ -157,7 +158,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex override def executeStatementAsync(sessionHandle: SessionHandle, statement: String, - confOverlay: Predef.Map[String, String]): OperationHandle = { + confOverlay: JMap[String, String]): OperationHandle = { val opHandle: OperationHandle = sessionManager.getSession(sessionHandle) .executeStatementAsync(statement, confOverlay) @@ -172,7 +173,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex } override def getCatalogs(sessionHandle: SessionHandle): OperationHandle = { - val opHandle: OperationHandle = sessionManager.getSession(sessionHandle).getTypeInfo + val opHandle: OperationHandle = sessionManager.getSession(sessionHandle).getCatalogs logDebug(sessionHandle + ": getTypeInfo()") opHandle } @@ -192,7 +193,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex catalogName: String, schemaName: String, tableName: String, - tableTypes: List[String]): OperationHandle = { + tableTypes: JList[String]): OperationHandle = { val opHandle: OperationHandle = sessionManager.getSession(sessionHandle) .getTables(catalogName, schemaName, tableName, tableTypes) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala index a3886dde2673..e8fff26f79cb 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala @@ -17,6 +17,8 @@ package org.apache.spark.sql.thriftserver.cli +import java.util.{List => JList, Map => JMap} + import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory import org.apache.spark.sql.thriftserver.cli.thrift._ import org.apache.spark.sql.types.StructType @@ -29,14 +31,14 @@ private[thriftserver] trait ICLIService { username: String, password: String, ipAddress: String, - configuration: Map[String, String]): SessionHandle + configuration: JMap[String, String]): SessionHandle @throws[SparkThriftServerSQLException] def openSessionWithImpersonation(protocol: TProtocolVersion, username: String, password: String, ipAddress: String, - configuration: Map[String, String], + configuration: JMap[String, String], delegationToken: String): SessionHandle @throws[SparkThriftServerSQLException] @@ -49,12 +51,12 @@ private[thriftserver] trait ICLIService { @throws[SparkThriftServerSQLException] def executeStatement(sessionHandle: SessionHandle, statement: String, - confOverlay: Map[String, String]): OperationHandle + confOverlay: JMap[String, String]): OperationHandle @throws[SparkThriftServerSQLException] def executeStatementAsync(sessionHandle: SessionHandle, statement: String, - confOverlay: Map[String, String]): OperationHandle + confOverlay: JMap[String, String]): OperationHandle @throws[SparkThriftServerSQLException] def getTypeInfo(sessionHandle: SessionHandle): OperationHandle @@ -72,7 +74,7 @@ private[thriftserver] trait ICLIService { catalogName: String, schemaName: String, tableName: String, - tableTypes: List[String]): OperationHandle + tableTypes: JList[String]): OperationHandle @throws[SparkThriftServerSQLException] def getTableTypes(sessionHandle: SessionHandle): OperationHandle diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index d9b82220d599..7aa3fbb32d8b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -49,6 +49,7 @@ private[thriftserver] object SchemaMapper { case _: ArrayType => TTypeId.ARRAY_TYPE case _: MapType => TTypeId.MAP_TYPE case _: StructType => TTypeId.STRUCT_TYPE + case _: CalendarIntervalType => TTypeId.STRING_TYPE case _: UserDefinedType[_] => TTypeId.USER_DEFINED_TYPE case other => val catalogString = if (other != null) { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala index 9c7b618e0b57..07db416115e1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.thriftserver.cli.operation import java.sql.SQLException import java.util +import java.util.{List => JList, Map => JMap} import java.util.concurrent.ConcurrentHashMap import scala.collection.JavaConverters._ @@ -74,7 +75,7 @@ private[thriftserver] class OperationManager def newExecuteStatementOperation(parentSession: ThriftServerSession, statement: String, - confOverlay: Map[String, String], + confOverlay: JMap[String, String], async: Boolean): SparkExecuteStatementOperation = synchronized { val sqlContext = sessionToContexts.get(parentSession.getSessionHandle) require(sqlContext != null, s"Session handle: ${parentSession.getSessionHandle} has not been" + @@ -127,12 +128,12 @@ private[thriftserver] class OperationManager catalogName: String, schemaName: String, tableName: String, - tableTypes: List[String]): SparkMetadataOperation = synchronized { + tableTypes: JList[String]): SparkMetadataOperation = synchronized { val sqlContext = sessionToContexts.get(session.getSessionHandle) require(sqlContext != null, s"Session handle: ${session.getSessionHandle} has not been" + " initialized or had already closed.") val operation = new SparkGetTablesOperation(sqlContext, session, - catalogName, schemaName, tableName, tableTypes.asJava) + catalogName, schemaName, tableName, tableTypes) handleToOperation.put(operation.getHandle, operation) logDebug(s"Created GetTablesOperation with session=$session.") operation diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala index 2e092b37adb9..6850c4847f08 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala @@ -42,7 +42,7 @@ import org.apache.spark.util.{Utils => SparkUtils} private[thriftserver] class SparkExecuteStatementOperation( parentSession: ThriftServerSession, statement: String, - confOverlay: Map[String, String], + confOverlay: JMap[String, String], runInBackground: Boolean = true)(sqlContext: SQLContext, sessionToActivePool: JMap[SessionHandle, String]) extends Operation(parentSession, EXECUTE_STATEMENT, runInBackground) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala index bd53dbfeb48d..5869842c64a8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala @@ -184,7 +184,7 @@ private[thriftserver] class SparkGetColumnsOperation( dbName, // TABLE_SCHEM tableName, // TABLE_NAME column.name, // COLUMN_NAME - Type.getType(column.dataType.sql).getName, // DATA_TYPE + Type.getType(column.dataType.sql).toJavaSQLType, // DATA_TYPE column.dataType.sql, // TYPE_NAME null, // COLUMN_SIZE null, // BUFFER_LENGTH, unused diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala index 43d773220dba..57868247485a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -23,7 +23,6 @@ import java.util.regex.Pattern import scala.collection.JavaConverters._ import org.apache.commons.lang3.exception.ExceptionUtils -import org.apache.hadoop.hive.conf.HiveConf import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObjectUtils} import org.apache.spark.internal.Logging @@ -56,12 +55,26 @@ private[thriftserver] class SparkGetTablesOperation( extends SparkMetadataOperation(parentSession, GET_TABLES) with Logging { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TABLE_CAT", StringType)) - .add(StructField("TABLE_SCHEM", StringType)) - .add(StructField("TABLE_NAME", StringType)) - .add(StructField("TABLE_TYPE", StringType)) - .add(StructField("REMARKS", StringType)) + if (HiveUtils.isHive23) { + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TABLE_CAT", StringType)) + .add(StructField("TABLE_SCHEM", StringType)) + .add(StructField("TABLE_NAME", StringType)) + .add(StructField("TABLE_TYPE", StringType)) + .add(StructField("REMARKS", StringType)) + .add(StructField("TYPE_CAT", StringType)) + .add(StructField("TYPE_SCHEM", StringType)) + .add(StructField("TYPE_NAME", StringType)) + .add(StructField("SELF_REFERENCING_COL_NAME", StringType)) + .add(StructField("REF_GENERATION", StringType)) + } else { + RESULT_SET_SCHEMA = new StructType() + .add(StructField("TABLE_CAT", StringType)) + .add(StructField("TABLE_SCHEM", StringType)) + .add(StructField("TABLE_NAME", StringType)) + .add(StructField("TABLE_TYPE", StringType)) + .add(StructField("REMARKS", StringType)) + } private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) @@ -74,7 +87,11 @@ private[thriftserver] class SparkGetTablesOperation( setStatementId(UUID.randomUUID().toString) // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" - val tableTypesStr = if (tableTypes == null) "null" else tableTypes.asScala.mkString(",") + val tableTypesStr = if (tableTypes == null) { + "null" + } else { + tableTypes.asScala.mkString(",") + } val logMsg = s"Listing tables '$cmdStr, tableTypes : $tableTypesStr, tableName : $tableName'" logInfo(s"$logMsg with $statementId") setState(RUNNING) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index 2b24e25c2696..e4c203c6a93a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -18,7 +18,7 @@ package org.apache.spark.sql.thriftserver.cli.session import java.io.{File, IOException} -import java.util.Date +import java.util.{Date, List => JList, Map => JMap} import java.util.concurrent._ import org.apache.commons.io.FileUtils @@ -205,7 +205,7 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo username: String, password: String, ipAddress: String, - sessionConf: Map[String, String]): SessionHandle = + sessionConf: JMap[String, String]): SessionHandle = openSession(protocol, username, password, ipAddress, sessionConf, false, null) @throws[SparkThriftServerSQLException] @@ -213,7 +213,7 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo username: String, password: String, ipAddress: String, - sessionConf: Map[String, String], + sessionConf: JMap[String, String], withImpersonation: Boolean, delegationToken: String): SessionHandle = { var session: ThriftServerSession = null @@ -260,8 +260,8 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo sqlContext.newSession() } ctx.setConf(HiveUtils.FAKE_HIVE_VERSION.key, HiveUtils.builtinHiveVersion) - if (sessionConf != null && sessionConf.contains("use:database")) { - ctx.sql(s"use ${sessionConf.get("use:database").get}") + if (sessionConf != null && sessionConf.containsKey("use:database")) { + ctx.sql(s"use ${sessionConf.get("use:database")}") } operationManager.sessionToContexts.put(sessionHandle, ctx) sessionHandle diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala index 867594ed8804..f3274d79401e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala @@ -17,6 +17,8 @@ package org.apache.spark.sql.thriftserver.cli.session +import java.util.{List => JList, Map => JMap} + import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.types.StructType @@ -24,7 +26,7 @@ import org.apache.spark.sql.types.StructType private[thriftserver] trait ThriftServerSession extends ThriftServerSessionBase { @throws[SparkThriftServerSQLException] - def open(sessionConfMap: Map[String, String]): Unit + def open(sessionConfMap: JMap[String, String]): Unit /** * getInfo operation handler @@ -46,11 +48,11 @@ private[thriftserver] trait ThriftServerSession extends ThriftServerSessionBase */ @throws[SparkThriftServerSQLException] def executeStatement(statement: String, - confOverlay: Map[String, String]): OperationHandle + confOverlay: JMap[String, String]): OperationHandle @throws[SparkThriftServerSQLException] def executeStatementAsync(statement: String, - confOverlay: Map[String, String]): OperationHandle + confOverlay: JMap[String, String]): OperationHandle /** * getTypeInfo operation handler @@ -96,10 +98,10 @@ private[thriftserver] trait ThriftServerSession extends ThriftServerSessionBase def getTables(catalogName: String, schemaName: String, tableName: String, - tableTypes: List[String]): OperationHandle + tableTypes: JList[String]): OperationHandle /** - * getTableTypes operation handler + * getTableTypes operListation handler * * @return * @throws SparkThriftServerSQLException diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index 74292e062706..567ce1311eb5 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.thriftserver.cli.session import java.io._ import java.util +import java.util.{List => JList, Map => JMap} import scala.collection.JavaConverters._ @@ -56,20 +57,20 @@ private[thriftserver] class ThriftServerSessionImpl( private var _lastIdleTime: Long = 0L @throws[SparkThriftServerSQLException] - override def open(sessionConfMap: Map[String, String]): Unit = { + override def open(sessionConfMap: JMap[String, String]): Unit = { _sessionState = new SessionState(_hiveConf, username) _sessionState.setUserIpAddress(ipAddress) _sessionState.setIsHiveServerQuery(true) SessionState.start(_sessionState) if (sessionConfMap != null) { - configureSession(sessionConfMap.asJava) + configureSession(sessionConfMap) } _lastAccessTime = System.currentTimeMillis _lastIdleTime = _lastAccessTime } @throws[SparkThriftServerSQLException] - private def configureSession(sessionConfMap: util.Map[String, String]): Unit = { + private def configureSession(sessionConfMap: JMap[String, String]): Unit = { SessionState.setCurrentSessionState(_sessionState) sessionConfMap.entrySet().forEach(entry => { @@ -189,18 +190,18 @@ private[thriftserver] class ThriftServerSessionImpl( * @throws SparkThriftServerSQLException */ override def executeStatement(statement: String, - confOverlay: Map[String, String]): OperationHandle = { + confOverlay: JMap[String, String]): OperationHandle = { executeStatementInternal(statement, confOverlay, false) } override def executeStatementAsync(statement: String, - confOverlay: Map[String, String]): OperationHandle = { + confOverlay: JMap[String, String]): OperationHandle = { executeStatementInternal(statement, confOverlay, true) } @throws[SparkThriftServerSQLException] private def executeStatementInternal(statement: String, - confOverlay: Map[String, String], + confOverlay: JMap[String, String], runAsync: Boolean): OperationHandle = { acquire(true) val operationManager = getOperationManager @@ -318,7 +319,7 @@ private[thriftserver] class ThriftServerSessionImpl( override def getTables(catalogName: String, schemaName: String, tableName: String, - tableTypes: List[String]): OperationHandle = { + tableTypes: JList[String]): OperationHandle = { acquire(true) val operationManager = getOperationManager val operation = diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala index f06944b09053..6f3e5e7e5eb8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala @@ -383,14 +383,14 @@ private[thriftserver] abstract class ThriftCLIService(cliService: CLIService, se userName, req.getPassword, ipAddress, - req.getConfiguration.asScala.toMap, + req.getConfiguration, delegationTokenStr) } else sessionHandle = cliService.openSession( protocol, userName, req.getPassword, ipAddress, - req.getConfiguration.asScala.toMap) + req.getConfiguration) sessionHandle } @@ -476,9 +476,9 @@ private[thriftserver] abstract class ThriftCLIService(cliService: CLIService, se val confOverlay: util.Map[String, String] = req.getConfOverlay val runAsync: Boolean = req.isRunAsync val operationHandle: OperationHandle = if (runAsync) { - cliService.executeStatementAsync(sessionHandle, statement, confOverlay.asScala.toMap) + cliService.executeStatementAsync(sessionHandle, statement, confOverlay) } else { - cliService.executeStatement(sessionHandle, statement, confOverlay.asScala.toMap) + cliService.executeStatement(sessionHandle, statement, confOverlay) } resp.setOperationHandle(operationHandle.toTOperationHandle) resp.setStatus(OK_STATUS) @@ -549,7 +549,7 @@ private[thriftserver] abstract class ThriftCLIService(cliService: CLIService, se req.getCatalogName, req.getSchemaName, req.getTableName, - req.getTableTypes.asScala.toList) + req.getTableTypes) resp.setOperationHandle(opHandle.toTOperationHandle) resp.setStatus(OK_STATUS) } catch { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala index 138fdc64fd00..4fdcf701571e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala @@ -1,13 +1,12 @@ /* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -16,6 +15,7 @@ * limitations under the License. */ + package org.apache.spark.sql.thriftserver.cli.utils import java.util From 74fb240f7aabb3d28150877b1f99eae50beb66f5 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 30 Oct 2019 00:59:58 +0800 Subject: [PATCH 25/55] fix UT --- .../apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala index 6a647b8a86dc..365e65ee8ca1 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala @@ -34,7 +34,6 @@ import scala.util.{Random, Try} import com.google.common.io.Files import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.hive.jdbc.HiveDriver -import org.apache.hive.service.cli.thrift.ThriftCLIServiceClient import org.apache.thrift.protocol.TBinaryProtocol import org.apache.thrift.transport.TSocket import org.scalatest.BeforeAndAfterAll From 2f90ed9cdbcc00c7c9a3163199a1e09cf79928de Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 30 Oct 2019 18:54:28 +0800 Subject: [PATCH 26/55] fix for UT --- .../sql/thriftserver/SparkThriftServer2.scala | 10 +- .../sql/thriftserver/cli/CLIService.scala | 75 ++- .../thriftserver/cli/CLIServiceClient.scala | 64 +++ .../sql/thriftserver/cli/ColumnBasedSet.scala | 21 +- .../sql/thriftserver/cli/ColumnBuffer.scala | 206 ++++++++ .../thriftserver/cli/FetchOrientation.scala | 5 + .../sql/thriftserver/cli/ICLIService.scala | 23 +- .../sql/thriftserver/cli/RowBasedSet.scala | 1 + .../spark/sql/thriftserver/cli/RowSet.scala | 2 + .../sql/thriftserver/cli/RowSetFactory.scala | 54 +- .../sql/thriftserver/cli/SchemaMapper.scala | 49 +- .../spark/sql/thriftserver/cli/Type.scala | 1 - .../cli/operation/OperationManager.scala | 29 +- .../operation/SparkGetTablesOperation.scala | 11 +- .../cli/session/SessionManager.scala | 11 + .../cli/session/ThriftServerSession.scala | 13 +- .../cli/session/ThriftServerSessionImpl.scala | 53 +- .../ThriftServerSessionImplWithUgi.scala | 5 +- .../cli/thrift/ThriftCLIService.scala | 3 +- .../cli/thrift/ThriftCLIServiceClient.scala | 461 ++++++++++++++++++ 20 files changed, 1032 insertions(+), 65 deletions(-) create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala create mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala index fcd271f10996..448cb525ea66 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala @@ -45,12 +45,12 @@ object SparkThriftServer2 extends Logging { var uiTab: Option[ThriftServerTab] = None var listener: SparkThriftServerListener = _ - def hiveConfForExecution(): HiveConf = { + def hiveConfForExecution(sparkContext: SparkContext): HiveConf = { val extraConfig = HiveUtils.newTemporaryConfiguration(true) val hiveConf: HiveConf = new HiveConf() - (SparkSQLEnv.sparkContext.hadoopConfiguration + (sparkContext.hadoopConfiguration .iterator().asScala.map(kv => kv.getKey -> kv.getValue) - ++ SparkSQLEnv.sparkContext.conf.getAll.toMap ++ extraConfig).toMap + ++ sparkContext.conf.getAll.toMap ++ extraConfig).toMap .foreach { case (k, v) => hiveConf.set(k, v) } hiveConf } @@ -63,7 +63,7 @@ object SparkThriftServer2 extends Logging { def startWithContext(sqlContext: SQLContext): SparkThriftServer = { val server = new SparkThriftServer(sqlContext) - server.init(hiveConfForExecution()) + server.init(hiveConfForExecution(sqlContext.sparkContext)) server.start() listener = new SparkThriftServerListener(server, sqlContext.conf) sqlContext.sparkContext.addSparkListener(listener) @@ -97,7 +97,7 @@ object SparkThriftServer2 extends Logging { try { val server = new SparkThriftServer(SparkSQLEnv.sqlContext) - server.init(hiveConfForExecution()) + server.init(hiveConfForExecution(SparkSQLEnv.sparkContext)) server.start() logInfo("HiveThriftServer2 started") listener = new SparkThriftServerListener(server, SparkSQLEnv.sqlContext.conf) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala index 436de8a8c070..969ebcae619a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -40,7 +40,7 @@ import org.apache.spark.sql.types.StructType private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContext: SQLContext) extends CompositeService(classOf[CLIService].getSimpleName) - with ICLIService with Logging { + with ICLIService with Logging { private var hiveConf: HiveConf = null private var sessionManager: SessionManager = null @@ -99,7 +99,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex def getHttpUGI: UserGroupInformation = this.httpUGI - override def openSession(protocol: TProtocolVersion, + def openSession(protocol: TProtocolVersion, username: String, password: String, ipAddress: String, @@ -116,7 +116,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex sessionHandle } - override def openSessionWithImpersonation(protocol: TProtocolVersion, + def openSessionWithImpersonation(protocol: TProtocolVersion, username: String, password: String, ipAddress: String, @@ -134,6 +134,37 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex sessionHandle } + override def openSession(username: String, + password: String, + configuration: JMap[String, String]): SessionHandle = { + val sessionHandle = + sessionManager.openSession(CLIService.SERVER_VERSION, + username, + password, + null, + configuration, + false, + null) + logDebug(sessionHandle + ": openSession()") + sessionHandle + } + + override def openSessionWithImpersonation(username: String, + password: String, + configuration: JMap[String, String], + delegationToken: String): SessionHandle = { + val sessionHandle = + sessionManager.openSession(CLIService.SERVER_VERSION, + username, + password, + null, + configuration, + true, + delegationToken) + logDebug(sessionHandle + ": openSessionWithImpersonation()") + sessionHandle + } + override def closeSession(sessionHandle: SessionHandle): Unit = { sessionManager.closeSession(sessionHandle) logDebug(sessionHandle + ": closeSession()") @@ -142,7 +173,12 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex override def getInfo(sessionHandle: SessionHandle, infoType: GetInfoType): GetInfoValue = { - val infoValue = sessionManager.getSession(sessionHandle).getInfo(infoType) + val infoValue = infoType match { + case GetInfoType.CLI_SERVER_NAME => new GetInfoValue("Spark SQL") + case GetInfoType.CLI_DBMS_NAME => new GetInfoValue("Spark SQL") + case GetInfoType.CLI_DBMS_VER => new GetInfoValue(sqlContext.sparkContext.version) + case _ => sessionManager.getSession(sessionHandle).getInfo(infoType) + } logDebug(sessionHandle + ": getInfo()") infoValue } @@ -166,6 +202,29 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex opHandle } + override def executeStatement(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle = { + val opHandle: OperationHandle = + sessionManager.getSession(sessionHandle) + .executeStatement(statement, confOverlay, queryTimeout) + logDebug(sessionHandle + ": executeStatementAsync()") + opHandle + } + + override def executeStatementAsync(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle = { + val opHandle: OperationHandle = + sessionManager.getSession(sessionHandle) + .executeStatementAsync(statement, confOverlay, queryTimeout) + logDebug(sessionHandle + ": executeStatementAsync()") + opHandle + } + + override def getTypeInfo(sessionHandle: SessionHandle): OperationHandle = { val opHandle: OperationHandle = sessionManager.getSession(sessionHandle).getTypeInfo logDebug(sessionHandle + ": getTypeInfo()") @@ -383,10 +442,9 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex override def getDelegationToken(sessionHandle: SessionHandle, authFactory: HiveAuthFactory, owner: String, - renewer: String, - remoteAddr: String): String = { + renewer: String): String = { val delegationToken = sessionManager.getSession(sessionHandle) - .getDelegationToken(authFactory, owner, renewer, remoteAddr) + .getDelegationToken(authFactory, owner, renewer) logInfo(sessionHandle + ": getDelegationToken()") delegationToken } @@ -408,7 +466,8 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex } def getSessionManager: SessionManager = sessionManager -} + + } object CLIService { val protocols: Array[TProtocolVersion] = TProtocolVersion.values() diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala new file mode 100644 index 000000000000..2a37b00819d3 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala @@ -0,0 +1,64 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.util.Collections + +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory + + +/** + * CLIServiceClient. + * + */ +object CLIServiceClient { + private val DEFAULT_MAX_ROWS = 1000 +} + +abstract class CLIServiceClient extends ICLIService { + @throws[SparkThriftServerSQLException] + def openSession(username: String, + password: String): SessionHandle = + openSession(username, password, Collections.emptyMap[String, String]) + + @throws[SparkThriftServerSQLException] + override def fetchResults(opHandle: OperationHandle): RowSet = { + // TODO: provide STATIC default value + fetchResults( + opHandle, + FetchOrientation.FETCH_NEXT, + CLIServiceClient.DEFAULT_MAX_ROWS, + FetchType.QUERY_OUTPUT) + } + + @throws[SparkThriftServerSQLException] + override def getDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + owner: String, + renewer: String): String + + @throws[SparkThriftServerSQLException] + override def cancelDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit + + @throws[SparkThriftServerSQLException] + override def renewDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index 778ef63f111d..373f896e36a8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -79,14 +79,18 @@ private[thriftserver] case class ColumnBasedSet( case LongType => val values = rows.indices.map { i => nulls.set(i, rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) 0 else rows(i).getLong(ordinal) + if (rows(i).isNullAt(ordinal)) 0L else rows(i).getLong(ordinal) }.map(_.asInstanceOf[java.lang.Long]).asJava TColumn.i64Val(new TI64Column(values, bitSetToBuffer(nulls))) case FloatType => val values = rows.indices.map { i => nulls.set(i, rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) 0 else rows(i).getFloat(ordinal) - }.map(_.toDouble.asInstanceOf[java.lang.Double]).asJava + if (rows(i).isNullAt(ordinal)) { + 0.toDouble.asInstanceOf[java.lang.Double] + } else { + new java.lang.Double(rows(i).get(ordinal).toString) + } + }.asJava TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) case DoubleType => val values = rows.indices.map { i => @@ -110,6 +114,16 @@ private[thriftserver] case class ColumnBasedSet( } }.asJava TColumn.binaryVal(new TBinaryColumn(values, bitSetToBuffer(nulls))) + case DecimalType() => + val values = rows.indices.map { i => + nulls.set(i, rows(i).isNullAt(ordinal)) + if (rows(i).isNullAt(ordinal)) { + EMPTY_STRING + } else { + rows(i).getDecimal(ordinal).toPlainString + } + }.asJava + TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) case _ => val values = rows.indices.map { i => nulls.set(i, rows(i).isNullAt(ordinal)) @@ -146,6 +160,7 @@ private[thriftserver] case class ColumnBasedSet( override def setStartOffset(startOffset: Long): Unit = this.startOffset = startOffset + override def iterator: Iterator[Row] = rows.iterator } object ColumnBasedSet { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala new file mode 100644 index 000000000000..217c8db128ee --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala @@ -0,0 +1,206 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli + +import java.nio.ByteBuffer + +import scala.collection.JavaConverters._ + +import com.google.common.primitives._ +import java.util._ + +import org.apache.spark.sql.thriftserver.cli.Type._ +import org.apache.spark.sql.thriftserver.cli.thrift._ + +/** + * ColumnBuffer + */ +object ColumnBuffer { + private val DEFAULT_SIZE = 100 + private val MASKS = Array[Byte](0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80.toByte) + + private def toBitset(nulls: Array[Byte]) = { + val bitset = new BitSet + val bits = nulls.length * 8 + var i = 0 + while (i < bits) { + bitset.set(i, (nulls(i / 8) & MASKS(i % 8)) != 0) + i = i + 1 + } + bitset + } + + private val EMPTY_BINARY = ByteBuffer.allocate(0) + private val EMPTY_STRING = "" +} + +class ColumnBuffer() { + + import ColumnBuffer._ + + final private var `type`: Type = null + private var nulls: BitSet = null + private var _size: Int = 0 + private var _boolVars: Array[Boolean] = null + private var _byteVars: Array[Byte] = null + private var _shortVars: Array[Short] = null + private var _intVars: Array[Int] = null + private var _longVars: Array[Long] = null + private var _doubleVars: Array[Double] = null + private var _stringVars: Array[String] = null + private var _binaryVars: Array[ByteBuffer] = null + + + def this(colValues: TColumn) { + this() + if (colValues.isSetBoolVal) { + `type` = Type.BOOLEAN + nulls = toBitset(colValues.getBoolVal.getNulls) + _boolVars = Booleans.toArray(colValues.getBoolVal.getValues) + _size = boolVars.length + } + else if (colValues.isSetByteVal) { + `type` = Type.BYTE + nulls = toBitset(colValues.getByteVal.getNulls) + _byteVars = Bytes.toArray(colValues.getByteVal.getValues) + _size = byteVars.length + } + else if (colValues.isSetI16Val) { + `type` = Type.SHORT + nulls = toBitset(colValues.getI16Val.getNulls) + _shortVars = Shorts.toArray(colValues.getI16Val.getValues) + _size = shortVars.length + } + else if (colValues.isSetI32Val) { + `type` = Type.INT + nulls = toBitset(colValues.getI32Val.getNulls) + _intVars = Ints.toArray(colValues.getI32Val.getValues) + _size = intVars.length + } + else if (colValues.isSetI64Val) { + `type` = Type.LONG + nulls = toBitset(colValues.getI64Val.getNulls) + _longVars = Longs.toArray(colValues.getI64Val.getValues) + _size = longVars.length + } + else if (colValues.isSetDoubleVal) { + `type` = Type.DOUBLE + nulls = toBitset(colValues.getDoubleVal.getNulls) + _doubleVars = Doubles.toArray(colValues.getDoubleVal.getValues) + _size = doubleVars.length + } + else if (colValues.isSetBinaryVal) { + `type` = Type.BINARY + nulls = toBitset(colValues.getBinaryVal.getNulls) + _binaryVars = colValues.getBinaryVal.getValues.asScala.toArray + _size = _binaryVars.size + } + else if (colValues.isSetStringVal) { + `type` = Type.STRING + nulls = toBitset(colValues.getStringVal.getNulls) + _stringVars = colValues.getStringVal.getValues.asScala.toArray + _size = _stringVars.size + } else { + throw new IllegalStateException("invalid union object") + } + } + + private[cli] def getNulls = nulls + + def getType: Type = `type` + + def get(index: Int): Any = { + if (nulls.get(index)) return null + `type` match { + case BOOLEAN => + return _boolVars(index) + case BYTE => + return _byteVars(index) + case SHORT => + return _shortVars(index) + case INT => + return _intVars(index) + case LONG => + return _longVars(index) + case FLOAT => + case DOUBLE => + return _doubleVars(index) + case STRING => + return _stringVars(index) + case BINARY => + return _binaryVars(index).array + } + null + } + + def size: Int = _size + + private def boolVars: Array[Boolean] = { + if (_boolVars.length == _size) { + val newVars = new Array[Boolean](_size << 1) + System.arraycopy(_boolVars, 0, newVars, 0, _size) + _boolVars = newVars + } + _boolVars + } + + private def byteVars: Array[Byte] = { + if (_byteVars.length == _size) { + val newVars = new Array[Byte](_size << 1) + System.arraycopy(_byteVars, 0, newVars, 0, _size) + _byteVars = newVars + } + _byteVars + } + + private def shortVars: Array[Short] = { + if (_shortVars.length == _size) { + val newVars = new Array[Short](_size << 1) + System.arraycopy(_shortVars, 0, newVars, 0, _size) + _shortVars = newVars + } + _shortVars + } + + private def intVars: Array[Int] = { + if (_intVars.length == _size) { + val newVars = new Array[Int](_size << 1) + System.arraycopy(_intVars, 0, newVars, 0, _size) + _intVars = newVars + } + _intVars + } + + private def longVars: Array[Long] = { + if (_longVars.length == _size) { + val newVars = new Array[Long](_size << 1) + System.arraycopy(_longVars, 0, newVars, 0, _size) + _longVars = newVars + } + _longVars + } + + private def doubleVars: Array[Double] = { + if (_doubleVars.length == _size) { + val newVars = new Array[Double](_size << 1) + System.arraycopy(_doubleVars, 0, newVars, 0, _size) + _doubleVars = newVars + } + _doubleVars + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala index 9ada8e98656b..d736ce1f3221 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala @@ -52,6 +52,11 @@ private[thriftserver] object FetchOrientation { def getFetchOrientation(tFetchOrientation: TFetchOrientation): FetchOrientation = tFetchOrientation match { case FETCH_FIRST.toTFetchOrientation => FETCH_FIRST + case FETCH_NEXT.toTFetchOrientation => FETCH_NEXT + case FETCH_ABSOLUTE.toTFetchOrientation => FETCH_ABSOLUTE + case FETCH_LAST.toTFetchOrientation => FETCH_LAST + case FETCH_PRIOR.toTFetchOrientation => FETCH_PRIOR + case FETCH_RELATIVE.toTFetchOrientation => FETCH_RELATIVE case _ => FETCH_NEXT } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala index e8fff26f79cb..ce9b7134d04b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala @@ -27,17 +27,13 @@ import org.apache.spark.sql.types.StructType private[thriftserver] trait ICLIService { @throws[SparkThriftServerSQLException] - def openSession(protocol: TProtocolVersion, - username: String, + def openSession(username: String, password: String, - ipAddress: String, configuration: JMap[String, String]): SessionHandle @throws[SparkThriftServerSQLException] - def openSessionWithImpersonation(protocol: TProtocolVersion, - username: String, + def openSessionWithImpersonation(username: String, password: String, - ipAddress: String, configuration: JMap[String, String], delegationToken: String): SessionHandle @@ -58,6 +54,18 @@ private[thriftserver] trait ICLIService { statement: String, confOverlay: JMap[String, String]): OperationHandle + @throws[SparkThriftServerSQLException] + def executeStatement(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle + + @throws[SparkThriftServerSQLException] + def executeStatementAsync(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle + @throws[SparkThriftServerSQLException] def getTypeInfo(sessionHandle: SessionHandle): OperationHandle @@ -137,8 +145,7 @@ private[thriftserver] trait ICLIService { def getDelegationToken(sessionHandle: SessionHandle, authFactory: HiveAuthFactory, owner: String, - renewer: String, - remoteAddr: String): String + renewer: String): String @throws[SparkThriftServerSQLException] def cancelDelegationToken(sessionHandle: SessionHandle, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala index 9ebf18f3b1d3..dd2ff900c0bf 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala @@ -150,4 +150,5 @@ private[thriftserver] case class RowBasedSet(types: StructType, override def setStartOffset(startOffset: Long): Unit = this.startOffset = startOffset + override def iterator: Iterator[Row] = rows.iterator } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala index 68f8fb6f77a4..a61a233f628d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala @@ -34,4 +34,6 @@ private[thriftserver] trait RowSet { def setStartOffset(startOffset: Long): Unit def toTRowSet: TRowSet + + def iterator: Iterator[Row] } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala index a984c7fb8894..f49d6dc08a6a 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala @@ -17,14 +17,23 @@ package org.apache.spark.sql.thriftserver.cli +import java.io.ByteArrayInputStream +import java.util + +import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer +import org.apache.thrift.TException +import org.apache.thrift.protocol.TCompactProtocol +import org.apache.thrift.transport.TIOStreamTransport + +import org.apache.spark.internal.Logging import org.apache.spark.sql.Row -import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion +import org.apache.spark.sql.thriftserver.cli.thrift.{TColumn, TProtocolVersion, TRowSet} import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion._ import org.apache.spark.sql.types.StructType -private[thriftserver] object RowSetFactory { +private[thriftserver] object RowSetFactory extends Logging { def create(types: StructType, rows: Seq[Row], version: TProtocolVersion): RowSet = { if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { ColumnBasedSet(types, ArrayBuffer(rows: _*), 0) @@ -40,4 +49,45 @@ private[thriftserver] object RowSetFactory { RowBasedSet(types, new ArrayBuffer[Row](), 0) } } + + def create(tRowSet: TRowSet, version: TProtocolVersion): RowSet = { + val rows = new ArrayBuffer[Row]() + if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { + if (tRowSet.isSetBinaryColumns) { + val protocol = + new TCompactProtocol( + new TIOStreamTransport( + new ByteArrayInputStream(tRowSet.getBinaryColumns))) + // Read from the stream using the protocol for each column in final schema + val bufferMap = new util.HashMap[Int, ColumnBuffer] + var i = 0 + while (i < tRowSet.getColumnCount) { + val tvalue = new TColumn + try { + tvalue.read(protocol) + } catch { + case e: TException => + logError(e.getMessage, e) + throw new TException("Error reading column value from the row set blob", e) + } + bufferMap.put(i, new ColumnBuffer(tvalue)) + i = i + 1 + } + (0 until tRowSet.getRowsSize).foreach(index => { + rows += Row((0 until tRowSet.getColumnCount).map(colPos => + bufferMap.get(colPos).get(index))) + }) + } else { + tRowSet.getRows.asScala.foreach(row => { + rows += Row(row.getColVals.asScala.map(_.getFieldValue)) + }) + } + ColumnBasedSet(null, rows, tRowSet.getStartRowOffset) + } else { + tRowSet.getRows.asScala.foreach(row => { + rows += Row(row.getColVals.asScala.map(_.getFieldValue)) + }) + RowBasedSet(null, rows, tRowSet.getStartRowOffset) + } + } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index 7aa3fbb32d8b..b68d579f133d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -17,7 +17,10 @@ package org.apache.spark.sql.thriftserver.cli -import org.apache.spark.sql.thriftserver.cli.thrift.{TTableSchema, TTypeId} +import scala.collection.JavaConverters._ +import scala.collection.mutable + +import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIServiceConstants, TTableSchema, TTypeEntry, TTypeId} import org.apache.spark.sql.types._ private[thriftserver] object SchemaMapper { @@ -32,6 +35,21 @@ private[thriftserver] object SchemaMapper { tTableSchema } + def toStructType(fields: TTableSchema): StructType = { + val schema = new StructType() + if (fields != null) { + val posToField: Map[Int, StructField] = fields.getColumns.asScala + .map { tColumn => + tColumn.position -> + new StructField(tColumn.columnName, + toDataType(tColumn.typeDesc.getTypes.get(0))) + }.toMap + posToField.keys.toSeq.sorted.foreach(pos => + posToField.get(pos).map(schema.add)) + } + schema + } + def toTTypeId(typ: DataType): TTypeId = typ match { case NullType => TTypeId.NULL_TYPE case BooleanType => TTypeId.BOOLEAN_TYPE @@ -59,4 +77,33 @@ private[thriftserver] object SchemaMapper { } throw new IllegalArgumentException("Unrecognized type name: " + catalogString) } + + def toDataType(entry: TTypeEntry): DataType = + entry.getPrimitiveEntry.`type` match { + case TTypeId.NULL_TYPE => NullType + case TTypeId.BOOLEAN_TYPE => BooleanType + case TTypeId.TINYINT_TYPE => ByteType + case TTypeId.SMALLINT_TYPE => ShortType + case TTypeId.INT_TYPE => IntegerType + case TTypeId.BIGINT_TYPE => LongType + case TTypeId.FLOAT_TYPE => FloatType + case TTypeId.DOUBLE_TYPE => DoubleType + case TTypeId.STRING_TYPE => StringType + case TTypeId.DECIMAL_TYPE => + val tQualifiers = entry.getPrimitiveEntry + .getTypeQualifiers.qualifiers + DecimalType(tQualifiers.get(TCLIServiceConstants.PRECISION).getI32Value, + tQualifiers.get(TCLIServiceConstants.SCALE).getI32Value) + case TTypeId.DATE_TYPE => DateType + case TTypeId.TIMESTAMP_TYPE => TimestampType + case TTypeId.BINARY_TYPE => BinaryType + case TTypeId.ARRAY_TYPE => + ArrayType(StringType, true) + case TTypeId.MAP_TYPE => + MapType(StringType, StringType, true) + case TTypeId.STRUCT_TYPE => + StringType + case TTypeId.USER_DEFINED_TYPE => StringType + case _ => StringType + } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala index ee158aabcfd9..df6b403c34bd 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala @@ -194,7 +194,6 @@ object Type { } else { throw new IllegalArgumentException("Unregonized Thrift TTypeId value: " + tTypeId) } - } def getType(name: String): Type = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala index 07db416115e1..b274c4523218 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala @@ -40,7 +40,7 @@ import org.apache.spark.sql.types.StructType private[thriftserver] class OperationManager extends AbstractService(classOf[OperationManager].getSimpleName) - with Logging { + with Logging { private[this] lazy val logSchema: StructType = new StructType().add("operation_log", "string") private[this] val handleToOperation = new ConcurrentHashMap[OperationHandle, Operation] @@ -76,18 +76,21 @@ private[thriftserver] class OperationManager def newExecuteStatementOperation(parentSession: ThriftServerSession, statement: String, confOverlay: JMap[String, String], - async: Boolean): SparkExecuteStatementOperation = synchronized { - val sqlContext = sessionToContexts.get(parentSession.getSessionHandle) - require(sqlContext != null, s"Session handle: ${parentSession.getSessionHandle} has not been" + - s" initialized or had already closed.") - val conf = sqlContext.sessionState.conf - val runInBackground = async && conf.getConf(HiveUtils.HIVE_THRIFT_SERVER_ASYNC) - val operation = new SparkExecuteStatementOperation(parentSession, statement, confOverlay, - runInBackground)(sqlContext, sessionToActivePool) - handleToOperation.put(operation.getHandle, operation) - logDebug(s"Created Operation for $statement with session=$parentSession, " + - s"runInBackground=$runInBackground") - operation + async: Boolean, + queryTimeOut: Long): SparkExecuteStatementOperation = { + synchronized { + val sqlContext = sessionToContexts.get(parentSession.getSessionHandle) + require(sqlContext != null, s"Session handle: ${parentSession.getSessionHandle} " + + s"has not been initialized or had already closed.") + val conf = sqlContext.sessionState.conf + val runInBackground = async && conf.getConf(HiveUtils.HIVE_THRIFT_SERVER_ASYNC) + val operation = new SparkExecuteStatementOperation(parentSession, statement, confOverlay, + runInBackground)(sqlContext, sessionToActivePool) + handleToOperation.put(operation.getHandle, operation) + logDebug(s"Created Operation for $statement with session=$parentSession, " + + s"runInBackground=$runInBackground") + operation + } } def newGetTypeInfoOperation(session: ThriftServerSession): SparkGetTypeInfoOperation = diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala index 57868247485a..0a478fe6f991 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -167,17 +167,12 @@ private[thriftserver] class SparkGetTablesOperation( tableName: String, tableType: String, comment: Option[String]): Unit = { - val rowData = Array[AnyRef]( - "", - dbName, - tableName, - tableType, - comment.getOrElse("")) // Since HIVE-7575(Hive 2.0.0), adds 5 additional columns to the ResultSet of GetTables. if (HiveUtils.isHive23) { - rowSet.addRow(Row(rowData ++ Array(null, null, null, null, null))) + rowSet.addRow(Row("", dbName, tableName, tableType, comment.getOrElse(""), + null, null, null, null, null)) } else { - rowSet.addRow(Row(rowData)) + rowSet.addRow(Row("", dbName, tableName, tableType, comment.getOrElse(""))) } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index e4c203c6a93a..7eca5fb81f1e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -200,6 +200,14 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo } } + def setConfMap(conf: SQLContext, confMap: JMap[String, String]): Unit = { + val iterator = confMap.entrySet().iterator() + while (iterator.hasNext) { + val kv = iterator.next() + conf.setConf(kv.getKey, kv.getValue) + } + } + @throws[SparkThriftServerSQLException] def openSession(protocol: TProtocolVersion, username: String, @@ -260,6 +268,9 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo sqlContext.newSession() } ctx.setConf(HiveUtils.FAKE_HIVE_VERSION.key, HiveUtils.builtinHiveVersion) + val hiveSessionState = session.getSessionState + setConfMap(ctx, hiveSessionState.getOverriddenConfigurations) + setConfMap(ctx, hiveSessionState.getHiveVariables) if (sessionConf != null && sessionConf.containsKey("use:database")) { ctx.sql(s"use ${sessionConf.get("use:database")}") } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala index f3274d79401e..2af97a83880f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala @@ -54,6 +54,16 @@ private[thriftserver] trait ThriftServerSession extends ThriftServerSessionBase def executeStatementAsync(statement: String, confOverlay: JMap[String, String]): OperationHandle + @throws[SparkThriftServerSQLException] + def executeStatement(statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle + + @throws[SparkThriftServerSQLException] + def executeStatementAsync(statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle + /** * getTypeInfo operation handler * @@ -201,8 +211,7 @@ private[thriftserver] trait ThriftServerSession extends ThriftServerSessionBase def getDelegationToken(authFactory: HiveAuthFactory, owner: String, - renewer: String, - remoteAddr: String): String + renewer: String): String @throws[SparkThriftServerSQLException] def cancelDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index 567ce1311eb5..cb15e2adb0b8 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -25,6 +25,7 @@ import scala.collection.JavaConverters._ import org.apache.commons.io.FileUtils import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.hadoop.hive.conf.SystemVariables._ import org.apache.hadoop.hive.ql.session.SessionState @@ -46,7 +47,12 @@ private[thriftserver] class ThriftServerSessionImpl( var ipAddress: String) extends ThriftServerSession with Logging { private val _sessionHandle: SessionHandle = new SessionHandle(protocol) - private val _hiveConf: HiveConf = new HiveConf(serverHiveConf) + private val _hiveConf: HiveConf = { + val conf = new HiveConf(serverHiveConf) + // Set an explicit session name to control the download directory name + conf.set(ConfVars.HIVESESSIONID.varname, _sessionHandle.getHandleIdentifier.toString) + conf + } private var _sessionState: SessionState = null private var _sessionManager: SessionManager = null private var _operationManager: OperationManager = new OperationManager() @@ -190,19 +196,32 @@ private[thriftserver] class ThriftServerSessionImpl( * @throws SparkThriftServerSQLException */ override def executeStatement(statement: String, - confOverlay: JMap[String, String]): OperationHandle = { - executeStatementInternal(statement, confOverlay, false) + confOverlay: JMap[String, String]): OperationHandle = { + executeStatementInternal(statement, confOverlay, false, 0) } override def executeStatementAsync(statement: String, confOverlay: JMap[String, String]): OperationHandle = { - executeStatementInternal(statement, confOverlay, true) + executeStatementInternal(statement, confOverlay, true, 0) + } + + override def executeStatement(statement: String, + confOverlay: JMap[String, String], + queryTimeOut: Long): OperationHandle = { + executeStatementInternal(statement, confOverlay, false, queryTimeOut) + } + + override def executeStatementAsync(statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle = { + executeStatementInternal(statement, confOverlay, true, queryTimeout) } @throws[SparkThriftServerSQLException] private def executeStatementInternal(statement: String, confOverlay: JMap[String, String], - runAsync: Boolean): OperationHandle = { + runAsync: Boolean, + queryTimeout: Long): OperationHandle = { acquire(true) val operationManager = getOperationManager val operation = operationManager @@ -210,7 +229,8 @@ private[thriftserver] class ThriftServerSessionImpl( getSession, statement, confOverlay, - runAsync) + runAsync, + queryTimeout) val opHandle = operation.getHandle try { operation.run @@ -510,6 +530,7 @@ private[thriftserver] class ThriftServerSessionImpl( _opHandleSet.clear // Cleanup session log directory. cleanupSessionLogDir + cleanupPipeoutFile val hiveHist = _sessionState.getHiveHistory if (null != hiveHist) { hiveHist.closeStream() @@ -567,6 +588,21 @@ private[thriftserver] class ThriftServerSessionImpl( } } + private def cleanupPipeoutFile(): Unit = { + val lScratchDir = _hiveConf.getVar(ConfVars.LOCALSCRATCHDIR) + val sessionID = _hiveConf.getVar(ConfVars.HIVESESSIONID) + val fileAry = new File(lScratchDir) + .listFiles((dir, name) => name.startsWith(sessionID) && name.endsWith(".pipeout")) + for (file <- fileAry) { + try + FileUtils.forceDelete(file) + catch { + case e: SparkThriftServerSQLException => + logError("Failed to cleanup pipeout file: " + file, e) + } + } + } + override def getResultSetMetadata(opHandle: OperationHandle): StructType = { acquire(true) try { @@ -593,14 +629,13 @@ private[thriftserver] class ThriftServerSessionImpl( override def getDelegationToken(authFactory: HiveAuthFactory, owner: String, - renewer: String, - remoteAddr: String): String = { + renewer: String): String = { HiveAuthFactory.verifyProxyAccess( getUsername, owner, getIpAddress, getHiveConf) - authFactory.getDelegationToken(owner, renewer, remoteAddr) + authFactory.getDelegationToken(owner, renewer, getIpAddress) } override def cancelDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala index 1abf93a73797..8ca5ba56df1d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImplWithUgi.scala @@ -137,9 +137,8 @@ private[thriftserver] class ThriftServerSessionImplWithUgi( @throws[SparkThriftServerSQLException] override def getDelegationToken(authFactory: HiveAuthFactory, owner: String, - renewer: String, - remoteAddr: String): String = { - authFactory.getDelegationToken(owner, renewer, remoteAddr) + renewer: String): String = { + authFactory.getDelegationToken(owner, renewer, getIpAddress) } @throws[SparkThriftServerSQLException] diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala index 6f3e5e7e5eb8..95b40bdbdcb6 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala @@ -193,8 +193,7 @@ private[thriftserver] abstract class ThriftCLIService(cliService: CLIService, se new SessionHandle(req.getSessionHandle), hiveAuthFactory, req.getOwner, - req.getRenewer, - getIpAddress) + req.getRenewer) resp.setDelegationToken(token) resp.setStatus(OK_STATUS) } catch { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala new file mode 100644 index 000000000000..54d803f27801 --- /dev/null +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala @@ -0,0 +1,461 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift + +import java.util.{List => JList, Map => JMap} + +import org.apache.thrift.TException + +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory +import org.apache.spark.sql.thriftserver.cli._ +import org.apache.spark.sql.types.StructType + + +/** + * ThriftCLIServiceClient. + * + */ +class ThriftCLIServiceClient(val cliService: TCLIService.Iface) extends CLIServiceClient { + @throws[SparkThriftServerSQLException] + def checkStatus(status: TStatus): Unit = { + if (TStatusCode.ERROR_STATUS == status.getStatusCode) { + throw new SparkThriftServerSQLException(status) + } + } + + + @throws[SparkThriftServerSQLException] + override def openSession(username: String, + password: String, + configuration: JMap[String, String]): SessionHandle = try { + val req = new TOpenSessionReq + req.setUsername(username) + req.setPassword(password) + req.setConfiguration(configuration) + val resp = cliService.OpenSession(req) + checkStatus(resp.getStatus) + new SessionHandle(resp.getSessionHandle, resp.getServerProtocolVersion) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def openSessionWithImpersonation(username: String, + password: String, + configuration: JMap[String, String], + delegationToken: String): SessionHandle = + throw new SparkThriftServerSQLException("open with impersonation operation " + + "is not supported in the client") + + @throws[SparkThriftServerSQLException] + override def closeSession(sessionHandle: SessionHandle): Unit = { + try { + val req = new TCloseSessionReq(sessionHandle.toTSessionHandle) + val resp = cliService.CloseSession(req) + checkStatus(resp.getStatus) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def getInfo(sessionHandle: SessionHandle, + infoType: GetInfoType): GetInfoValue = { + try { + // FIXME extract the right info type + val req = new TGetInfoReq(sessionHandle.toTSessionHandle, infoType.toTGetInfoType) + val resp = cliService.GetInfo(req) + checkStatus(resp.getStatus) + new GetInfoValue(resp.getInfoValue) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def executeStatement(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String]): OperationHandle = + executeStatementInternal(sessionHandle, statement, confOverlay, false, 0) + + @throws[SparkThriftServerSQLException] + override def executeStatement(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle = + executeStatementInternal(sessionHandle, statement, confOverlay, false, queryTimeout) + + @throws[SparkThriftServerSQLException] + override def executeStatementAsync(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String]): OperationHandle = + executeStatementInternal(sessionHandle, statement, confOverlay, true, 0) + + @throws[SparkThriftServerSQLException] + override def executeStatementAsync(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String], + queryTimeout: Long): OperationHandle = + executeStatementInternal(sessionHandle, statement, confOverlay, true, queryTimeout) + + @throws[SparkThriftServerSQLException] + private def executeStatementInternal(sessionHandle: SessionHandle, + statement: String, + confOverlay: JMap[String, String], + isAsync: Boolean, + queryTimeout: Long): OperationHandle = { + try { + val req = new TExecuteStatementReq(sessionHandle.toTSessionHandle, statement) + req.setConfOverlay(confOverlay) + req.setRunAsync(isAsync) + req.setQueryTimeout(queryTimeout) + val resp = cliService.ExecuteStatement(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def getTypeInfo(sessionHandle: SessionHandle): OperationHandle = try { + val req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle) + val resp = cliService.GetTypeInfo(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def getCatalogs(sessionHandle: SessionHandle): OperationHandle = try { + val req = new TGetCatalogsReq(sessionHandle.toTSessionHandle) + val resp = cliService.GetCatalogs(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def getSchemas(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String): OperationHandle = try { + val req = new TGetSchemasReq(sessionHandle.toTSessionHandle) + req.setCatalogName(catalogName) + req.setSchemaName(schemaName) + val resp = cliService.GetSchemas(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def getTables(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + tableName: String, + tableTypes: JList[String]): OperationHandle = try { + val req = new TGetTablesReq(sessionHandle.toTSessionHandle) + req.setTableName(tableName) + req.setTableTypes(tableTypes) + req.setSchemaName(schemaName) + val resp = cliService.GetTables(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def getTableTypes(sessionHandle: SessionHandle): OperationHandle = try { + val req = new TGetTableTypesReq(sessionHandle.toTSessionHandle) + val resp = cliService.GetTableTypes(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def getColumns(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + tableName: String, + columnName: String): OperationHandle = { + try { + val req = new TGetColumnsReq + req.setSessionHandle(sessionHandle.toTSessionHandle) + req.setCatalogName(catalogName) + req.setSchemaName(schemaName) + req.setTableName(tableName) + req.setColumnName(columnName) + val resp = cliService.GetColumns(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def getFunctions(sessionHandle: SessionHandle, + catalogName: String, + schemaName: String, + functionName: String): OperationHandle = { + try { + val req = new TGetFunctionsReq(sessionHandle.toTSessionHandle, functionName) + req.setCatalogName(catalogName) + req.setSchemaName(schemaName) + val resp = cliService.GetFunctions(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def getOperationStatus(opHandle: OperationHandle): OperationStatus = try { + val req = new TGetOperationStatusReq(opHandle.toTOperationHandle) + val resp = cliService.GetOperationStatus(req) + // Checks the status of the RPC call, throws an exception in case of error + checkStatus(resp.getStatus) + val opState = OperationState.getOperationState(resp.getOperationState) + var opException: SparkThriftServerSQLException = null + if (opState eq ERROR) { + opException = + new SparkThriftServerSQLException( + resp.getErrorMessage, + resp.getSqlState, + resp.getErrorCode) + } + new OperationStatus(opState, opException) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def cancelOperation(opHandle: OperationHandle): Unit = { + try { + val req = new TCancelOperationReq(opHandle.toTOperationHandle) + val resp = cliService.CancelOperation(req) + checkStatus(resp.getStatus) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def closeOperation(opHandle: OperationHandle): Unit = { + try { + val req = new TCloseOperationReq(opHandle.toTOperationHandle) + val resp = cliService.CloseOperation(req) + checkStatus(resp.getStatus) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def getResultSetMetadata(opHandle: OperationHandle): StructType = try { + val req = new TGetResultSetMetadataReq(opHandle.toTOperationHandle) + val resp = cliService.GetResultSetMetadata(req) + checkStatus(resp.getStatus) + SchemaMapper.toStructType(resp.getSchema) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def fetchResults(opHandle: OperationHandle, + orientation: FetchOrientation, + maxRows: Long, + fetchType: FetchType): RowSet = try { + val req = new TFetchResultsReq + req.setOperationHandle(opHandle.toTOperationHandle) + req.setOrientation(orientation.toTFetchOrientation) + req.setMaxRows(maxRows) + req.setFetchType(fetchType.toTFetchType) + val resp = cliService.FetchResults(req) + checkStatus(resp.getStatus) + RowSetFactory.create(resp.getResults, opHandle.getProtocolVersion) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def fetchResults(opHandle: OperationHandle): RowSet = { + // TODO: set the correct default fetch size + fetchResults(opHandle, FetchOrientation.FETCH_NEXT, 10000, FetchType.QUERY_OUTPUT) + } + + @throws[SparkThriftServerSQLException] + override def getDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + owner: String, + renewer: String): String = { + val req = new TGetDelegationTokenReq(sessionHandle.toTSessionHandle, owner, renewer) + try { + val tokenResp = cliService.GetDelegationToken(req) + checkStatus(tokenResp.getStatus) + tokenResp.getDelegationToken + } catch { + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def cancelDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit = { + val cancelReq = new TCancelDelegationTokenReq(sessionHandle.toTSessionHandle, tokenStr) + try { + val cancelResp = cliService.CancelDelegationToken(cancelReq) + checkStatus(cancelResp.getStatus) + } catch { + case e: TException => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def renewDelegationToken(sessionHandle: SessionHandle, + authFactory: HiveAuthFactory, + tokenStr: String): Unit = { + val cancelReq = new TRenewDelegationTokenReq(sessionHandle.toTSessionHandle, tokenStr) + try { + val renewResp = cliService.RenewDelegationToken(cancelReq) + checkStatus(renewResp.getStatus) + } catch { + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + } + + @throws[SparkThriftServerSQLException] + override def getPrimaryKeys(sessionHandle: SessionHandle, + catalog: String, + schema: String, + table: String): OperationHandle = try { + val req = new TGetPrimaryKeysReq(sessionHandle.toTSessionHandle) + req.setCatalogName(catalog) + req.setSchemaName(schema) + req.setTableName(table) + val resp = cliService.GetPrimaryKeys(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + @throws[SparkThriftServerSQLException] + override def getCrossReference(sessionHandle: SessionHandle, + primaryCatalog: String, + primarySchema: String, + primaryTable: String, + foreignCatalog: String, + foreignSchema: String, + foreignTable: String): OperationHandle = try { + val req = new TGetCrossReferenceReq(sessionHandle.toTSessionHandle) + req.setParentCatalogName(primaryCatalog) + req.setParentSchemaName(primarySchema) + req.setParentTableName(primaryTable) + req.setForeignCatalogName(foreignCatalog) + req.setForeignSchemaName(foreignSchema) + req.setForeignTableName(foreignTable) + val resp = cliService.GetCrossReference(req) + checkStatus(resp.getStatus) + val protocol = sessionHandle.getProtocolVersion + new OperationHandle(resp.getOperationHandle, protocol) + } catch { + case e: SparkThriftServerSQLException => + throw e + case e: Exception => + throw new SparkThriftServerSQLException(e) + } + + override def getQueryId(opHandle: TOperationHandle): String = try + return cliService.GetQueryId(new TGetQueryIdReq(opHandle)).getQueryId + catch { + case e: TException => + throw new SparkThriftServerSQLException(e) + } +} From cd92f3f990cc7d9363000e6cc527ca1514df04c3 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 30 Oct 2019 19:32:56 +0800 Subject: [PATCH 27/55] fix return error --- .../sql/thriftserver/cli/ColumnBasedSet.scala | 22 +++++++++---------- .../sql/thriftserver/cli/SchemaMapper.scala | 18 +++++++-------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index 373f896e36a8..0f8d2ed52b01 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -54,37 +54,37 @@ private[thriftserver] case class ColumnBasedSet( typ match { case BooleanType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) true else rows(i).getBoolean(ordinal) }.map(_.asInstanceOf[java.lang.Boolean]).asJava TColumn.boolVal(new TBoolColumn(values, bitSetToBuffer(nulls))) case ByteType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) 0.toByte else rows(i).getByte(ordinal) }.map(_.asInstanceOf[java.lang.Byte]).asJava TColumn.byteVal(new TByteColumn(values, bitSetToBuffer(nulls))) case ShortType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) 0.toShort else rows(i).getShort(ordinal) }.map(_.asInstanceOf[java.lang.Short]).asJava TColumn.i16Val(new TI16Column(values, bitSetToBuffer(nulls))) case IntegerType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) 0 else rows(i).getInt(ordinal) }.map(_.asInstanceOf[java.lang.Integer]).asJava TColumn.i32Val(new TI32Column(values, bitSetToBuffer(nulls))) case LongType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) 0L else rows(i).getLong(ordinal) }.map(_.asInstanceOf[java.lang.Long]).asJava TColumn.i64Val(new TI64Column(values, bitSetToBuffer(nulls))) case FloatType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) { 0.toDouble.asInstanceOf[java.lang.Double] } else { @@ -94,19 +94,19 @@ private[thriftserver] case class ColumnBasedSet( TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) case DoubleType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) 0 else rows(i).getDouble(ordinal) }.map(_.asInstanceOf[java.lang.Double]).asJava TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) case StringType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) EMPTY_STRING else rows(i).getString(ordinal) }.asJava TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) case BinaryType => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) { EMPTY_BINARY } else { @@ -116,7 +116,7 @@ private[thriftserver] case class ColumnBasedSet( TColumn.binaryVal(new TBinaryColumn(values, bitSetToBuffer(nulls))) case DecimalType() => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) { EMPTY_STRING } else { @@ -126,7 +126,7 @@ private[thriftserver] case class ColumnBasedSet( TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) case _ => val values = rows.indices.map { i => - nulls.set(i, rows(i).isNullAt(ordinal)) + nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) if (rows(i).isNullAt(ordinal)) { EMPTY_STRING } else { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index b68d579f133d..8fe03bae1374 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -36,16 +36,16 @@ private[thriftserver] object SchemaMapper { } def toStructType(fields: TTableSchema): StructType = { - val schema = new StructType() + var schema = new StructType() if (fields != null) { - val posToField: Map[Int, StructField] = fields.getColumns.asScala - .map { tColumn => - tColumn.position -> - new StructField(tColumn.columnName, - toDataType(tColumn.typeDesc.getTypes.get(0))) - }.toMap - posToField.keys.toSeq.sorted.foreach(pos => - posToField.get(pos).map(schema.add)) + val posToField: Map[Int, StructField] = fields.getColumns.asScala.map { tColumn => + tColumn.position -> + new StructField(tColumn.columnName, + toDataType(tColumn.typeDesc.getTypes.get(0))) + }.toMap + posToField.keys.toSeq.sorted.foreach { pos => + schema = schema.add(posToField(pos)) + } } schema } From 60dc24f5390d6e157eca83af3d187d0abbd161f6 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Thu, 31 Oct 2019 07:27:58 +0800 Subject: [PATCH 28/55] fix client convert row map --- sql/thriftserver/if/TCLIService.thrift | 3 +- .../sql/thriftserver/cli/ColumnBasedSet.scala | 118 +++++++++++++----- .../sql/thriftserver/cli/ColumnBuffer.scala | 4 +- .../sql/thriftserver/cli/RowSetFactory.scala | 21 +++- .../cli/operation/Operation.scala | 2 +- 5 files changed, 104 insertions(+), 44 deletions(-) diff --git a/sql/thriftserver/if/TCLIService.thrift b/sql/thriftserver/if/TCLIService.thrift index b230a59d8ae7..8899cf2aff71 100644 --- a/sql/thriftserver/if/TCLIService.thrift +++ b/sql/thriftserver/if/TCLIService.thrift @@ -1121,7 +1121,6 @@ enum TFetchOrientation { FETCH_NEXT, // Get the previous rowset. The fetch offset is ignored. - // NOT SUPPORTED FETCH_PRIOR, // Return the rowset at the given fetch offset relative @@ -1150,7 +1149,7 @@ struct TFetchResultsReq { 1: required TOperationHandle operationHandle // The fetch orientation. For V1 this must be either - // FETCH_NEXT or FETCH_FIRST. Defaults to FETCH_NEXT. + // FETCH_NEXT, FETCH_FIRST or FETCH_PRIOR. Defaults to FETCH_NEXT. 2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT // Max number of rows that should be returned in diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index 0f8d2ed52b01..6f6486dddff3 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -53,39 +53,71 @@ private[thriftserver] case class ColumnBasedSet( val nulls = new BitSet() typ match { case BooleanType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) true else rows(i).getBoolean(ordinal) + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + true + } else { + rows(i).getBoolean(ordinal) + } }.map(_.asInstanceOf[java.lang.Boolean]).asJava TColumn.boolVal(new TBoolColumn(values, bitSetToBuffer(nulls))) case ByteType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) 0.toByte else rows(i).getByte(ordinal) + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + 0.toByte + } else { + rows(i).getByte(ordinal) + } }.map(_.asInstanceOf[java.lang.Byte]).asJava TColumn.byteVal(new TByteColumn(values, bitSetToBuffer(nulls))) case ShortType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) 0.toShort else rows(i).getShort(ordinal) + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + 0.toShort + } else { + rows(i).getShort(ordinal) + } }.map(_.asInstanceOf[java.lang.Short]).asJava TColumn.i16Val(new TI16Column(values, bitSetToBuffer(nulls))) case IntegerType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) 0 else rows(i).getInt(ordinal) + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + 0 + } else { + rows(i).getInt(ordinal) + } }.map(_.asInstanceOf[java.lang.Integer]).asJava TColumn.i32Val(new TI32Column(values, bitSetToBuffer(nulls))) case LongType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) 0L else rows(i).getLong(ordinal) + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + 0L + } else { + rows(i).getLong(ordinal) + } }.map(_.asInstanceOf[java.lang.Long]).asJava TColumn.i64Val(new TI64Column(values, bitSetToBuffer(nulls))) case FloatType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) { + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { 0.toDouble.asInstanceOf[java.lang.Double] } else { new java.lang.Double(rows(i).get(ordinal).toString) @@ -93,21 +125,35 @@ private[thriftserver] case class ColumnBasedSet( }.asJava TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) case DoubleType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) 0 else rows(i).getDouble(ordinal) - }.map(_.asInstanceOf[java.lang.Double]).asJava + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + 0.toDouble.asInstanceOf[java.lang.Double] + } else { + new java.lang.Double(rows(i).get(ordinal).toString) + } + }.asJava TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) case StringType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) EMPTY_STRING else rows(i).getString(ordinal) + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + EMPTY_STRING + } else { + rows(i).getString(ordinal) + } }.asJava TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) case BinaryType => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) { + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { EMPTY_BINARY } else { ByteBuffer.wrap(rows(i).getAs[Array[Byte]](ordinal)) @@ -115,9 +161,11 @@ private[thriftserver] case class ColumnBasedSet( }.asJava TColumn.binaryVal(new TBinaryColumn(values, bitSetToBuffer(nulls))) case DecimalType() => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) { + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { EMPTY_STRING } else { rows(i).getDecimal(ordinal).toPlainString @@ -125,9 +173,11 @@ private[thriftserver] case class ColumnBasedSet( }.asJava TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) case _ => - val values = rows.indices.map { i => - nulls.set(i, rows(i).size > i && rows(i).isNullAt(ordinal)) - if (rows(i).isNullAt(ordinal)) { + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { EMPTY_STRING } else { HiveResult.toHiveString((rows(i).get(ordinal), typ)) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala index 217c8db128ee..da835ca82c4d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala @@ -125,7 +125,9 @@ class ColumnBuffer() { def getType: Type = `type` def get(index: Int): Any = { - if (nulls.get(index)) return null + if (nulls.get(index)) { + return null + } `type` match { case BOOLEAN => return _boolVars(index) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala index f49d6dc08a6a..f5a63201c2b5 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala @@ -73,19 +73,28 @@ private[thriftserver] object RowSetFactory extends Logging { bufferMap.put(i, new ColumnBuffer(tvalue)) i = i + 1 } - (0 until tRowSet.getRowsSize).foreach(index => { - rows += Row((0 until tRowSet.getColumnCount).map(colPos => - bufferMap.get(colPos).get(index))) + val columnsSize = bufferMap.values().asScala.map(_.size).max + val columnCount = tRowSet.getColumns.size() + (0 until columnsSize).foreach(index => { + val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) + rows += row }) } else { - tRowSet.getRows.asScala.foreach(row => { - rows += Row(row.getColVals.asScala.map(_.getFieldValue)) + val bufferMap = new util.HashMap[Int, ColumnBuffer] + tRowSet.getColumns.asScala.zipWithIndex.foreach { case (tColumn, i) => + bufferMap.put(i, new ColumnBuffer(tColumn)) + } + val columnsSize = bufferMap.values().asScala.map(_.size).max + val columnCount = tRowSet.getColumns.size() + (0 until columnsSize).foreach(index => { + val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) + rows += row }) } ColumnBasedSet(null, rows, tRowSet.getStartRowOffset) } else { tRowSet.getRows.asScala.foreach(row => { - rows += Row(row.getColVals.asScala.map(_.getFieldValue)) + rows += Row.fromSeq(row.getColVals.asScala.map(_.getFieldValue)) }) RowBasedSet(null, rows, tRowSet.getStartRowOffset) } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala index c2628ad5f464..d59d657d4913 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala @@ -53,7 +53,7 @@ private[thriftserver] abstract class Operation( private var _lastAccessTime = System.currentTimeMillis() protected val DEFAULT_FETCH_ORIENTATION_SET: Set[FetchOrientation] = - Set(FetchOrientation.FETCH_NEXT, FetchOrientation.FETCH_FIRST) + Set(FetchOrientation.FETCH_NEXT, FetchOrientation.FETCH_FIRST, FetchOrientation.FETCH_PRIOR) def getBackgroundHandle: Future[_] = _backgroundHandle From 409a1a354c8ebc16e6cc526fb848f908a880232d Mon Sep 17 00:00:00 2001 From: angerszhu Date: Thu, 31 Oct 2019 09:29:23 +0800 Subject: [PATCH 29/55] add UT of TCLIServiceClient --- .../HiveThriftServer2Suites.scala | 375 +++++++++--------- 1 file changed, 187 insertions(+), 188 deletions(-) diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala index 365e65ee8ca1..6ddc959f1190 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala @@ -23,7 +23,6 @@ import java.nio.charset.StandardCharsets import java.sql.{Date, DriverManager, SQLException, Statement} import java.util.{Locale, UUID} -import scala.collection.JavaConverters._ import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.concurrent.{ExecutionContext, Future, Promise} @@ -45,7 +44,8 @@ import org.apache.spark.sql.hive.test.HiveTestJars import org.apache.spark.sql.internal.StaticSQLConf.HIVE_THRIFT_SERVER_SINGLESESSION import org.apache.spark.sql.test.ProcessTestUtils.ProcessOutputCapturer import org.apache.spark.sql.thriftserver.auth.PlainSaslHelper -import org.apache.spark.sql.thriftserver.cli.RowSet +import org.apache.spark.sql.thriftserver.cli.{FetchOrientation, FetchType, GetInfoType, RowSet} +import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIService, ThriftCLIServiceClient} import org.apache.spark.util.{ThreadUtils, Utils} object TestData { @@ -60,82 +60,81 @@ object TestData { class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { override def mode: ServerMode.Value = ServerMode.binary - // private def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { - // // Transport creation logic below mimics HiveConnection.createBinaryTransport - // val rawTransport = new TSocket("localhost", serverPort) - // val user = System.getProperty("user.name") - // val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - // val protocol = new TBinaryProtocol(transport) - // val client = new ThriftCLIServiceClient(new TCLIService.Client(protocol)) - // - // transport.open() - // try f(client) finally transport.close() - // } - - // test("GetInfo Thrift API") { - // withCLIServiceClient { client => - // val user = System.getProperty("user.name") - // val sessionHandle = client.openSession(user, "") - // - // assertResult("Spark SQL", "Wrong GetInfo(CLI_DBMS_NAME) result") { - // client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_NAME).getStringValue - // } - // - // assertResult("Spark SQL", "Wrong GetInfo(CLI_SERVER_NAME) result") { - // client.getInfo(sessionHandle, GetInfoType.CLI_SERVER_NAME).getStringValue - // } - // - // assertResult(true, "Spark version shouldn't be \"Unknown\"") { - // val version = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER).getStringValue - // logInfo(s"Spark version: $version") - // version != "Unknown" - // } - // } - // } - - // test("SPARK-16563 ThriftCLIService FetchResults repeat fetching result") { - // withCLIServiceClient { client => - // val user = System.getProperty("user.name") - // val sessionHandle = client.openSession(user, "") - // - // withJdbcStatement("test_16563") { statement => - // val queries = Seq( - // "CREATE TABLE test_16563(key INT, val STRING)", - // s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_16563") - // - // queries.foreach(statement.execute) - // val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] - // val operationHandle = client.executeStatement( - // sessionHandle, - // "SELECT * FROM test_16563", - // confOverlay) - // - // // Fetch result first time - // assertResult(5, "Fetching result first time from next row") { - // - // val rows_next = client.fetchResults( - // operationHandle, - // FetchOrientation.FETCH_NEXT, - // 1000, - // FetchType.QUERY_OUTPUT) - // - // rows_next.numRows() - // } - // - // // Fetch result second time from first row - // assertResult(5, "Repeat fetching result from first row") { - // - // val rows_first = client.fetchResults( - // operationHandle, - // FetchOrientation.FETCH_FIRST, - // 1000, - // FetchType.QUERY_OUTPUT) - // - // rows_first.numRows() - // } - // } - // } - // } + private def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { + // Transport creation logic below mimics HiveConnection.createBinaryTransport + val rawTransport = new TSocket("localhost", serverPort) + val user = System.getProperty("user.name") + val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) + val protocol = new TBinaryProtocol(transport) + val client = new ThriftCLIServiceClient(new TCLIService.Client(protocol)) + + transport.open() + try f(client) finally transport.close() + } + + test("GetInfo Thrift API") { + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + + assertResult("Spark SQL", "Wrong GetInfo(CLI_DBMS_NAME) result") { + client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_NAME).getStringValue + } + + assertResult("Spark SQL", "Wrong GetInfo(CLI_SERVER_NAME) result") { + client.getInfo(sessionHandle, GetInfoType.CLI_SERVER_NAME).getStringValue + } + + assertResult(true, "Spark version shouldn't be \"Unknown\"") { + val version = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER).getStringValue + logInfo(s"Spark version: $version") + version != "Unknown" + } + } + } + + test("SPARK-16563 ThriftCLIService FetchResults repeat fetching result") { + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + + withJdbcStatement("test_16563") { statement => + val queries = Seq( + "CREATE TABLE test_16563(key INT, val STRING)", + s"LOAD DATA LOCAL INPATH '${TestData.smallKv}' OVERWRITE INTO TABLE test_16563") + queries.foreach(statement.execute) + val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] + val operationHandle = client.executeStatement( + sessionHandle, + "SELECT * FROM test_16563", + confOverlay) + + // Fetch result first time + assertResult(5, "Fetching result first time from next row") { + + val rows_next = client.fetchResults( + operationHandle, + FetchOrientation.FETCH_NEXT, + 1000, + FetchType.QUERY_OUTPUT) + + rows_next.numRows + } + + // Fetch result second time from first row + assertResult(5, "Repeat fetching result from first row") { + + val rows_first = client.fetchResults( + operationHandle, + FetchOrientation.FETCH_FIRST, + 1000, + FetchType.QUERY_OUTPUT) + + rows_first.numRows + } + } + } + } test("Support beeline --hiveconf and --hivevar") { withJdbcStatement() { statement => @@ -629,31 +628,31 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { } } - // test("SPARK-23547 Cleanup the .pipeout file when the Hive Session closed") { - // def pipeoutFileList(sessionID: UUID): Array[File] = { - // lScratchDir.listFiles(new FilenameFilter { - // override def accept(dir: File, name: String): Boolean = { - // name.startsWith(sessionID.toString) && name.endsWith(".pipeout") - // } - // }) - // } - // - // withCLIServiceClient { client => - // val user = System.getProperty("user.name") - // val sessionHandle = client.openSession(user, "") - // val sessionID = sessionHandle.getSessionId - // - // if (HiveUtils.isHive23) { - // assert(pipeoutFileList(sessionID).length == 2) - // } else { - // assert(pipeoutFileList(sessionID).length == 1) - // } - // - // client.closeSession(sessionHandle) - // - // assert(pipeoutFileList(sessionID).length == 0) - // } - // } + test("SPARK-23547 Cleanup the .pipeout file when the Hive Session closed") { + def pipeoutFileList(sessionID: UUID): Array[File] = { + lScratchDir.listFiles(new FilenameFilter { + override def accept(dir: File, name: String): Boolean = { + name.startsWith(sessionID.toString) && name.endsWith(".pipeout") + } + }) + } + + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + val sessionID = sessionHandle.getSessionId + + if (HiveUtils.isHive23) { + assert(pipeoutFileList(sessionID).length == 2) + } else { + assert(pipeoutFileList(sessionID).length == 1) + } + + client.closeSession(sessionHandle) + + assert(pipeoutFileList(sessionID).length == 0) + } + } test("SPARK-24829 Checks cast as float") { withJdbcStatement() { statement => @@ -686,91 +685,91 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { } } - // test("ThriftCLIService FetchResults FETCH_FIRST, FETCH_NEXT, FETCH_PRIOR") { - // def checkResult(rows: RowSet, start: Long, end: Long): Unit = { - // assert(rows.getStartOffset == start) - // assert(rows.numRows == end - start) - // rows.iterator.asScala.zip((start until end).iterator).foreach { case (row, v) => - // assert(row(0).asInstanceOf[Long] === v) - // } - // } - // - // withCLIServiceClient { client => - // val user = System.getProperty("user.name") - // val sessionHandle = client.openSession(user, "") - // - // val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] - // val operationHandle = client.executeStatement( - // sessionHandle, - // "SELECT * FROM range(10)", - // confOverlay) // 10 rows result with sequence 0, 1, 2, ..., 9 - // var rows: RowSet = null - // - // // Fetch 5 rows with FETCH_NEXT - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) - // checkResult(rows, 0, 5) // fetched [0, 5) - // - // // Fetch another 2 rows with FETCH_NEXT - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) - // checkResult(rows, 5, 7) // fetched [5, 7) - // - // // FETCH_PRIOR 3 rows - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) - // checkResult(rows, 2, 5) // fetched [2, 5) - // - // // FETCH_PRIOR again will scroll back to 0, and then the returned result - // // may overlap the results of previous FETCH_PRIOR - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) - // checkResult(rows, 0, 3) // fetched [0, 3) - // - // // FETCH_PRIOR again will stay at 0 - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_PRIOR, 4, FetchType.QUERY_OUTPUT) - // checkResult(rows, 0, 4) // fetched [0, 4) - // - // // FETCH_NEXT will continue moving forward from offset 4 - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_NEXT, 10, FetchType.QUERY_OUTPUT) - // checkResult(rows, 4, 10) // fetched [4, 10) until the end of results - // - // // FETCH_NEXT is at end of results - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) - // checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) - // - // // FETCH_NEXT is at end of results again - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) - // checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) - // - // // FETCH_PRIOR 1 rows yet again - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_PRIOR, 1, FetchType.QUERY_OUTPUT) - // checkResult(rows, 9, 10) // fetched [9, 10) - // - // // FETCH_NEXT will return 0 yet again - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) - // checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) - // - // // FETCH_FIRST results from first row - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_FIRST, 3, FetchType.QUERY_OUTPUT) - // checkResult(rows, 0, 3) // fetch [0, 3) - // - // // Fetch till the end rows with FETCH_NEXT" - // rows = client.fetchResults( - // operationHandle, FetchOrientation.FETCH_NEXT, 1000, FetchType.QUERY_OUTPUT) - // checkResult(rows, 3, 10) // fetched [3, 10) - // - // client.closeOperation(operationHandle) - // client.closeSession(sessionHandle) - // } - // } + test("ThriftCLIService FetchResults FETCH_FIRST, FETCH_NEXT, FETCH_PRIOR") { + def checkResult(rows: RowSet, start: Long, end: Long): Unit = { + assert(rows.getStartOffset == start) + assert(rows.numRows == end - start) + rows.iterator.zip((start until end).iterator).foreach { case (row, v) => + assert(row(0).asInstanceOf[Long] === v) + } + } + + withCLIServiceClient { client => + val user = System.getProperty("user.name") + val sessionHandle = client.openSession(user, "") + + val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] + val operationHandle = client.executeStatement( + sessionHandle, + "SELECT * FROM range(10)", + confOverlay) // 10 rows result with sequence 0, 1, 2, ..., 9 + var rows: RowSet = null + + // Fetch 5 rows with FETCH_NEXT + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 5) // fetched [0, 5) + + // Fetch another 2 rows with FETCH_NEXT + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) + checkResult(rows, 5, 7) // fetched [5, 7) + + // FETCH_PRIOR 3 rows + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) + checkResult(rows, 2, 5) // fetched [2, 5) + + // FETCH_PRIOR again will scroll back to 0, and then the returned result + // may overlap the results of previous FETCH_PRIOR + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 3, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 3) // fetched [0, 3) + + // FETCH_PRIOR again will stay at 0 + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 4, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 4) // fetched [0, 4) + + // FETCH_NEXT will continue moving forward from offset 4 + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 10, FetchType.QUERY_OUTPUT) + checkResult(rows, 4, 10) // fetched [4, 10) until the end of results + + // FETCH_NEXT is at end of results + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + + // FETCH_NEXT is at end of results again + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 2, FetchType.QUERY_OUTPUT) + checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + + // FETCH_PRIOR 1 rows yet again + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_PRIOR, 1, FetchType.QUERY_OUTPUT) + checkResult(rows, 9, 10) // fetched [9, 10) + + // FETCH_NEXT will return 0 yet again + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 5, FetchType.QUERY_OUTPUT) + checkResult(rows, 10, 10) // fetched empty [10, 10) (at end of results) + + // FETCH_FIRST results from first row + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_FIRST, 3, FetchType.QUERY_OUTPUT) + checkResult(rows, 0, 3) // fetch [0, 3) + + // Fetch till the end rows with FETCH_NEXT" + rows = client.fetchResults( + operationHandle, FetchOrientation.FETCH_NEXT, 1000, FetchType.QUERY_OUTPUT) + checkResult(rows, 3, 10) // fetched [3, 10) + + client.closeOperation(operationHandle) + client.closeSession(sessionHandle) + } + } } class SingleSessionSuite extends SparkThriftJdbcTest { From 5771a9bde45dc47800fa544f51f40a4b472340aa Mon Sep 17 00:00:00 2001 From: angerszhu Date: Thu, 31 Oct 2019 17:02:04 +0800 Subject: [PATCH 30/55] fix java code style --- .../auth/AnonymousAuthenticationProviderImpl.java | 2 +- .../auth/CustomAuthenticationProviderImpl.java | 4 ++-- .../auth/LdapAuthenticationProviderImpl.java | 2 +- .../auth/PamAuthenticationProviderImpl.java | 2 +- .../auth/PasswdAuthenticationProvider.java | 4 ++-- .../spark/sql/thriftserver/cli/GetInfoType.java | 3 ++- .../cli/SparkThriftServerSQLException.java | 12 +++++++++--- .../cli/operation/LogDivertAppender.java | 6 ++++-- .../sql/thriftserver/auth/PlainSaslHelper.scala | 2 +- .../thriftserver/cli/thrift/ThriftHttpServlet.scala | 4 ++-- 10 files changed, 25 insertions(+), 16 deletions(-) diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java index 322ab54b0910..dcde5f4e122a 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/AnonymousAuthenticationProviderImpl.java @@ -26,7 +26,7 @@ public class AnonymousAuthenticationProviderImpl implements PasswdAuthenticationProvider { @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { // no-op authentication } diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java index 8122a003e458..3536a4b8df83 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/CustomAuthenticationProviderImpl.java @@ -43,8 +43,8 @@ public class CustomAuthenticationProviderImpl implements PasswdAuthenticationPro } @Override - public void Authenticate(String user, String password) throws AuthenticationException { - customProvider.Authenticate(user, password); + public void authenticate(String user, String password) throws AuthenticationException { + customProvider.authenticate(user, password); } } diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java index 8e2113f1b7c6..38b7bb7b4b41 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/LdapAuthenticationProviderImpl.java @@ -40,7 +40,7 @@ public class LdapAuthenticationProviderImpl implements PasswdAuthenticationProvi } @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java index a969cab69583..04ad34b469d2 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PamAuthenticationProviderImpl.java @@ -32,7 +32,7 @@ public class PamAuthenticationProviderImpl implements PasswdAuthenticationProvid } @Override - public void Authenticate(String user, String password) throws AuthenticationException { + public void authenticate(String user, String password) throws AuthenticationException { if (pamServiceNames == null || pamServiceNames.trim().isEmpty()) { throw new AuthenticationException("No PAM services are set."); diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java index da78f7ea4feb..6c81f6daf8e0 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PasswdAuthenticationProvider.java @@ -22,7 +22,7 @@ public interface PasswdAuthenticationProvider { /** - * The Authenticate method is called by the HiveServer2 authentication layer + * The authenticate method is called by the HiveServer2 authentication layer * to authenticate users for their requests. * If a user is to be granted, return nothing/throw nothing. * When a user is to be disallowed, throw an appropriate {@link AuthenticationException}. @@ -35,5 +35,5 @@ public interface PasswdAuthenticationProvider { * @throws AuthenticationException When a user is found to be * invalid by the implementation */ - void Authenticate(String user, String password) throws AuthenticationException; + void authenticate(String user, String password) throws AuthenticationException; } diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java index 0c1ae302c9db..b04ec6ed5275 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/GetInfoType.java @@ -86,7 +86,8 @@ public static GetInfoType getGetInfoType(TGetInfoType tGetInfoType) { return infoType; } } - throw new IllegalArgumentException("Unrecognized Thrift TGetInfoType value: " + tGetInfoType); + throw new IllegalArgumentException("Unrecognized Thrift TGetInfoType value: " + + tGetInfoType); } public TGetInfoType toTGetInfoType() { diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java index f9fca1c4cb90..c5bbd7800f86 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SparkThriftServerSQLException.java @@ -97,7 +97,10 @@ public SparkThriftServerSQLException(String reason, String sqlState, Throwable c * @param vendorCode * @param cause */ - public SparkThriftServerSQLException(String reason, String sqlState, int vendorCode, Throwable cause) { + public SparkThriftServerSQLException(String reason, + String sqlState, + int vendorCode, + Throwable cause) { super(reason, sqlState, vendorCode, cause); } @@ -197,7 +200,9 @@ public static Throwable toCause(List details) { return toStackTrace(details, null, 0); } - private static Throwable toStackTrace(List details, StackTraceElement[] parent, int index) { + private static Throwable toStackTrace(List details, + StackTraceElement[] parent, + int index) { String detail = details.get(index++); if (!detail.startsWith("*")) { return null; // should not be happened. ignore remaining @@ -241,7 +246,8 @@ private static Throwable toStackTrace(List details, StackTraceElement[] private static Throwable newInstance(String className, String message) { try { - return (Throwable)Class.forName(className).getConstructor(String.class).newInstance(message); + return (Throwable)Class.forName(className) + .getConstructor(String.class).newInstance(message); } catch (Exception e) { return new RuntimeException(className + ":" + message); } diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java index a2c0174d7ef8..1536b92d65f1 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/LogDivertAppender.java @@ -130,7 +130,8 @@ private void setLayout(boolean isVerbose, Layout lo) { if (isVerbose) { if (lo == null) { lo = CLIServiceUtils.verboseLayout; - LOG.info("Cannot find a Layout from a ConsoleAppender. Using default Layout pattern."); + LOG.info("Cannot find a Layout from a ConsoleAppender. " + + "Using default Layout pattern."); } } else { lo = CLIServiceUtils.nonVerboseLayout; @@ -171,7 +172,8 @@ public void doAppend(LoggingEvent event) { // Set current layout depending on the verbose/non-verbose mode. if (log != null) { - boolean isCurrModeVerbose = (log.getOpLoggingLevel() == OperationLog.LoggingLevel.VERBOSE); + boolean isCurrModeVerbose = + (log.getOpLoggingLevel() == OperationLog.LoggingLevel.VERBOSE); // If there is a logging level change from verbose->non-verbose or vice-versa since // the last subAppend call, change the layout to preserve consistency. diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala index e60984df70a2..d509645debb7 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala @@ -102,7 +102,7 @@ private class PlainServerCallbackHandler @throws[AuthenticationException] } } val provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod) - provider.Authenticate(username, password) + provider.authenticate(username, password) if (ac != null) { ac.setAuthorized(true) } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala index c4d28cba04ee..344f4192f441 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala @@ -289,7 +289,7 @@ private[thriftserver] class ThriftHttpServlet(processor: TProcessor, AuthMethods.getValidAuthMethod(authType) val provider: PasswdAuthenticationProvider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod) - provider.Authenticate(userName, getPassword(request, authType)) + provider.authenticate(userName, getPassword(request, authType)) } catch { case e: Exception => throw new HttpAuthenticationException(e) @@ -359,7 +359,7 @@ private[thriftserver] class ThriftHttpServlet(processor: TProcessor, val serviceTicketBase64: String = getAuthHeader(request, authType) val inToken: Array[Byte] = Base64.decodeBase64(serviceTicketBase64.getBytes) gssContext.acceptSecContext(inToken, 0, inToken.length) - // Authenticate or deny based on its context completion + // authenticate or deny based on its context completion if (!gssContext.isEstablished) { throw new HttpAuthenticationException("Kerberos authentication failed: " + "unable to establish context with the service ticket " + "provided by the client.") From 77578c3468f965788433effd4124d40e42ecfc79 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Thu, 31 Oct 2019 23:35:51 +0800 Subject: [PATCH 31/55] add processGlobalInitFile --- .../cli/session/SessionManager.scala | 4 +- .../cli/session/ThriftServerSessionImpl.scala | 57 ++++++++++++++++++- 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index 7eca5fb81f1e..bc2633c074ed 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -308,7 +308,9 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo def getOpenSessionCount: Int = handleToSession.size } -object SessionManager extends Logging { +private[thriftserver] object SessionManager extends Logging { + + val HIVERCFILE = ".hiverc" private val threadLocalProxyUserName = new ThreadLocal[String]() { override protected def initialValue: String = null diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index cb15e2adb0b8..610a4e72505b 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -17,13 +17,14 @@ package org.apache.spark.sql.thriftserver.cli.session -import java.io._ +import java.io.{BufferedReader, FileInputStream, IOException, _} import java.util import java.util.{List => JList, Map => JMap} import scala.collection.JavaConverters._ import org.apache.commons.io.FileUtils +import org.apache.hadoop.hive.common.cli.HiveFileProcessor import org.apache.hadoop.hive.conf.HiveConf import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.hadoop.hive.conf.SystemVariables._ @@ -68,6 +69,7 @@ private[thriftserver] class ThriftServerSessionImpl( _sessionState.setUserIpAddress(ipAddress) _sessionState.setIsHiveServerQuery(true) SessionState.start(_sessionState) + processGlobalInitFile() if (sessionConfMap != null) { configureSession(sessionConfMap) } @@ -75,6 +77,59 @@ private[thriftserver] class ThriftServerSessionImpl( _lastIdleTime = _lastAccessTime } + + + /** + * It is used for processing hiverc file from HiveServer2 side. + */ + private class GlobalHivercFileProcessor extends HiveFileProcessor { + @throws[IOException] + override protected def loadFile(fileName: String): BufferedReader = { + val initStream = new FileInputStream(fileName) + val bufferedReader = new BufferedReader(new Nothing(initStream)) + bufferedReader + } + + override protected def processCmd(cmd: String): Int = { + var rc = 0 + val cmd_trimed = cmd.trim + try { + executeStatementInternal(cmd_trimed, null, false, 0) + } + catch { + case e: SparkThriftServerSQLException => + rc = -1 + logWarning("Failed to execute HQL command in global .hiverc file.", e) + } + rc + } + } + + private def processGlobalInitFile(): Unit = { + val processor = new GlobalHivercFileProcessor + try { + val hiverc = _hiveConf.getVar(ConfVars.HIVE_SERVER2_GLOBAL_INIT_FILE_LOCATION) + if (hiverc != null) { + var hivercFile = new File(hiverc) + if (hivercFile.isDirectory) { + hivercFile = new File(hivercFile, SessionManager.HIVERCFILE) + } + if (hivercFile.isFile) { + logInfo("Running global init file: " + hivercFile) + val rc = processor.processFile(hivercFile.getAbsolutePath) + if (rc != 0) { + logError("Failed on initializing global .hiverc file") + } + } else { + logDebug("Global init file " + hivercFile + " does not exist") + } + } + } catch { + case e: IOException => + logWarning("Failed on initializing global .hiverc file", e) + } + } + @throws[SparkThriftServerSQLException] private def configureSession(sessionConfMap: JMap[String, String]): Unit = { SessionState.setCurrentSessionState(_sessionState) From 4f7cbac6b72896de63943b16750200be9cb57e8a Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 00:16:22 +0800 Subject: [PATCH 32/55] Update ThriftServerSessionImpl.scala --- .../sql/thriftserver/cli/session/ThriftServerSessionImpl.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index 610a4e72505b..6e69c5d0075e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -86,7 +86,7 @@ private[thriftserver] class ThriftServerSessionImpl( @throws[IOException] override protected def loadFile(fileName: String): BufferedReader = { val initStream = new FileInputStream(fileName) - val bufferedReader = new BufferedReader(new Nothing(initStream)) + val bufferedReader = new BufferedReader(new InputStreamReader(initStream)) bufferedReader } From d93ab7222c793b969e4a8b3c30d4fc4f1c86795b Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 00:39:07 +0800 Subject: [PATCH 33/55] Keep type in scala and remove unused type --- .../spark/sql/thriftserver/cli/Type.java | 327 ++++++++++++ .../sql/thriftserver/cli/ColumnBuffer.scala | 34 +- .../sql/thriftserver/cli/SchemaMapper.scala | 1 - .../spark/sql/thriftserver/cli/Type.scala | 483 ------------------ .../operation/SparkGetTypeInfoOperation.scala | 4 +- 5 files changed, 346 insertions(+), 503 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Type.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Type.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Type.java new file mode 100644 index 000000000000..a594ad24576f --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Type.java @@ -0,0 +1,327 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.sql.DatabaseMetaData; +import java.util.Locale; + +import org.apache.hadoop.hive.common.type.HiveDecimal; +import org.apache.spark.sql.thriftserver.cli.thrift.TTypeId; + +/** + * Type. + * + */ +public enum Type { + NULL_TYPE("VOID", + java.sql.Types.NULL, + TTypeId.NULL_TYPE), + BOOLEAN_TYPE("BOOLEAN", + java.sql.Types.BOOLEAN, + TTypeId.BOOLEAN_TYPE), + TINYINT_TYPE("TINYINT", + java.sql.Types.TINYINT, + TTypeId.TINYINT_TYPE), + SMALLINT_TYPE("SMALLINT", + java.sql.Types.SMALLINT, + TTypeId.SMALLINT_TYPE), + INT_TYPE("INT", + java.sql.Types.INTEGER, + TTypeId.INT_TYPE), + BIGINT_TYPE("BIGINT", + java.sql.Types.BIGINT, + TTypeId.BIGINT_TYPE), + FLOAT_TYPE("FLOAT", + java.sql.Types.FLOAT, + TTypeId.FLOAT_TYPE), + DOUBLE_TYPE("DOUBLE", + java.sql.Types.DOUBLE, + TTypeId.DOUBLE_TYPE), + STRING_TYPE("STRING", + java.sql.Types.VARCHAR, + TTypeId.STRING_TYPE), + DATE_TYPE("DATE", + java.sql.Types.DATE, + TTypeId.DATE_TYPE), + TIMESTAMP_TYPE("TIMESTAMP", + java.sql.Types.TIMESTAMP, + TTypeId.TIMESTAMP_TYPE), + BINARY_TYPE("BINARY", + java.sql.Types.BINARY, + TTypeId.BINARY_TYPE), + DECIMAL_TYPE("DECIMAL", + java.sql.Types.DECIMAL, + TTypeId.DECIMAL_TYPE, + true, false, false), + ARRAY_TYPE("ARRAY", + java.sql.Types.ARRAY, + TTypeId.ARRAY_TYPE, + true, true), + MAP_TYPE("MAP", + java.sql.Types.JAVA_OBJECT, + TTypeId.MAP_TYPE, + true, true), + STRUCT_TYPE("STRUCT", + java.sql.Types.STRUCT, + TTypeId.STRUCT_TYPE, + true, false); + + private final String name; + private final TTypeId tType; + private final int javaSQLType; + private final boolean isQualified; + private final boolean isComplex; + private final boolean isCollection; + + Type(String name, int javaSQLType, TTypeId tType, boolean isQualified, boolean isComplex, boolean isCollection) { + this.name = name; + this.javaSQLType = javaSQLType; + this.tType = tType; + this.isQualified = isQualified; + this.isComplex = isComplex; + this.isCollection = isCollection; + } + + Type(String name, int javaSQLType, TTypeId tType, boolean isComplex, boolean isCollection) { + this(name, javaSQLType, tType, false, isComplex, isCollection); + } + + Type(String name, int javaSqlType, TTypeId tType) { + this(name, javaSqlType, tType, false, false, false); + } + + public boolean isPrimitiveType() { + return !isComplex; + } + + public boolean isQualifiedType() { + return isQualified; + } + + public boolean isComplexType() { + return isComplex; + } + + public boolean isCollectionType() { + return isCollection; + } + + public static Type getType(TTypeId tType) { + for (Type type : values()) { + if (tType.equals(type.tType)) { + return type; + } + } + throw new IllegalArgumentException("Unregonized Thrift TTypeId value: " + tType); + } + + public static Type getType(String name) { + if (name == null) { + throw new IllegalArgumentException("Invalid type name: null"); + } + for (Type type : values()) { + if (name.equalsIgnoreCase(type.name)) { + return type; + } else if (type.isQualifiedType() || type.isComplexType()) { + if (name.toUpperCase(Locale.ROOT).startsWith(type.name)) { + return type; + } + } + } + throw new IllegalArgumentException("Unrecognized type name: " + name); + } + + /** + * Radix for this type (typically either 2 or 10) + * Null is returned for data types where this is not applicable. + */ + public Integer getNumPrecRadix() { + if (this.isNumericType()) { + return 10; + } + return null; + } + + /** + * Maximum precision for numeric types. + * Returns null for non-numeric types. + * @return + */ + public Integer getMaxPrecision() { + switch (this) { + case TINYINT_TYPE: + return 3; + case SMALLINT_TYPE: + return 5; + case INT_TYPE: + return 10; + case BIGINT_TYPE: + return 19; + case FLOAT_TYPE: + return 7; + case DOUBLE_TYPE: + return 15; + case DECIMAL_TYPE: + return HiveDecimal.MAX_PRECISION; + default: + return null; + } + } + + public boolean isNumericType() { + switch (this) { + case TINYINT_TYPE: + case SMALLINT_TYPE: + case INT_TYPE: + case BIGINT_TYPE: + case FLOAT_TYPE: + case DOUBLE_TYPE: + case DECIMAL_TYPE: + return true; + default: + return false; + } + } + + /** + * Prefix used to quote a literal of this type (may be null) + */ + public String getLiteralPrefix() { + return null; + } + + /** + * Suffix used to quote a literal of this type (may be null) + * @return + */ + public String getLiteralSuffix() { + return null; + } + + /** + * Can you use NULL for this type? + * @return + * DatabaseMetaData.typeNoNulls - does not allow NULL values + * DatabaseMetaData.typeNullable - allows NULL values + * DatabaseMetaData.typeNullableUnknown - nullability unknown + */ + public Short getNullable() { + // All Hive types are nullable + return DatabaseMetaData.typeNullable; + } + + /** + * Is the type case sensitive? + * @return + */ + public Boolean isCaseSensitive() { + switch (this) { + case STRING_TYPE: + return true; + default: + return false; + } + } + + /** + * Parameters used in creating the type (may be null) + * @return + */ + public String getCreateParams() { + return null; + } + + /** + * Can you use WHERE based on this type? + * @return + * DatabaseMetaData.typePredNone - No support + * DatabaseMetaData.typePredChar - Only support with WHERE .. LIKE + * DatabaseMetaData.typePredBasic - Supported except for WHERE .. LIKE + * DatabaseMetaData.typeSearchable - Supported for all WHERE .. + */ + public Short getSearchable() { + if (isPrimitiveType()) { + return DatabaseMetaData.typeSearchable; + } + return DatabaseMetaData.typePredNone; + } + + /** + * Is this type unsigned? + * @return + */ + public Boolean isUnsignedAttribute() { + if (isNumericType()) { + return false; + } + return true; + } + + /** + * Can this type represent money? + * @return + */ + public Boolean isFixedPrecScale() { + return false; + } + + /** + * Can this type be used for an auto-increment value? + * @return + */ + public Boolean isAutoIncrement() { + return false; + } + + /** + * Localized version of type name (may be null). + * @return + */ + public String getLocalizedName() { + return null; + } + + /** + * Minimum scale supported for this type + * @return + */ + public Short getMinimumScale() { + return 0; + } + + /** + * Maximum scale supported for this type + * @return + */ + public Short getMaximumScale() { + return 0; + } + + public TTypeId toTType() { + return tType; + } + + public int toJavaSQLType() { + return javaSQLType; + } + + public String getName() { + return name; + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala index da835ca82c4d..c8c52d76abaf 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala @@ -69,49 +69,49 @@ class ColumnBuffer() { def this(colValues: TColumn) { this() if (colValues.isSetBoolVal) { - `type` = Type.BOOLEAN + `type` = Type.BOOLEAN_TYPE nulls = toBitset(colValues.getBoolVal.getNulls) _boolVars = Booleans.toArray(colValues.getBoolVal.getValues) _size = boolVars.length } else if (colValues.isSetByteVal) { - `type` = Type.BYTE + `type` = Type.TINYINT_TYPE nulls = toBitset(colValues.getByteVal.getNulls) _byteVars = Bytes.toArray(colValues.getByteVal.getValues) _size = byteVars.length } else if (colValues.isSetI16Val) { - `type` = Type.SHORT + `type` = Type.SMALLINT_TYPE nulls = toBitset(colValues.getI16Val.getNulls) _shortVars = Shorts.toArray(colValues.getI16Val.getValues) _size = shortVars.length } else if (colValues.isSetI32Val) { - `type` = Type.INT + `type` = Type.INT_TYPE nulls = toBitset(colValues.getI32Val.getNulls) _intVars = Ints.toArray(colValues.getI32Val.getValues) _size = intVars.length } else if (colValues.isSetI64Val) { - `type` = Type.LONG + `type` = Type.BIGINT_TYPE nulls = toBitset(colValues.getI64Val.getNulls) _longVars = Longs.toArray(colValues.getI64Val.getValues) _size = longVars.length } else if (colValues.isSetDoubleVal) { - `type` = Type.DOUBLE + `type` = Type.DOUBLE_TYPE nulls = toBitset(colValues.getDoubleVal.getNulls) _doubleVars = Doubles.toArray(colValues.getDoubleVal.getValues) _size = doubleVars.length } else if (colValues.isSetBinaryVal) { - `type` = Type.BINARY + `type` = Type.BINARY_TYPE nulls = toBitset(colValues.getBinaryVal.getNulls) _binaryVars = colValues.getBinaryVal.getValues.asScala.toArray _size = _binaryVars.size } else if (colValues.isSetStringVal) { - `type` = Type.STRING + `type` = Type.STRING_TYPE nulls = toBitset(colValues.getStringVal.getNulls) _stringVars = colValues.getStringVal.getValues.asScala.toArray _size = _stringVars.size @@ -129,22 +129,22 @@ class ColumnBuffer() { return null } `type` match { - case BOOLEAN => + case Type.BOOLEAN_TYPE => return _boolVars(index) - case BYTE => + case Type.TINYINT_TYPE => return _byteVars(index) - case SHORT => + case Type.SMALLINT_TYPE => return _shortVars(index) - case INT => + case Type.INT_TYPE => return _intVars(index) - case LONG => + case Type.BIGINT_TYPE => return _longVars(index) - case FLOAT => - case DOUBLE => + case Type.FLOAT_TYPE => + case Type.DOUBLE_TYPE => return _doubleVars(index) - case STRING => + case Type.STRING_TYPE => return _stringVars(index) - case BINARY => + case Type.BINARY_TYPE => return _binaryVars(index).array } null diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index 8fe03bae1374..cfe3f2b84f95 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -18,7 +18,6 @@ package org.apache.spark.sql.thriftserver.cli import scala.collection.JavaConverters._ -import scala.collection.mutable import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIServiceConstants, TTableSchema, TTypeEntry, TTypeId} import org.apache.spark.sql.types._ diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala deleted file mode 100644 index df6b403c34bd..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Type.scala +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.sql.DatabaseMetaData -import java.util.Locale - -import org.apache.spark.sql.thriftserver.cli.thrift.TTypeId -import org.apache.spark.sql.types.DecimalType - -private[thriftserver] trait Type { - - def getName: String - - def tTypeId: TTypeId - - def isComplex: Boolean - - def isQualifiedType: Boolean - - def isCollectionType: Boolean - - def isPrimitiveType: Boolean = !isComplex - - def isComplexType: Boolean = isComplex - - /** - * Radix for this type (typically either 2 or 10) - * Null is returned for data types where this is not applicable. - */ - def getNumPrecRadix: Integer = { - if (this.isNumericType) { - 10 - } else { - null - } - } - - def getMaxPrecision(): Option[Int] - - def isNumericType(): Boolean = false - - /** - * Prefix used to quote a literal of this type (may be null) - */ - def getLiteralPrefix: String = null - - /** - * Suffix used to quote a literal of this type (may be null) - * - * @return - */ - def getLiteralSuffix: String = null - - /** - * Can you use NULL for this type? - * - * @return - * DatabaseMetaData.typeNoNulls - does not allow NULL values - * DatabaseMetaData.typeNullable - allows NULL values - * DatabaseMetaData.typeNullableUnknown - nullability unknown - */ - def getNullable: Short = { - // All Hive types are nullable - DatabaseMetaData.typeNullable.toShort - } - - /** - * Is the type case sensitive? - * - * @return - */ - def isCaseSensitive: Boolean = false - - /** - * Parameters used in creating the type (may be null) - * - * @return - */ - def getCreateParams: String = null - - /** - * Can you use WHERE based on this type? - * - * @return - * DatabaseMetaData.typePredNone - No support - * DatabaseMetaData.typePredChar - Only support with WHERE .. LIKE - * DatabaseMetaData.typePredBasic - Supported except for WHERE .. LIKE - * DatabaseMetaData.typeSearchable - Supported for all WHERE .. - */ - def getSearchable: Short = { - if (isPrimitiveType) { - DatabaseMetaData.typeSearchable.toShort - } else { - DatabaseMetaData.typePredNone.toShort - } - } - - /** - * Is this type unsigned? - * - * @return - */ - def isUnsignedAttribute: Boolean = { - if (isNumericType) { - false - } else { - true - } - } - - /** - * Can this type represent money? - * - * @return - */ - def isFixedPrecScale: Boolean = false - - /** - * Can this type be used for an auto-increment value? - * - * @return - */ - def isAutoIncrement: Boolean = false - - /** - * Localized version of type name (may be null). - * - * @return - */ - def getLocalizedName: String = null - - /** - * Minimum scale supported for this type - * - * @return - */ - def getMinimumScale: Short = 0.toShort - - /** - * Maximum scale supported for this type - * - * @return - */ - def getMaximumScale: Short = 0.toShort - - def javaSQLType: Int - - def toJavaSQLType: Int = javaSQLType -} - -object Type { - - val typeMap: Map[String, Type] = Map( - NULL.getName -> NULL, - STRING.getName -> STRING, - INT.getName -> INT, - BOOLEAN.getName -> BOOLEAN, - DOUBLE.getName -> DOUBLE, - FLOAT.getName -> FLOAT, - DECIMAL.getName -> DECIMAL, - LONG.getName -> LONG, - BYTE.getName -> BYTE, - SHORT.getName -> SHORT, - DATE.getName -> DATE, - TIMESTAMP.getName -> TIMESTAMP, - BINARY.getName -> BINARY, - ARRAY.getName -> ARRAY, - MAP.getName -> MAP, - STRUCT.getName -> STRUCT - ) - - def values: Seq[Type] = typeMap.values.toSeq - - def getType(tTypeId: TTypeId): Type = { - val tType = values.find(_.tTypeId == tTypeId) - if (tType.isDefined) { - tType.get - } else { - throw new IllegalArgumentException("Unregonized Thrift TTypeId value: " + tTypeId) - } - } - - def getType(name: String): Type = { - values.foreach(t => { - if (t.getName == name) { - return t - } else { - if ((t.isQualifiedType || t.isComplex) && - name.toUpperCase(Locale.ROOT).startsWith(t.getName)) { - return t - } - } - }) - throw new IllegalArgumentException("Unrecognized type name: " + name) - } - - case object NULL extends Type() { - override def getName: String = "VOID" - - override def tTypeId: TTypeId = TTypeId.NULL_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.NULL - } - - case object STRING extends Type { - override def getName: String = "STRING" - - override def tTypeId: TTypeId = TTypeId.STRING_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.VARCHAR - - override def isCaseSensitive: Boolean = true - } - - case object INT extends Type { - override def getName: String = "INT" - - override def tTypeId: TTypeId = TTypeId.INT_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = Some(10) - - override def javaSQLType: Int = java.sql.Types.INTEGER - - override def isNumericType(): Boolean = true - } - - case object BOOLEAN extends Type { - override def getName: String = "BOOLEAN" - - override def tTypeId: TTypeId = TTypeId.BOOLEAN_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.BOOLEAN - } - - case object DOUBLE extends Type { - override def getName: String = "DOUBLE" - - override def tTypeId: TTypeId = TTypeId.DOUBLE_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = Some(15) - - override def javaSQLType: Int = java.sql.Types.DOUBLE - - override def isNumericType(): Boolean = true - } - - case object FLOAT extends Type { - override def getName: String = "FLOAT" - - override def tTypeId: TTypeId = TTypeId.FLOAT_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = Some(7) - - override def javaSQLType: Int = java.sql.Types.FLOAT - - override def isNumericType(): Boolean = true - } - - case object DECIMAL extends Type { - override def getName: String = "DECIMAL" - - override def tTypeId: TTypeId = TTypeId.DECIMAL_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = true - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = Some(DecimalType.MAX_PRECISION) - - override def javaSQLType: Int = java.sql.Types.DECIMAL - - override def isNumericType(): Boolean = true - } - - case object LONG extends Type { - override def getName: String = "BIGINT" - - override def tTypeId: TTypeId = TTypeId.BIGINT_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = Some(19) - - override def javaSQLType: Int = java.sql.Types.BIGINT - - override def isNumericType(): Boolean = true - } - - case object BYTE extends Type { - override def getName: String = "TINYINT" - - override def tTypeId: TTypeId = TTypeId.TINYINT_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.TINYINT - } - - case object SHORT extends Type { - override def getName: String = "SMALLINT" - - override def tTypeId: TTypeId = TTypeId.SMALLINT_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = Some(5) - - override def javaSQLType: Int = java.sql.Types.SMALLINT - - override def isNumericType(): Boolean = true - } - - case object DATE extends Type { - override def getName: String = "DATE" - - override def tTypeId: TTypeId = TTypeId.DATE_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.DATE - } - - case object TIMESTAMP extends Type { - override def getName: String = "TIMESTAMP" - - override def tTypeId: TTypeId = TTypeId.TIMESTAMP_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.TIMESTAMP - } - - case object BINARY extends Type { - override def getName: String = "BINARY" - - override def tTypeId: TTypeId = TTypeId.BINARY_TYPE - - override def isComplex: Boolean = false - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.BINARY - } - - case object ARRAY extends Type { - override def getName: String = "ARRAY" - - override def tTypeId: TTypeId = TTypeId.ARRAY_TYPE - - override def isComplex: Boolean = true - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = true - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.ARRAY - } - - case object MAP extends Type { - override def getName: String = "MAP" - - override def tTypeId: TTypeId = TTypeId.MAP_TYPE - - override def isComplex: Boolean = true - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = true - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.JAVA_OBJECT - } - - case object STRUCT extends Type { - override def getName: String = "STRUCT" - - override def tTypeId: TTypeId = TTypeId.STRUCT_TYPE - - override def isComplex: Boolean = true - - override def isQualifiedType: Boolean = false - - override def isCollectionType: Boolean = false - - override def getMaxPrecision(): Option[Int] = None - - override def javaSQLType: Int = java.sql.Types.STRUCT - } - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala index 9786c2fe4666..7ec449ce27b4 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala @@ -90,11 +90,11 @@ private[thriftserver] class SparkGetTypeInfoOperation( parentSession.getUsername) try { - Type.values.foreach(typeInfo => { + Type.values().foreach(typeInfo => { val rowData = Row( typeInfo.getName, // TYPE_NAME typeInfo.toJavaSQLType, // DATA_TYPE - typeInfo.getMaxPrecision.getOrElse(null), // PRECISION + typeInfo.getMaxPrecision, // PRECISION typeInfo.getLiteralPrefix, // LITERAL_PREFIX typeInfo.getLiteralSuffix, // LITERAL_SUFFIX typeInfo.getCreateParams, // CREATE_PARAMS From ac9ad540db6c163af42792257ad99b10c61dbf64 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 00:50:35 +0800 Subject: [PATCH 34/55] basic service to java --- .../sql/thriftserver/AbstractService.java | 193 ++++++++++++++++++ .../sql/thriftserver/CompositeService.java | 133 ++++++++++++ .../spark/sql/thriftserver/CookieSigner.java | 108 ++++++++++ .../spark/sql/thriftserver/Service.java | 122 +++++++++++ .../sql/thriftserver/ServiceException.java | 38 ++++ .../sql/thriftserver/ServiceOperations.java | 141 +++++++++++++ .../ServiceStateChangeListener.java | 46 +++++ .../spark/sql/thriftserver/ServiceUtils.java | 70 +++++++ .../sql/thriftserver/AbstractService.scala | 139 ------------- .../sql/thriftserver/CompositeService.scala | 115 ----------- .../spark/sql/thriftserver/CookieSigner.scala | 102 --------- .../spark/sql/thriftserver/Service.scala | 112 ---------- .../sql/thriftserver/ServiceException.scala | 26 --- .../sql/thriftserver/ServiceOperations.scala | 132 ------------ .../ServiceStateChangeListener.scala | 43 ---- .../spark/sql/thriftserver/ServiceUtils.scala | 69 ------- 16 files changed, 851 insertions(+), 738 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/AbstractService.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CompositeService.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CookieSigner.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/Service.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceException.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceOperations.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceUtils.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/AbstractService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/AbstractService.java new file mode 100644 index 000000000000..0d3068bf529d --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/AbstractService.java @@ -0,0 +1,193 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * AbstractService. + * + */ +public abstract class AbstractService implements Service { + + private static final Logger LOG = LoggerFactory.getLogger(AbstractService.class); + + /** + * Service state: initially {@link STATE#NOTINITED}. + */ + private STATE state = STATE.NOTINITED; + + /** + * Service name. + */ + private final String name; + /** + * Service start time. Will be zero until the service is started. + */ + private long startTime; + + /** + * The configuration. Will be null until the service is initialized. + */ + private HiveConf hiveConf; + + /** + * List of state change listeners; it is final to ensure + * that it will never be null. + */ + private final List listeners = + new ArrayList(); + + /** + * Construct the service. + * + * @param name + * service name + */ + public AbstractService(String name) { + this.name = name; + } + + // This probably doesn't need to be sync, but nobody calls this, so it doesn't matter. + @Override + public synchronized STATE getServiceState() { + return state; + } + + /** + * {@inheritDoc} + * + * @throws IllegalStateException + * if the current service state does not permit + * this action + */ + @Override + public synchronized void init(HiveConf hiveConf) { + ensureCurrentState(STATE.NOTINITED); + setHiveConf(hiveConf); + changeState(STATE.INITED); + LOG.info("Service:" + getName() + " is inited."); + } + + protected final void setHiveConf(HiveConf hiveConf) { + this.hiveConf = hiveConf; + } + + /** + * {@inheritDoc} + * + * @throws IllegalStateException + * if the current service state does not permit + * this action + */ + @Override + public synchronized void start() { + startTime = System.currentTimeMillis(); + ensureCurrentState(STATE.INITED); + changeState(STATE.STARTED); + LOG.info("Service:" + getName() + " is started."); + } + + /** + * {@inheritDoc} + * + * @throws IllegalStateException + * if the current service state does not permit + * this action + */ + @Override + public synchronized void stop() { + if (state == STATE.STOPPED || + state == STATE.INITED || + state == STATE.NOTINITED) { + // already stopped, or else it was never + // started (eg another service failing canceled startup) + return; + } + ensureCurrentState(STATE.STARTED); + changeState(STATE.STOPPED); + LOG.info("Service:" + getName() + " is stopped."); + } + + @Override + public void register(ServiceStateChangeListener l) { + synchronized (listeners) { + listeners.add(l); + } + } + + @Override + public void unregister(ServiceStateChangeListener l) { + synchronized (listeners) { + listeners.remove(l); + } + } + + @Override + public String getName() { + return name; + } + + @Override + public HiveConf getHiveConf() { + return hiveConf; + } + + @Override + public long getStartTime() { + return startTime; + } + + /** + * Verify that that a service is in a given state. + * + * @param currentState + * the desired state + * @throws IllegalStateException + * if the service state is different from + * the desired state + */ + private void ensureCurrentState(STATE currentState) { + ServiceOperations.ensureCurrentState(state, currentState); + } + + /** + * Change to a new state and notify all listeners. + * This is a private method that is only invoked from synchronized methods, + * which avoid having to clone the listener list. It does imply that + * the state change listener methods should be short lived, as they + * will delay the state transition. + * + * @param newState + * new service state + */ + private void changeState(STATE newState) { + state = newState; + // notify listeners + for (ServiceStateChangeListener l : listeners) { + l.stateChanged(this); + } + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CompositeService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CompositeService.java new file mode 100644 index 000000000000..30ff3d25fcc2 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CompositeService.java @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * CompositeService. + * + */ +public class CompositeService extends AbstractService { + + private static final Logger LOG = LoggerFactory.getLogger(CompositeService.class); + + private final List serviceList = new ArrayList(); + + public CompositeService(String name) { + super(name); + } + + public Collection getServices() { + return Collections.unmodifiableList(serviceList); + } + + protected synchronized void addService(Service service) { + serviceList.add(service); + } + + protected synchronized boolean removeService(Service service) { + return serviceList.remove(service); + } + + @Override + public synchronized void init(HiveConf hiveConf) { + for (Service service : serviceList) { + service.init(hiveConf); + } + super.init(hiveConf); + } + + @Override + public synchronized void start() { + int i = 0; + try { + for (int n = serviceList.size(); i < n; i++) { + Service service = serviceList.get(i); + service.start(); + } + super.start(); + } catch (Throwable e) { + LOG.error("Error starting services " + getName(), e); + // Note that the state of the failed service is still INITED and not + // STARTED. Even though the last service is not started completely, still + // call stop() on all services including failed service to make sure cleanup + // happens. + stop(i); + throw new ServiceException("Failed to Start " + getName(), e); + } + + } + + @Override + public synchronized void stop() { + if (this.getServiceState() == STATE.STOPPED) { + // The base composite-service is already stopped, don't do anything again. + return; + } + if (serviceList.size() > 0) { + stop(serviceList.size() - 1); + } + super.stop(); + } + + private synchronized void stop(int numOfServicesStarted) { + // stop in reserve order of start + for (int i = numOfServicesStarted; i >= 0; i--) { + Service service = serviceList.get(i); + try { + service.stop(); + } catch (Throwable t) { + LOG.info("Error stopping " + service.getName(), t); + } + } + } + + /** + * JVM Shutdown hook for CompositeService which will stop the given + * CompositeService gracefully in case of JVM shutdown. + */ + public static class CompositeServiceShutdownHook implements Runnable { + + private final CompositeService compositeService; + + public CompositeServiceShutdownHook(CompositeService compositeService) { + this.compositeService = compositeService; + } + + @Override + public void run() { + try { + // Stop the Composite Service + compositeService.stop(); + } catch (Throwable t) { + LOG.info("Error stopping " + compositeService.getName(), t); + } + } + } + + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CookieSigner.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CookieSigner.java new file mode 100644 index 000000000000..6d978923a7d2 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/CookieSigner.java @@ -0,0 +1,108 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver; + +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; + +import org.apache.commons.codec.binary.Base64; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * The cookie signer generates a signature based on SHA digest + * and appends it to the cookie value generated at the + * server side. It uses SHA digest algorithm to sign and verify signatures. + */ +public class CookieSigner { + private static final String SIGNATURE = "&s="; + private static final String SHA_STRING = "SHA-256"; + private byte[] secretBytes; + private static final Logger LOG = LoggerFactory.getLogger(CookieSigner.class); + + /** + * Constructor + * @param secret Secret Bytes + */ + public CookieSigner(byte[] secret) { + if (secret == null) { + throw new IllegalArgumentException(" NULL Secret Bytes"); + } + this.secretBytes = secret.clone(); + } + + /** + * Sign the cookie given the string token as input. + * @param str Input token + * @return Signed token that can be used to create a cookie + */ + public String signCookie(String str) { + if (str == null || str.isEmpty()) { + throw new IllegalArgumentException("NULL or empty string to sign"); + } + String signature = getSignature(str); + + if (LOG.isDebugEnabled()) { + LOG.debug("Signature generated for " + str + " is " + signature); + } + return str + SIGNATURE + signature; + } + + /** + * Verify a signed string and extracts the original string. + * @param signedStr The already signed string + * @return Raw Value of the string without the signature + */ + public String verifyAndExtract(String signedStr) { + int index = signedStr.lastIndexOf(SIGNATURE); + if (index == -1) { + throw new IllegalArgumentException("Invalid input sign: " + signedStr); + } + String originalSignature = signedStr.substring(index + SIGNATURE.length()); + String rawValue = signedStr.substring(0, index); + String currentSignature = getSignature(rawValue); + + if (LOG.isDebugEnabled()) { + LOG.debug("Signature generated for " + rawValue + " inside verify is " + currentSignature); + } + if (!originalSignature.equals(currentSignature)) { + throw new IllegalArgumentException("Invalid sign, original = " + originalSignature + + " current = " + currentSignature); + } + return rawValue; + } + + /** + * Get the signature of the input string based on SHA digest algorithm. + * @param str Input token + * @return Signed String + */ + private String getSignature(String str) { + try { + MessageDigest md = MessageDigest.getInstance(SHA_STRING); + md.update(str.getBytes()); + md.update(secretBytes); + byte[] digest = md.digest(); + return new Base64(0).encodeToString(digest); + } catch (NoSuchAlgorithmException ex) { + throw new RuntimeException("Invalid SHA digest String: " + SHA_STRING + + " " + ex.getMessage(), ex); + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/Service.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/Service.java new file mode 100644 index 000000000000..95befdf136ef --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/Service.java @@ -0,0 +1,122 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver; + +import org.apache.hadoop.hive.conf.HiveConf; + +/** + * Service. + * + */ +public interface Service { + + /** + * Service states + */ + public enum STATE { + /** Constructed but not initialized */ + NOTINITED, + + /** Initialized but not started or stopped */ + INITED, + + /** started and not stopped */ + STARTED, + + /** stopped. No further state transitions are permitted */ + STOPPED + } + + /** + * Initialize the service. + * + * The transition must be from {@link STATE#NOTINITED} to {@link STATE#INITED} unless the + * operation failed and an exception was raised. + * + * @param config + * the configuration of the service + */ + void init(HiveConf conf); + + + /** + * Start the service. + * + * The transition should be from {@link STATE#INITED} to {@link STATE#STARTED} unless the + * operation failed and an exception was raised. + */ + void start(); + + /** + * Stop the service. + * + * This operation must be designed to complete regardless of the initial state + * of the service, including the state of all its internal fields. + */ + void stop(); + + /** + * Register an instance of the service state change events. + * + * @param listener + * a new listener + */ + void register(ServiceStateChangeListener listener); + + /** + * Unregister a previously instance of the service state change events. + * + * @param listener + * the listener to unregister. + */ + void unregister(ServiceStateChangeListener listener); + + /** + * Get the name of this service. + * + * @return the service name + */ + String getName(); + + /** + * Get the configuration of this service. + * This is normally not a clone and may be manipulated, though there are no + * guarantees as to what the consequences of such actions may be + * + * @return the current configuration, unless a specific implementation chooses + * otherwise. + */ + HiveConf getHiveConf(); + + /** + * Get the current service state + * + * @return the state of the service + */ + STATE getServiceState(); + + /** + * Get the service start time + * + * @return the start time of the service. This will be zero if the service + * has not yet been started. + */ + long getStartTime(); + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceException.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceException.java new file mode 100644 index 000000000000..0921197c674d --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceException.java @@ -0,0 +1,38 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver; + +/** + * ServiceException. + * + */ +public class ServiceException extends RuntimeException { + + public ServiceException(Throwable cause) { + super(cause); + } + + public ServiceException(String message) { + super(message); + } + + public ServiceException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceOperations.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceOperations.java new file mode 100644 index 000000000000..814241033d2c --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceOperations.java @@ -0,0 +1,141 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ServiceOperations. + * + */ +public final class ServiceOperations { + private static final Logger LOG = LoggerFactory.getLogger(AbstractService.class); + + private ServiceOperations() { + } + + /** + * Verify that that a service is in a given state. + * @param state the actual state a service is in + * @param expectedState the desired state + * @throws IllegalStateException if the service state is different from + * the desired state + */ + public static void ensureCurrentState(Service.STATE state, + Service.STATE expectedState) { + if (state != expectedState) { + throw new IllegalStateException("For this operation, the " + + "current service state must be " + + expectedState + + " instead of " + state); + } + } + + /** + * Initialize a service. + *

+ * The service state is checked before the operation begins. + * This process is not thread safe. + * @param service a service that must be in the state + * {@link Service.STATE#NOTINITED} + * @param configuration the configuration to initialize the service with + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + + public static void init(Service service, HiveConf configuration) { + Service.STATE state = service.getServiceState(); + ensureCurrentState(state, Service.STATE.NOTINITED); + service.init(configuration); + } + + /** + * Start a service. + *

+ * The service state is checked before the operation begins. + * This process is not thread safe. + * @param service a service that must be in the state + * {@link Service.STATE#INITED} + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + + public static void start(Service service) { + Service.STATE state = service.getServiceState(); + ensureCurrentState(state, Service.STATE.INITED); + service.start(); + } + + /** + * Initialize then start a service. + *

+ * The service state is checked before the operation begins. + * This process is not thread safe. + * @param service a service that must be in the state + * {@link Service.STATE#NOTINITED} + * @param configuration the configuration to initialize the service with + * @throws RuntimeException on a state change failure + * @throws IllegalStateException if the service is in the wrong state + */ + public static void deploy(Service service, HiveConf configuration) { + init(service, configuration); + start(service); + } + + /** + * Stop a service. + *

Do nothing if the service is null or not + * in a state in which it can be/needs to be stopped. + *

+ * The service state is checked before the operation begins. + * This process is not thread safe. + * @param service a service or null + */ + public static void stop(Service service) { + if (service != null) { + Service.STATE state = service.getServiceState(); + if (state == Service.STATE.STARTED) { + service.stop(); + } + } + } + + /** + * Stop a service; if it is null do nothing. Exceptions are caught and + * logged at warn level. (but not Throwables). This operation is intended to + * be used in cleanup operations + * + * @param service a service; may be null + * @return any exception that was caught; null if none was. + */ + public static Exception stopQuietly(Service service) { + try { + stop(service); + } catch (Exception e) { + LOG.warn("When stopping the service " + service.getName() + + " : " + e, + e); + return e; + } + return null; + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.java new file mode 100644 index 000000000000..c03c7023e0c2 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.java @@ -0,0 +1,46 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver; + +/** + * ServiceStateChangeListener. + * + */ +public interface ServiceStateChangeListener { + + /** + * Callback to notify of a state change. The service will already + * have changed state before this callback is invoked. + * + * This operation is invoked on the thread that initiated the state change, + * while the service itself in in a sychronized section. + *

    + *
  1. Any long-lived operation here will prevent the service state + * change from completing in a timely manner.
  2. + *
  3. If another thread is somehow invoked from the listener, and + * that thread invokes the methods of the service (including + * subclass-specific methods), there is a risk of a deadlock.
  4. + *
+ * + * + * @param service the service that has changed. + */ + void stateChanged(Service service); + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceUtils.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceUtils.java new file mode 100644 index 000000000000..cf71cd4027d3 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/ServiceUtils.java @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver; + +import java.io.IOException; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.slf4j.Logger; + +public class ServiceUtils { + + /* + * Get the index separating the user name from domain name (the user's name up + * to the first '/' or '@'). + * + * @param userName full user name. + * @return index of domain match or -1 if not found + */ + public static int indexOfDomainMatch(String userName) { + if (userName == null) { + return -1; + } + + int idx = userName.indexOf('/'); + int idx2 = userName.indexOf('@'); + int endIdx = Math.min(idx, idx2); // Use the earlier match. + // Unless at least one of '/' or '@' was not found, in + // which case, user the latter match. + if (endIdx == -1) { + endIdx = Math.max(idx, idx2); + } + return endIdx; + } + + /** + * Close the Closeable objects and ignore any {@link IOException} or + * null pointers. Must only be used for cleanup in exception handlers. + * + * @param log the log to record problems to at debug level. Can be null. + * @param closeables the objects to close + */ + public static void cleanup(Logger log, java.io.Closeable... closeables) { + for (java.io.Closeable c : closeables) { + if (c != null) { + try { + c.close(); + } catch(IOException e) { + if (log != null && log.isDebugEnabled()) { + log.debug("Exception in closing " + c, e); + } + } + } + } + } +} \ No newline at end of file diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala deleted file mode 100644 index 76730d4c8678..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/AbstractService.scala +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.util - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.conf.HiveConf - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.Service._ - -/** - * Construct the service. - * - * @param name - * service name - */ -private[thriftserver] abstract class AbstractService(val name: String) - extends Service with Logging { - - /** - * Service state: initially {@link STATE#NOTINITED}. - */ - private var state: STATE = NOTINITED - /** - * Service start time. Will be zero until the service is started. - */ - private var startTime = 0L - /** - * The configuration. Will be null until the service is initialized. - */ - private var hiveConf: HiveConf = _ - /** - * List of state change listeners; it is final to ensure - * that it will never be null. - */ - final private val listeners = new util.ArrayList[ServiceStateChangeListener] - - def getServiceState: Service.STATE = synchronized { - state - } - - /** - * {@inheritDoc } - * - * @throws IllegalStateException - * if the current service state does not permit - * this action - */ - def init(hiveConf: HiveConf): Unit = { - ensureCurrentState(NOTINITED) - this.hiveConf = hiveConf - changeState(INITED) - logInfo("Service:" + getName + " is inited.") - } - - def start(): Unit = { - startTime = System.currentTimeMillis - ensureCurrentState(INITED) - changeState(STARTED) - logInfo("Service:" + getName + " is started.") - } - - def stop(): Unit = { - if ((state eq STOPPED) || - (state eq INITED) || - (state eq NOTINITED)) { - // already stopped, or else it was never - // started (eg another service failing canceled startup) - return - } - ensureCurrentState(STARTED) - changeState(STOPPED) - logInfo("Service:" + getName + " is stopped.") - } - - def register(l: ServiceStateChangeListener): Unit = { - listeners.add(l) - } - - def unregister(l: ServiceStateChangeListener): Unit = { - listeners.remove(l) - } - - def getName: String = name - - def getHiveConf: HiveConf = hiveConf - - def getStartTime: Long = startTime - - /** - * Verify that a service is in a given state. - * - * @param currentState - * the desired state - * @throws IllegalStateException - * if the service state is different from - * the desired state - */ - private def ensureCurrentState(currentState: STATE): Unit = { - ServiceOperations.ensureCurrentState(state, currentState) - } - - /** - * Change to a new state and notify all listeners. - * This is a private method that is only invoked from synchronized methods, - * which avoid having to clone the listener list. It does imply that - * the state change listener methods should be short lived, as they - * will delay the state transition. - * - * @param newState - * new service state - */ - private def changeState(newState: STATE): Unit = { - state = newState - // notify listeners - for (l <- listeners.asScala) { - l.stateChanged(this) - } - } -} - diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala deleted file mode 100644 index 5f91dc1bfc1d..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CompositeService.scala +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.util -import java.util.Collections - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.conf.HiveConf - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.Service.STOPPED - -private[thriftserver] class CompositeService(name: String) - extends AbstractService(name) - with Logging { - - - private val serviceList: util.ArrayList[Service] = new util.ArrayList[Service] - - def getServices: util.Collection[Service] = Collections.unmodifiableList(serviceList) - - protected def addService(service: Service): Unit = { - serviceList.add(service) - } - - protected def removeService(service: Service): Boolean = serviceList.remove(service) - - override def init(hiveConf: HiveConf): Unit = { - for (service <- serviceList.asScala) { - service.init(hiveConf) - } - super.init(hiveConf) - } - - override def start(): Unit = { - var i = 0 - try { - val n = serviceList.size - while (i < n) { - val service = serviceList.get(i) - service.start - i += 1 - } - super.start - } catch { - case e: Throwable => - logError("Error starting services " + getName, e) - // Note that the state of the failed service is still INITED and not - // STARTED. Even though the last service is not started completely, still - // call stop() on all services including failed service to make sure cleanup - // happens. - stop(i) - throw new ServiceException("Failed to Start " + getName, e) - } - } - - override def stop(): Unit = { - if (this.getServiceState eq STOPPED) { - // The base composite-service is already stopped, don't do anything again. - return - } - if (serviceList.size > 0) { - stop(serviceList.size - 1) - } - super.stop - } - - private def stop(numOfServicesStarted: Int): Unit = { - // stop in reserve order of start - var i = numOfServicesStarted - while (i >= 0) { - val service = serviceList.get(i) - try { - service.stop - } catch { - case t: Throwable => - logInfo("Error stopping " + service.getName, t) - } - i -= 1 - } - } - - /** - * JVM Shutdown hook for CompositeService which will stop the given - * CompositeService gracefully in case of JVM shutdown. - */ - class CompositeServiceShutdownHook(val compositeService: CompositeService) extends Runnable { - override def run(): Unit = { - try // Stop the Composite Service - compositeService.stop - catch { - case t: Throwable => - logInfo("Error stopping " + compositeService.getName, t) - } - } - } - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala deleted file mode 100644 index 9c14e7d208f3..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/CookieSigner.scala +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.security.{MessageDigest, NoSuchAlgorithmException} - -import org.apache.commons.codec.binary.Base64 - -import org.apache.spark.internal.Logging - -/** - * The cookie signer generates a signature based on SHA digest - * and appends it to the cookie value generated at the - * server side. It uses SHA digest algorithm to sign and verify signatures. - */ -private[thriftserver] object CookieSigner { - private val SIGNATURE = "&s=" - private val SHA_STRING = "SHA" -} - -private[thriftserver] class CookieSigner extends Logging { - private var secretBytes: Array[Byte] = null - - def this(secret: Array[Byte]) { - this() - if (secret == null) { - throw new IllegalArgumentException("NULL Secret Bytes") - } - this.secretBytes = secret.clone - } - - - /** - * Sign the cookie given the string token as input. - * - * @param str Input token - * @return Signed token that can be used to create a cookie - */ - def signCookie(str: String): String = { - if (str == null || str.isEmpty) { - throw new IllegalArgumentException("NULL or empty string to sign") - } - val signature = getSignature(str) - logDebug("Signature generated for " + str + " is " + signature) - str + CookieSigner.SIGNATURE + signature - } - - /** - * Verify a signed string and extracts the original string. - * - * @param signedStr The already signed string - * @return Raw Value of the string without the signature - */ - def verifyAndExtract(signedStr: String): String = { - val index = signedStr.lastIndexOf(CookieSigner.SIGNATURE) - if (index == -1) { - throw new IllegalArgumentException("Invalid input sign: " + signedStr) - } - val originalSignature = signedStr.substring(index + CookieSigner.SIGNATURE.length) - val rawValue = signedStr.substring(0, index) - val currentSignature = getSignature(rawValue) - logDebug("Signature generated for " + rawValue + " inside verify is " + currentSignature) - if (!(originalSignature == currentSignature)) { - throw new IllegalArgumentException("Invalid sign, original = " + - originalSignature + " current = " + currentSignature) - } - rawValue - } - - /** - * Get the signature of the input string based on SHA digest algorithm. - * - * @param str Input token - * @return Signed String - */ - private def getSignature(str: String) = try { - val md = MessageDigest.getInstance(CookieSigner.SHA_STRING) - md.update(str.getBytes) - md.update(secretBytes) - val digest = md.digest - new Base64(0).encodeToString(digest) - } catch { - case ex: NoSuchAlgorithmException => - throw new RuntimeException("Invalid SHA digest String: " + - CookieSigner.SHA_STRING + " " + ex.getMessage, ex) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala deleted file mode 100644 index 82b5fc43bdc9..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/Service.scala +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import org.apache.hadoop.hive.conf.HiveConf - -private[thriftserver] trait Service { - /** - * Initialize the service. - * - * The transition must be from {@link STATE#NOTINITED} to {@link STATE#INITED} unless the - * operation failed and an exception was raised. - * - * @param conf - * the configuration of the service - */ - def init(conf: HiveConf): Unit - - - /** - * Start the service. - * - * The transition should be from {@link STATE#INITED} to {@link STATE#STARTED} unless the - * operation failed and an exception was raised. - */ - def start(): Unit - - /** - * Stop the service. - * - * This operation must be designed to complete regardless of the initial state - * of the service, including the state of all its internal fields. - */ - def stop(): Unit - - /** - * Register an instance of the service state change events. - * - * @param listener - * a new listener - */ - def register(listener: ServiceStateChangeListener): Unit - - /** - * Unregister a previously instance of the service state change events. - * - * @param listener - * the listener to unregister. - */ - def unregister(listener: ServiceStateChangeListener): Unit - - /** - * Get the name of this service. - * - * @return the service name - */ - def getName: String - - /** - * Get the configuration of this service. - * This is normally not a clone and may be manipulated, though there are no - * guarantees as to what the consequences of such actions may be - * - * @return the current configuration, unless a specific implementation chooses - * otherwise. - */ - def getHiveConf: HiveConf - - /** - * Get the current service state - * - * @return the state of the service - */ - def getServiceState: Service.STATE - - /** - * Get the service start time - * - * @return the start time of the service. This will be zero if the service - * has not yet been started. - */ - def getStartTime: Long -} - -private[thriftserver] object Service { - - trait STATE - - case object NOTINITED extends STATE - - case object INITED extends STATE - - case object STARTED extends STATE - - case object STOPPED extends STATE - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala deleted file mode 100644 index e52cfe35788e..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceException.scala +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -private[thriftserver] class ServiceException(msg: String, cause: Throwable) - extends RuntimeException(msg, cause) { - - def this(cause: Throwable) = this(null, cause) - - def this(message: String) = this(message, null) -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala deleted file mode 100644 index bc8627b05c2a..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceOperations.scala +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import org.apache.hadoop.hive.conf.HiveConf - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.Service._ - -private[thriftserver] object ServiceOperations extends Logging { - - /** - * Verify that a service is in a given state. - * - * @param state the actual state a service is in - * @param expectedState the desired state - * @throws IllegalStateException if the service state is different from - * the desired state - */ - def ensureCurrentState(state: STATE, expectedState: STATE): Unit = { - if (state ne expectedState) { - throw new IllegalStateException("For this operation, the " + - "current service state must be " + expectedState + " instead of " + state) - } - } - - /** - * Initialize a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service that must be in the state - * { @link Service.STATE#NOTINITED} - * @param configuration the configuration to initialize the service with - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - def init(service: Service, configuration: HiveConf): Unit = { - val state = service.getServiceState - ensureCurrentState(state, NOTINITED) - service.init(configuration) - } - - /** - * Start a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service that must be in the state - * { @link Service.STATE#INITED} - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - def start(service: Service): Unit = { - val state = service.getServiceState - ensureCurrentState(state, INITED) - service.start() - } - - /** - * Initialize then start a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service that must be in the state - * { @link Service.STATE#NOTINITED} - * @param configuration the configuration to initialize the service with - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - def deploy(service: Service, configuration: HiveConf): Unit = { - init(service, configuration) - start(service) - } - - /** - * Stop a service. - * - * Do nothing if the service is null or not in a state in which it can be/needs to be stopped. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * - * @param service a service or null - */ - def stop(service: Service): Unit = { - if (service != null) { - val state = service.getServiceState - if (state eq STARTED) { - service.stop() - - } - } - } - - /** - * Stop a service; if it is null do nothing. Exceptions are caught and - * logged at warn level. (but not Throwables). This operation is intended to - * be used in cleanup operations - * - * @param service a service; may be null - * @return any exception that was caught; null if none was. - */ - def stopQuietly(service: Service): Exception = { - try { - stop(service) - } catch { - case e: Exception => - logWarning("When stopping the service " + service.getName + " : " + e, e) - return e - } - null - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala deleted file mode 100644 index a3e8461d5dd1..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceStateChangeListener.scala +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -/** - * ServiceStateChangeListener. - * - */ -private[thriftserver] trait ServiceStateChangeListener { - - /** - * Callback to notify of a state change. The service will already - * have changed state before this callback is invoked. - * - * This operation is invoked on the thread that initiated the state change, - * while the service itself in a synchronized section. - *
    - *
  1. Any long-lived operation here will prevent the service state - * change from completing in a timely manner.
  2. - *
  3. If another thread is somehow invoked from the listener, and - * that thread invokes the methods of the service (including - * subclass-specific methods), there is a risk of a deadlock.
  4. - *
- * - * @param service the service that has changed. - */ - def stateChanged(service: Service): Unit -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala deleted file mode 100644 index d065d4960fb7..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ServiceUtils.scala +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import java.io.{Closeable, IOException} - -import org.slf4j.Logger - -private[thriftserver] object ServiceUtils { - - /* - * Get the index separating the user name from domain name (the user's name up - * to the first '/' or '@'). - * - * @param userName full user name. - * @return index of domain match or -1 if not found - */ - def indexOfDomainMatch(userName: String): Int = { - if (userName == null) { - return -1 - } - val idx = userName.indexOf('/') - val idx2 = userName.indexOf('@') - var endIdx = Math.min(idx, idx2) // Use the earlier match. - // Unless at least one of '/' or '@' was not found, in - // which case, user the latter match. - if (endIdx == -1) { - endIdx = Math.max(idx, idx2) - } - endIdx - } - - /** - * Close the Closeable objects and ignore any {@link IOException} or - * null pointers. Must only be used for cleanup in exception handlers. - * - * @param log the log to record problems to at debug level. Can be null. - * @param closeables the objects to close - */ - def cleanup(log: Logger, closeables: Closeable*): Unit = { - for (c <- closeables) { - if (c != null) { - try { - c.close() - } catch { - case e: IOException => - if (log != null && log.isDebugEnabled) { - log.debug("Exception in closing " + c, e) - } - } - } - } - } -} From 795ada11d60aad47529f7aeee552f9031f5621af Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 00:56:55 +0800 Subject: [PATCH 35/55] Handle to java --- .../spark/sql/thriftserver/cli/Handle.java | 75 ++++++++++++ .../thriftserver/cli/HandleIdentifier.java | 114 ++++++++++++++++++ .../sql/thriftserver/cli/OperationHandle.java | 103 ++++++++++++++++ .../sql/thriftserver/cli/SessionHandle.java | 71 +++++++++++ .../spark/sql/thriftserver/cli/Handle.scala | 61 ---------- .../thriftserver/cli/HandleIdentifier.scala | 86 ------------- .../thriftserver/cli/OperationHandle.scala | 82 ------------- .../sql/thriftserver/cli/SessionHandle.scala | 48 -------- 8 files changed, 363 insertions(+), 277 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Handle.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationHandle.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SessionHandle.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Handle.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Handle.java new file mode 100644 index 000000000000..552244f846e2 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/Handle.java @@ -0,0 +1,75 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier; + +public abstract class Handle { + + private final HandleIdentifier handleId; + + public Handle() { + handleId = new HandleIdentifier(); + } + + public Handle(HandleIdentifier handleId) { + this.handleId = handleId; + } + + public Handle(THandleIdentifier tHandleIdentifier) { + this.handleId = new HandleIdentifier(tHandleIdentifier); + } + + public HandleIdentifier getHandleIdentifier() { + return handleId; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((handleId == null) ? 0 : handleId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof Handle)) { + return false; + } + Handle other = (Handle) obj; + if (handleId == null) { + if (other.handleId != null) { + return false; + } + } else if (!handleId.equals(other.handleId)) { + return false; + } + return true; + } + + @Override + public abstract String toString(); + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.java new file mode 100644 index 000000000000..3c5f0bbac73f --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.java @@ -0,0 +1,114 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier; + +import java.nio.ByteBuffer; +import java.util.UUID; + + +/** + * HandleIdentifier. + * + */ +public class HandleIdentifier { + private final UUID publicId; + private final UUID secretId; + + public HandleIdentifier() { + publicId = UUID.randomUUID(); + secretId = UUID.randomUUID(); + } + + public HandleIdentifier(UUID publicId, UUID secretId) { + this.publicId = publicId; + this.secretId = secretId; + } + + public HandleIdentifier(THandleIdentifier tHandleId) { + ByteBuffer bb = ByteBuffer.wrap(tHandleId.getGuid()); + this.publicId = new UUID(bb.getLong(), bb.getLong()); + bb = ByteBuffer.wrap(tHandleId.getSecret()); + this.secretId = new UUID(bb.getLong(), bb.getLong()); + } + + public UUID getPublicId() { + return publicId; + } + + public UUID getSecretId() { + return secretId; + } + + public THandleIdentifier toTHandleIdentifier() { + byte[] guid = new byte[16]; + byte[] secret = new byte[16]; + ByteBuffer guidBB = ByteBuffer.wrap(guid); + ByteBuffer secretBB = ByteBuffer.wrap(secret); + guidBB.putLong(publicId.getMostSignificantBits()); + guidBB.putLong(publicId.getLeastSignificantBits()); + secretBB.putLong(secretId.getMostSignificantBits()); + secretBB.putLong(secretId.getLeastSignificantBits()); + return new THandleIdentifier(ByteBuffer.wrap(guid), ByteBuffer.wrap(secret)); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((publicId == null) ? 0 : publicId.hashCode()); + result = prime * result + ((secretId == null) ? 0 : secretId.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (!(obj instanceof HandleIdentifier)) { + return false; + } + HandleIdentifier other = (HandleIdentifier) obj; + if (publicId == null) { + if (other.publicId != null) { + return false; + } + } else if (!publicId.equals(other.publicId)) { + return false; + } + if (secretId == null) { + if (other.secretId != null) { + return false; + } + } else if (!secretId.equals(other.secretId)) { + return false; + } + return true; + } + + @Override + public String toString() { + return publicId.toString(); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationHandle.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationHandle.java new file mode 100644 index 000000000000..f3f73e68ed41 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationHandle.java @@ -0,0 +1,103 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.cli; + + +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationHandle; +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion; + +public class OperationHandle extends Handle { + + private final OperationType opType; + private final TProtocolVersion protocol; + private boolean hasResultSet = false; + + public OperationHandle(OperationType opType, TProtocolVersion protocol) { + super(); + this.opType = opType; + this.protocol = protocol; + } + + // dummy handle for ThriftCLIService + public OperationHandle(TOperationHandle tOperationHandle) { + this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1); + } + + public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) { + super(tOperationHandle.getOperationId()); + this.opType = OperationType.getOperationType(tOperationHandle.getOperationType()); + this.hasResultSet = tOperationHandle.isHasResultSet(); + this.protocol = protocol; + } + + public OperationType getOperationType() { + return opType; + } + + public void setHasResultSet(boolean hasResultSet) { + this.hasResultSet = hasResultSet; + } + + public boolean hasResultSet() { + return hasResultSet; + } + + public TOperationHandle toTOperationHandle() { + TOperationHandle tOperationHandle = new TOperationHandle(); + tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); + tOperationHandle.setOperationType(opType.toTOperationType()); + tOperationHandle.setHasResultSet(hasResultSet); + return tOperationHandle; + } + + public TProtocolVersion getProtocolVersion() { + return protocol; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = prime * result + ((opType == null) ? 0 : opType.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (!(obj instanceof OperationHandle)) { + return false; + } + OperationHandle other = (OperationHandle) obj; + if (opType != other.opType) { + return false; + } + return true; + } + + @Override + public String toString() { + return "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier() + + "]"; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SessionHandle.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SessionHandle.java new file mode 100644 index 000000000000..a303c43400c5 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/SessionHandle.java @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion; +import org.apache.spark.sql.thriftserver.cli.thrift.TSessionHandle; + +import java.util.UUID; + + + +/** + * SessionHandle. + * + */ +public class SessionHandle extends Handle { + + private final TProtocolVersion protocol; + + public SessionHandle(TProtocolVersion protocol) { + this.protocol = protocol; + } + + // dummy handle for ThriftCLIService + public SessionHandle(TSessionHandle tSessionHandle) { + this(tSessionHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1); + } + + public SessionHandle(TSessionHandle tSessionHandle, TProtocolVersion protocol) { + super(tSessionHandle.getSessionId()); + this.protocol = protocol; + } + public SessionHandle(HandleIdentifier handleId, TProtocolVersion protocol) { + super(handleId); + this.protocol = protocol; + } + public UUID getSessionId() { + return getHandleIdentifier().getPublicId(); + } + + public TSessionHandle toTSessionHandle() { + TSessionHandle tSessionHandle = new TSessionHandle(); + tSessionHandle.setSessionId(getHandleIdentifier().toTHandleIdentifier()); + return tSessionHandle; + } + + public TProtocolVersion getProtocolVersion() { + return protocol; + } + + @Override + public String toString() { + return "SessionHandle [" + getHandleIdentifier() + "]"; + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala deleted file mode 100644 index 7ee73dabec04..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/Handle.scala +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier - - -private[thriftserver] abstract class Handle(val handleId: HandleIdentifier) { - def this() = this(new HandleIdentifier()) - - def this(tHandleIdentifier: THandleIdentifier) = this(new HandleIdentifier(tHandleIdentifier)) - - def getHandleIdentifier: HandleIdentifier = handleId - - override def hashCode: Int = { - val prime = 31 - var result = 1 - result = prime * result + (if (handleId == null) 0 else handleId.hashCode) - result - } - - override def equals(obj: Any): Boolean = { - if (obj == null) { - return false - } - - if (!obj.isInstanceOf[Handle]) { - return false - } - - val other = obj.asInstanceOf[Handle] - if (this eq other) { - return true - } - - if (handleId == null) { - if (other.handleId != null) { - return false - } - } else if (handleId != other.handleId) { - return false - } - - true - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala deleted file mode 100644 index 29fa92e97e53..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/HandleIdentifier.scala +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.nio.ByteBuffer -import java.util.UUID - -import org.apache.spark.sql.thriftserver.cli.thrift.THandleIdentifier - -private[thriftserver] class HandleIdentifier(val publicId: UUID, val secretId: UUID) { - - def this() = this(UUID.randomUUID(), UUID.randomUUID()) - - def this(guid: ByteBuffer, secret: ByteBuffer) = - this(Option(guid).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID()), - Option(secret).map(id => new UUID(id.getLong(), id.getLong())).getOrElse(UUID.randomUUID())) - - def this(tHandleId: THandleIdentifier) = - this(ByteBuffer.wrap(tHandleId.getGuid), ByteBuffer.wrap(tHandleId.getSecret)) - - def getPublicId: UUID = this.publicId - - def getSecretId: UUID = this.secretId - - def toTHandleIdentifier: THandleIdentifier = { - val guid = new Array[Byte](16) - val gBuff = ByteBuffer.wrap(guid) - val secret = new Array[Byte](16) - val sBuff = ByteBuffer.wrap(secret) - gBuff.putLong(publicId.getMostSignificantBits) - gBuff.putLong(publicId.getLeastSignificantBits) - sBuff.putLong(secretId.getMostSignificantBits) - sBuff.putLong(secretId.getLeastSignificantBits) - new THandleIdentifier(ByteBuffer.wrap(guid), ByteBuffer.wrap(secret)) - } - - override def hashCode: Int = { - val prime = 31 - var result = 1 - result = prime * result + (if (publicId == null) 0 else publicId.hashCode) - result = prime * result + (if (secretId == null) 0 else secretId.hashCode) - result - } - - override def equals(obj: Any): Boolean = { - if (obj == null) return false - if (!obj.isInstanceOf[HandleIdentifier]) return false - - val other = obj.asInstanceOf[HandleIdentifier] - if (this eq other) return true - - if (publicId == null) { - if (other.publicId != null) { - return false - } - } else if (!(publicId == other.publicId)) { - return false - } - - if (secretId == null) { - if (other.secretId != null) { - return false - } - } else if (!(secretId == other.secretId)) { - return false - } - true - } - - override def toString: String = Option(publicId).map(_.toString).getOrElse("") -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala deleted file mode 100644 index 503e6427b6f8..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationHandle.scala +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.{TOperationHandle, TProtocolVersion} - -private[thriftserver] class OperationHandle private( - val opType: OperationType, - protocol: TProtocolVersion, - handleId: HandleIdentifier) extends Handle(handleId) { - - private[this] var hasResultSet: Boolean = false - - def this(opType: OperationType, protocol: TProtocolVersion) = - this(opType, protocol, new HandleIdentifier) - - def this(tOperationHandle: TOperationHandle, protocol: TProtocolVersion) = { - this( - OperationType.getOperationType(tOperationHandle.getOperationType), - protocol, - new HandleIdentifier(tOperationHandle.getOperationId)) - setHasResultSet(tOperationHandle.isHasResultSet) - } - - def this(tOperationHandle: TOperationHandle) = - this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) - - def getOperationType: OperationType = opType - - def toTOperationHandle: TOperationHandle = { - val tOperationHandle = new TOperationHandle - tOperationHandle.setOperationId(getHandleIdentifier.toTHandleIdentifier) - tOperationHandle.setOperationType(opType.toTOperationType) - tOperationHandle.setHasResultSet(this.hasResultSet) - tOperationHandle - } - - def setHasResultSet(hasResultSet: Boolean): Unit = { - this.hasResultSet = hasResultSet - } - - def isHasResultSet: Boolean = this.hasResultSet - - def getProtocolVersion: TProtocolVersion = protocol - - override def hashCode: Int = { - val prime = 31 - var result = super.hashCode - result = prime * result + (if (opType == null) 0 else opType.hashCode) - result - } - - override def equals(obj: Any): Boolean = { - if (!super.equals(obj)) return false - if (!obj.isInstanceOf[OperationHandle]) return false - val other = obj.asInstanceOf[OperationHandle] - if (this eq other) return true - if (opType != other.opType) { - return false - } - true - } - - override def toString: String = - "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier + "]" - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala deleted file mode 100644 index 1bec82bfd555..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SessionHandle.scala +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.util.UUID - -import org.apache.spark.sql.thriftserver.cli.thrift.{TProtocolVersion, TSessionHandle} - -private[thriftserver] class SessionHandle(handleId: HandleIdentifier, protocol: TProtocolVersion) - extends Handle(handleId) { - - def this(tSessionHandle: TSessionHandle) = - this(new HandleIdentifier(tSessionHandle.getSessionId), - TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1) - - - def this(tSessionHandle: TSessionHandle, protocol: TProtocolVersion) = - this(new HandleIdentifier(tSessionHandle.getSessionId), protocol) - - def this(protocol: TProtocolVersion) = this(new HandleIdentifier(), protocol) - - def toTSessionHandle: TSessionHandle = { - val tSessionHandle = new TSessionHandle - tSessionHandle.setSessionId(getHandleIdentifier.toTHandleIdentifier) - tSessionHandle - } - - def getSessionId: UUID = getHandleIdentifier.getPublicId - - def getProtocolVersion: TProtocolVersion = protocol - - override def toString: String = "SessionHandle [" + getHandleIdentifier + "]" -} From 63076d3f266cb74cf9fa408a1053b09443e56ddc Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 01:08:39 +0800 Subject: [PATCH 36/55] Operation Type State Status to java --- .../sql/thriftserver/cli/OperationState.java | 122 ++++++++++++++++ .../sql/thriftserver/cli/OperationStatus.java | 43 ++++++ .../sql/thriftserver/cli/OperationType.java | 59 ++++++++ .../sql/thriftserver/cli/OperationState.scala | 130 ------------------ .../thriftserver/cli/OperationStatus.scala | 32 ----- .../sql/thriftserver/cli/OperationType.scala | 79 ----------- .../cli/operation/Operation.scala | 12 +- .../cli/operation/OperationManager.scala | 10 +- .../SparkExecuteStatementOperation.scala | 22 +-- .../operation/SparkGetCatalogsOperation.scala | 12 +- .../operation/SparkGetColumnsOperation.scala | 12 +- .../SparkGetFunctionsOperation.scala | 12 +- .../operation/SparkGetSchemasOperation.scala | 12 +- .../SparkGetTableTypesOperation.scala | 12 +- .../operation/SparkGetTablesOperation.scala | 12 +- .../operation/SparkGetTypeInfoOperation.scala | 12 +- .../operation/SparkMetadataOperation.scala | 4 +- 17 files changed, 290 insertions(+), 307 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationState.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationStatus.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationType.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationState.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationState.java new file mode 100644 index 000000000000..9ac879b97e7b --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationState.java @@ -0,0 +1,122 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + + +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationState; + +/** + * OperationState. + * + */ +public enum OperationState { + INITIALIZED(TOperationState.INITIALIZED_STATE, false), + RUNNING(TOperationState.RUNNING_STATE, false), + FINISHED(TOperationState.FINISHED_STATE, true), + CANCELED(TOperationState.CANCELED_STATE, true), + CLOSED(TOperationState.CLOSED_STATE, true), + ERROR(TOperationState.ERROR_STATE, true), + UNKNOWN(TOperationState.UKNOWN_STATE, false), + PENDING(TOperationState.PENDING_STATE, false), + TIMEDOUT(TOperationState.TIMEDOUT_STATE, true); + + private final TOperationState tOperationState; + private final boolean terminal; + private String errorMessage; + + OperationState(TOperationState tOperationState, boolean terminal) { + this.tOperationState = tOperationState; + this.terminal = terminal; + } + + // must be sync with TOperationState in order + public static OperationState getOperationState(TOperationState tOperationState) { + return OperationState.values()[tOperationState.getValue()]; + } + + public static void validateTransition(OperationState oldState, + OperationState newState) + throws SparkThriftServerSQLException { + switch (oldState) { + case INITIALIZED: + switch (newState) { + case PENDING: + case RUNNING: + case CANCELED: + case CLOSED: + case TIMEDOUT: + return; + } + break; + case PENDING: + switch (newState) { + case RUNNING: + case FINISHED: + case CANCELED: + case ERROR: + case CLOSED: + case TIMEDOUT: + return; + } + break; + case RUNNING: + switch (newState) { + case FINISHED: + case CANCELED: + case ERROR: + case CLOSED: + case TIMEDOUT: + return; + } + break; + case FINISHED: + case CANCELED: + case TIMEDOUT: + case ERROR: + if (OperationState.CLOSED.equals(newState)) { + return; + } + default: + // fall-through + } + throw new SparkThriftServerSQLException("Illegal Operation state transition " + + "from " + oldState + " to " + newState); + } + + public void validateTransition(OperationState newState) + throws SparkThriftServerSQLException { + validateTransition(this, newState); + } + + public TOperationState toTOperationState() { + return tOperationState; + } + + public boolean isTerminal() { + return terminal; + } + + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(final String errorMessage) { + this.errorMessage = errorMessage; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationStatus.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationStatus.java new file mode 100644 index 000000000000..0de86756a778 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationStatus.java @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +/** + * OperationStatus + * + */ +public class OperationStatus { + + private final OperationState state; + private final SparkThriftServerSQLException operationException; + + public OperationStatus(OperationState state, SparkThriftServerSQLException operationException) { + this.state = state; + this.operationException = operationException; + } + + public OperationState getState() { + return state; + } + + public SparkThriftServerSQLException getOperationException() { + return operationException; + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationType.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationType.java new file mode 100644 index 000000000000..4b1c789675ce --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/OperationType.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + + +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationType; + +/** + * OperationType. + * + */ +public enum OperationType { + + UNKNOWN_OPERATION(TOperationType.UNKNOWN), + EXECUTE_STATEMENT(TOperationType.EXECUTE_STATEMENT), + GET_TYPE_INFO(TOperationType.GET_TYPE_INFO), + GET_CATALOGS(TOperationType.GET_CATALOGS), + GET_SCHEMAS(TOperationType.GET_SCHEMAS), + GET_TABLES(TOperationType.GET_TABLES), + GET_TABLE_TYPES(TOperationType.GET_TABLE_TYPES), + GET_COLUMNS(TOperationType.GET_COLUMNS), + GET_FUNCTIONS(TOperationType.GET_FUNCTIONS); + + private TOperationType tOperationType; + + OperationType(TOperationType tOpType) { + this.tOperationType = tOpType; + } + + public static OperationType getOperationType(TOperationType tOperationType) { + // TODO: replace this with a Map? + for (OperationType opType : values()) { + if (tOperationType.equals(opType.tOperationType)) { + return opType; + } + } + return OperationType.UNKNOWN_OPERATION; + } + + public TOperationType toTOperationType() { + return tOperationType; + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala deleted file mode 100644 index e81b50cd438b..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationState.scala +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.TOperationState - -private[thriftserver] trait OperationState { - - def toTOperationState(): TOperationState - - def isTerminal(): Boolean = false - - @throws[SparkThriftServerSQLException] - def validateTransition(newState: OperationState): Unit = ex(newState) - - @throws[SparkThriftServerSQLException] - protected def ex(state: OperationState): Unit = throw new SparkThriftServerSQLException( - "Illegal Operation state transition " + this + " -> " + state, "ServerError", 1000) -} - -private[thriftserver] case object INITIALIZED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.INITIALIZED_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case PENDING | RUNNING | CANCELED | CLOSED | TIMEOUT => - case _ => ex(newState) - } -} - -private[thriftserver] case object PENDING extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.PENDING_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case RUNNING | FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => - case _ => ex(newState) - } -} - -private[thriftserver] case object RUNNING extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.RUNNING_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case FINISHED | CANCELED | ERROR | CLOSED | TIMEOUT => - case _ => ex(newState) - } -} - -private[thriftserver] case object TIMEOUT extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.TIMEDOUT_STATE - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -private[thriftserver] case object FINISHED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.FINISHED_STATE - - override def isTerminal(): Boolean = true - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -private[thriftserver] case object CANCELED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.CANCELED_STATE - - override def isTerminal(): Boolean = true - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -private[thriftserver] case object CLOSED extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.CLOSED_STATE - - override def isTerminal(): Boolean = true -} - -private[thriftserver] case object ERROR extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.ERROR_STATE - - override def isTerminal(): Boolean = true - - override def validateTransition(newState: OperationState): Unit = newState match { - case CLOSED => - case _ => ex(newState) - } -} - -private[thriftserver] case object UNKNOWN extends OperationState { - override def toTOperationState(): TOperationState = TOperationState.UKNOWN_STATE -} - - -private[thriftserver] object OperationState { - def getOperationState(tOperationState: TOperationState): OperationState = { - tOperationState match { - case TOperationState.INITIALIZED_STATE => INITIALIZED - case TOperationState.PENDING_STATE => PENDING - case TOperationState.RUNNING_STATE => RUNNING - case TOperationState.CANCELED_STATE => CANCELED - case TOperationState.ERROR_STATE => ERROR - case TOperationState.CLOSED_STATE => CLOSED - case TOperationState.FINISHED_STATE => FINISHED - case TOperationState.TIMEDOUT_STATE => TIMEOUT - case TOperationState.UKNOWN_STATE => UNKNOWN - } - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala deleted file mode 100644 index ba47b394a794..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationStatus.scala +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - - -/** - * OperationStatus - * - */ -private[thriftserver] class OperationStatus( - val state: OperationState, - val operationException: SparkThriftServerSQLException) { - - def getState: OperationState = state - - def getOperationException: SparkThriftServerSQLException = operationException -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala deleted file mode 100644 index 4f1e0cefe58f..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/OperationType.scala +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.TOperationType - - -/** - * OperationType. - */ -private[thriftserver] abstract class OperationType { - def toTOperationType: TOperationType -} - -private[thriftserver] case object EXECUTE_STATEMENT extends OperationType { - override def toTOperationType: TOperationType = TOperationType.EXECUTE_STATEMENT -} - -private[thriftserver] case object GET_TYPE_INFO extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_TYPE_INFO -} - -private[thriftserver] case object GET_CATALOGS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_CATALOGS -} - -private[thriftserver] case object GET_SCHEMAS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_SCHEMAS -} - -private[thriftserver] case object GET_TABLES extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_TABLES -} - -private[thriftserver] case object GET_TABLE_TYPES extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_TABLE_TYPES -} - -private[thriftserver] case object GET_COLUMNS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_COLUMNS -} - -private[thriftserver] case object GET_FUNCTIONS extends OperationType { - override def toTOperationType: TOperationType = TOperationType.GET_FUNCTIONS -} - -private[thriftserver] case object UNKNOWN_OPERATION extends OperationType { - override def toTOperationType: TOperationType = TOperationType.UNKNOWN -} - -private[thriftserver] object OperationType { - def getOperationType(tOperationType: TOperationType): OperationType = - tOperationType match { - case TOperationType.EXECUTE_STATEMENT => EXECUTE_STATEMENT - case TOperationType.GET_TYPE_INFO => GET_TYPE_INFO - case TOperationType.GET_CATALOGS => GET_CATALOGS - case TOperationType.GET_SCHEMAS => GET_SCHEMAS - case TOperationType.GET_TABLES => GET_TABLES - case TOperationType.GET_TABLE_TYPES => GET_TABLE_TYPES - case TOperationType.GET_COLUMNS => GET_COLUMNS - case TOperationType.GET_FUNCTIONS => GET_FUNCTIONS - case _ => UNKNOWN_OPERATION - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala index d59d657d4913..f2ccccff0933 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala @@ -35,7 +35,7 @@ private[thriftserver] abstract class Operation( session: ThriftServerSession, opType: OperationType, runInBackground: Boolean) extends Logging { - private[this] var _state: OperationState = INITIALIZED + private[this] var _state: OperationState = OperationState.INITIALIZED private[this] val _opHandle: OperationHandle = new OperationHandle(opType, session.getProtocolVersion) private[this] var _conf: HiveConf = session.getHiveConf @@ -134,13 +134,13 @@ private[thriftserver] abstract class Operation( this._lastAccessTime = System.currentTimeMillis } - def isRunning: Boolean = RUNNING == _state + def isRunning: Boolean = OperationState.RUNNING == _state - def isFinished: Boolean = FINISHED == _state + def isFinished: Boolean = OperationState.FINISHED == _state - def isCanceled: Boolean = CANCELED == _state + def isCanceled: Boolean = OperationState.CANCELED == _state - def isFailed: Boolean = ERROR == _state + def isFailed: Boolean = OperationState.ERROR == _state protected def createOperationLog(): Unit = { @@ -248,7 +248,7 @@ private[thriftserver] abstract class Operation( // TODO: make this abstract and implement in subclasses. @throws[SparkThriftServerSQLException] def cancel(): Unit = { - setState(CANCELED) + setState(OperationState.CANCELED) throw new UnsupportedOperationException("SQLOperation.cancel()") } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala index b274c4523218..5ca51553b956 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala @@ -246,11 +246,11 @@ private[thriftserver] class OperationManager def cancelOperation(opHandle: OperationHandle): Unit = { val operation: Operation = getOperation(opHandle) val opState: OperationState = operation.getStatus.getState - if ((opState eq CANCELED) || - (opState eq CLOSED) || - (opState eq FINISHED) || - (opState eq ERROR) || - (opState eq UNKNOWN)) { // Cancel should be a no-op in either cases + if ((opState eq OperationState.CANCELED) || + (opState eq OperationState.CLOSED) || + (opState eq OperationState.FINISHED) || + (opState eq OperationState.ERROR) || + (opState eq OperationState.UNKNOWN)) { // Cancel should be a no-op in either cases logDebug(opHandle + ": Operation is already aborted in state - " + opState) } else { logDebug(opHandle + ": Attempting to cancel from state - " + opState) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala index 6850c4847f08..1e94a1186f3c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala @@ -45,7 +45,7 @@ private[thriftserver] class SparkExecuteStatementOperation( confOverlay: JMap[String, String], runInBackground: Boolean = true)(sqlContext: SQLContext, sessionToActivePool: JMap[SessionHandle, String]) - extends Operation(parentSession, EXECUTE_STATEMENT, runInBackground) + extends Operation(parentSession, OperationType.EXECUTE_STATEMENT, runInBackground) with Logging { private var result: DataFrame = _ @@ -74,7 +74,7 @@ private[thriftserver] class SparkExecuteStatementOperation( override def close(): Unit = { // RDDs will be cleaned automatically upon garbage collection. logInfo(s"Close statement with $statementId") - cleanup(CLOSED) + cleanup(OperationState.CLOSED) SparkThriftServer2.listener.onOperationClosed(statementId) } @@ -82,7 +82,7 @@ private[thriftserver] class SparkExecuteStatementOperation( logInfo(s"Received getNextRowSet request order=${order} and maxRowsL=${maxRowsL} " + s"with ${statementId}") validateDefaultFetchOrientation(order) - assertState(FINISHED) + assertState(OperationState.FINISHED) setHasResultSet(true) val resultRowSet: RowSet = RowSetFactory.create(getResultSetSchema, getProtocolVersion) @@ -144,7 +144,7 @@ private[thriftserver] class SparkExecuteStatementOperation( } def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) if (result == null || result.schema.isEmpty) { new StructType().add("Result", "string") } else { @@ -153,7 +153,7 @@ private[thriftserver] class SparkExecuteStatementOperation( } override def runInternal(): Unit = { - setState(PENDING) + setState(OperationState.PENDING) setStatementId(UUID.randomUUID().toString) logInfo(s"Submitting query '$statement' with $statementId") SparkThriftServer2.listener.onStatementStart( @@ -205,14 +205,14 @@ private[thriftserver] class SparkExecuteStatementOperation( } catch { case rejected: RejectedExecutionException => logError("Error submitting query in background, query rejected", rejected) - setState(ERROR) + setState(OperationState.ERROR) SparkThriftServer2.listener.onStatementError( statementId, rejected.getMessage, SparkUtils.exceptionString(rejected)) throw new SparkThriftServerSQLException("The background threadpool cannot accept" + " new task for execution, please retry the operation", rejected) case NonFatal(e) => logError(s"Error executing query in background", e) - setState(ERROR) + setState(OperationState.ERROR) SparkThriftServer2.listener.onStatementError( statementId, e.getMessage, SparkUtils.exceptionString(e)) throw new SparkThriftServerSQLException(e) @@ -228,7 +228,7 @@ private[thriftserver] class SparkExecuteStatementOperation( return } else { logInfo(s"Running query with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) } } // Always use the latest class loader provided by executionHive's state. @@ -273,7 +273,7 @@ private[thriftserver] class SparkExecuteStatementOperation( logWarning(s"Ignore exception in terminal state with $statementId: $e") } else { logError(s"Error executing query with $statementId, currentState $currentState, ", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -289,7 +289,7 @@ private[thriftserver] class SparkExecuteStatementOperation( } finally { synchronized { if (!getStatus.getState.isTerminal) { - setState(FINISHED) + setState(OperationState.FINISHED) SparkThriftServer2.listener.onStatementFinish(statementId) } } @@ -301,7 +301,7 @@ private[thriftserver] class SparkExecuteStatementOperation( synchronized { if (!getStatus.getState.isTerminal) { logInfo(s"Cancel query with $statementId") - cleanup(CANCELED) + cleanup(OperationState.CANCELED) SparkThriftServer2.listener.onStatementCanceled(statementId) } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala index 4e59ad4bef92..b57acb21fcec 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala @@ -39,7 +39,7 @@ import org.apache.spark.util.{Utils => SparkUtils} private[thriftserver] class SparkGetCatalogsOperation( sqlContext: SQLContext, parentSession: ThriftServerSession) - extends SparkMetadataOperation(parentSession, GET_CATALOGS) with Logging { + extends SparkMetadataOperation(parentSession, OperationType.GET_CATALOGS) with Logging { RESULT_SET_SCHEMA = new StructType() .add(StructField("TABLE_CAT", StringType)) @@ -55,7 +55,7 @@ private[thriftserver] class SparkGetCatalogsOperation( setStatementId(UUID.randomUUID().toString) val logMsg = "Listing catalogs" logInfo(s"$logMsg with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) // Always use the latest class loader provided by executionHive's state. val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) @@ -71,11 +71,11 @@ private[thriftserver] class SparkGetCatalogsOperation( if (isAuthV2Enabled) { authorizeMetaGets(HiveOperationType.GET_CATALOGS, null) } - setState(FINISHED) + setState(OperationState.FINISHED) } catch { case e: Throwable => logError(s"Error executing get catalogs operation with $statementId", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -93,12 +93,12 @@ private[thriftserver] class SparkGetCatalogsOperation( } override def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { - assertState(FINISHED) + assertState(OperationState.FINISHED) validateDefaultFetchOrientation(orientation) if (orientation == FetchOrientation.FETCH_FIRST) { rowSet.setStartOffset(0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala index 5869842c64a8..4745291e0c55 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala @@ -53,7 +53,7 @@ private[thriftserver] class SparkGetColumnsOperation( schemaName: String, tableName: String, columnName: String) - extends SparkMetadataOperation(parentSession, GET_COLUMNS) + extends SparkMetadataOperation(parentSession, OperationType.GET_COLUMNS) with Logging { val catalog: SessionCatalog = sqlContext.sessionState.catalog @@ -96,7 +96,7 @@ private[thriftserver] class SparkGetColumnsOperation( val logMsg = s"Listing columns '$cmdStr, columnName : $columnName'" logInfo(s"$logMsg with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) // Always use the latest class loader provided by executionHive's state. val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) @@ -151,11 +151,11 @@ private[thriftserver] class SparkGetColumnsOperation( addToRowSet(columnPattern, null, localTempView.table, plan.schema) } } - setState(FINISHED) + setState(OperationState.FINISHED) } catch { case e: Throwable => logError(s"Error executing get columns operation with $statementId", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -218,12 +218,12 @@ private[thriftserver] class SparkGetColumnsOperation( } override def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { - assertState(FINISHED) + assertState(OperationState.FINISHED) validateDefaultFetchOrientation(orientation) if (orientation == FetchOrientation.FETCH_FIRST) { rowSet.setStartOffset(0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala index 6b9f145f3a0a..ffd5664e40d0 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala @@ -48,7 +48,7 @@ private[thriftserver] class SparkGetFunctionsOperation( catalogName: String, schemaName: String, functionName: String) - extends SparkMetadataOperation(parentSession, GET_FUNCTIONS) with Logging { + extends SparkMetadataOperation(parentSession, OperationType.GET_FUNCTIONS) with Logging { RESULT_SET_SCHEMA = new StructType() .add(StructField("FUNCTION_CAT", StringType)) @@ -71,7 +71,7 @@ private[thriftserver] class SparkGetFunctionsOperation( val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing functions '$cmdStr, functionName : $functionName'" logInfo(s"$logMsg with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) // Always use the latest class loader provided by executionHive's state. val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) @@ -111,11 +111,11 @@ private[thriftserver] class SparkGetFunctionsOperation( rowSet.addRow(rowData); } } - setState(FINISHED) + setState(OperationState.FINISHED) } catch { case e: Throwable => logError(s"Error executing get functions operation with $statementId", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -133,12 +133,12 @@ private[thriftserver] class SparkGetFunctionsOperation( } override def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { - assertState(FINISHED) + assertState(OperationState.FINISHED) validateDefaultFetchOrientation(orientation) if (orientation == FetchOrientation.FETCH_FIRST) { rowSet.setStartOffset(0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala index f3aade7a981a..358b796303bb 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala @@ -44,7 +44,7 @@ private[thriftserver] class SparkGetSchemasOperation( parentSession: ThriftServerSession, catalogName: String, schemaName: String) - extends SparkMetadataOperation(parentSession, GET_SCHEMAS) with Logging { + extends SparkMetadataOperation(parentSession, OperationType.GET_SCHEMAS) with Logging { RESULT_SET_SCHEMA = new StructType() .add(StructField("TABLE_SCHEM", StringType)) @@ -64,7 +64,7 @@ private[thriftserver] class SparkGetSchemasOperation( val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing databases '$cmdStr'" logInfo(s"$logMsg with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) // Always use the latest class loader provided by executionHive's state. val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) @@ -91,11 +91,11 @@ private[thriftserver] class SparkGetSchemasOperation( if (databasePattern.matcher(globalTempViewDb).matches()) { rowSet.addRow(Row(globalTempViewDb, DEFAULT_HIVE_CATALOG)) } - setState(FINISHED) + setState(OperationState.FINISHED) } catch { case e: Throwable => logError(s"Error executing get schemas operation with $statementId", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -112,12 +112,12 @@ private[thriftserver] class SparkGetSchemasOperation( } override def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { - assertState(FINISHED) + assertState(OperationState.FINISHED) validateDefaultFetchOrientation(orientation) if (orientation == FetchOrientation.FETCH_FIRST) { rowSet.setStartOffset(0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala index 82455e28ab1c..507dadd25cb1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala @@ -41,7 +41,7 @@ import org.apache.spark.util.{Utils => SparkUtils} private[thriftserver] class SparkGetTableTypesOperation( sqlContext: SQLContext, parentSession: ThriftServerSession) - extends SparkMetadataOperation(parentSession, GET_TABLE_TYPES) + extends SparkMetadataOperation(parentSession, OperationType.GET_TABLE_TYPES) with Logging { RESULT_SET_SCHEMA = new StructType() @@ -58,7 +58,7 @@ private[thriftserver] class SparkGetTableTypesOperation( setStatementId(UUID.randomUUID().toString) val logMsg = "Listing table types" logInfo(s"$logMsg with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) // Always use the latest class loader provided by executionHive's state. val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) @@ -79,11 +79,11 @@ private[thriftserver] class SparkGetTableTypesOperation( tableTypes.foreach { tableType => rowSet.addRow(Row(tableType)) } - setState(FINISHED) + setState(OperationState.FINISHED) } catch { case e: Throwable => logError(s"Error executing get table types operation with $statementId", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -101,12 +101,12 @@ private[thriftserver] class SparkGetTableTypesOperation( } override def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { - assertState(FINISHED) + assertState(OperationState.FINISHED) validateDefaultFetchOrientation(orientation) if (orientation == FetchOrientation.FETCH_FIRST) { rowSet.setStartOffset(0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala index 0a478fe6f991..15f3496aa5b1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -52,7 +52,7 @@ private[thriftserver] class SparkGetTablesOperation( schemaName: String, tableName: String, tableTypes: JList[String]) - extends SparkMetadataOperation(parentSession, GET_TABLES) + extends SparkMetadataOperation(parentSession, OperationType.GET_TABLES) with Logging { if (HiveUtils.isHive23) { @@ -94,7 +94,7 @@ private[thriftserver] class SparkGetTablesOperation( } val logMsg = s"Listing tables '$cmdStr, tableTypes : $tableTypesStr, tableName : $tableName'" logInfo(s"$logMsg with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) // Always use the latest class loader provided by executionHive's state. val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) @@ -142,11 +142,11 @@ private[thriftserver] class SparkGetTablesOperation( addToRowSet(view.database.orNull, view.table, VIEW.name, None) } } - setState(FINISHED) + setState(OperationState.FINISHED) } catch { case e: Throwable => logError(s"Error executing get tables operation with $statementId", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -177,13 +177,13 @@ private[thriftserver] class SparkGetTablesOperation( } override def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { - assertState(FINISHED) + assertState(OperationState.FINISHED) validateDefaultFetchOrientation(orientation) if (orientation == FetchOrientation.FETCH_FIRST) { rowSet.setStartOffset(0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala index 7ec449ce27b4..080852415a55 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala @@ -39,7 +39,7 @@ import org.apache.spark.util.{Utils => SparkUtils} private[thriftserver] class SparkGetTypeInfoOperation( sqlContext: SQLContext, parentSession: ThriftServerSession) - extends SparkMetadataOperation(parentSession, GET_TYPE_INFO) with Logging { + extends SparkMetadataOperation(parentSession, OperationType.GET_TYPE_INFO) with Logging { RESULT_SET_SCHEMA = new StructType() .add(StructField("TYPE_NAME", StringType)) @@ -73,7 +73,7 @@ private[thriftserver] class SparkGetTypeInfoOperation( setStatementId(UUID.randomUUID().toString) val logMsg = "Listing type info" logInfo(s"$logMsg with $statementId") - setState(RUNNING) + setState(OperationState.RUNNING) // Always use the latest class loader provided by executionHive's state. val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) @@ -113,11 +113,11 @@ private[thriftserver] class SparkGetTypeInfoOperation( ) rowSet.addRow(rowData) }) - setState(FINISHED) + setState(OperationState.FINISHED) } catch { case e: Throwable => logError(s"Error executing get type info with $statementId", e) - setState(ERROR) + setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => SparkThriftServer2.listener.onStatementError( @@ -135,12 +135,12 @@ private[thriftserver] class SparkGetTypeInfoOperation( } override def getResultSetSchema: StructType = { - assertState(FINISHED) + assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } override def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet = { - assertState(FINISHED) + assertState(OperationState.FINISHED) validateDefaultFetchOrientation(orientation) if (orientation == FetchOrientation.FETCH_FIRST) { rowSet.setStartOffset(0) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala index 36515bab7b4e..4172a36711bf 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala @@ -26,7 +26,7 @@ import org.apache.hadoop.hive.ql.session.SessionState import org.apache.spark.internal.Logging import org.apache.spark.sql.catalyst.catalog.CatalogTableType import org.apache.spark.sql.catalyst.catalog.CatalogTableType.{EXTERNAL, MANAGED, VIEW} -import org.apache.spark.sql.thriftserver.cli.{CLOSED, OperationType, SparkThriftServerSQLException} +import org.apache.spark.sql.thriftserver.cli.{OperationState, OperationType, SparkThriftServerSQLException} import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession import org.apache.spark.sql.types.StructType @@ -47,7 +47,7 @@ private[thriftserver] abstract class SparkMetadataOperation( */ @throws[SparkThriftServerSQLException] override def close(): Unit = { - setState(CLOSED) + setState(OperationState.CLOSED) cleanupOperationLog() } From 000443adf3a836ef5811c23a250469403fcf4b59 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 01:13:05 +0800 Subject: [PATCH 37/55] Fetch type and orientation to java --- .../thriftserver/cli/FetchOrientation.java | 55 ++++++++++++++++ .../spark/sql/thriftserver/cli/FetchType.java | 47 ++++++++++++++ .../thriftserver/cli/FetchOrientation.scala | 62 ------------------- .../sql/thriftserver/cli/FetchType.scala | 38 ------------ 4 files changed, 102 insertions(+), 100 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchOrientation.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchType.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchOrientation.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchOrientation.java new file mode 100644 index 000000000000..45b0eac85f9a --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchOrientation.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + + +import org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation; + +/** + * FetchOrientation. + * + */ +public enum FetchOrientation { + FETCH_NEXT(TFetchOrientation.FETCH_NEXT), + FETCH_PRIOR(TFetchOrientation.FETCH_PRIOR), + FETCH_RELATIVE(TFetchOrientation.FETCH_RELATIVE), + FETCH_ABSOLUTE(TFetchOrientation.FETCH_ABSOLUTE), + FETCH_FIRST(TFetchOrientation.FETCH_FIRST), + FETCH_LAST(TFetchOrientation.FETCH_LAST); + + private TFetchOrientation tFetchOrientation; + + FetchOrientation(TFetchOrientation tFetchOrientation) { + this.tFetchOrientation = tFetchOrientation; + } + + public static FetchOrientation getFetchOrientation(TFetchOrientation tFetchOrientation) { + for (FetchOrientation fetchOrientation : values()) { + if (tFetchOrientation.equals(fetchOrientation.toTFetchOrientation())) { + return fetchOrientation; + } + } + // TODO: Should this really default to FETCH_NEXT? + return FETCH_NEXT; + } + + public TFetchOrientation toTFetchOrientation() { + return tFetchOrientation; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchType.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchType.java new file mode 100644 index 000000000000..292497e97cee --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/FetchType.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +/** + * FetchType indicates the type of fetchResults request. + * It maps the TFetchType, which is generated from Thrift interface. + */ +public enum FetchType { + QUERY_OUTPUT((short)0), + LOG((short)1); + + private final short tFetchType; + + FetchType(short tFetchType) { + this.tFetchType = tFetchType; + } + + public static FetchType getFetchType(short tFetchType) { + for (FetchType fetchType : values()) { + if (tFetchType == fetchType.toTFetchType()) { + return fetchType; + } + } + return QUERY_OUTPUT; + } + + public short toTFetchType() { + return tFetchType; + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala deleted file mode 100644 index d736ce1f3221..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchOrientation.scala +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation - -private[thriftserver] trait FetchOrientation { - def toTFetchOrientation: TFetchOrientation -} - -private[thriftserver] object FetchOrientation { - - case object FETCH_NEXT extends FetchOrientation { - override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_NEXT - } - - case object FETCH_PRIOR extends FetchOrientation { - override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_PRIOR - } - - case object FETCH_RELATIVE extends FetchOrientation { - override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_RELATIVE - } - - case object FETCH_ABSOLUTE extends FetchOrientation { - override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_ABSOLUTE - } - - case object FETCH_FIRST extends FetchOrientation { - override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_FIRST - } - - case object FETCH_LAST extends FetchOrientation { - override val toTFetchOrientation: TFetchOrientation = TFetchOrientation.FETCH_LAST - } - - def getFetchOrientation(tFetchOrientation: TFetchOrientation): FetchOrientation = - tFetchOrientation match { - case FETCH_FIRST.toTFetchOrientation => FETCH_FIRST - case FETCH_NEXT.toTFetchOrientation => FETCH_NEXT - case FETCH_ABSOLUTE.toTFetchOrientation => FETCH_ABSOLUTE - case FETCH_LAST.toTFetchOrientation => FETCH_LAST - case FETCH_PRIOR.toTFetchOrientation => FETCH_PRIOR - case FETCH_RELATIVE.toTFetchOrientation => FETCH_RELATIVE - case _ => FETCH_NEXT - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala deleted file mode 100644 index 90d46b324072..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/FetchType.scala +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -private[thriftserver] trait FetchType { - def toTFetchType: Short -} - -private[thriftserver] object FetchType { - - case object QUERY_OUTPUT extends FetchType { - override val toTFetchType: Short = 0 - } - - case object LOG extends FetchType { - override val toTFetchType: Short = 1 - } - - def getFetchType(tFetchType: Short): FetchType = tFetchType match { - case LOG.toTFetchType => LOG - case _ => QUERY_OUTPUT - } -} From 5de2bf9d69b2f5a6a38746df856522631b2f8b55 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 01:15:59 +0800 Subject: [PATCH 38/55] PatternOrIdentifier to java --- .../thriftserver/cli/PatternOrIdentifier.java | 47 +++++++++++++++++++ .../cli/PatternOrIdentifier.scala | 33 ------------- 2 files changed, 47 insertions(+), 33 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.java new file mode 100644 index 000000000000..ba1cf9edb74c --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +/** + * PatternOrIdentifier. + * + */ +public class PatternOrIdentifier { + + boolean isPattern = false; + String text; + + public PatternOrIdentifier(String tpoi) { + text = tpoi; + isPattern = false; + } + + public boolean isPattern() { + return isPattern; + } + + public boolean isIdentifier() { + return !isPattern; + } + + @Override + public String toString() { + return text; + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala deleted file mode 100644 index 9708a5c089b4..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/PatternOrIdentifier.scala +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -/** - * PatternOrIdentifier. - * - */ -private[thriftserver] class PatternOrIdentifier(var text: String) { - - var isPt: Boolean = false - - def isPattern: Boolean = isPt - - def isIdentifier: Boolean = !isPt - - override def toString: String = text -} From a6b0ed120e91bbf7bc39519dc98609dc1c272365 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 01:34:29 +0800 Subject: [PATCH 39/55] Interface to Java --- .../thriftserver/cli/CLIServiceClient.java | 56 ++++++ .../sql/thriftserver/cli/ICLIService.java | 118 +++++++++++++ .../spark/sql/thriftserver/cli/RowSet.java | 42 +++++ .../thriftserver/cli/CLIServiceClient.scala | 64 ------- .../sql/thriftserver/cli/ICLIService.scala | 159 ------------------ .../spark/sql/thriftserver/cli/RowSet.scala | 39 ----- .../cli/thrift/CLIServiceUtils.scala | 62 ------- 7 files changed, 216 insertions(+), 324 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.java new file mode 100644 index 000000000000..9b4771f15ec6 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.util.Collections; + +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory; + + +/** + * CLIServiceClient. + * + */ +public abstract class CLIServiceClient implements ICLIService { + protected int defaultFetchRows = 1000; + + public SessionHandle openSession(String username, String password) + throws SparkThriftServerSQLException { + return openSession(username, password, Collections.emptyMap()); + } + + @Override + public RowSet fetchResults(OperationHandle opHandle) throws SparkThriftServerSQLException { + return fetchResults(opHandle, FetchOrientation.FETCH_NEXT, + defaultFetchRows, FetchType.QUERY_OUTPUT); + } + + @Override + public abstract String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String owner, String renewer) throws SparkThriftServerSQLException; + + @Override + public abstract void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws SparkThriftServerSQLException; + + @Override + public abstract void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws SparkThriftServerSQLException; + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java new file mode 100644 index 000000000000..a9d2988bdf6f --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java @@ -0,0 +1,118 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory; +import org.apache.spark.sql.thriftserver.cli.thrift.TOperationHandle; +import org.apache.spark.sql.types.StructType; + +import java.util.List; +import java.util.Map; + +public interface ICLIService { + + SessionHandle openSession(String username, String password, + Map configuration) + throws SparkThriftServerSQLException; + + SessionHandle openSessionWithImpersonation(String username, String password, + Map configuration, String delegationToken) + throws SparkThriftServerSQLException; + + void closeSession(SessionHandle sessionHandle) + throws SparkThriftServerSQLException; + + GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) + throws SparkThriftServerSQLException; + + OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay) throws SparkThriftServerSQLException; + + OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws SparkThriftServerSQLException; + + OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay) throws SparkThriftServerSQLException; + + OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws SparkThriftServerSQLException; + + OperationHandle getTypeInfo(SessionHandle sessionHandle) + throws SparkThriftServerSQLException; + + OperationHandle getCatalogs(SessionHandle sessionHandle) + throws SparkThriftServerSQLException; + + OperationHandle getSchemas(SessionHandle sessionHandle, + String catalogName, String schemaName) + throws SparkThriftServerSQLException; + + OperationHandle getTables(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, List tableTypes) + throws SparkThriftServerSQLException; + + OperationHandle getTableTypes(SessionHandle sessionHandle) + throws SparkThriftServerSQLException; + + OperationHandle getColumns(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, String columnName) + throws SparkThriftServerSQLException; + + OperationHandle getFunctions(SessionHandle sessionHandle, + String catalogName, String schemaName, String functionName) + throws SparkThriftServerSQLException; + + OperationStatus getOperationStatus(OperationHandle opHandle, boolean getProgressUpdate) + throws SparkThriftServerSQLException; + + String getQueryId(TOperationHandle operationHandle) throws SparkThriftServerSQLException; + + void cancelOperation(OperationHandle opHandle) + throws SparkThriftServerSQLException; + + void closeOperation(OperationHandle opHandle) + throws SparkThriftServerSQLException; + + StructType getResultSetMetadata(OperationHandle opHandle) + throws SparkThriftServerSQLException; + + RowSet fetchResults(OperationHandle opHandle) + throws SparkThriftServerSQLException; + + RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, + long maxRows, FetchType fetchType) throws SparkThriftServerSQLException; + + String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String owner, String renewer) throws SparkThriftServerSQLException; + + void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws SparkThriftServerSQLException; + + void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws SparkThriftServerSQLException; + + OperationHandle getPrimaryKeys(SessionHandle sessionHandle, String catalog, + String schema, String table) throws SparkThriftServerSQLException; + + OperationHandle getCrossReference(SessionHandle sessionHandle, + String primaryCatalog, String primarySchema, String primaryTable, + String foreignCatalog, String foreignSchema, String foreignTable) + throws SparkThriftServerSQLException; + + void setApplicationName(SessionHandle sh, String value) throws SparkThriftServerSQLException; +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java new file mode 100644 index 000000000000..d56c2bb029d3 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + + +import org.apache.spark.sql.Row; +import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet; + +public interface RowSet { + + RowSet addRow(Row row); + + RowSet extractSubset(int maxRows); + + int numColumns(); + + int numRows(); + + long getStartOffset(); + + void setStartOffset(long startOffset); + + TRowSet toTRowSet(); + + Iterable iterator(); +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala deleted file mode 100644 index 2a37b00819d3..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIServiceClient.scala +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.util.Collections - -import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory - - -/** - * CLIServiceClient. - * - */ -object CLIServiceClient { - private val DEFAULT_MAX_ROWS = 1000 -} - -abstract class CLIServiceClient extends ICLIService { - @throws[SparkThriftServerSQLException] - def openSession(username: String, - password: String): SessionHandle = - openSession(username, password, Collections.emptyMap[String, String]) - - @throws[SparkThriftServerSQLException] - override def fetchResults(opHandle: OperationHandle): RowSet = { - // TODO: provide STATIC default value - fetchResults( - opHandle, - FetchOrientation.FETCH_NEXT, - CLIServiceClient.DEFAULT_MAX_ROWS, - FetchType.QUERY_OUTPUT) - } - - @throws[SparkThriftServerSQLException] - override def getDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - owner: String, - renewer: String): String - - @throws[SparkThriftServerSQLException] - override def cancelDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - tokenStr: String): Unit - - @throws[SparkThriftServerSQLException] - override def renewDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - tokenStr: String): Unit -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala deleted file mode 100644 index ce9b7134d04b..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ICLIService.scala +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.util.{List => JList, Map => JMap} - -import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory -import org.apache.spark.sql.thriftserver.cli.thrift._ -import org.apache.spark.sql.types.StructType - - -private[thriftserver] trait ICLIService { - - @throws[SparkThriftServerSQLException] - def openSession(username: String, - password: String, - configuration: JMap[String, String]): SessionHandle - - @throws[SparkThriftServerSQLException] - def openSessionWithImpersonation(username: String, - password: String, - configuration: JMap[String, String], - delegationToken: String): SessionHandle - - @throws[SparkThriftServerSQLException] - def closeSession(sessionHandle: SessionHandle): Unit - - @throws[SparkThriftServerSQLException] - def getInfo(sessionHandle: SessionHandle, - infoType: GetInfoType): GetInfoValue - - @throws[SparkThriftServerSQLException] - def executeStatement(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String]): OperationHandle - - @throws[SparkThriftServerSQLException] - def executeStatementAsync(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String]): OperationHandle - - @throws[SparkThriftServerSQLException] - def executeStatement(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String], - queryTimeout: Long): OperationHandle - - @throws[SparkThriftServerSQLException] - def executeStatementAsync(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String], - queryTimeout: Long): OperationHandle - - @throws[SparkThriftServerSQLException] - def getTypeInfo(sessionHandle: SessionHandle): OperationHandle - - @throws[SparkThriftServerSQLException] - def getCatalogs(sessionHandle: SessionHandle): OperationHandle - - @throws[SparkThriftServerSQLException] - def getSchemas(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String): OperationHandle - - @throws[SparkThriftServerSQLException] - def getTables(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String, - tableName: String, - tableTypes: JList[String]): OperationHandle - - @throws[SparkThriftServerSQLException] - def getTableTypes(sessionHandle: SessionHandle): OperationHandle - - @throws[SparkThriftServerSQLException] - def getColumns(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String, - tableName: String, - columnName: String): OperationHandle - - @throws[SparkThriftServerSQLException] - def getFunctions(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String, - functionName: String): OperationHandle - - @throws[SparkThriftServerSQLException] - def getPrimaryKeys(sessionHandle: SessionHandle, - catalog: String, - schema: String, - table: String): OperationHandle - - @throws[SparkThriftServerSQLException] - def getCrossReference(sessionHandle: SessionHandle, - primaryCatalog: String, - primarySchema: String, - primaryTable: String, - foreignCatalog: String, - foreignSchema: String, - foreignTable: String): OperationHandle - - @throws[SparkThriftServerSQLException] - def getOperationStatus(opHandle: OperationHandle): OperationStatus - - import org.apache.spark.sql.thriftserver.cli.thrift.TOperationHandle - - @throws[SparkThriftServerSQLException] - def getQueryId(opHandle: TOperationHandle): String - - @throws[SparkThriftServerSQLException] - def cancelOperation(opHandle: OperationHandle): Unit - - @throws[SparkThriftServerSQLException] - def closeOperation(opHandle: OperationHandle): Unit - - @throws[SparkThriftServerSQLException] - def getResultSetMetadata(opHandle: OperationHandle): StructType - - @throws[SparkThriftServerSQLException] - def fetchResults(opHandle: OperationHandle): RowSet - - @throws[SparkThriftServerSQLException] - def fetchResults(opHandle: OperationHandle, - orientation: FetchOrientation, - maxRows: Long, - fetchType: FetchType): RowSet - - @throws[SparkThriftServerSQLException] - def getDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - owner: String, - renewer: String): String - - @throws[SparkThriftServerSQLException] - def cancelDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - tokenStr: String): Unit - - @throws[SparkThriftServerSQLException] - def renewDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - tokenStr: String): Unit -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala deleted file mode 100644 index a61a233f628d..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.Row -import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet - -private[thriftserver] trait RowSet { - def addRow(row: Row): RowSet - - def extractSubset(maxRows: Int): RowSet - - def numColumns: Int - - def numRows: Int - - def getStartOffset: Long - - def setStartOffset(startOffset: Long): Unit - - def toTRowSet: TRowSet - - def iterator: Iterator[Row] -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala deleted file mode 100644 index 53c6a889534f..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/CLIServiceUtils.scala +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.thrift - -import org.apache.log4j.PatternLayout - -private[thriftserver] object CLIServiceUtils { - - private val SEARCH_STRING_ESCAPE = '\\' - val verboseLayout = new PatternLayout("%d{yy/MM/dd HH:mm:ss} %p %c{2}: %m%n") - val nonVerboseLayout = new PatternLayout("%-5p : %m%n") - - /** - * Convert a SQL search pattern into an equivalent Java Regex. - * - * @param pattern input which may contain '%' or '_' wildcard characters, or - * these characters escaped using { @code getSearchStringEscape()}. - * @return replace %/_ with regex search characters, also handle escaped - * characters. - */ - def patternToRegex(pattern: String): String = { - if (pattern == null) { - ".*" - } else { - val result = new StringBuilder(pattern.length) - var escaped = false - var i = 0 - pattern.toCharArray.foreach(c => { - if (escaped) { - if (c != SEARCH_STRING_ESCAPE) { - escaped = false - } - result.append(c) - } else if (c == SEARCH_STRING_ESCAPE) { - escaped = true - } else if (c == '%') { - result.append(".*") - } else if (c == '_') { - result.append('.') - } else { - result.append(Character.toLowerCase(c)) - } - }) - result.toString() - } - } -} From 2e6d22133d353b50e68e9707ef35216401983ebc Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 08:05:42 +0800 Subject: [PATCH 40/55] fix bug --- .../java/org/apache/spark/sql/thriftserver/cli/ICLIService.java | 2 +- .../sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java index a9d2988bdf6f..aa0525310916 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java @@ -77,7 +77,7 @@ OperationHandle getFunctions(SessionHandle sessionHandle, String catalogName, String schemaName, String functionName) throws SparkThriftServerSQLException; - OperationStatus getOperationStatus(OperationHandle opHandle, boolean getProgressUpdate) + OperationStatus getOperationStatus(OperationHandle opHandle) throws SparkThriftServerSQLException; String getQueryId(TOperationHandle operationHandle) throws SparkThriftServerSQLException; diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala index 54d803f27801..47866ce2bc12 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala @@ -280,7 +280,7 @@ class ThriftCLIServiceClient(val cliService: TCLIService.Iface) extends CLIServi checkStatus(resp.getStatus) val opState = OperationState.getOperationState(resp.getOperationState) var opException: SparkThriftServerSQLException = null - if (opState eq ERROR) { + if (opState eq OperationState.ERROR) { opException = new SparkThriftServerSQLException( resp.getErrorMessage, From 158b2981d18b17abb6c8cc15202a4480161824d2 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 10:36:53 +0800 Subject: [PATCH 41/55] remove setApplicationName --- .../org/apache/spark/sql/thriftserver/cli/ICLIService.java | 2 -- .../org/apache/spark/sql/thriftserver/cli/CLIService.scala | 3 +-- .../org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala | 1 - .../spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala | 3 ++- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java index aa0525310916..e56971f8f66f 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java @@ -113,6 +113,4 @@ OperationHandle getCrossReference(SessionHandle sessionHandle, String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws SparkThriftServerSQLException; - - void setApplicationName(SessionHandle sh, String value) throws SparkThriftServerSQLException; } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala index 969ebcae619a..59e5680a8653 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -466,8 +466,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex } def getSessionManager: SessionManager = sessionManager - - } +} object CLIService { val protocols: Array[TProtocolVersion] = TProtocolVersion.values() diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala index c8c52d76abaf..134fe2ed6a60 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala @@ -24,7 +24,6 @@ import scala.collection.JavaConverters._ import com.google.common.primitives._ import java.util._ -import org.apache.spark.sql.thriftserver.cli.Type._ import org.apache.spark.sql.thriftserver.cli.thrift._ /** diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala index 95b40bdbdcb6..99e158aeac95 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala @@ -664,7 +664,8 @@ private[thriftserver] abstract class ThriftCLIService(cliService: CLIService, se } override def SetClientInfo(req: TSetClientInfoReq): TSetClientInfoResp = { - throw new TException("Method not implemented") + val resp = new TSetClientInfoResp() + resp.setStatus(notSupportTokenErrorStatus) } @throws[TException] From 745ca60a6b55c772301df673aa925c2520969474 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 10:45:25 +0800 Subject: [PATCH 42/55] Session Basic Class to java --- .../cli/session/ThriftServerSessionBase.java | 97 ++++++++++++++++++ .../cli/session/ThriftServerSessionProxy.java | 98 +++++++++++++++++++ .../cli/session/ThriftServerSessionBase.scala | 91 ----------------- .../session/ThriftServerSessionProxy.scala | 84 ---------------- 4 files changed, 195 insertions(+), 175 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java new file mode 100644 index 000000000000..f3495e874404 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java @@ -0,0 +1,97 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session; + +import java.io.File; +import java.util.List; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hive.service.rpc.thrift.TProtocolVersion; +import org.apache.spark.sql.thriftserver.cli.SessionHandle; +import org.apache.spark.sql.thriftserver.cli.operation.OperationManager; + +/** + * Methods that don't need to be executed under a doAs + * context are here. Rest of them in HiveSession interface + */ +public interface ThriftServerSessionBase { + + TProtocolVersion getProtocolVersion(); + + /** + * Set the session manager for the session + * @param sessionManager + */ + void setSessionManager(SessionManager sessionManager); + + /** + * Get the session manager for the session + */ + SessionManager getSessionManager(); + + /** + * Set operation manager for the session + * @param operationManager + */ + void setOperationManager(OperationManager operationManager); + + /** + * Check whether operation logging is enabled and session dir is created successfully + */ + boolean isOperationLogEnabled(); + + /** + * Get the session dir, which is the parent dir of operation logs + * @return a file representing the parent directory of operation logs + */ + File getOperationLogSessionDir(); + + /** + * Set the session dir, which is the parent dir of operation logs + * @param operationLogRootDir the parent dir of the session dir + */ + void setOperationLogSessionDir(File operationLogRootDir); + + SessionHandle getSessionHandle(); + + String getPassword(); + + HiveConf getHiveConf(); + + SessionState getSessionState(); + + String getUserName(); + + void setUserName(String userName); + + String getIpAddress(); + + void setIpAddress(String ipAddress); + + List getForwardedAddresses(); + + void setForwardedAddresses(List forwardedAddresses); + + long getLastAccessTime(); + + long getCreationTime(); + + int getOpenOperationCount(); +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.java new file mode 100644 index 000000000000..01960773ba02 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.java @@ -0,0 +1,98 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.session; + +/** + * Proxy wrapper on HiveSession to execute operations + * by impersonating given user + */ + +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.lang.reflect.UndeclaredThrowableException; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.spark.sql.thriftserver.cli.SparkThriftServerSQLException; + +public class ThriftServerSessionProxy implements InvocationHandler { + private final ThriftServerSession base; + private final UserGroupInformation ugi; + + public ThriftServerSessionProxy(ThriftServerSession hiveSession, UserGroupInformation ugi) { + this.base = hiveSession; + this.ugi = ugi; + } + + public static ThriftServerSession getProxy(ThriftServerSession hiveSession, UserGroupInformation ugi) + throws IllegalArgumentException, SparkThriftServerSQLException { + return (ThriftServerSession) Proxy.newProxyInstance(ThriftServerSession.class.getClassLoader(), + new Class[]{ThriftServerSession.class}, + new ThriftServerSessionProxy(hiveSession, ugi)); + } + + @Override + public Object invoke(Object arg0, final Method method, final Object[] args) + throws Throwable { + try { + if (method.getDeclaringClass() == ThriftServerSessionBase.class) { + return invoke(method, args); + } + return ugi.doAs( + new PrivilegedExceptionAction() { + @Override + public Object run() throws SparkThriftServerSQLException { + return invoke(method, args); + } + }); + } catch (UndeclaredThrowableException e) { + Throwable innerException = e.getCause(); + if (innerException instanceof PrivilegedActionException) { + throw innerException.getCause(); + } else { + throw e.getCause(); + } + } + } + + private Object invoke(final Method method, final Object[] args) throws SparkThriftServerSQLException { + try { + return method.invoke(base, args); + } catch (InvocationTargetException e) { + if (e.getCause() instanceof SparkThriftServerSQLException) { + throw (SparkThriftServerSQLException) e.getCause(); + } else if (e.getCause() instanceof OutOfMemoryError) { + throw (OutOfMemoryError) e.getCause(); + } else if (e.getCause() instanceof Error) { + // TODO: maybe we should throw this as-is too. ThriftCLIService currently catches Exception, + // so the combination determines what would kill the HS2 executor thread. For now, + // let's only allow OOM to propagate. + } + throw new RuntimeException(e.getCause()); + } catch (IllegalArgumentException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} + diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala deleted file mode 100644 index 318b1edb55ff..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.scala +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.session - -import java.io.File - -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.ql.session.SessionState - -import org.apache.spark.sql.thriftserver.cli.SessionHandle -import org.apache.spark.sql.thriftserver.cli.operation.OperationManager -import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion - - -private[thriftserver] trait ThriftServerSessionBase { - - def getProtocolVersion: TProtocolVersion - - /** - * Set the session manager for the session - * - * @param sessionManager - */ - def setSessionManager(sessionManager: SessionManager): Unit - - /** - * Get the session manager for the session - */ - def getSessionManager: SessionManager - - /** - * Set operation manager for the session - * - * @param operationManager - */ - def setOperationManager(operationManager: OperationManager): Unit - - /** - * Check whether operation logging is enabled and session dir is created successfully - */ - def isOperationLogEnabled: Boolean - - /** - * Get the session dir, which is the parent dir of operation logs - * - * @return a file representing the parent directory of operation logs - */ - def getOperationLogSessionDir: File - - /** - * Set the session dir, which is the parent dir of operation logs - * - * @param operationLogRootDir the parent dir of the session dir - */ - def setOperationLogSessionDir(operationLogRootDir: File): Unit - - def getSessionHandle: SessionHandle - - def getUsername: String - - def getPassword: String - - def getHiveConf: HiveConf - - def getSessionState: SessionState - - def getUserName: String - - def setUserName(userName: String): Unit - - def getIpAddress: String - - def setIpAddress(ipAddr: String): Unit - - def getLastAccessTime: Long -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala deleted file mode 100644 index ade2f17d4b56..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionProxy.scala +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.session - -import java.lang.reflect.{InvocationHandler, InvocationTargetException, Method, UndeclaredThrowableException} -import java.security.{PrivilegedActionException, PrivilegedExceptionAction} - -import org.apache.hadoop.security.UserGroupInformation - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.cli.SparkThriftServerSQLException - -class ThriftServerSessionProxy extends InvocationHandler with Logging { - private var _base: ThriftServerSession = null - private var _ugi: UserGroupInformation = _ - - def this(session: ThriftServerSession, ugi: UserGroupInformation) = { - this() - this._base = session - this._ugi = ugi - } - - def invoke(method: Method, args: Array[AnyRef]): AnyRef = { - try { - return method.invoke(_base, args: _*) - } - catch { - case e: InvocationTargetException => - if (e.getCause.isInstanceOf[SparkThriftServerSQLException]) { - throw e.getCause.asInstanceOf[SparkThriftServerSQLException] - } - throw new RuntimeException(e.getCause) - case e: IllegalArgumentException => - throw new RuntimeException(e) - case e: IllegalAccessException => - throw new RuntimeException(e) - } - } - - override def invoke(proxy: AnyRef, method: Method, args: Array[AnyRef]): AnyRef = { - try { - if (method.getDeclaringClass eq classOf[ThriftServerSessionBase]) { - invoke(method, args) - } - _ugi.doAs(new PrivilegedExceptionAction[AnyRef]() { - @throws[SparkThriftServerSQLException] - override def run: AnyRef = invoke(method, args) - }) - - } catch { - case e: UndeclaredThrowableException => - val innerException: Throwable = e.getCause - if (innerException.isInstanceOf[PrivilegedActionException]) { - throw innerException.getCause - } - else { - throw e.getCause - } - } - } -} - -object ThriftServerSessionProxy { - def getProxy(session: ThriftServerSession, ugi: UserGroupInformation): ThriftServerSession = { - java.lang.reflect.Proxy.newProxyInstance(classOf[ThriftServerSession].getClassLoader, - Array[Class[_]](classOf[ThriftServerSession]), - new ThriftServerSessionProxy(session, ugi)).asInstanceOf[ThriftServerSession] - } -} From f62e577ef0db6a6a45faaeb775c7e7344f25cd13 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 16:10:21 +0800 Subject: [PATCH 43/55] auth and thrift service to java --- .../org/apache/spark/deploy/SparkSubmit.scala | 2 +- .../launcher/SparkSubmitCommandBuilder.java | 4 +- sbin/start-spark-thriftserver.sh | 2 +- sbin/stop-spark-thriftserver.sh | 2 +- .../thriftserver/auth/HiveAuthFactory.java | 441 ++++++++++ .../sql/thriftserver/auth/HttpAuthUtils.java | 189 ++++ .../thriftserver/auth/KerberosSaslHelper.java | 110 +++ .../thriftserver/auth/PlainSaslHelper.java | 152 ++++ .../auth/TSetIpAddressProcessor.java | 113 +++ .../auth/ThriftDelegationTokenManager.java | 191 +++++ .../spark/sql/thriftserver/cli/RowSet.java | 42 - .../cli/session/ThriftServerSessionBase.java | 11 +- .../cli/thrift/ThriftBinaryCLIService.java | 109 +++ .../cli/thrift/ThriftCLIService.java | 743 ++++++++++++++++ .../cli/thrift/ThriftCLIServiceClient.java | 505 +++++++++++ .../cli/thrift/ThriftHttpCLIService.java | 181 ++++ .../cli/thrift/ThriftHttpServlet.java | 562 ++++++++++++ .../cli/utils/VariableSubstitution.java | 71 ++ .../sql/thriftserver/SparkThriftServer2.scala | 303 ------- .../thriftserver/auth/HiveAuthFactory.scala | 433 ---------- .../sql/thriftserver/auth/HttpAuthUtils.scala | 191 ----- .../auth/KerberosSaslHelper.scala | 108 --- .../thriftserver/auth/PlainSaslHelper.scala | 136 --- .../auth/TSetIpAddressProcessor.scala | 93 -- .../ThriftserverDelegationTokenManager.scala | 160 ---- .../sql/thriftserver/cli/CLIService.scala | 5 +- .../sql/thriftserver/cli/ColumnBuffer.scala | 2 +- .../{auth/AuthType.scala => cli/RowSet.scala} | 24 +- .../SparkExecuteStatementOperation.scala | 22 +- .../operation/SparkGetCatalogsOperation.scala | 14 +- .../operation/SparkGetColumnsOperation.scala | 14 +- .../SparkGetFunctionsOperation.scala | 14 +- .../operation/SparkGetSchemasOperation.scala | 14 +- .../SparkGetTableTypesOperation.scala | 15 +- .../operation/SparkGetTablesOperation.scala | 14 +- .../operation/SparkGetTypeInfoOperation.scala | 14 +- .../operation/SparkMetadataOperation.scala | 2 +- .../cli/session/SessionManager.scala | 8 +- .../cli/session/ThriftServerSessionImpl.scala | 8 +- .../cli/thrift/ThriftBinaryCLIService.scala | 109 --- .../cli/thrift/ThriftCLIService.scala | 806 ------------------ .../cli/thrift/ThriftCLIServiceClient.scala | 461 ---------- .../cli/thrift/ThriftHttpCLIService.scala | 165 ---- .../cli/thrift/ThriftHttpServlet.scala | 490 ----------- .../thriftserver/cli/utils/LogHelper.scala | 131 --- .../cli/utils/VariableSubstitution.scala | 58 -- .../server/SparkThriftServer.scala | 341 ++++++-- .../thriftserver/ui/ThriftServerPage.scala | 2 +- .../ui/ThriftServerSessionPage.scala | 2 +- .../sql/thriftserver/ui/ThriftServerTab.scala | 4 +- .../thriftserver/JdbcConnectionUriSuite.scala | 2 +- ...es.scala => SparkThriftServerSuites.scala} | 21 +- .../ThriftServerQueryTestSuite.scala | 2 +- 53 files changed, 3734 insertions(+), 3884 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/ThriftDelegationTokenManager.java delete mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala rename sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/{auth/AuthType.scala => cli/RowSet.scala} (64%) delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala rename sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/{HiveThriftServer2Suites.scala => SparkThriftServerSuites.scala} (98%) diff --git a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala index b16614675e4c..131dbc38ae6f 100644 --- a/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala +++ b/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala @@ -1042,7 +1042,7 @@ object SparkSubmit extends CommandLineUtils with Logging { */ private def isThriftServer(mainClass: String): Boolean = { mainClass == "org.apache.spark.sql.hive.thriftserver.HiveThriftServer2" || - mainClass == "org.apache.spark.sql.thriftserver.SparkThriftServer2" + mainClass == "org.apache.spark.sql.thriftserver.server.SparkThriftServer" } /** diff --git a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java index e7653e25005b..3a1e81a7e4d0 100644 --- a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java +++ b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java @@ -86,7 +86,7 @@ class SparkSubmitCommandBuilder extends AbstractCommandBuilder { SparkLauncher.NO_RESOURCE); specialClasses.put("org.apache.spark.sql.hive.thriftserver.HiveThriftServer2", SparkLauncher.NO_RESOURCE); - specialClasses.put("org.apache.spark.sql.thriftserver.SparkThriftServer2", + specialClasses.put("org.apache.spark.sql.thriftserver.server.SparkThriftServer", SparkLauncher.NO_RESOURCE); } @@ -401,7 +401,7 @@ boolean isClientMode(Map userProps) { private boolean isThriftServer(String mainClass) { return (mainClass != null && (mainClass.equals("org.apache.spark.sql.hive.thriftserver.HiveThriftServer2") || - mainClass.equals("org.apache.spark.sql.thriftserver.SparkThriftServer2"))); + mainClass.equals("org.apache.spark.sql.thriftserver.server.SparkThriftServer"))); } private List findExamplesJars() { diff --git a/sbin/start-spark-thriftserver.sh b/sbin/start-spark-thriftserver.sh index e0dff53e43e6..5983326053db 100755 --- a/sbin/start-spark-thriftserver.sh +++ b/sbin/start-spark-thriftserver.sh @@ -29,7 +29,7 @@ fi # NOTE: This exact class name is matched downstream by SparkSubmit. # Any changes need to be reflected there. -CLASS="org.apache.spark.sql.thriftserver.SparkThriftServer2" +CLASS="org.apache.spark.sql.thriftserver.server.SparkThriftServer" function usage { echo "Usage: ./sbin/start-spark-thriftserver [options] [thrift server options]" diff --git a/sbin/stop-spark-thriftserver.sh b/sbin/stop-spark-thriftserver.sh index 294cd6de3dd8..e02e47d42aa6 100755 --- a/sbin/stop-spark-thriftserver.sh +++ b/sbin/stop-spark-thriftserver.sh @@ -23,4 +23,4 @@ if [ -z "${SPARK_HOME}" ]; then export SPARK_HOME="$(cd "`dirname "$0"`"/..; pwd)" fi -"${SPARK_HOME}/sbin"/spark-daemon.sh stop org.apache.spark.sql.thriftserver.SparkThriftServer2 1 +"${SPARK_HOME}/sbin"/spark-daemon.sh stop org.apache.spark.sql.thriftserver.server.SparkThriftServer 1 diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.java new file mode 100644 index 000000000000..77e976898a3f --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.java @@ -0,0 +1,441 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; + +import javax.net.ssl.SSLServerSocket; +import javax.security.auth.login.LoginException; +import javax.security.sasl.Sasl; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.metastore.HiveMetaStore; +import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler; +import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.shims.HadoopShims.KerberosNameShim; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hadoop.hive.thrift.DBTokenStore; +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge; +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server.ServerMode; +import org.apache.hadoop.security.SecurityUtil; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.authorize.ProxyUsers; +import org.apache.spark.sql.thriftserver.ReflectionUtils; +import org.apache.spark.sql.thriftserver.cli.SparkThriftServerSQLException; +import org.apache.spark.sql.thriftserver.cli.thrift.ThriftCLIService; +import org.apache.thrift.TProcessorFactory; +import org.apache.thrift.transport.TSSLTransportFactory; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; +import org.apache.thrift.transport.TTransportFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class helps in some aspects of authentication. It creates the proper Thrift classes for the + * given configuration as well as helps with authenticating requests. + */ +public class HiveAuthFactory { + private static final Logger LOG = LoggerFactory.getLogger(HiveAuthFactory.class); + + + public enum AuthTypes { + NOSASL("NOSASL"), + NONE("NONE"), + LDAP("LDAP"), + KERBEROS("KERBEROS"), + CUSTOM("CUSTOM"), + PAM("PAM"); + + private final String authType; + + AuthTypes(String authType) { + this.authType = authType; + } + + public String getAuthName() { + return authType; + } + + } + + private HadoopThriftAuthBridge.Server saslServer; + private String authTypeStr; + private final String transportMode; + private final HiveConf conf; + private ThriftDelegationTokenManager delegationTokenManager = null; + + public static final String HS2_PROXY_USER = "hive.server2.proxy.user"; + public static final String HS2_CLIENT_TOKEN = "hiveserver2ClientToken"; + + private static Field keytabFile = null; + private static Method getKeytab = null; + static { + Class clz = UserGroupInformation.class; + try { + keytabFile = clz.getDeclaredField("keytabFile"); + keytabFile.setAccessible(true); + } catch (NoSuchFieldException nfe) { + LOG.debug("Cannot find private field \"keytabFile\" in class: " + + UserGroupInformation.class.getCanonicalName(), nfe); + keytabFile = null; + } + + try { + getKeytab = clz.getDeclaredMethod("getKeytab"); + getKeytab.setAccessible(true); + } catch(NoSuchMethodException nme) { + LOG.debug("Cannot find private method \"getKeytab\" in class:" + + UserGroupInformation.class.getCanonicalName(), nme); + getKeytab = null; + } + } + + public HiveAuthFactory(HiveConf conf) throws TTransportException, IOException { + this.conf = conf; + transportMode = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE); + authTypeStr = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION); + + // In http mode we use NOSASL as the default auth type + if ("http".equalsIgnoreCase(transportMode)) { + if (authTypeStr == null) { + authTypeStr = AuthTypes.NOSASL.getAuthName(); + } + } else { + if (authTypeStr == null) { + authTypeStr = AuthTypes.NONE.getAuthName(); + } + if (authTypeStr.equalsIgnoreCase(AuthTypes.KERBEROS.getAuthName())) { + String principal = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL); + String keytab = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB); + if (needUgiLogin(UserGroupInformation.getCurrentUser(), + SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keytab)) { + saslServer = ShimLoader.getHadoopThriftAuthBridge().createServer(principal, keytab); + } else { + // Using the default constructor to avoid unnecessary UGI login. + saslServer = new HadoopThriftAuthBridge.Server(); + } + + // start delegation token manager + delegationTokenManager = new ThriftDelegationTokenManager(); + try { + // rawStore is only necessary for DBTokenStore + Object rawStore = null; + String tokenStoreClass = conf.getVar( + HiveConf.ConfVars.METASTORE_CLUSTER_DELEGATION_TOKEN_STORE_CLS); + + if (tokenStoreClass.equals(DBTokenStore.class.getName())) { + HMSHandler baseHandler = new HiveMetaStore.HMSHandler( + "new db based metaserver", conf, true); + rawStore = baseHandler.getMS(); + } + + delegationTokenManager.startDelegationTokenSecretManager( + conf, rawStore, ServerMode.HIVESERVER2); + ReflectionUtils.setSuperField(saslServer, "secretManager", delegationTokenManager); + } + catch (MetaException|IOException e) { + throw new TTransportException("Failed to start token manager", e); + } + } + } + } + + public Map getSaslProperties() { + Map saslProps = new HashMap(); + SaslQOP saslQOP = SaslQOP.fromString(conf.getVar(ConfVars.HIVE_SERVER2_THRIFT_SASL_QOP)); + saslProps.put(Sasl.QOP, saslQOP.toString()); + saslProps.put(Sasl.SERVER_AUTH, "true"); + return saslProps; + } + + public TTransportFactory getAuthTransFactory() throws LoginException { + TTransportFactory transportFactory; + if (authTypeStr.equalsIgnoreCase(AuthTypes.KERBEROS.getAuthName())) { + try { + transportFactory = saslServer.createTransportFactory(getSaslProperties()); + } catch (TTransportException e) { + throw new LoginException(e.getMessage()); + } + } else if (authTypeStr.equalsIgnoreCase(AuthTypes.NONE.getAuthName())) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); + } else if (authTypeStr.equalsIgnoreCase(AuthTypes.LDAP.getAuthName())) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); + } else if (authTypeStr.equalsIgnoreCase(AuthTypes.PAM.getAuthName())) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); + } else if (authTypeStr.equalsIgnoreCase(AuthTypes.NOSASL.getAuthName())) { + transportFactory = new TTransportFactory(); + } else if (authTypeStr.equalsIgnoreCase(AuthTypes.CUSTOM.getAuthName())) { + transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); + } else { + throw new LoginException("Unsupported authentication type " + authTypeStr); + } + return transportFactory; + } + + /** + * Returns the thrift processor factory for HiveServer2 running in binary mode + * @param service + * @return + * @throws LoginException + */ + public TProcessorFactory getAuthProcFactory(ThriftCLIService service) throws LoginException { + if (authTypeStr.equalsIgnoreCase(AuthTypes.KERBEROS.getAuthName())) { + return KerberosSaslHelper.getKerberosProcessorFactory(saslServer, service); + } else { + return PlainSaslHelper.getPlainProcessorFactory(service); + } + } + + public String getRemoteUser() { + return saslServer == null ? null : saslServer.getRemoteUser(); + } + + public String getIpAddress() { + if (saslServer == null || saslServer.getRemoteAddress() == null) { + return null; + } else { + return saslServer.getRemoteAddress().getHostAddress(); + } + } + + // Perform kerberos login using the hadoop shim API if the configuration is available + public static void loginFromKeytab(HiveConf hiveConf) throws IOException { + String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL); + String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB); + if (principal.isEmpty() || keyTabFile.isEmpty()) { + throw new IOException("HiveServer2 Kerberos principal or keytab is not correctly configured"); + } else { + UserGroupInformation.loginUserFromKeytab(SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile); + } + } + + // Perform SPNEGO login using the hadoop shim API if the configuration is available + public static UserGroupInformation loginFromSpnegoKeytabAndReturnUGI(HiveConf hiveConf) + throws IOException { + String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL); + String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB); + if (principal.isEmpty() || keyTabFile.isEmpty()) { + throw new IOException("HiveServer2 SPNEGO principal or keytab is not correctly configured"); + } else { + return UserGroupInformation.loginUserFromKeytabAndReturnUGI(SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile); + } + } + + public static TTransport getSocketTransport(String host, int port, int loginTimeout) { + return new TSocket(host, port, loginTimeout); + } + + public static TTransport getSSLSocket(String host, int port, int loginTimeout) + throws TTransportException { + return TSSLTransportFactory.getClientSocket(host, port, loginTimeout); + } + + public static TTransport getSSLSocket(String host, int port, int loginTimeout, + String trustStorePath, String trustStorePassWord) throws TTransportException { + TSSLTransportFactory.TSSLTransportParameters params = + new TSSLTransportFactory.TSSLTransportParameters(); + params.setTrustStore(trustStorePath, trustStorePassWord); + params.requireClientAuth(true); + return TSSLTransportFactory.getClientSocket(host, port, loginTimeout, params); + } + + public static TServerSocket getServerSocket(String hiveHost, int portNum) + throws TTransportException { + InetSocketAddress serverAddress; + if (hiveHost == null || hiveHost.isEmpty()) { + // Wildcard bind + serverAddress = new InetSocketAddress(portNum); + } else { + serverAddress = new InetSocketAddress(hiveHost, portNum); + } + return new TServerSocket(serverAddress); + } + + public static TServerSocket getServerSSLSocket(String hiveHost, int portNum, String keyStorePath, + String keyStorePassWord, List sslVersionBlacklist) throws TTransportException, + UnknownHostException { + TSSLTransportFactory.TSSLTransportParameters params = + new TSSLTransportFactory.TSSLTransportParameters(); + params.setKeyStore(keyStorePath, keyStorePassWord); + InetSocketAddress serverAddress; + if (hiveHost == null || hiveHost.isEmpty()) { + // Wildcard bind + serverAddress = new InetSocketAddress(portNum); + } else { + serverAddress = new InetSocketAddress(hiveHost, portNum); + } + TServerSocket thriftServerSocket = + TSSLTransportFactory.getServerSocket(portNum, 0, serverAddress.getAddress(), params); + if (thriftServerSocket.getServerSocket() instanceof SSLServerSocket) { + List sslVersionBlacklistLocal = new ArrayList(); + for (String sslVersion : sslVersionBlacklist) { + sslVersionBlacklistLocal.add(sslVersion.trim().toLowerCase(Locale.ROOT)); + } + SSLServerSocket sslServerSocket = (SSLServerSocket) thriftServerSocket.getServerSocket(); + List enabledProtocols = new ArrayList(); + for (String protocol : sslServerSocket.getEnabledProtocols()) { + if (sslVersionBlacklistLocal.contains(protocol.toLowerCase(Locale.ROOT))) { + LOG.debug("Disabling SSL Protocol: " + protocol); + } else { + enabledProtocols.add(protocol); + } + } + sslServerSocket.setEnabledProtocols(enabledProtocols.toArray(new String[0])); + LOG.info("SSL Server Socket Enabled Protocols: " + + Arrays.toString(sslServerSocket.getEnabledProtocols())); + } + return thriftServerSocket; + } + + // retrieve delegation token for the given user + public String getDelegationToken(String owner, String renewer, String remoteAddr) + throws SparkThriftServerSQLException { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException( + "Delegation token only supported over kerberos authentication", "08S01"); + } + + try { + String tokenStr = delegationTokenManager.getDelegationTokenWithService(owner, renewer, + HS2_CLIENT_TOKEN, remoteAddr); + if (tokenStr == null || tokenStr.isEmpty()) { + throw new SparkThriftServerSQLException( + "Received empty retrieving delegation token for user " + owner, "08S01"); + } + return tokenStr; + } catch (IOException e) { + throw new SparkThriftServerSQLException( + "Error retrieving delegation token for user " + owner, "08S01", e); + } catch (InterruptedException e) { + throw new SparkThriftServerSQLException("delegation token retrieval interrupted", "08S01", e); + } + } + + // cancel given delegation token + public void cancelDelegationToken(String delegationToken) throws SparkThriftServerSQLException { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException( + "Delegation token only supported over kerberos authentication", "08S01"); + } + try { + delegationTokenManager.cancelDelegationToken(delegationToken); + } catch (IOException e) { + throw new SparkThriftServerSQLException( + "Error canceling delegation token " + delegationToken, "08S01", e); + } + } + + public void renewDelegationToken(String delegationToken) throws SparkThriftServerSQLException { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException( + "Delegation token only supported over kerberos authentication", "08S01"); + } + try { + delegationTokenManager.renewDelegationToken(delegationToken); + } catch (IOException e) { + throw new SparkThriftServerSQLException( + "Error renewing delegation token " + delegationToken, "08S01", e); + } + } + + public String verifyDelegationToken(String delegationToken) throws SparkThriftServerSQLException { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException( + "Delegation token only supported over kerberos authentication", "08S01"); + } + try { + return delegationTokenManager.verifyDelegationToken(delegationToken); + } catch (IOException e) { + String msg = "Error verifying delegation token " + delegationToken; + LOG.error(msg, e); + throw new SparkThriftServerSQLException(msg, "08S01", e); + } + } + + public String getUserFromToken(String delegationToken) throws SparkThriftServerSQLException { + if (delegationTokenManager == null) { + throw new SparkThriftServerSQLException( + "Delegation token only supported over kerberos authentication", "08S01"); + } + try { + return delegationTokenManager.getUserFromToken(delegationToken); + } catch (IOException e) { + throw new SparkThriftServerSQLException( + "Error extracting user from delegation token " + delegationToken, "08S01", e); + } + } + + public static void verifyProxyAccess(String realUser, String proxyUser, String ipAddress, + HiveConf hiveConf) throws SparkThriftServerSQLException { + try { + UserGroupInformation sessionUgi; + if (UserGroupInformation.isSecurityEnabled()) { + KerberosNameShim kerbName = ShimLoader.getHadoopShims().getKerberosNameShim(realUser); + sessionUgi = UserGroupInformation.createProxyUser( + kerbName.getServiceName(), UserGroupInformation.getLoginUser()); + } else { + sessionUgi = UserGroupInformation.createRemoteUser(realUser); + } + if (!proxyUser.equalsIgnoreCase(realUser)) { + ProxyUsers.refreshSuperUserGroupsConfiguration(hiveConf); + ProxyUsers.authorize(UserGroupInformation.createProxyUser(proxyUser, sessionUgi), + ipAddress, hiveConf); + } + } catch (IOException e) { + throw new SparkThriftServerSQLException( + "Failed to validate proxy privilege of " + realUser + " for " + proxyUser, "08S01", e); + } + } + + public static boolean needUgiLogin(UserGroupInformation ugi, String principal, String keytab) { + return null == ugi || !ugi.hasKerberosCredentials() || !ugi.getUserName().equals(principal) || + !Objects.equals(keytab, getKeytabFromUgi()); + } + + private static String getKeytabFromUgi() { + synchronized (UserGroupInformation.class) { + try { + if (keytabFile != null) { + return (String) keytabFile.get(null); + } else if (getKeytab != null) { + return (String) getKeytab.invoke(UserGroupInformation.getCurrentUser()); + } else { + return null; + } + } catch (Exception e) { + LOG.debug("Fail to get keytabFile path via reflection", e); + return null; + } + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.java new file mode 100644 index 000000000000..09fb1a272f61 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.java @@ -0,0 +1,189 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth; + +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedExceptionAction; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.StringTokenizer; + +import javax.security.auth.Subject; + +import org.apache.commons.codec.binary.Base64; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.http.protocol.BasicHttpContext; +import org.apache.http.protocol.HttpContext; +import org.ietf.jgss.GSSContext; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.ietf.jgss.Oid; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Utility functions for HTTP mode authentication. + */ +public final class HttpAuthUtils { + public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; + public static final String AUTHORIZATION = "Authorization"; + public static final String BASIC = "Basic"; + public static final String NEGOTIATE = "Negotiate"; + private static final Logger LOG = LoggerFactory.getLogger(HttpAuthUtils.class); + private static final String COOKIE_ATTR_SEPARATOR = "&"; + private static final String COOKIE_CLIENT_USER_NAME = "cu"; + private static final String COOKIE_CLIENT_RAND_NUMBER = "rn"; + private static final String COOKIE_KEY_VALUE_SEPARATOR = "="; + private static final Set COOKIE_ATTRIBUTES = + new HashSet(Arrays.asList(COOKIE_CLIENT_USER_NAME, COOKIE_CLIENT_RAND_NUMBER)); + + /** + * @return Stringified Base64 encoded kerberosAuthHeader on success + * @throws Exception + */ + public static String getKerberosServiceTicket(String principal, String host, + String serverHttpUrl, boolean assumeSubject) throws Exception { + String serverPrincipal = + ShimLoader.getHadoopThriftAuthBridge().getServerPrincipal(principal, host); + if (assumeSubject) { + // With this option, we're assuming that the external application, + // using the JDBC driver has done a JAAS kerberos login already + AccessControlContext context = AccessController.getContext(); + Subject subject = Subject.getSubject(context); + if (subject == null) { + throw new Exception("The Subject is not set"); + } + return Subject.doAs(subject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl)); + } else { + // JAAS login from ticket cache to setup the client UserGroupInformation + UserGroupInformation clientUGI = + ShimLoader.getHadoopThriftAuthBridge().getCurrentUGIWithConf("kerberos"); + return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl)); + } + } + + /** + * Creates and returns a HS2 cookie token. + * @param clientUserName Client User name. + * @return An unsigned cookie token generated from input parameters. + * The final cookie generated is of the following format : + * {@code cu=&rn=&s=} + */ + public static String createCookieToken(String clientUserName) { + StringBuffer sb = new StringBuffer(); + sb.append(COOKIE_CLIENT_USER_NAME).append(COOKIE_KEY_VALUE_SEPARATOR).append(clientUserName) + .append(COOKIE_ATTR_SEPARATOR); + sb.append(COOKIE_CLIENT_RAND_NUMBER).append(COOKIE_KEY_VALUE_SEPARATOR) + .append((new Random(System.currentTimeMillis())).nextLong()); + return sb.toString(); + } + + /** + * Parses a cookie token to retrieve client user name. + * @param tokenStr Token String. + * @return A valid user name if input is of valid format, else returns null. + */ + public static String getUserNameFromCookieToken(String tokenStr) { + Map map = splitCookieToken(tokenStr); + + if (!map.keySet().equals(COOKIE_ATTRIBUTES)) { + LOG.error("Invalid token with missing attributes " + tokenStr); + return null; + } + return map.get(COOKIE_CLIENT_USER_NAME); + } + + /** + * Splits the cookie token into attributes pairs. + * @param tokenStr input token. + * @return a map with the attribute pairs of the token if the input is valid. + * Else, returns null. + */ + private static Map splitCookieToken(String tokenStr) { + Map map = new HashMap(); + StringTokenizer st = new StringTokenizer(tokenStr, COOKIE_ATTR_SEPARATOR); + + while (st.hasMoreTokens()) { + String part = st.nextToken(); + int separator = part.indexOf(COOKIE_KEY_VALUE_SEPARATOR); + if (separator == -1) { + LOG.error("Invalid token string " + tokenStr); + return null; + } + String key = part.substring(0, separator); + String value = part.substring(separator + 1); + map.put(key, value); + } + return map; + } + + + private HttpAuthUtils() { + throw new UnsupportedOperationException("Can't initialize class"); + } + + /** + * We'll create an instance of this class within a doAs block so that the client's TGT credentials + * can be read from the Subject + */ + public static class HttpKerberosClientAction implements PrivilegedExceptionAction { + public static final String HTTP_RESPONSE = "HTTP_RESPONSE"; + public static final String SERVER_HTTP_URL = "SERVER_HTTP_URL"; + private final String serverPrincipal; + private final String serverHttpUrl; + private final Base64 base64codec; + private final HttpContext httpContext; + + public HttpKerberosClientAction(String serverPrincipal, String serverHttpUrl) { + this.serverPrincipal = serverPrincipal; + this.serverHttpUrl = serverHttpUrl; + base64codec = new Base64(0); + httpContext = new BasicHttpContext(); + httpContext.setAttribute(SERVER_HTTP_URL, serverHttpUrl); + } + + @Override + public String run() throws Exception { + // This Oid for Kerberos GSS-API mechanism. + Oid mechOid = new Oid("1.2.840.113554.1.2.2"); + // Oid for kerberos principal name + Oid krb5PrincipalOid = new Oid("1.2.840.113554.1.2.2.1"); + GSSManager manager = GSSManager.getInstance(); + // GSS name for server + GSSName serverName = manager.createName(serverPrincipal, krb5PrincipalOid); + // Create a GSSContext for authentication with the service. + // We're passing client credentials as null since we want them to be read from the Subject. + GSSContext gssContext = + manager.createContext(serverName, mechOid, null, GSSContext.DEFAULT_LIFETIME); + gssContext.requestMutualAuth(false); + // Establish context + byte[] inToken = new byte[0]; + byte[] outToken = gssContext.initSecContext(inToken, 0, inToken.length); + gssContext.dispose(); + // Base64 encoded and stringified token for server + return new String(base64codec.encode(outToken)); + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.java new file mode 100644 index 000000000000..27c9b0264fb8 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.java @@ -0,0 +1,110 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import java.io.IOException; +import java.util.Map; +import javax.security.sasl.SaslException; + +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge; +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server; +import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService; +import org.apache.spark.sql.thriftserver.cli.thrift.ThriftCLIService; +import org.apache.thrift.TProcessor; +import org.apache.thrift.TProcessorFactory; +import org.apache.thrift.transport.TSaslClientTransport; +import org.apache.thrift.transport.TTransport; + +public final class KerberosSaslHelper { + + public static TProcessorFactory getKerberosProcessorFactory(Server saslServer, + ThriftCLIService service) { + return new CLIServiceProcessorFactory(saslServer, service); + } + + public static TTransport getKerberosTransport(String principal, String host, + TTransport underlyingTransport, Map saslProps, boolean assumeSubject) + throws SaslException { + try { + String[] names = principal.split("[/@]"); + if (names.length != 3) { + throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal); + } + + if (assumeSubject) { + return createSubjectAssumedTransport(principal, underlyingTransport, saslProps); + } else { + HadoopThriftAuthBridge.Client authBridge = + ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); + return authBridge.createClientTransport(principal, host, "KERBEROS", null, + underlyingTransport, saslProps); + } + } catch (IOException e) { + throw new SaslException("Failed to open client transport", e); + } + } + + public static TTransport createSubjectAssumedTransport(String principal, + TTransport underlyingTransport, Map saslProps) throws IOException { + String[] names = principal.split("[/@]"); + try { + TTransport saslTransport = + new TSaslClientTransport("GSSAPI", null, names[0], names[1], saslProps, null, + underlyingTransport); + return new TSubjectAssumingTransport(saslTransport); + } catch (SaslException se) { + throw new IOException("Could not instantiate SASL transport", se); + } + } + + public static TTransport getTokenTransport(String tokenStr, String host, + TTransport underlyingTransport, Map saslProps) throws SaslException { + HadoopThriftAuthBridge.Client authBridge = + ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); + + try { + return authBridge.createClientTransport(null, host, "DIGEST", tokenStr, underlyingTransport, + saslProps); + } catch (IOException e) { + throw new SaslException("Failed to open client transport", e); + } + } + + private KerberosSaslHelper() { + throw new UnsupportedOperationException("Can't initialize class"); + } + + private static class CLIServiceProcessorFactory extends TProcessorFactory { + + private final ThriftCLIService service; + private final Server saslServer; + + CLIServiceProcessorFactory(Server saslServer, ThriftCLIService service) { + super(null); + this.service = service; + this.saslServer = saslServer; + } + + @Override + public TProcessor getProcessor(TTransport trans) { + TProcessor sqlProcessor = new TCLIService.Processor(service); + return saslServer.wrapNonAssumingProcessor(sqlProcessor); + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.java new file mode 100644 index 000000000000..107779282af8 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.java @@ -0,0 +1,152 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import java.io.IOException; +import java.security.Security; +import java.util.HashMap; +import javax.security.auth.callback.Callback; +import javax.security.auth.callback.CallbackHandler; +import javax.security.auth.callback.NameCallback; +import javax.security.auth.callback.PasswordCallback; +import javax.security.auth.callback.UnsupportedCallbackException; +import javax.security.auth.login.LoginException; +import javax.security.sasl.AuthenticationException; +import javax.security.sasl.AuthorizeCallback; +import javax.security.sasl.SaslException; + +import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService; +import org.apache.spark.sql.thriftserver.cli.thrift.ThriftCLIService; +import org.apache.thrift.TProcessor; +import org.apache.thrift.TProcessorFactory; +import org.apache.thrift.transport.TSaslClientTransport; +import org.apache.thrift.transport.TSaslServerTransport; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportFactory; + +public final class PlainSaslHelper { + + public static TProcessorFactory getPlainProcessorFactory(ThriftCLIService service) { + return new SQLPlainProcessorFactory(service); + } + + // Register Plain SASL server provider + static { + Security.addProvider(new PlainSaslServer.SaslPlainProvider()); + } + + public static TTransportFactory getPlainTransportFactory(String authTypeStr) + throws LoginException { + TSaslServerTransport.Factory saslFactory = new TSaslServerTransport.Factory(); + try { + saslFactory.addServerDefinition("PLAIN", authTypeStr, null, new HashMap(), + new PlainServerCallbackHandler(authTypeStr)); + } catch (AuthenticationException e) { + throw new LoginException("Error setting callback handler" + e); + } + return saslFactory; + } + + public static TTransport getPlainTransport(String username, String password, + TTransport underlyingTransport) throws SaslException { + return new TSaslClientTransport("PLAIN", null, null, null, new HashMap(), + new PlainCallbackHandler(username, password), underlyingTransport); + } + + private PlainSaslHelper() { + throw new UnsupportedOperationException("Can't initialize class"); + } + + private static final class PlainServerCallbackHandler implements CallbackHandler { + + private final AuthenticationProviderFactory.AuthMethods authMethod; + + PlainServerCallbackHandler(String authMethodStr) throws AuthenticationException { + authMethod = AuthenticationProviderFactory.AuthMethods.getValidAuthMethod(authMethodStr); + } + + @Override + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + String username = null; + String password = null; + AuthorizeCallback ac = null; + + for (Callback callback : callbacks) { + if (callback instanceof NameCallback) { + NameCallback nc = (NameCallback) callback; + username = nc.getName(); + } else if (callback instanceof PasswordCallback) { + PasswordCallback pc = (PasswordCallback) callback; + password = new String(pc.getPassword()); + } else if (callback instanceof AuthorizeCallback) { + ac = (AuthorizeCallback) callback; + } else { + throw new UnsupportedCallbackException(callback); + } + } + PasswdAuthenticationProvider provider = + AuthenticationProviderFactory.getAuthenticationProvider(authMethod); + provider.authenticate(username, password); + if (ac != null) { + ac.setAuthorized(true); + } + } + } + + public static class PlainCallbackHandler implements CallbackHandler { + + private final String username; + private final String password; + + public PlainCallbackHandler(String username, String password) { + this.username = username; + this.password = password; + } + + @Override + public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { + for (Callback callback : callbacks) { + if (callback instanceof NameCallback) { + NameCallback nameCallback = (NameCallback) callback; + nameCallback.setName(username); + } else if (callback instanceof PasswordCallback) { + PasswordCallback passCallback = (PasswordCallback) callback; + passCallback.setPassword(password.toCharArray()); + } else { + throw new UnsupportedCallbackException(callback); + } + } + } + } + + private static final class SQLPlainProcessorFactory extends TProcessorFactory { + + private final ThriftCLIService service; + + SQLPlainProcessorFactory(ThriftCLIService service) { + super(null); + this.service = service; + } + + @Override + public TProcessor getProcessor(TTransport trans) { + return new TSetIpAddressProcessor(service); + } + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.java new file mode 100644 index 000000000000..de9404b66823 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.java @@ -0,0 +1,113 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.auth; + +import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.transport.TSaslClientTransport; +import org.apache.thrift.transport.TSaslServerTransport; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class is responsible for setting the ipAddress for operations executed via HiveServer2. + * + * - IP address is only set for operations that calls listeners with hookContext + * - IP address is only set if the underlying transport mechanism is socket + * + * @see org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext + */ +public class TSetIpAddressProcessor extends TCLIService.Processor { + + private static final Logger LOGGER = LoggerFactory.getLogger(TSetIpAddressProcessor.class.getName()); + + public TSetIpAddressProcessor(TCLIService.Iface iface) { + super(iface); + } + + @Override + public boolean process(final TProtocol in, final TProtocol out) throws TException { + setIpAddress(in); + setUserName(in); + try { + return super.process(in, out); + } finally { + THREAD_LOCAL_USER_NAME.remove(); + THREAD_LOCAL_IP_ADDRESS.remove(); + } + } + + private void setUserName(final TProtocol in) { + TTransport transport = in.getTransport(); + if (transport instanceof TSaslServerTransport) { + String userName = ((TSaslServerTransport) transport).getSaslServer().getAuthorizationID(); + THREAD_LOCAL_USER_NAME.set(userName); + } + } + + protected void setIpAddress(final TProtocol in) { + TTransport transport = in.getTransport(); + TSocket tSocket = getUnderlyingSocketFromTransport(transport); + if (tSocket == null) { + LOGGER.warn("Unknown Transport, cannot determine ipAddress"); + } else { + THREAD_LOCAL_IP_ADDRESS.set(tSocket.getSocket().getInetAddress().getHostAddress()); + } + } + + private TSocket getUnderlyingSocketFromTransport(TTransport transport) { + while (transport != null) { + if (transport instanceof TSaslServerTransport) { + transport = ((TSaslServerTransport) transport).getUnderlyingTransport(); + } + if (transport instanceof TSaslClientTransport) { + transport = ((TSaslClientTransport) transport).getUnderlyingTransport(); + } + if (transport instanceof TSocket) { + return (TSocket) transport; + } + } + return null; + } + + private static final ThreadLocal THREAD_LOCAL_IP_ADDRESS = new ThreadLocal() { + @Override + protected synchronized String initialValue() { + return null; + } + }; + + private static final ThreadLocal THREAD_LOCAL_USER_NAME = new ThreadLocal() { + @Override + protected synchronized String initialValue() { + return null; + } + }; + + public static String getUserIpAddress() { + return THREAD_LOCAL_IP_ADDRESS.get(); + } + + public static String getUserName() { + return THREAD_LOCAL_USER_NAME.get(); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/ThriftDelegationTokenManager.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/ThriftDelegationTokenManager.java new file mode 100644 index 000000000000..455469b9cc4d --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/ThriftDelegationTokenManager.java @@ -0,0 +1,191 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package org.apache.spark.sql.thriftserver.auth; + +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.net.InetAddress; +import java.security.PrivilegedExceptionAction; + +import org.apache.commons.lang.StringUtils; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.shims.Utils; +import org.apache.hadoop.hive.thrift.*; +import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server.ServerMode; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod; +import org.apache.hadoop.security.authorize.AuthorizationException; +import org.apache.hadoop.security.authorize.ProxyUsers; +import org.apache.hadoop.security.token.Token; +import org.apache.hadoop.util.ReflectionUtils; + +public class ThriftDelegationTokenManager { + + public static final String DELEGATION_TOKEN_GC_INTERVAL = + "hive.cluster.delegation.token.gc-interval"; + private final static long DELEGATION_TOKEN_GC_INTERVAL_DEFAULT = 3600000; // 1 hour + // Delegation token related keys + public static final String DELEGATION_KEY_UPDATE_INTERVAL_KEY = + "hive.cluster.delegation.key.update-interval"; + public static final long DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT = + 24*60*60*1000; // 1 day + public static final String DELEGATION_TOKEN_RENEW_INTERVAL_KEY = + "hive.cluster.delegation.token.renew-interval"; + public static final long DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT = + 24*60*60*1000; // 1 day + public static final String DELEGATION_TOKEN_MAX_LIFETIME_KEY = + "hive.cluster.delegation.token.max-lifetime"; + public static final long DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT = + 7*24*60*60*1000; // 7 days + public static final String DELEGATION_TOKEN_STORE_CLS = + "hive.cluster.delegation.token.store.class"; + public static final String DELEGATION_TOKEN_STORE_ZK_CONNECT_STR = + "hive.cluster.delegation.token.store.zookeeper.connectString"; + // Alternate connect string specification configuration + public static final String DELEGATION_TOKEN_STORE_ZK_CONNECT_STR_ALTERNATE = + "hive.zookeeper.quorum"; + + public static final String DELEGATION_TOKEN_STORE_ZK_CONNECT_TIMEOUTMILLIS = + "hive.cluster.delegation.token.store.zookeeper.connectTimeoutMillis"; + public static final String DELEGATION_TOKEN_STORE_ZK_ZNODE = + "hive.cluster.delegation.token.store.zookeeper.znode"; + public static final String DELEGATION_TOKEN_STORE_ZK_ACL = + "hive.cluster.delegation.token.store.zookeeper.acl"; + public static final String DELEGATION_TOKEN_STORE_ZK_ZNODE_DEFAULT = + "/hivedelegation"; + + protected DelegationTokenSecretManager secretManager; + + public ThriftDelegationTokenManager() { + } + + public DelegationTokenSecretManager getSecretManager() { + return secretManager; + } + + public void startDelegationTokenSecretManager(Configuration conf, Object hms, ServerMode smode) + throws IOException { + long secretKeyInterval = + conf.getLong(DELEGATION_KEY_UPDATE_INTERVAL_KEY, DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT); + long tokenMaxLifetime = + conf.getLong(DELEGATION_TOKEN_MAX_LIFETIME_KEY, DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT); + long tokenRenewInterval = + conf.getLong(DELEGATION_TOKEN_RENEW_INTERVAL_KEY, DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT); + long tokenGcInterval = + conf.getLong(DELEGATION_TOKEN_GC_INTERVAL, DELEGATION_TOKEN_GC_INTERVAL_DEFAULT); + + DelegationTokenStore dts = getTokenStore(conf); + dts.setConf(conf); + dts.init(hms, smode); + secretManager = + new TokenStoreDelegationTokenSecretManager(secretKeyInterval, tokenMaxLifetime, + tokenRenewInterval, tokenGcInterval, dts); + secretManager.startThreads(); + } + + public String getDelegationToken(final String owner, final String renewer, String remoteAddr) + throws IOException, + InterruptedException { + /** + * If the user asking the token is same as the 'owner' then don't do + * any proxy authorization checks. For cases like oozie, where it gets + * a delegation token for another user, we need to make sure oozie is + * authorized to get a delegation token. + */ + // Do all checks on short names + UserGroupInformation currUser = UserGroupInformation.getCurrentUser(); + UserGroupInformation ownerUgi = UserGroupInformation.createRemoteUser(owner); + if (!ownerUgi.getShortUserName().equals(currUser.getShortUserName())) { + // in the case of proxy users, the getCurrentUser will return the + // real user (for e.g. oozie) due to the doAs that happened just before the + // server started executing the method getDelegationToken in the MetaStore + ownerUgi = UserGroupInformation.createProxyUser(owner, UserGroupInformation.getCurrentUser()); + ProxyUsers.authorize(ownerUgi, remoteAddr, null); + } + return ownerUgi.doAs(new PrivilegedExceptionAction() { + + @Override + public String run() throws IOException { + return secretManager.getDelegationToken(renewer); + } + }); + } + + public String getDelegationTokenWithService(String owner, String renewer, String service, String remoteAddr) + throws IOException, InterruptedException { + String token = getDelegationToken(owner, renewer, remoteAddr); + return Utils.addServiceToToken(token, service); + } + + public long renewDelegationToken(String tokenStrForm) + throws IOException { + return secretManager.renewDelegationToken(tokenStrForm); + } + + public String getUserFromToken(String tokenStr) throws IOException { + return secretManager.getUserFromToken(tokenStr); + } + + public void cancelDelegationToken(String tokenStrForm) throws IOException { + secretManager.cancelDelegationToken(tokenStrForm); + } + + /** + * Verify token string + * @param tokenStrForm + * @return user name + * @throws IOException + */ + public synchronized String verifyDelegationToken(String tokenStrForm) throws IOException { + Token t = new Token(); + t.decodeFromUrlString(tokenStrForm); + + DelegationTokenIdentifier id = getTokenIdentifier(t); + secretManager.verifyToken(id, t.getPassword()); + return id.getUser().getShortUserName(); + } + + protected DelegationTokenIdentifier getTokenIdentifier(Token token) + throws IOException { + // turn bytes back into identifier for cache lookup + ByteArrayInputStream buf = new ByteArrayInputStream(token.getIdentifier()); + DataInputStream in = new DataInputStream(buf); + DelegationTokenIdentifier id = secretManager.createIdentifier(); + id.readFields(in); + return id; + } + + private DelegationTokenStore getTokenStore(Configuration conf) throws IOException { + String tokenStoreClassName = conf.get(DELEGATION_TOKEN_STORE_CLS, ""); + if (StringUtils.isBlank(tokenStoreClassName)) { + return new MemoryTokenStore(); + } + try { + Class storeClass = + Class.forName(tokenStoreClassName).asSubclass(DelegationTokenStore.class); + return ReflectionUtils.newInstance(storeClass, conf); + } catch (ClassNotFoundException e) { + throw new IOException("Error initializing delegation token store: " + tokenStoreClassName, e); + } + } + + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java deleted file mode 100644 index d56c2bb029d3..000000000000 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli; - - -import org.apache.spark.sql.Row; -import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet; - -public interface RowSet { - - RowSet addRow(Row row); - - RowSet extractSubset(int maxRows); - - int numColumns(); - - int numRows(); - - long getStartOffset(); - - void setStartOffset(long startOffset); - - TRowSet toTRowSet(); - - Iterable iterator(); -} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java index f3495e874404..d9d35f7cd7d5 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionBase.java @@ -19,13 +19,12 @@ package org.apache.spark.sql.thriftserver.cli.session; import java.io.File; -import java.util.List; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hive.service.rpc.thrift.TProtocolVersion; import org.apache.spark.sql.thriftserver.cli.SessionHandle; import org.apache.spark.sql.thriftserver.cli.operation.OperationManager; +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion; /** * Methods that don't need to be executed under a doAs @@ -85,13 +84,5 @@ public interface ThriftServerSessionBase { void setIpAddress(String ipAddress); - List getForwardedAddresses(); - - void setForwardedAddresses(List forwardedAddresses); - long getLastAccessTime(); - - long getCreationTime(); - - int getOpenOperationCount(); } diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java new file mode 100644 index 000000000000..6a83dcafe9c6 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java @@ -0,0 +1,109 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.common.auth.HiveAuthUtils; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory; +import org.apache.spark.sql.thriftserver.cli.CLIService; +import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup; +import org.apache.thrift.TProcessorFactory; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.server.TThreadPoolServer; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TTransportFactory; + + +public class ThriftBinaryCLIService extends ThriftCLIService { + + public ThriftBinaryCLIService(CLIService cliService) { + super(cliService, ThriftBinaryCLIService.class.getSimpleName()); + } + + @Override + public void run() { + try { + // Server thread pool + String threadPoolName = "HiveServer2-Handler-Pool"; + ExecutorService executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, + workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), + new ThreadFactoryWithGarbageCleanup(threadPoolName)); + + // Thrift configs + hiveAuthFactory = new HiveAuthFactory(hiveConf); + TTransportFactory transportFactory = hiveAuthFactory.getAuthTransFactory(); + TProcessorFactory processorFactory = hiveAuthFactory.getAuthProcFactory(this); + TServerSocket serverSocket = null; + List sslVersionBlacklist = new ArrayList(); + for (String sslVersion : hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",")) { + sslVersionBlacklist.add(sslVersion); + } + if (!hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL)) { + serverSocket = HiveAuthUtils.getServerSocket(hiveHost, portNum); + } else { + String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); + if (keyStorePath.isEmpty()) { + throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + + " Not configured for SSL connection"); + } + String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, + HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); + serverSocket = HiveAuthUtils.getServerSSLSocket(hiveHost, portNum, keyStorePath, + keyStorePassword, sslVersionBlacklist); + } + + // Server args + int maxMessageSize = hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_MAX_MESSAGE_SIZE); + int requestTimeout = (int) hiveConf.getTimeVar( + HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_TIMEOUT, TimeUnit.SECONDS); + int beBackoffSlotLength = (int) hiveConf.getTimeVar( + HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_BEBACKOFF_SLOT_LENGTH, TimeUnit.MILLISECONDS); + TThreadPoolServer.Args sargs = new TThreadPoolServer.Args(serverSocket) + .processorFactory(processorFactory).transportFactory(transportFactory) + .protocolFactory(new TBinaryProtocol.Factory()) + .inputProtocolFactory(new TBinaryProtocol.Factory(true, true, maxMessageSize, maxMessageSize)) + .requestTimeout(requestTimeout).requestTimeoutUnit(TimeUnit.SECONDS) + .beBackoffSlotLength(beBackoffSlotLength).beBackoffSlotLengthUnit(TimeUnit.MILLISECONDS) + .executorService(executorService); + + // TCP Server + server = new TThreadPoolServer(sargs); + server.setServerEventHandler(serverEventHandler); + String msg = "Starting " + ThriftBinaryCLIService.class.getSimpleName() + " on port " + + portNum + " with " + minWorkerThreads + "..." + maxWorkerThreads + " worker threads"; + LOG.info(msg); + server.serve(); + } catch (Throwable t) { + LOG.error( + "Error starting HiveServer2: could not start " + + ThriftBinaryCLIService.class.getSimpleName(), t); + System.exit(-1); + } + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java new file mode 100644 index 000000000000..99d00cf4eb8c --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java @@ -0,0 +1,743 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift; + +import javax.security.auth.login.LoginException; +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; + +import org.apache.spark.sql.thriftserver.AbstractService; +import org.apache.spark.sql.thriftserver.ServiceException; +import org.apache.spark.sql.thriftserver.ServiceUtils; +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory; +import org.apache.spark.sql.thriftserver.auth.TSetIpAddressProcessor; +import org.apache.spark.sql.thriftserver.cli.*; +import org.apache.spark.sql.thriftserver.cli.session.SessionManager; +import org.apache.spark.sql.thriftserver.server.SparkThriftServer; +import org.apache.spark.sql.types.StructType; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.server.ServerContext; +import org.apache.thrift.server.TServer; +import org.apache.thrift.server.TServerEventHandler; +import org.apache.thrift.transport.TTransport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ThriftCLIService. + * + */ +public abstract class ThriftCLIService extends AbstractService implements TCLIService.Iface, Runnable { + + public static final Logger LOG = LoggerFactory.getLogger(ThriftCLIService.class.getName()); + + protected CLIService cliService; + private static final TStatus OK_STATUS = new TStatus(TStatusCode.SUCCESS_STATUS); + protected static HiveAuthFactory hiveAuthFactory; + + protected int portNum; + protected InetAddress serverIPAddress; + protected String hiveHost; + protected TServer server; + protected org.eclipse.jetty.server.Server httpServer; + + private boolean isStarted = false; + protected boolean isEmbedded = false; + + protected HiveConf hiveConf; + + protected int minWorkerThreads; + protected int maxWorkerThreads; + protected long workerKeepAliveTime; + + protected TServerEventHandler serverEventHandler; + protected ThreadLocal currentServerContext; + + static class ThriftCLIServerContext implements ServerContext { + private SessionHandle sessionHandle = null; + + public void setSessionHandle(SessionHandle sessionHandle) { + this.sessionHandle = sessionHandle; + } + + public SessionHandle getSessionHandle() { + return sessionHandle; + } + } + + public ThriftCLIService(CLIService service, String serviceName) { + super(serviceName); + this.cliService = service; + currentServerContext = new ThreadLocal(); + serverEventHandler = new TServerEventHandler() { + @Override + public ServerContext createContext( + TProtocol input, TProtocol output) { + return new ThriftCLIServerContext(); + } + + @Override + public void deleteContext(ServerContext serverContext, + TProtocol input, TProtocol output) { + ThriftCLIServerContext context = (ThriftCLIServerContext)serverContext; + SessionHandle sessionHandle = context.getSessionHandle(); + if (sessionHandle != null) { + LOG.info("Session disconnected without closing properly, close it now"); + try { + cliService.closeSession(sessionHandle); + } catch (SparkThriftServerSQLException e) { + LOG.warn("Failed to close session: " + e, e); + } + } + } + + @Override + public void preServe() { + } + + @Override + public void processContext(ServerContext serverContext, + TTransport input, TTransport output) { + currentServerContext.set(serverContext); + } + }; + } + + @Override + public synchronized void init(HiveConf hiveConf) { + this.hiveConf = hiveConf; + // Initialize common server configs needed in both binary & http modes + String portString; + hiveHost = System.getenv("HIVE_SERVER2_THRIFT_BIND_HOST"); + if (hiveHost == null) { + hiveHost = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST); + } + try { + if (hiveHost != null && !hiveHost.isEmpty()) { + serverIPAddress = InetAddress.getByName(hiveHost); + } else { + serverIPAddress = InetAddress.getLocalHost(); + } + } catch (UnknownHostException e) { + throw new ServiceException(e); + } + // HTTP mode + if (SparkThriftServer.isHTTPTransportMode(hiveConf)) { + workerKeepAliveTime = + hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_WORKER_KEEPALIVE_TIME, + TimeUnit.SECONDS); + portString = System.getenv("HIVE_SERVER2_THRIFT_HTTP_PORT"); + if (portString != null) { + portNum = Integer.valueOf(portString); + } else { + portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT); + } + } + // Binary mode + else { + workerKeepAliveTime = + hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_WORKER_KEEPALIVE_TIME, TimeUnit.SECONDS); + portString = System.getenv("HIVE_SERVER2_THRIFT_PORT"); + if (portString != null) { + portNum = Integer.valueOf(portString); + } else { + portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_PORT); + } + } + minWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS); + maxWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS); + super.init(hiveConf); + } + + @Override + public synchronized void start() { + super.start(); + if (!isStarted && !isEmbedded) { + new Thread(this).start(); + isStarted = true; + } + } + + @Override + public synchronized void stop() { + if (isStarted && !isEmbedded) { + if(server != null) { + server.stop(); + LOG.info("Thrift server has stopped"); + } + if((httpServer != null) && httpServer.isStarted()) { + try { + httpServer.stop(); + LOG.info("Http server has stopped"); + } catch (Exception e) { + LOG.error("Error stopping Http server: ", e); + } + } + isStarted = false; + } + super.stop(); + } + + public int getPortNumber() { + return portNum; + } + + public InetAddress getServerIPAddress() { + return serverIPAddress; + } + + @Override + public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) + throws TException { + TGetDelegationTokenResp resp = new TGetDelegationTokenResp(); + resp.setStatus(notSupportTokenErrorStatus()); + return resp; + } + + @Override + public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) + throws TException { + TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp(); + resp.setStatus(notSupportTokenErrorStatus()); + return resp; + } + + @Override + public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) + throws TException { + TRenewDelegationTokenResp resp = new TRenewDelegationTokenResp(); + resp.setStatus(notSupportTokenErrorStatus()); + return resp; + } + + private TStatus notSupportTokenErrorStatus() { + TStatus errorStatus = new TStatus(TStatusCode.ERROR_STATUS); + errorStatus.setErrorMessage("Delegation token is not supported"); + return errorStatus; + } + + @Override + public TOpenSessionResp OpenSession(TOpenSessionReq req) throws TException { + LOG.info("Client protocol version: " + req.getClient_protocol()); + TOpenSessionResp resp = new TOpenSessionResp(); + try { + SessionHandle sessionHandle = getSessionHandle(req, resp); + resp.setSessionHandle(sessionHandle.toTSessionHandle()); + // TODO: set real configuration map + resp.setConfiguration(new HashMap()); + resp.setStatus(OK_STATUS); + ThriftCLIServerContext context = + (ThriftCLIServerContext)currentServerContext.get(); + if (context != null) { + context.setSessionHandle(sessionHandle); + } + } catch (Exception e) { + LOG.warn("Error opening session: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + private String getIpAddress() { + String clientIpAddress; + // Http transport mode. + // We set the thread local ip address, in ThriftHttpServlet. + if (cliService.getHiveConf().getVar( + ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { + clientIpAddress = SessionManager.getIpAddress(); + } + else { + // Kerberos + if (isKerberosAuthMode()) { + clientIpAddress = hiveAuthFactory.getIpAddress(); + } + // Except kerberos, NOSASL + else { + clientIpAddress = TSetIpAddressProcessor.getUserIpAddress(); + } + } + LOG.debug("Client's IP Address: " + clientIpAddress); + return clientIpAddress; + } + + /** + * Returns the effective username. + * 1. If hive.server2.allow.user.substitution = false: the username of the connecting user + * 2. If hive.server2.allow.user.substitution = true: the username of the end user, + * that the connecting user is trying to proxy for. + * This includes a check whether the connecting user is allowed to proxy for the end user. + * @param req + * @return + * @throws SparkThriftServerSQLException + */ + private String getUserName(TOpenSessionReq req) throws SparkThriftServerSQLException { + String userName = null; + // Kerberos + if (isKerberosAuthMode()) { + userName = hiveAuthFactory.getRemoteUser(); + } + // Except kerberos, NOSASL + if (userName == null) { + userName = TSetIpAddressProcessor.getUserName(); + } + // Http transport mode. + // We set the thread local username, in ThriftHttpServlet. + if (cliService.getHiveConf().getVar( + ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { + userName = SessionManager.getUserName(); + } + if (userName == null) { + userName = req.getUsername(); + } + + userName = getShortName(userName); + String effectiveClientUser = getProxyUser(userName, req.getConfiguration(), getIpAddress()); + LOG.debug("Client's username: " + effectiveClientUser); + return effectiveClientUser; + } + + private String getShortName(String userName) { + String ret = null; + if (userName != null) { + int indexOfDomainMatch = ServiceUtils.indexOfDomainMatch(userName); + ret = (indexOfDomainMatch <= 0) ? userName : + userName.substring(0, indexOfDomainMatch); + } + + return ret; + } + + /** + * Create a session handle + * @param req + * @param res + * @return + * @throws SparkThriftServerSQLException + * @throws LoginException + * @throws IOException + */ + SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res) + throws SparkThriftServerSQLException, LoginException, IOException { + String userName = getUserName(req); + String ipAddress = getIpAddress(); + TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION(), + req.getClient_protocol()); + res.setServerProtocolVersion(protocol); + SessionHandle sessionHandle; + if (cliService.getHiveConf().getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && + (userName != null)) { + String delegationTokenStr = getDelegationToken(userName); + sessionHandle = cliService.openSessionWithImpersonation(protocol, userName, + req.getPassword(), ipAddress, req.getConfiguration(), delegationTokenStr); + } else { + sessionHandle = cliService.openSession(protocol, userName, req.getPassword(), + ipAddress, req.getConfiguration()); + } + return sessionHandle; + } + + + private String getDelegationToken(String userName) + throws SparkThriftServerSQLException, LoginException, IOException { + if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) + .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { + return null; + } + try { + return cliService.getDelegationTokenFromMetaStore(userName); + } catch (UnsupportedOperationException e) { + // The delegation token is not applicable in the given deployment mode + } + return null; + } + + private TProtocolVersion getMinVersion(TProtocolVersion... versions) { + TProtocolVersion[] values = TProtocolVersion.values(); + int current = values[values.length - 1].getValue(); + for (TProtocolVersion version : versions) { + if (current > version.getValue()) { + current = version.getValue(); + } + } + for (TProtocolVersion version : values) { + if (version.getValue() == current) { + return version; + } + } + throw new IllegalArgumentException("never"); + } + + @Override + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws TException { + TCloseSessionResp resp = new TCloseSessionResp(); + try { + SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); + cliService.closeSession(sessionHandle); + resp.setStatus(OK_STATUS); + ThriftCLIServerContext context = + (ThriftCLIServerContext)currentServerContext.get(); + if (context != null) { + context.setSessionHandle(null); + } + } catch (Exception e) { + LOG.warn("Error closing session: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { + TGetInfoResp resp = new TGetInfoResp(); + try { + GetInfoValue getInfoValue = + cliService.getInfo(new SessionHandle(req.getSessionHandle()), + GetInfoType.getGetInfoType(req.getInfoType())); + resp.setInfoValue(getInfoValue.toTGetInfoValue()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting info: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws TException { + TExecuteStatementResp resp = new TExecuteStatementResp(); + try { + SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); + String statement = req.getStatement(); + Map confOverlay = req.getConfOverlay(); + Boolean runAsync = req.isRunAsync(); + long queryTimeout = req.getQueryTimeout(); + OperationHandle operationHandle = runAsync ? + cliService.executeStatementAsync(sessionHandle, statement, confOverlay, queryTimeout) + : cliService.executeStatement(sessionHandle, statement, confOverlay, queryTimeout); + resp.setOperationHandle(operationHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error executing statement: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws TException { + TGetTypeInfoResp resp = new TGetTypeInfoResp(); + try { + OperationHandle operationHandle = cliService.getTypeInfo(new SessionHandle(req.getSessionHandle())); + resp.setOperationHandle(operationHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting type info: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws TException { + TGetCatalogsResp resp = new TGetCatalogsResp(); + try { + OperationHandle opHandle = cliService.getCatalogs(new SessionHandle(req.getSessionHandle())); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting catalogs: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws TException { + TGetSchemasResp resp = new TGetSchemasResp(); + try { + OperationHandle opHandle = cliService.getSchemas( + new SessionHandle(req.getSessionHandle()), req.getCatalogName(), req.getSchemaName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting schemas: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetTablesResp GetTables(TGetTablesReq req) throws TException { + TGetTablesResp resp = new TGetTablesResp(); + try { + OperationHandle opHandle = cliService + .getTables(new SessionHandle(req.getSessionHandle()), req.getCatalogName(), + req.getSchemaName(), req.getTableName(), req.getTableTypes()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting tables: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws TException { + TGetTableTypesResp resp = new TGetTableTypesResp(); + try { + OperationHandle opHandle = cliService.getTableTypes(new SessionHandle(req.getSessionHandle())); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting table types: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetColumnsResp GetColumns(TGetColumnsReq req) throws TException { + TGetColumnsResp resp = new TGetColumnsResp(); + try { + OperationHandle opHandle = cliService.getColumns( + new SessionHandle(req.getSessionHandle()), + req.getCatalogName(), + req.getSchemaName(), + req.getTableName(), + req.getColumnName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting columns: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws TException { + TGetFunctionsResp resp = new TGetFunctionsResp(); + try { + OperationHandle opHandle = cliService.getFunctions( + new SessionHandle(req.getSessionHandle()), req.getCatalogName(), + req.getSchemaName(), req.getFunctionName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting functions: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws TException { + TGetOperationStatusResp resp = new TGetOperationStatusResp(); + try { + OperationStatus operationStatus = cliService.getOperationStatus( + new OperationHandle(req.getOperationHandle())); + resp.setOperationState(operationStatus.getState().toTOperationState()); + SparkThriftServerSQLException opException = operationStatus.getOperationException(); + if (opException != null) { + resp.setSqlState(opException.getSQLState()); + resp.setErrorCode(opException.getErrorCode()); + resp.setErrorMessage(opException.getMessage()); + } + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting operation status: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { + TCancelOperationResp resp = new TCancelOperationResp(); + try { + cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error cancelling operation: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws TException { + TCloseOperationResp resp = new TCloseOperationResp(); + try { + cliService.closeOperation(new OperationHandle(req.getOperationHandle())); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error closing operation: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) + throws TException { + TGetResultSetMetadataResp resp = new TGetResultSetMetadataResp(); + try { + StructType schema = cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle())); + resp.setSchema(SchemaMapper.toTTableSchema(schema)); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting result set metadata: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TFetchResultsResp FetchResults(TFetchResultsReq req) throws TException { + TFetchResultsResp resp = new TFetchResultsResp(); + try { + RowSet rowSet = cliService.fetchResults( + new OperationHandle(req.getOperationHandle()), + FetchOrientation.getFetchOrientation(req.getOrientation()), + req.getMaxRows(), + FetchType.getFetchType(req.getFetchType())); + resp.setResults(rowSet.toTRowSet()); + resp.setHasMoreRows(false); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error fetching results: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) + throws TException { + TGetPrimaryKeysResp resp = new TGetPrimaryKeysResp(); + try { + OperationHandle opHandle = cliService.getPrimaryKeys( + new SessionHandle(req.getSessionHandle()), req.getCatalogName(), + req.getSchemaName(), req.getTableName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting functions: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) + throws TException { + TGetCrossReferenceResp resp = new TGetCrossReferenceResp(); + try { + OperationHandle opHandle = cliService.getCrossReference( + new SessionHandle(req.getSessionHandle()), req.getParentCatalogName(), + req.getParentSchemaName(), req.getParentTableName(), + req.getForeignCatalogName(), req.getForeignSchemaName(), req.getForeignTableName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting functions: ", e); + resp.setStatus(SparkThriftServerSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws TException { + try { + return new TGetQueryIdResp(cliService.getQueryId(req.getOperationHandle())); + } catch (SparkThriftServerSQLException e) { + throw new TException(e); + } + } + + @Override + public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws TException { + TSetClientInfoResp resp = new TSetClientInfoResp(); + resp.setStatus(notSupportTokenErrorStatus()); + return resp; + } + + @Override + public abstract void run(); + + /** + * If the proxy user name is provided then check privileges to substitute the user. + * @param realUser + * @param sessionConf + * @param ipAddress + * @return + * @throws SparkThriftServerSQLException + */ + private String getProxyUser(String realUser, Map sessionConf, + String ipAddress) throws SparkThriftServerSQLException { + String proxyUser = null; + // Http transport mode. + // We set the thread local proxy username, in ThriftHttpServlet. + if (cliService.getHiveConf().getVar( + ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { + proxyUser = SessionManager.getProxyUserName(); + LOG.debug("Proxy user from query string: " + proxyUser); + } + + if (proxyUser == null && sessionConf != null && sessionConf.containsKey(HiveAuthFactory.HS2_PROXY_USER)) { + String proxyUserFromThriftBody = sessionConf.get(HiveAuthFactory.HS2_PROXY_USER); + LOG.debug("Proxy user from thrift body: " + proxyUserFromThriftBody); + proxyUser = proxyUserFromThriftBody; + } + + if (proxyUser == null) { + return realUser; + } + + // check whether substitution is allowed + if (!hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ALLOW_USER_SUBSTITUTION)) { + throw new SparkThriftServerSQLException("Proxy user substitution is not allowed"); + } + + // If there's no authentication, then directly substitute the user + if (HiveAuthFactory.AuthTypes.NONE.toString() + .equalsIgnoreCase(hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION))) { + return proxyUser; + } + + // Verify proxy user privilege of the realUser for the proxyUser + HiveAuthFactory.verifyProxyAccess(realUser, proxyUser, ipAddress, hiveConf); + LOG.debug("Verified proxy user: " + proxyUser); + return proxyUser; + } + + private boolean isKerberosAuthMode() { + return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) + .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java new file mode 100644 index 000000000000..74b158772c83 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java @@ -0,0 +1,505 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift; + +import java.util.List; +import java.util.Map; + +import org.apache.hadoop.conf.Configuration; +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory; +import org.apache.spark.sql.thriftserver.cli.*; +import org.apache.spark.sql.types.StructType; +import org.apache.thrift.TException; + +import com.google.common.annotations.VisibleForTesting; + +/** + * ThriftCLIServiceClient. + * + */ +public class ThriftCLIServiceClient extends CLIServiceClient { + private final TCLIService.Iface cliService; + + public ThriftCLIServiceClient(TCLIService.Iface cliService, Configuration conf) { + this.cliService = cliService; + } + + @VisibleForTesting + public ThriftCLIServiceClient(TCLIService.Iface cliService) { + this(cliService, new Configuration()); + } + + public void checkStatus(TStatus status) throws SparkThriftServerSQLException { + if (TStatusCode.ERROR_STATUS.equals(status.getStatusCode())) { + throw new SparkThriftServerSQLException(status); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) + */ + @Override + public SessionHandle openSession(String username, String password, + Map configuration) + throws SparkThriftServerSQLException { + try { + TOpenSessionReq req = new TOpenSessionReq(); + req.setUsername(username); + req.setPassword(password); + req.setConfiguration(configuration); + TOpenSessionResp resp = cliService.OpenSession(req); + checkStatus(resp.getStatus()); + return new SessionHandle(resp.getSessionHandle(), resp.getServerProtocolVersion()); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#closeSession(org.apache.spark.sql.thriftserver.cli.SessionHandle) + */ + @Override + public SessionHandle openSessionWithImpersonation(String username, String password, + Map configuration, String delegationToken) throws SparkThriftServerSQLException { + throw new SparkThriftServerSQLException("open with impersonation operation is not supported in the client"); + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#closeSession(org.apache.spark.sql.thriftserver.cli.SessionHandle) + */ + @Override + public void closeSession(SessionHandle sessionHandle) throws SparkThriftServerSQLException { + try { + TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); + TCloseSessionResp resp = cliService.CloseSession(req); + checkStatus(resp.getStatus()); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getInfo(org.apache.spark.sql.thriftserver.cli.SessionHandle, java.util.List) + */ + @Override + public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) + throws SparkThriftServerSQLException { + try { + // FIXME extract the right info type + TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); + TGetInfoResp resp = cliService.GetInfo(req); + checkStatus(resp.getStatus()); + return new GetInfoValue(resp.getInfoValue()); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + @Override + public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay) throws SparkThriftServerSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, false, 0); + } + + @Override + public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws SparkThriftServerSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, false, queryTimeout); + } + + @Override + public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay) throws SparkThriftServerSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, true, 0); + } + + @Override + public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws SparkThriftServerSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, true, queryTimeout); + } + + private OperationHandle executeStatementInternal(SessionHandle sessionHandle, String statement, + Map confOverlay, boolean isAsync, long queryTimeout) throws SparkThriftServerSQLException { + try { + TExecuteStatementReq req = + new TExecuteStatementReq(sessionHandle.toTSessionHandle(), statement); + req.setConfOverlay(confOverlay); + req.setRunAsync(isAsync); + req.setQueryTimeout(queryTimeout); + TExecuteStatementResp resp = cliService.ExecuteStatement(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getTypeInfo(org.apache.spark.sql.thriftserver.cli.SessionHandle) + */ + @Override + public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws SparkThriftServerSQLException { + try { + TGetTypeInfoReq req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle()); + TGetTypeInfoResp resp = cliService.GetTypeInfo(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getCatalogs(org.apache.spark.sql.thriftserver.cli.SessionHandle) + */ + @Override + public OperationHandle getCatalogs(SessionHandle sessionHandle) throws SparkThriftServerSQLException { + try { + TGetCatalogsReq req = new TGetCatalogsReq(sessionHandle.toTSessionHandle()); + TGetCatalogsResp resp = cliService.GetCatalogs(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getSchemas(org.apache.spark.sql.thriftserver.cli.SessionHandle, java.lang.String, java.lang.String) + */ + @Override + public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, + String schemaName) + throws SparkThriftServerSQLException { + try { + TGetSchemasReq req = new TGetSchemasReq(sessionHandle.toTSessionHandle()); + req.setCatalogName(catalogName); + req.setSchemaName(schemaName); + TGetSchemasResp resp = cliService.GetSchemas(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getTables(org.apache.spark.sql.thriftserver.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) + */ + @Override + public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, + String schemaName, String tableName, List tableTypes) + throws SparkThriftServerSQLException { + try { + TGetTablesReq req = new TGetTablesReq(sessionHandle.toTSessionHandle()); + req.setTableName(tableName); + req.setTableTypes(tableTypes); + req.setSchemaName(schemaName); + TGetTablesResp resp = cliService.GetTables(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getTableTypes(org.apache.spark.sql.thriftserver.cli.SessionHandle) + */ + @Override + public OperationHandle getTableTypes(SessionHandle sessionHandle) throws SparkThriftServerSQLException { + try { + TGetTableTypesReq req = new TGetTableTypesReq(sessionHandle.toTSessionHandle()); + TGetTableTypesResp resp = cliService.GetTableTypes(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getColumns(org.apache.spark.sql.thriftserver.cli.SessionHandle) + */ + @Override + public OperationHandle getColumns(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, String columnName) + throws SparkThriftServerSQLException { + try { + TGetColumnsReq req = new TGetColumnsReq(); + req.setSessionHandle(sessionHandle.toTSessionHandle()); + req.setCatalogName(catalogName); + req.setSchemaName(schemaName); + req.setTableName(tableName); + req.setColumnName(columnName); + TGetColumnsResp resp = cliService.GetColumns(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getFunctions(org.apache.spark.sql.thriftserver.cli.SessionHandle) + */ + @Override + public OperationHandle getFunctions(SessionHandle sessionHandle, + String catalogName, String schemaName, String functionName) throws SparkThriftServerSQLException { + try { + TGetFunctionsReq req = new TGetFunctionsReq(sessionHandle.toTSessionHandle(), functionName); + req.setCatalogName(catalogName); + req.setSchemaName(schemaName); + TGetFunctionsResp resp = cliService.GetFunctions(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getOperationStatus(org.apache.spark.sql.thriftserver.cli.OperationHandle) + */ + @Override + public OperationStatus getOperationStatus(OperationHandle opHandle) throws SparkThriftServerSQLException { + try { + TGetOperationStatusReq req = new TGetOperationStatusReq(opHandle.toTOperationHandle()); + TGetOperationStatusResp resp = cliService.GetOperationStatus(req); + // Checks the status of the RPC call, throws an exception in case of error + checkStatus(resp.getStatus()); + OperationState opState = OperationState.getOperationState(resp.getOperationState()); + SparkThriftServerSQLException opException = null; + if (opState == OperationState.ERROR) { + opException = new SparkThriftServerSQLException(resp.getErrorMessage(), resp.getSqlState(), resp.getErrorCode()); + } + return new OperationStatus(opState, opException); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#cancelOperation(org.apache.spark.sql.thriftserver.cli.OperationHandle) + */ + @Override + public void cancelOperation(OperationHandle opHandle) throws SparkThriftServerSQLException { + try { + TCancelOperationReq req = new TCancelOperationReq(opHandle.toTOperationHandle()); + TCancelOperationResp resp = cliService.CancelOperation(req); + checkStatus(resp.getStatus()); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#closeOperation(org.apache.spark.sql.thriftserver.cli.OperationHandle) + */ + @Override + public void closeOperation(OperationHandle opHandle) + throws SparkThriftServerSQLException { + try { + TCloseOperationReq req = new TCloseOperationReq(opHandle.toTOperationHandle()); + TCloseOperationResp resp = cliService.CloseOperation(req); + checkStatus(resp.getStatus()); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getResultSetMetadata(org.apache.spark.sql.thriftserver.cli.OperationHandle) + */ + @Override + public StructType getResultSetMetadata(OperationHandle opHandle) + throws SparkThriftServerSQLException { + try { + TGetResultSetMetadataReq req = new TGetResultSetMetadataReq(opHandle.toTOperationHandle()); + TGetResultSetMetadataResp resp = cliService.GetResultSetMetadata(req); + checkStatus(resp.getStatus()); + return SchemaMapper.toStructType(resp.getSchema()); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + @Override + public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows, + FetchType fetchType) throws SparkThriftServerSQLException { + try { + TFetchResultsReq req = new TFetchResultsReq(); + req.setOperationHandle(opHandle.toTOperationHandle()); + req.setOrientation(orientation.toTFetchOrientation()); + req.setMaxRows(maxRows); + req.setFetchType(fetchType.toTFetchType()); + TFetchResultsResp resp = cliService.FetchResults(req); + checkStatus(resp.getStatus()); + return RowSetFactory.create(resp.getResults(), opHandle.getProtocolVersion()); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.spark.sql.thriftserver.cli.ICLIService#fetchResults(org.apache.spark.sql.thriftserver.cli.OperationHandle) + */ + @Override + public RowSet fetchResults(OperationHandle opHandle) throws SparkThriftServerSQLException { + return fetchResults( + opHandle, FetchOrientation.FETCH_NEXT, defaultFetchRows, FetchType.QUERY_OUTPUT); + } + + @Override + public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String owner, String renewer) throws SparkThriftServerSQLException { + TGetDelegationTokenReq req = new TGetDelegationTokenReq( + sessionHandle.toTSessionHandle(), owner, renewer); + try { + TGetDelegationTokenResp tokenResp = cliService.GetDelegationToken(req); + checkStatus(tokenResp.getStatus()); + return tokenResp.getDelegationToken(); + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + @Override + public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws SparkThriftServerSQLException { + TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq( + sessionHandle.toTSessionHandle(), tokenStr); + try { + TCancelDelegationTokenResp cancelResp = + cliService.CancelDelegationToken(cancelReq); + checkStatus(cancelResp.getStatus()); + return; + } catch (TException e) { + throw new SparkThriftServerSQLException(e); + } + } + + @Override + public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws SparkThriftServerSQLException { + TRenewDelegationTokenReq cancelReq = new TRenewDelegationTokenReq( + sessionHandle.toTSessionHandle(), tokenStr); + try { + TRenewDelegationTokenResp renewResp = + cliService.RenewDelegationToken(cancelReq); + checkStatus(renewResp.getStatus()); + return; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + @Override + public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, + String catalog, String schema, String table) throws SparkThriftServerSQLException { + try { + TGetPrimaryKeysReq req = new TGetPrimaryKeysReq(sessionHandle.toTSessionHandle()); + req.setCatalogName(catalog); + req.setSchemaName(schema); + req.setTableName(table); + TGetPrimaryKeysResp resp = cliService.GetPrimaryKeys(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + @Override + public OperationHandle getCrossReference(SessionHandle sessionHandle, + String primaryCatalog, String primarySchema, String primaryTable, + String foreignCatalog, String foreignSchema, String foreignTable) + throws SparkThriftServerSQLException { + try { + TGetCrossReferenceReq req = new TGetCrossReferenceReq(sessionHandle.toTSessionHandle()); + req.setParentCatalogName(primaryCatalog); + req.setParentSchemaName(primarySchema); + req.setParentTableName(primaryTable); + req.setForeignCatalogName(foreignCatalog); + req.setForeignSchemaName(foreignSchema); + req.setForeignTableName(foreignTable); + TGetCrossReferenceResp resp = cliService.GetCrossReference(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (SparkThriftServerSQLException e) { + throw e; + } catch (Exception e) { + throw new SparkThriftServerSQLException(e); + } + } + + @Override + public String getQueryId(TOperationHandle operationHandle) throws SparkThriftServerSQLException { + try { + return cliService.GetQueryId(new TGetQueryIdReq(operationHandle)).getQueryId(); + } catch (TException e) { + throw new SparkThriftServerSQLException(e); + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.java new file mode 100644 index 000000000000..356232997f6f --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.java @@ -0,0 +1,181 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift; + +import java.util.Arrays; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.util.Shell; +import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory; +import org.apache.spark.sql.thriftserver.cli.CLIService; +import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.TServlet; +import org.eclipse.jetty.server.AbstractConnectionFactory; +import org.eclipse.jetty.server.ConnectionFactory; +import org.eclipse.jetty.server.HttpConnectionFactory; +import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.jetty.util.thread.ExecutorThreadPool; +import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; + + +public class ThriftHttpCLIService extends ThriftCLIService { + + public ThriftHttpCLIService(CLIService cliService) { + super(cliService, ThriftHttpCLIService.class.getSimpleName()); + } + + /** + * Configure Jetty to serve http requests. Example of a client connection URL: + * http://localhost:10000/servlets/thrifths2/ A gateway may cause actual target URL to differ, + * e.g. http://gateway:port/hive2/servlets/thrifths2/ + */ + @Override + public void run() { + try { + // Server thread pool + // Start with minWorkerThreads, expand till maxWorkerThreads and reject subsequent requests + String threadPoolName = "HiveServer2-HttpHandler-Pool"; + ThreadPoolExecutor executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, + workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), + new ThreadFactoryWithGarbageCleanup(threadPoolName)); + ExecutorThreadPool threadPool = new ExecutorThreadPool(executorService); + + // HTTP Server + httpServer = new org.eclipse.jetty.server.Server(threadPool); + + // Connector configs + + ConnectionFactory[] connectionFactories; + boolean useSsl = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL); + String schemeName = useSsl ? "https" : "http"; + // Change connector if SSL is used + if (useSsl) { + String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); + String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, + HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); + if (keyStorePath.isEmpty()) { + throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + + " Not configured for SSL connection"); + } + SslContextFactory sslContextFactory = new SslContextFactory.Server(); + String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(","); + LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols)); + sslContextFactory.addExcludeProtocols(excludedProtocols); + LOG.info("HTTP Server SSL: SslContextFactory.getExcludeProtocols = " + + Arrays.toString(sslContextFactory.getExcludeProtocols())); + sslContextFactory.setKeyStorePath(keyStorePath); + sslContextFactory.setKeyStorePassword(keyStorePassword); + connectionFactories = AbstractConnectionFactory.getFactories( + sslContextFactory, new HttpConnectionFactory()); + } else { + connectionFactories = new ConnectionFactory[] { new HttpConnectionFactory() }; + } + ServerConnector connector = new ServerConnector( + httpServer, + null, + // Call this full constructor to set this, which forces daemon threads: + new ScheduledExecutorScheduler("HiveServer2-HttpHandler-JettyScheduler", true), + null, + -1, + -1, + connectionFactories); + + connector.setPort(portNum); + // Linux:yes, Windows:no + connector.setReuseAddress(!Shell.WINDOWS); + int maxIdleTime = (int) hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_MAX_IDLE_TIME, + TimeUnit.MILLISECONDS); + connector.setIdleTimeout(maxIdleTime); + + httpServer.addConnector(connector); + + // Thrift configs + hiveAuthFactory = new HiveAuthFactory(hiveConf); + TProcessor processor = new TCLIService.Processor(this); + TProtocolFactory protocolFactory = new TBinaryProtocol.Factory(); + // Set during the init phase of HiveServer2 if auth mode is kerberos + // UGI for the hive/_HOST (kerberos) principal + UserGroupInformation serviceUGI = cliService.getServiceUGI(); + // UGI for the http/_HOST (SPNego) principal + UserGroupInformation httpUGI = cliService.getHttpUGI(); + String authType = hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION); + TServlet thriftHttpServlet = new ThriftHttpServlet(processor, protocolFactory, authType, + serviceUGI, httpUGI, hiveAuthFactory); + + // Context handler + final ServletContextHandler context = new ServletContextHandler( + ServletContextHandler.SESSIONS); + context.setContextPath("/"); + String httpPath = getHttpPath(hiveConf + .getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH)); + httpServer.setHandler(context); + context.addServlet(new ServletHolder(thriftHttpServlet), httpPath); + + // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc. + // Finally, start the server + httpServer.start(); + String msg = "Started " + ThriftHttpCLIService.class.getSimpleName() + " in " + schemeName + + " mode on port " + portNum + " path=" + httpPath + " with " + minWorkerThreads + "..." + + maxWorkerThreads + " worker threads"; + LOG.info(msg); + httpServer.join(); + } catch (Throwable t) { + LOG.error( + "Error starting HiveServer2: could not start " + + ThriftHttpCLIService.class.getSimpleName(), t); + System.exit(-1); + } + } + + /** + * The config parameter can be like "path", "/path", "/path/", "path/*", "/path1/path2/*" and so on. + * httpPath should end up as "/*", "/path/*" or "/path1/../pathN/*" + * @param httpPath + * @return + */ + private String getHttpPath(String httpPath) { + if(httpPath == null || httpPath.equals("")) { + httpPath = "/*"; + } + else { + if(!httpPath.startsWith("/")) { + httpPath = "/" + httpPath; + } + if(httpPath.endsWith("/")) { + httpPath = httpPath + "*"; + } + if(!httpPath.endsWith("/*")) { + httpPath = httpPath + "/*"; + } + } + return httpPath; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.java new file mode 100644 index 000000000000..33c113159006 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.java @@ -0,0 +1,562 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli.thrift; + +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.PrivilegedExceptionAction; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import javax.servlet.ServletException; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.core.NewCookie; + +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.codec.binary.StringUtils; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.shims.HadoopShims.KerberosNameShim; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.spark.sql.thriftserver.CookieSigner; +import org.apache.spark.sql.thriftserver.auth.*; +import org.apache.spark.sql.thriftserver.auth.AuthenticationProviderFactory.AuthMethods; +import org.apache.spark.sql.thriftserver.cli.SparkThriftServerSQLException; +import org.apache.spark.sql.thriftserver.cli.session.SessionManager; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.TServlet; +import org.ietf.jgss.GSSContext; +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSException; +import org.ietf.jgss.GSSManager; +import org.ietf.jgss.GSSName; +import org.ietf.jgss.Oid; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * + * ThriftHttpServlet + * + */ +public class ThriftHttpServlet extends TServlet { + + private static final long serialVersionUID = 1L; + public static final Logger LOG = LoggerFactory.getLogger(ThriftHttpServlet.class.getName()); + private final String authType; + private final UserGroupInformation serviceUGI; + private final UserGroupInformation httpUGI; + private HiveConf hiveConf = new HiveConf(); + + // Class members for cookie based authentication. + private CookieSigner signer; + public static final String AUTH_COOKIE = "hive.server2.auth"; + private static final Random RAN = new Random(); + private boolean isCookieAuthEnabled; + private String cookieDomain; + private String cookiePath; + private int cookieMaxAge; + private boolean isCookieSecure; + private boolean isHttpOnlyCookie; + private final HiveAuthFactory hiveAuthFactory; + private static final String HIVE_DELEGATION_TOKEN_HEADER = "X-Hive-Delegation-Token"; + + public ThriftHttpServlet(TProcessor processor, TProtocolFactory protocolFactory, + String authType, UserGroupInformation serviceUGI, UserGroupInformation httpUGI, + HiveAuthFactory hiveAuthFactory) { + super(processor, protocolFactory); + this.authType = authType; + this.serviceUGI = serviceUGI; + this.httpUGI = httpUGI; + this.hiveAuthFactory = hiveAuthFactory; + this.isCookieAuthEnabled = hiveConf.getBoolVar( + ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_AUTH_ENABLED); + // Initialize the cookie based authentication related variables. + if (isCookieAuthEnabled) { + // Generate the signer with secret. + String secret = Long.toString(RAN.nextLong()); + LOG.debug("Using the random number as the secret for cookie generation " + secret); + this.signer = new CookieSigner(secret.getBytes()); + this.cookieMaxAge = (int) hiveConf.getTimeVar( + ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_MAX_AGE, TimeUnit.SECONDS); + this.cookieDomain = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_DOMAIN); + this.cookiePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_PATH); + this.isCookieSecure = hiveConf.getBoolVar( + ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_SECURE); + this.isHttpOnlyCookie = hiveConf.getBoolVar( + ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_HTTPONLY); + } + } + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + String clientUserName = null; + String clientIpAddress; + boolean requireNewCookie = false; + + try { + // If the cookie based authentication is already enabled, parse the + // request and validate the request cookies. + if (isCookieAuthEnabled) { + clientUserName = validateCookie(request); + requireNewCookie = (clientUserName == null); + if (requireNewCookie) { + LOG.info("Could not validate cookie sent, will try to generate a new cookie"); + } + } + // If the cookie based authentication is not enabled or the request does + // not have a valid cookie, use the kerberos or password based authentication + // depending on the server setup. + if (clientUserName == null) { + // For a kerberos setup + if (isKerberosAuthMode(authType)) { + String delegationToken = request.getHeader(HIVE_DELEGATION_TOKEN_HEADER); + // Each http request must have an Authorization header + if ((delegationToken != null) && (!delegationToken.isEmpty())) { + clientUserName = doTokenAuth(request, response); + } else { + clientUserName = doKerberosAuth(request); + } + } + // For password based authentication + else { + clientUserName = doPasswdAuth(request, authType); + } + } + LOG.debug("Client username: " + clientUserName); + + // Set the thread local username to be used for doAs if true + SessionManager.setUserName(clientUserName); + + // find proxy user if any from query param + String doAsQueryParam = getDoAsQueryParam(request.getQueryString()); + if (doAsQueryParam != null) { + SessionManager.setProxyUserName(doAsQueryParam); + } + + clientIpAddress = request.getRemoteAddr(); + LOG.debug("Client IP Address: " + clientIpAddress); + // Set the thread local ip address + SessionManager.setIpAddress(clientIpAddress); + // Generate new cookie and add it to the response + if (requireNewCookie && + !authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { + String cookieToken = HttpAuthUtils.createCookieToken(clientUserName); + Cookie hs2Cookie = createCookie(signer.signCookie(cookieToken)); + + if (isHttpOnlyCookie) { + response.setHeader("SET-COOKIE", getHttpOnlyCookieHeader(hs2Cookie)); + } else { + response.addCookie(hs2Cookie); + } + LOG.info("Cookie added for clientUserName " + clientUserName); + } + super.doPost(request, response); + } + catch (HttpAuthenticationException e) { + LOG.error("Error: ", e); + // Send a 401 to the client + response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); + if(isKerberosAuthMode(authType)) { + response.addHeader(HttpAuthUtils.WWW_AUTHENTICATE, HttpAuthUtils.NEGOTIATE); + } + response.getWriter().println("Authentication Error: " + e.getMessage()); + } + finally { + // Clear the thread locals + SessionManager.clearUserName(); + SessionManager.clearIpAddress(); + SessionManager.clearProxyUserName(); + } + } + + /** + * Retrieves the client name from cookieString. If the cookie does not + * correspond to a valid client, the function returns null. + * @param cookies HTTP Request cookies. + * @return Client Username if cookieString has a HS2 Generated cookie that is currently valid. + * Else, returns null. + */ + private String getClientNameFromCookie(Cookie[] cookies) { + // Current Cookie Name, Current Cookie Value + String currName, currValue; + + // Following is the main loop which iterates through all the cookies send by the client. + // The HS2 generated cookies are of the format hive.server2.auth= + // A cookie which is identified as a hiveserver2 generated cookie is validated + // by calling signer.verifyAndExtract(). If the validation passes, send the + // username for which the cookie is validated to the caller. If no client side + // cookie passes the validation, return null to the caller. + for (Cookie currCookie : cookies) { + // Get the cookie name + currName = currCookie.getName(); + if (!currName.equals(AUTH_COOKIE)) { + // Not a HS2 generated cookie, continue. + continue; + } + // If we reached here, we have match for HS2 generated cookie + currValue = currCookie.getValue(); + // Validate the value. + currValue = signer.verifyAndExtract(currValue); + // Retrieve the user name, do the final validation step. + if (currValue != null) { + String userName = HttpAuthUtils.getUserNameFromCookieToken(currValue); + + if (userName == null) { + LOG.warn("Invalid cookie token " + currValue); + continue; + } + //We have found a valid cookie in the client request. + if (LOG.isDebugEnabled()) { + LOG.debug("Validated the cookie for user " + userName); + } + return userName; + } + } + // No valid HS2 generated cookies found, return null + return null; + } + + /** + * Convert cookie array to human readable cookie string + * @param cookies Cookie Array + * @return String containing all the cookies separated by a newline character. + * Each cookie is of the format [key]=[value] + */ + private String toCookieStr(Cookie[] cookies) { + String cookieStr = ""; + + for (Cookie c : cookies) { + cookieStr += c.getName() + "=" + c.getValue() + " ;\n"; + } + return cookieStr; + } + + /** + * Validate the request cookie. This function iterates over the request cookie headers + * and finds a cookie that represents a valid client/server session. If it finds one, it + * returns the client name associated with the session. Else, it returns null. + * @param request The HTTP Servlet Request send by the client + * @return Client Username if the request has valid HS2 cookie, else returns null + * @throws UnsupportedEncodingException + */ + private String validateCookie(HttpServletRequest request) throws UnsupportedEncodingException { + // Find all the valid cookies associated with the request. + Cookie[] cookies = request.getCookies(); + + if (cookies == null) { + if (LOG.isDebugEnabled()) { + LOG.debug("No valid cookies associated with the request " + request); + } + return null; + } + if (LOG.isDebugEnabled()) { + LOG.debug("Received cookies: " + toCookieStr(cookies)); + } + return getClientNameFromCookie(cookies); + } + + /** + * Generate a server side cookie given the cookie value as the input. + * @param str Input string token. + * @return The generated cookie. + * @throws UnsupportedEncodingException + */ + private Cookie createCookie(String str) throws UnsupportedEncodingException { + if (LOG.isDebugEnabled()) { + LOG.debug("Cookie name = " + AUTH_COOKIE + " value = " + str); + } + Cookie cookie = new Cookie(AUTH_COOKIE, str); + + cookie.setMaxAge(cookieMaxAge); + if (cookieDomain != null) { + cookie.setDomain(cookieDomain); + } + if (cookiePath != null) { + cookie.setPath(cookiePath); + } + cookie.setSecure(isCookieSecure); + return cookie; + } + + /** + * Generate httponly cookie from HS2 cookie + * @param cookie HS2 generated cookie + * @return The httponly cookie + */ + private static String getHttpOnlyCookieHeader(Cookie cookie) { + NewCookie newCookie = new NewCookie(cookie.getName(), cookie.getValue(), + cookie.getPath(), cookie.getDomain(), cookie.getVersion(), + cookie.getComment(), cookie.getMaxAge(), cookie.getSecure()); + return newCookie + "; HttpOnly"; + } + + /** + * Do the LDAP/PAM authentication + * @param request + * @param authType + * @throws HttpAuthenticationException + */ + private String doPasswdAuth(HttpServletRequest request, String authType) + throws HttpAuthenticationException { + String userName = getUsername(request, authType); + // No-op when authType is NOSASL + if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { + try { + AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); + PasswdAuthenticationProvider provider = + AuthenticationProviderFactory.getAuthenticationProvider(authMethod); + provider.authenticate(userName, getPassword(request, authType)); + + } catch (Exception e) { + throw new HttpAuthenticationException(e); + } + } + return userName; + } + + private String doTokenAuth(HttpServletRequest request, HttpServletResponse response) + throws HttpAuthenticationException { + String tokenStr = request.getHeader(HIVE_DELEGATION_TOKEN_HEADER); + try { + return hiveAuthFactory.verifyDelegationToken(tokenStr); + } catch (SparkThriftServerSQLException e) { + throw new HttpAuthenticationException(e); + } + } + + /** + * Do the GSS-API kerberos authentication. + * We already have a logged in subject in the form of serviceUGI, + * which GSS-API will extract information from. + * In case of a SPNego request we use the httpUGI, + * for the authenticating service tickets. + * @param request + * @return + * @throws HttpAuthenticationException + */ + private String doKerberosAuth(HttpServletRequest request) + throws HttpAuthenticationException { + // Try authenticating with the http/_HOST principal + if (httpUGI != null) { + try { + return httpUGI.doAs(new HttpKerberosServerAction(request, httpUGI)); + } catch (Exception e) { + LOG.info("Failed to authenticate with http/_HOST kerberos principal, " + + "trying with hive/_HOST kerberos principal"); + } + } + // Now try with hive/_HOST principal + try { + return serviceUGI.doAs(new HttpKerberosServerAction(request, serviceUGI)); + } catch (Exception e) { + LOG.error("Failed to authenticate with hive/_HOST kerberos principal"); + throw new HttpAuthenticationException(e); + } + + } + + class HttpKerberosServerAction implements PrivilegedExceptionAction { + HttpServletRequest request; + UserGroupInformation serviceUGI; + + HttpKerberosServerAction(HttpServletRequest request, + UserGroupInformation serviceUGI) { + this.request = request; + this.serviceUGI = serviceUGI; + } + + @Override + public String run() throws HttpAuthenticationException { + // Get own Kerberos credentials for accepting connection + GSSManager manager = GSSManager.getInstance(); + GSSContext gssContext = null; + String serverPrincipal = getPrincipalWithoutRealm( + serviceUGI.getUserName()); + try { + // This Oid for Kerberos GSS-API mechanism. + Oid kerberosMechOid = new Oid("1.2.840.113554.1.2.2"); + // Oid for SPNego GSS-API mechanism. + Oid spnegoMechOid = new Oid("1.3.6.1.5.5.2"); + // Oid for kerberos principal name + Oid krb5PrincipalOid = new Oid("1.2.840.113554.1.2.2.1"); + + // GSS name for server + GSSName serverName = manager.createName(serverPrincipal, krb5PrincipalOid); + + // GSS credentials for server + GSSCredential serverCreds = manager.createCredential(serverName, + GSSCredential.DEFAULT_LIFETIME, + new Oid[]{kerberosMechOid, spnegoMechOid}, + GSSCredential.ACCEPT_ONLY); + + // Create a GSS context + gssContext = manager.createContext(serverCreds); + // Get service ticket from the authorization header + String serviceTicketBase64 = getAuthHeader(request, authType); + byte[] inToken = Base64.decodeBase64(serviceTicketBase64.getBytes()); + gssContext.acceptSecContext(inToken, 0, inToken.length); + // Authenticate or deny based on its context completion + if (!gssContext.isEstablished()) { + throw new HttpAuthenticationException("Kerberos authentication failed: " + + "unable to establish context with the service ticket " + + "provided by the client."); + } + else { + return getPrincipalWithoutRealmAndHost(gssContext.getSrcName().toString()); + } + } + catch (GSSException e) { + throw new HttpAuthenticationException("Kerberos authentication failed: ", e); + } + finally { + if (gssContext != null) { + try { + gssContext.dispose(); + } catch (GSSException e) { + // No-op + } + } + } + } + + private String getPrincipalWithoutRealm(String fullPrincipal) + throws HttpAuthenticationException { + KerberosNameShim fullKerberosName; + try { + fullKerberosName = ShimLoader.getHadoopShims().getKerberosNameShim(fullPrincipal); + } catch (IOException e) { + throw new HttpAuthenticationException(e); + } + String serviceName = fullKerberosName.getServiceName(); + String hostName = fullKerberosName.getHostName(); + String principalWithoutRealm = serviceName; + if (hostName != null) { + principalWithoutRealm = serviceName + "/" + hostName; + } + return principalWithoutRealm; + } + + private String getPrincipalWithoutRealmAndHost(String fullPrincipal) + throws HttpAuthenticationException { + KerberosNameShim fullKerberosName; + try { + fullKerberosName = ShimLoader.getHadoopShims().getKerberosNameShim(fullPrincipal); + return fullKerberosName.getShortName(); + } catch (IOException e) { + throw new HttpAuthenticationException(e); + } + } + } + + private String getUsername(HttpServletRequest request, String authType) + throws HttpAuthenticationException { + String[] creds = getAuthHeaderTokens(request, authType); + // Username must be present + if (creds[0] == null || creds[0].isEmpty()) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client does not contain username."); + } + return creds[0]; + } + + private String getPassword(HttpServletRequest request, String authType) + throws HttpAuthenticationException { + String[] creds = getAuthHeaderTokens(request, authType); + // Password must be present + if (creds[1] == null || creds[1].isEmpty()) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client does not contain username."); + } + return creds[1]; + } + + private String[] getAuthHeaderTokens(HttpServletRequest request, + String authType) throws HttpAuthenticationException { + String authHeaderBase64 = getAuthHeader(request, authType); + String authHeaderString = StringUtils.newStringUtf8( + Base64.decodeBase64(authHeaderBase64.getBytes())); + String[] creds = authHeaderString.split(":"); + return creds; + } + + /** + * Returns the base64 encoded auth header payload + * @param request + * @param authType + * @return + * @throws HttpAuthenticationException + */ + private String getAuthHeader(HttpServletRequest request, String authType) + throws HttpAuthenticationException { + String authHeader = request.getHeader(HttpAuthUtils.AUTHORIZATION); + // Each http request must have an Authorization header + if (authHeader == null || authHeader.isEmpty()) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client is empty."); + } + + String authHeaderBase64String; + int beginIndex; + if (isKerberosAuthMode(authType)) { + beginIndex = (HttpAuthUtils.NEGOTIATE + " ").length(); + } + else { + beginIndex = (HttpAuthUtils.BASIC + " ").length(); + } + authHeaderBase64String = authHeader.substring(beginIndex); + // Authorization header must have a payload + if (authHeaderBase64String == null || authHeaderBase64String.isEmpty()) { + throw new HttpAuthenticationException("Authorization header received " + + "from the client does not contain any data."); + } + return authHeaderBase64String; + } + + private boolean isKerberosAuthMode(String authType) { + return authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); + } + + private static String getDoAsQueryParam(String queryString) { + if (LOG.isDebugEnabled()) { + LOG.debug("URL query string:" + queryString); + } + if (queryString == null) { + return null; + } + Map params = javax.servlet.http.HttpUtils.parseQueryString( queryString ); + Set keySet = params.keySet(); + for (String key: keySet) { + if (key.equalsIgnoreCase("doAs")) { + return params.get(key)[0]; + } + } + return null; + } + +} + + diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.java new file mode 100644 index 000000000000..d95f6723b3ee --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.java @@ -0,0 +1,71 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.cli.utils; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.SystemVariables; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Map; + +public class VariableSubstitution extends SystemVariables { + private static final Logger l4j = LoggerFactory.getLogger(VariableSubstitution.class); + + private final Map hiveVariableSource; + + public VariableSubstitution(Map hiveVariableSource) { + this.hiveVariableSource = hiveVariableSource; + } + + /** + * The super method will handle with the case of substitutions for system variables, + * hive conf variables and env variables. In this method, it will retrieve the hive + * variables using hiveVariableSource. + * + * @param conf + * @param var + * @return + */ + @Override + protected String getSubstitute(Configuration conf, String var) { + String val = super.getSubstitute(conf, var); + if (val == null && hiveVariableSource != null) { + if (var.startsWith(HIVEVAR_PREFIX)) { + val = hiveVariableSource.get(var.substring(HIVEVAR_PREFIX.length())); + } else { + val = hiveVariableSource.get(var); + } + } + return val; + } + + public String substitute(HiveConf conf, String expr) { + if (expr == null) { + return expr; + } + if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVEVARIABLESUBSTITUTE)) { + l4j.debug("Substitution is on: " + expr); + } else { + return expr; + } + int depth = HiveConf.getIntVar(conf, HiveConf.ConfVars.HIVEVARIABLESUBSTITUTEDEPTH); + return substitute(conf, expr, depth); + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala deleted file mode 100644 index 448cb525ea66..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/SparkThriftServer2.scala +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver - -import scala.collection.JavaConverters._ -import scala.collection.mutable -import scala.collection.mutable.ArrayBuffer - -import org.apache.hadoop.hive.conf.HiveConf - -import org.apache.spark.SparkContext -import org.apache.spark.annotation.DeveloperApi -import org.apache.spark.internal.Logging -import org.apache.spark.internal.config.UI.UI_ENABLED -import org.apache.spark.scheduler.{SparkListener, SparkListenerApplicationEnd, SparkListenerJobStart} -import org.apache.spark.sql.SQLContext -import org.apache.spark.sql.hive.HiveUtils -import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.thriftserver.server.SparkThriftServer -import org.apache.spark.sql.thriftserver.ui.ThriftServerTab -import org.apache.spark.util.{ShutdownHookManager, Utils} - - - -/** - * The main entry point for the Spark SQL port of HiveServer2. Starts up a `SparkSQLContext` and a - * `HiveThriftServer2` thrift server. - */ -object SparkThriftServer2 extends Logging { - var uiTab: Option[ThriftServerTab] = None - var listener: SparkThriftServerListener = _ - - def hiveConfForExecution(sparkContext: SparkContext): HiveConf = { - val extraConfig = HiveUtils.newTemporaryConfiguration(true) - val hiveConf: HiveConf = new HiveConf() - (sparkContext.hadoopConfiguration - .iterator().asScala.map(kv => kv.getKey -> kv.getValue) - ++ sparkContext.conf.getAll.toMap ++ extraConfig).toMap - .foreach { case (k, v) => hiveConf.set(k, v) } - hiveConf - } - - /** - * :: DeveloperApi :: - * Starts a new thrift server with the given context. - */ - @DeveloperApi - def startWithContext(sqlContext: SQLContext): SparkThriftServer = { - val server = new SparkThriftServer(sqlContext) - - server.init(hiveConfForExecution(sqlContext.sparkContext)) - server.start() - listener = new SparkThriftServerListener(server, sqlContext.conf) - sqlContext.sparkContext.addSparkListener(listener) - uiTab = if (sqlContext.sparkContext.getConf.get(UI_ENABLED)) { - Some(new ThriftServerTab(sqlContext.sparkContext)) - } else { - None - } - server - } - - def main(args: Array[String]) { - // If the arguments contains "-h" or "--help", print out the usage and exit. - if (args.contains("-h") || args.contains("--help")) { - SparkThriftServer.main(args) - // The following code should not be reachable. It is added to ensure the main function exits. - return - } - - Utils.initDaemon(log) - val optionsProcessor = new SparkThriftServer.ServerOptionsProcessor("HiveThriftServer2") - optionsProcessor.parse(args) - - logInfo("Starting SparkContext") - SparkSQLEnv.init() - - ShutdownHookManager.addShutdownHook { () => - SparkSQLEnv.stop() - uiTab.foreach(_.detach()) - } - - try { - val server = new SparkThriftServer(SparkSQLEnv.sqlContext) - server.init(hiveConfForExecution(SparkSQLEnv.sparkContext)) - server.start() - logInfo("HiveThriftServer2 started") - listener = new SparkThriftServerListener(server, SparkSQLEnv.sqlContext.conf) - SparkSQLEnv.sparkContext.addSparkListener(listener) - uiTab = if (SparkSQLEnv.sparkContext.getConf.get(UI_ENABLED)) { - Some(new ThriftServerTab(SparkSQLEnv.sparkContext)) - } else { - - None - } - // If application was killed before HiveThriftServer2 start successfully then SparkSubmit - // process can not exit, so check whether if SparkContext was stopped. - if (SparkSQLEnv.sparkContext.stopped.get()) { - logError("SparkContext has stopped even if HiveServer2 has started, so exit") - System.exit(-1) - } - } catch { - case e: Exception => - logError("Error starting HiveThriftServer2", e) - System.exit(-1) - } - } - - private[thriftserver] class SessionInfo( - val sessionId: String, - val startTimestamp: Long, - val ip: String, - val userName: String) { - var finishTimestamp: Long = 0L - var totalExecution: Int = 0 - - def totalTime: Long = { - if (finishTimestamp == 0L) { - System.currentTimeMillis - startTimestamp - } else { - finishTimestamp - startTimestamp - } - } - } - - private[thriftserver] object ExecutionState extends Enumeration { - val STARTED, CANCELED, COMPILED, FAILED, FINISHED, CLOSED = Value - type ExecutionState = Value - } - - private[thriftserver] class ExecutionInfo( - val statement: String, - val sessionId: String, - val startTimestamp: Long, - val userName: String) { - var finishTimestamp: Long = 0L - var closeTimestamp: Long = 0L - var executePlan: String = "" - var detail: String = "" - var state: ExecutionState.Value = ExecutionState.STARTED - val jobId: ArrayBuffer[String] = ArrayBuffer[String]() - var groupId: String = "" - - def totalTime(endTime: Long): Long = { - if (endTime == 0L) { - System.currentTimeMillis - startTimestamp - } else { - endTime - startTimestamp - } - } - } - - - /** - * An inner sparkListener called in sc.stop to clean up the HiveThriftServer2 - */ - private[thriftserver] class SparkThriftServerListener(val server: SparkThriftServer, - val conf: SQLConf) extends SparkListener { - - override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd): Unit = { - server.stop() - } - - private val sessionList = new mutable.LinkedHashMap[String, SessionInfo] - private val executionList = new mutable.LinkedHashMap[String, ExecutionInfo] - private val retainedStatements = conf.getConf(SQLConf.THRIFTSERVER_UI_STATEMENT_LIMIT) - private val retainedSessions = conf.getConf(SQLConf.THRIFTSERVER_UI_SESSION_LIMIT) - - def getOnlineSessionNum: Int = synchronized { - sessionList.count(_._2.finishTimestamp == 0) - } - - def isExecutionActive(execInfo: ExecutionInfo): Boolean = { - !(execInfo.state == ExecutionState.FAILED || - execInfo.state == ExecutionState.CANCELED || - execInfo.state == ExecutionState.CLOSED) - } - - /** - * When an error or a cancellation occurs, we set the finishTimestamp of the statement. - * Therefore, when we count the number of running statements, we need to exclude errors and - * cancellations and count all statements that have not been closed so far. - */ - def getTotalRunning: Int = synchronized { - executionList.count { - case (_, v) => isExecutionActive(v) - } - } - - def getSessionList: Seq[SessionInfo] = synchronized { - sessionList.values.toSeq - } - - def getSession(sessionId: String): Option[SessionInfo] = synchronized { - sessionList.get(sessionId) - } - - def getExecutionList: Seq[ExecutionInfo] = synchronized { - executionList.values.toSeq - } - - override def onJobStart(jobStart: SparkListenerJobStart): Unit = synchronized { - for { - props <- Option(jobStart.properties) - groupId <- Option(props.getProperty(SparkContext.SPARK_JOB_GROUP_ID)) - (_, info) <- executionList if info.groupId == groupId - } { - info.jobId += jobStart.jobId.toString - info.groupId = groupId - } - } - - def onSessionCreated(ip: String, sessionId: String, userName: String = "UNKNOWN"): Unit = { - synchronized { - val info = new SessionInfo(sessionId, System.currentTimeMillis, ip, userName) - sessionList.put(sessionId, info) - trimSessionIfNecessary() - } - } - - def onSessionClosed(sessionId: String): Unit = synchronized { - sessionList(sessionId).finishTimestamp = System.currentTimeMillis - trimSessionIfNecessary() - } - - def onStatementStart( - id: String, - sessionId: String, - statement: String, - groupId: String, - userName: String = "UNKNOWN"): Unit = synchronized { - val info = new ExecutionInfo(statement, sessionId, System.currentTimeMillis, userName) - info.state = ExecutionState.STARTED - executionList.put(id, info) - trimExecutionIfNecessary() - sessionList(sessionId).totalExecution += 1 - executionList(id).groupId = groupId - } - - def onStatementParsed(id: String, executionPlan: String): Unit = synchronized { - executionList(id).executePlan = executionPlan - executionList(id).state = ExecutionState.COMPILED - } - - def onStatementCanceled(id: String): Unit = synchronized { - executionList(id).finishTimestamp = System.currentTimeMillis - executionList(id).state = ExecutionState.CANCELED - trimExecutionIfNecessary() - } - - def onStatementError(id: String, errorMsg: String, errorTrace: String): Unit = synchronized { - executionList(id).finishTimestamp = System.currentTimeMillis - executionList(id).detail = errorMsg - executionList(id).state = ExecutionState.FAILED - trimExecutionIfNecessary() - } - - def onStatementFinish(id: String): Unit = synchronized { - executionList(id).finishTimestamp = System.currentTimeMillis - executionList(id).state = ExecutionState.FINISHED - trimExecutionIfNecessary() - } - - def onOperationClosed(id: String): Unit = synchronized { - executionList(id).closeTimestamp = System.currentTimeMillis - executionList(id).state = ExecutionState.CLOSED - } - - private def trimExecutionIfNecessary() = { - if (executionList.size > retainedStatements) { - val toRemove = math.max(retainedStatements / 10, 1) - executionList.filter(_._2.finishTimestamp != 0).take(toRemove).foreach { s => - executionList.remove(s._1) - } - } - } - - private def trimSessionIfNecessary() = { - if (sessionList.size > retainedSessions) { - val toRemove = math.max(retainedSessions / 10, 1) - sessionList.filter(_._2.finishTimestamp != 0).take(toRemove).foreach { s => - sessionList.remove(s._1) - } - } - - } - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala deleted file mode 100644 index e288e9346dba..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HiveAuthFactory.scala +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.auth - -import java.io.IOException -import java.lang.reflect.{Field, Method} -import java.net.{InetSocketAddress, UnknownHostException} -import java.util -import java.util.{Locale, Objects} -import javax.net.ssl.SSLServerSocket -import javax.security.auth.login.LoginException -import javax.security.sasl.Sasl - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.apache.hadoop.hive.metastore.HiveMetaStore -import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler -import org.apache.hadoop.hive.metastore.api.MetaException -import org.apache.hadoop.hive.shims.ShimLoader -import org.apache.hadoop.hive.thrift.{DBTokenStore, HadoopThriftAuthBridge} -import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server.ServerMode -import org.apache.hadoop.security.{SecurityUtil, UserGroupInformation} -import org.apache.hadoop.security.authorize.ProxyUsers -import org.apache.thrift.TProcessorFactory -import org.apache.thrift.transport._ - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.ReflectionUtils -import org.apache.spark.sql.thriftserver.cli.SparkThriftServerSQLException -import org.apache.spark.sql.thriftserver.cli.thrift.ThriftCLIService - - -class HiveAuthFactory extends Logging { - - import HiveAuthFactory._ - - private var saslServer: HadoopThriftAuthBridge.Server = null - private var delegationTokenManager: ThriftserverDelegationTokenManager = null - private var authTypeStr: String = null - private var transportMode: String = null - private var conf: HiveConf = null - - - def this(hiveConf: HiveConf) { - this() - this.conf = hiveConf - transportMode = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE) - authTypeStr = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION) - - // In http mode we use NOSASL as the default auth type - if ("http".equalsIgnoreCase(transportMode)) { - if (authTypeStr == null) { - authTypeStr = NOSASL.getAuthName - } else { - if (authTypeStr == null) { - authTypeStr = NONE.getAuthName - } - if (authTypeStr.equalsIgnoreCase(KERBEROS.getAuthName)) { - val principal = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL) - val keytab = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB) - if (needUgiLogin(UserGroupInformation.getCurrentUser, - SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keytab)) { - saslServer = ShimLoader.getHadoopThriftAuthBridge.createServer(principal, keytab) - } else { // Using the default constructor to avoid unnecessary UGI login. - saslServer = new HadoopThriftAuthBridge.Server - } - - delegationTokenManager = new ThriftserverDelegationTokenManager() - // start delegation token manager - try { // rawStore is only necessary for DBTokenStore - var rawStore: Any = null - val tokenStoreClass = - conf.getVar(HiveConf.ConfVars.METASTORE_CLUSTER_DELEGATION_TOKEN_STORE_CLS) - if (tokenStoreClass == classOf[DBTokenStore].getName) { - val baseHandler: HMSHandler = - new HiveMetaStore.HMSHandler("new db based metaserver", conf, true) - rawStore = baseHandler.getMS - } - delegationTokenManager - .startDelegationTokenSecretManager(conf, rawStore, ServerMode.HIVESERVER2) - ReflectionUtils.setSuperField(saslServer, "secretManager", delegationTokenManager) - } catch { - case e@(_: MetaException | _: IOException) => - throw new TTransportException("Failed to start token manager", e) - } - } - } - } - } - - def getSaslProperties: util.HashMap[String, String] = { - val saslProps = new util.HashMap[String, String]; - val saslQOP = SaslQOP.fromString(conf.getVar(ConfVars.HIVE_SERVER2_THRIFT_SASL_QOP)) - saslProps.put(Sasl.QOP, saslQOP.toString) - saslProps.put(Sasl.SERVER_AUTH, "true") - saslProps - } - - @throws[LoginException] - def getAuthTransFactory: TTransportFactory = { - var transportFactory: TTransportFactory = null - if (authTypeStr.equalsIgnoreCase(KERBEROS.getAuthName)) { - try { - transportFactory = saslServer.createTransportFactory(getSaslProperties) - } catch { - case e: TTransportException => - throw new LoginException(e.getMessage) - } - } else if (authTypeStr.equalsIgnoreCase(NONE.getAuthName)) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) - } else if (authTypeStr.equalsIgnoreCase(LDAP.getAuthName)) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) - } else if (authTypeStr.equalsIgnoreCase(PAM.getAuthName)) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) - } else if (authTypeStr.equalsIgnoreCase(NOSASL.getAuthName)) { - transportFactory = new TTransportFactory() - } else if (authTypeStr.equalsIgnoreCase(CUSTOM.getAuthName)) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr) - } else { - throw new LoginException("Unsupported authentication type " + authTypeStr) - } - transportFactory - } - - /** - * Returns the thrift processor factory for HiveServer2 running in binary mode - * - * @param service - * @return - * @throws LoginException - */ - @throws[LoginException] - def getAuthProcFactory(service: ThriftCLIService): TProcessorFactory = { - if (authTypeStr.equalsIgnoreCase(KERBEROS.getAuthName)) { - KerberosSaslHelper.getKerberosProcessorFactory(saslServer, service) - } else { - PlainSaslHelper.getPlainProcessorFactory(service) - } - } - - def getRemoteUser: String = { - if (saslServer == null) { - null - } else { - saslServer.getRemoteUser - } - } - - def getIpAddress: String = { - if (saslServer == null || saslServer.getRemoteAddress == null) { - null - } else { - saslServer.getRemoteAddress.getHostAddress - } - } - - - def getSocketTransport(host: String, port: Int, loginTimeout: Int): TSocket = { - new TSocket(host, port, loginTimeout) - } - - // retrieve delegation token for the given user - @throws[SparkThriftServerSQLException] - def getDelegationToken(owner: String, renewer: String, remoteAddr: String): String = { - if (delegationTokenManager == null) { - throw new SparkThriftServerSQLException("Delegation token only supported " + - "over kerberos authentication", "08S01") - } - try { - val tokenStr = - delegationTokenManager.getDelegationTokenWithService( - owner, - renewer, - HS2_CLIENT_TOKEN, - remoteAddr) - if (tokenStr == null || tokenStr.isEmpty) { - throw new SparkThriftServerSQLException("Received empty retrieving " + - "delegation token for user " + owner, "08S01") - } - tokenStr - } catch { - case e: IOException => - throw new SparkThriftServerSQLException("Error retrieving " + - "delegation token for user " + owner, "08S01", e) - case e: InterruptedException => - throw new SparkThriftServerSQLException("delegation token retrieval interrupted", - "08S01", e) - } - } - - // cancel given delegation token - @throws[SparkThriftServerSQLException] - def cancelDelegationToken(delegationToken: String): Unit = { - if (delegationTokenManager == null) { - throw new SparkThriftServerSQLException("Delegation token only supported " + - "over kerberos authentication", "08S01") - } - try { - delegationTokenManager.cancelDelegationToken(delegationToken) - } catch { - case e: IOException => - throw new SparkThriftServerSQLException("Error canceling delegation token " + - delegationToken, "08S01", e) - } - } - - @throws[SparkThriftServerSQLException] - def renewDelegationToken(delegationToken: String): Unit = { - if (delegationTokenManager == null) { - throw new SparkThriftServerSQLException("Delegation token only supported " + - "over kerberos authentication", "08S01") - } - try { - delegationTokenManager.renewDelegationToken(delegationToken) - } catch { - case e: IOException => - throw new SparkThriftServerSQLException("Error renewing delegation token " + - delegationToken, "08S01", e) - } - } - - @throws[SparkThriftServerSQLException] - def getUserFromToken(delegationToken: String): String = { - if (delegationTokenManager == null) { - throw new SparkThriftServerSQLException("Delegation token only supported over" + - " kerberos authentication", "08S01") - } - try { - delegationTokenManager.getUserFromToken(delegationToken) - } catch { - case e: IOException => - throw new SparkThriftServerSQLException("Error extracting user from delegation token " + - delegationToken, "08S01", e) - } - } - - -} - -object HiveAuthFactory extends Logging { - val HS2_PROXY_USER = "hive.server2.proxy.user" - val HS2_CLIENT_TOKEN = "hiveserver2ClientToken" - - private var keytabFile: Field = null - private var getKeytab: Method = null - - try { - val clz = classOf[UserGroupInformation] - try { - keytabFile = clz.getDeclaredField("keytabFile") - keytabFile.setAccessible(true); - } catch { - case nfe: NoSuchFieldError => - logDebug("Cannot find private field \"keytabFile\" in class: " + - classOf[UserGroupInformation].getCanonicalName, nfe) - keytabFile = null - } - - try { - getKeytab = clz.getDeclaredMethod("getKeytab") - getKeytab.setAccessible(true); - } catch { - case nme: NoSuchMethodError => - logDebug("Cannot find private method \"getKeytab\" in class:" + - classOf[UserGroupInformation].getCanonicalName, nme - ) - getKeytab = null - } - } catch { - case e: Throwable => - } - - @throws[SparkThriftServerSQLException] - def verifyProxyAccess(realUser: String, - proxyUser: String, - ipAddress: String, - hiveConf: HiveConf): Unit = { - try { - var sessionUgi: UserGroupInformation = null - if (UserGroupInformation.isSecurityEnabled) { - val kerbName = ShimLoader.getHadoopShims.getKerberosNameShim(realUser) - sessionUgi = - UserGroupInformation.createProxyUser(kerbName.getServiceName, - UserGroupInformation.getLoginUser) - } else { - sessionUgi = UserGroupInformation.createRemoteUser(realUser) - } - if (!proxyUser.equalsIgnoreCase(realUser)) { - ProxyUsers.refreshSuperUserGroupsConfiguration(hiveConf) - ProxyUsers.authorize(UserGroupInformation.createProxyUser(proxyUser, sessionUgi), - ipAddress, hiveConf) - } - } catch { - case e: IOException => - throw new SparkThriftServerSQLException("Failed to validate proxy privilege of " + - realUser + " for " + proxyUser, "08S01", e) - } - } - - @throws[TTransportException] - def getSSLSocket(host: String, port: Int, loginTimeout: Int): TTransport = { - TSSLTransportFactory.getClientSocket(host, port, loginTimeout) - } - - @throws[TTransportException] - def getSSLSocket(host: String, - port: Int, - loginTimeout: Int, - trustStorePath: String, - trustStorePassWord: String): TTransport = { - val params = new TSSLTransportFactory.TSSLTransportParameters() - params.setTrustStore(trustStorePath, trustStorePassWord) - params.requireClientAuth(true) - TSSLTransportFactory.getClientSocket(host, port, loginTimeout, params) - } - - @throws[TTransportException] - def getServerSocket(hiveHost: String, portNum: Int): TServerSocket = { - var serverAddress: InetSocketAddress = null - if (hiveHost == null || hiveHost.isEmpty) { // Wildcard bind - serverAddress = new InetSocketAddress(portNum) - } else { - serverAddress = new InetSocketAddress(hiveHost, portNum) - } - new TServerSocket(serverAddress) - } - - @throws[TTransportException] - @throws[UnknownHostException] - def getServerSSLSocket(hiveHost: String, - portNum: Int, - keyStorePath: String, - keyStorePassWord: String, - sslVersionBlacklist: util.List[String]): TServerSocket = { - val params: TSSLTransportFactory.TSSLTransportParameters = - new TSSLTransportFactory.TSSLTransportParameters() - params.setKeyStore(keyStorePath, keyStorePassWord) - var serverAddress: InetSocketAddress = null - if (hiveHost == null || hiveHost.isEmpty) { - serverAddress = new InetSocketAddress(portNum) - } else { - serverAddress = new InetSocketAddress(hiveHost, portNum) - } - val thriftServerSocket = - TSSLTransportFactory.getServerSocket(portNum, 0, serverAddress.getAddress, params) - if (thriftServerSocket.getServerSocket.isInstanceOf[SSLServerSocket]) { - val sslVersionBlacklistLocal = new util.ArrayList[String] - for (sslVersion <- sslVersionBlacklist.asScala) { - sslVersionBlacklistLocal.add(sslVersion.trim.toLowerCase(Locale.ROOT)) - } - val sslServerSocket = thriftServerSocket.getServerSocket.asInstanceOf[SSLServerSocket] - val enabledProtocols = new util.ArrayList[String] - for (protocol <- sslServerSocket.getEnabledProtocols) { - if (sslVersionBlacklistLocal.contains(protocol.toLowerCase(Locale.ROOT))) { - logDebug("Disabling SSL Protocol: " + protocol) - } else { - enabledProtocols.add(protocol) - } - } - sslServerSocket.setEnabledProtocols(enabledProtocols.toArray(new Array[String](0))) - logInfo("SSL Server Socket Enabled Protocols: " + - sslServerSocket.getEnabledProtocols.mkString(",")) - } - thriftServerSocket - } - - // Perform kerberos login using the hadoop shim API if the configuration is available - @throws[IOException] - def loginFromKeytab(hiveConf: HiveConf): Unit = { - val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL) - val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB) - if (principal.isEmpty || keyTabFile.isEmpty) { - throw new IOException("HiveServer2 Kerberos principal or keytab is not correctly configured") - } else { - UserGroupInformation - .loginUserFromKeytab(SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile) - } - } - - // Perform SPNEGO login using the hadoop shim API if the configuration is available - @throws[IOException] - def loginFromSpnegoKeytabAndReturnUGI(hiveConf: HiveConf): UserGroupInformation = { - val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL) - val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB) - if (principal.isEmpty || keyTabFile.isEmpty) { - throw new IOException("HiveServer2 SPNEGO principal or keytab is not correctly configured") - } else { - UserGroupInformation.loginUserFromKeytabAndReturnUGI( - SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile) - } - } - - def needUgiLogin(ugi: UserGroupInformation, principal: String, keytab: String): Boolean = { - null == ugi || - !ugi.hasKerberosCredentials || - !(ugi.getUserName == principal) || - !Objects.equals(keytab, getKeytabFromUgi) - } - - private def getKeytabFromUgi: String = classOf[UserGroupInformation].synchronized { - try { - if (keytabFile != null) { - keytabFile.get(null).asInstanceOf[String] - } else if (getKeytab != null) { - getKeytab.invoke(UserGroupInformation.getCurrentUser).asInstanceOf[String] - } else { - null - } - } catch { - case e: Exception => - logDebug("Fail to get keytabFile path via reflection", e) - null - } - - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala deleted file mode 100644 index 84c68214858b..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/HttpAuthUtils.scala +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.auth - -import java.security.{AccessController, PrivilegedExceptionAction} -import java.util -import java.util.{Random, StringTokenizer} -import javax.security.auth.Subject - -import org.apache.commons.codec.binary.Base64 -import org.apache.commons.logging.LogFactory -import org.apache.hadoop.hive.shims.ShimLoader -import org.apache.http.protocol.{BasicHttpContext, HttpContext} -import org.ietf.jgss.{GSSContext, GSSManager, Oid} - -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -/** - * Utility functions for HTTP mode authentication. - */ -object HttpAuthUtils { - val WWW_AUTHENTICATE = "WWW-Authenticate" - val AUTHORIZATION = "Authorization" - val BASIC = "Basic" - val NEGOTIATE = "Negotiate" - private val LOG = LogFactory.getLog(classOf[HttpAuthUtils]) - private val COOKIE_ATTR_SEPARATOR = "&" - private val COOKIE_CLIENT_USER_NAME = "cu" - private val COOKIE_CLIENT_RAND_NUMBER = "rn" - private val COOKIE_KEY_VALUE_SEPARATOR = "=" - private val COOKIE_ATTRIBUTES = - new util.HashSet[String](util.Arrays.asList(COOKIE_CLIENT_USER_NAME, COOKIE_CLIENT_RAND_NUMBER)) - - /** - * @return Stringified Base64 encoded kerberosAuthHeader on success - * @throws Exception - */ - @throws[Exception] - def getKerberosServiceTicket(principal: String, - host: String, - serverHttpUrl: String, - assumeSubject: Boolean): String = { - val serverPrincipal = ShimLoader.getHadoopThriftAuthBridge.getServerPrincipal(principal, host) - if (assumeSubject) { // With this option, we're assuming that the external application, - // using the JDBC driver has done a JAAS kerberos login already - val context = AccessController.getContext - val subject = Subject.getSubject(context) - if (subject == null) throw new Exception("The Subject is not set") - Subject.doAs(subject, - new HttpAuthUtils.HttpKerberosClientAction(serverPrincipal, serverHttpUrl)) - } - else { // JAAS login from ticket cache to setup the client UserGroupInformation - val clientUGI = ShimLoader.getHadoopThriftAuthBridge.getCurrentUGIWithConf("kerberos") - clientUGI.doAs(new HttpAuthUtils.HttpKerberosClientAction(serverPrincipal, serverHttpUrl)) - } - } - - /** - * Creates and returns a HS2 cookie token. - * - * @param clientUserName Client User name. - * @return An unsigned cookie token generated from input parameters. - * The final cookie generated is of the following format : - * { @code cu=&rn=&s=} - */ - def createCookieToken(clientUserName: String): String = { - val sb = new StringBuffer - sb.append(COOKIE_CLIENT_USER_NAME) - .append(COOKIE_KEY_VALUE_SEPARATOR) - .append(clientUserName).append(COOKIE_ATTR_SEPARATOR) - sb.append(COOKIE_CLIENT_RAND_NUMBER) - .append(COOKIE_KEY_VALUE_SEPARATOR) - .append(new Random(System.currentTimeMillis).nextLong) - sb.toString - } - - /** - * Parses a cookie token to retrieve client user name. - * - * @param tokenStr Token String. - * @return A valid user name if input is of valid format, else returns null. - */ - def getUserNameFromCookieToken(tokenStr: String): String = { - val map = splitCookieToken(tokenStr) - if (!(map.keySet == COOKIE_ATTRIBUTES)) { - LOG.error("Invalid token with missing attributes " + tokenStr) - return null - } - map.get(COOKIE_CLIENT_USER_NAME) - } - - /** - * Splits the cookie token into attributes pairs. - * - * @param str input token. - * @return a map with the attribute pairs of the token if the input is valid. - * Else, returns null. - */ - private def splitCookieToken(tokenStr: String): util.Map[String, String] = { - val map = new util.HashMap[String, String] - val st = new StringTokenizer(tokenStr, COOKIE_ATTR_SEPARATOR) - while ( { - st.hasMoreTokens - }) { - val part = st.nextToken - val separator = part.indexOf(COOKIE_KEY_VALUE_SEPARATOR) - if (separator == -1) { - LOG.error("Invalid token string " + tokenStr) - return null - } - val key = part.substring(0, separator) - val value = part.substring(separator + 1) - map.put(key, value) - } - map - } - - /** - * We'll create an instance of this class within a doAs block so that the client's TGT credentials - * can be read from the Subject - */ - object HttpKerberosClientAction { - val HTTP_RESPONSE = "HTTP_RESPONSE" - val SERVER_HTTP_URL = "SERVER_HTTP_URL" - } - - class HttpKerberosClientAction(val serverPrincipal: String, - val serverHttpUrl: String) - extends PrivilegedExceptionAction[String] { - final private val base64codec: Base64 = new Base64(0) - final private val httpContext: HttpContext = new BasicHttpContext - httpContext.setAttribute(HttpKerberosClientAction.SERVER_HTTP_URL, serverHttpUrl) - - @throws[Exception] - override def run: String = { // This Oid for Kerberos GSS-API mechanism. - val mechOid = new Oid("1.2.840.113554.1.2.2") - // Oid for kerberos principal name - val krb5PrincipalOid = new Oid("1.2.840.113554.1.2.2.1") - val manager = GSSManager.getInstance - // GSS name for server - val serverName = manager.createName(serverPrincipal, krb5PrincipalOid) - // Create a GSSContext for authentication with the service. - // We're passing client credentials as null since we want them to be read from the Subject. - val gssContext = manager.createContext(serverName, mechOid, null, GSSContext.DEFAULT_LIFETIME) - gssContext.requestMutualAuth(false) - // Establish context - val inToken = new Array[Byte](0) - val outToken = gssContext.initSecContext(inToken, 0, inToken.length) - gssContext.dispose() - // Base64 encoded and stringified token for server - new String(base64codec.encode(outToken)) - } - } - -} - -final class HttpAuthUtils private() { - throw new UnsupportedOperationException("Can't initialize class") -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala deleted file mode 100644 index b3ea4777c352..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/KerberosSaslHelper.scala +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.auth - -import java.io.IOException -import java.util -import javax.security.sasl.SaslException - -import org.apache.hadoop.hive.shims.ShimLoader -import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge -import org.apache.thrift.{TProcessor, TProcessorFactory} -import org.apache.thrift.transport.{TSaslClientTransport, TTransport} - -import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIService, ThriftCLIService} - - -object KerberosSaslHelper { - - def getKerberosProcessorFactory( - saslServer: HadoopThriftAuthBridge.Server, - service: ThriftCLIService): KerberosSaslHelper.CLIServiceProcessorFactory = { - new KerberosSaslHelper.CLIServiceProcessorFactory(saslServer, service) - } - - @throws[SaslException] - def getKerberosTransport(principal: String, - host: String, - underlyingTransport: TTransport, - saslProps: util.Map[String, String], - assumeSubject: Boolean): TTransport = try { - val names = principal.split("[/@]") - if (names.length != 3) { - throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal) - } - if (assumeSubject) { - createSubjectAssumedTransport(principal, underlyingTransport, saslProps) - } else { - val authBridge = ShimLoader.getHadoopThriftAuthBridge.createClientWithConf("kerberos") - authBridge.createClientTransport(principal, host, "KERBEROS", - null, underlyingTransport, saslProps) - } - } catch { - case e: IOException => - throw new SaslException("Failed to open client transport", e) - } - - @throws[IOException] - def createSubjectAssumedTransport(principal: String, - underlyingTransport: TTransport, - saslProps: util.Map[String, String]): TTransport = { - val names = principal.split("[/@]") - try { - val saslTransport = - new TSaslClientTransport("GSSAPI", - null, - names(0), - names(1), - saslProps, - null, - underlyingTransport) - new TSubjectAssumingTransport(saslTransport) - } catch { - case se: SaslException => - throw new IOException("Could not instantiate SASL transport", se) - } - } - - @throws[SaslException] - def getTokenTransport(tokenStr: String, - host: String, - underlyingTransport: TTransport, - saslProps: util.Map[String, String]): TTransport = { - val authBridge = ShimLoader.getHadoopThriftAuthBridge.createClientWithConf("kerberos") - try { - authBridge.createClientTransport(null, host, "DIGEST", - tokenStr, underlyingTransport, saslProps) - } catch { - case e: IOException => - throw new SaslException("Failed to open client transport", e) - } - } - - - private[auth] class CLIServiceProcessorFactory(val saslServer: HadoopThriftAuthBridge.Server, - val service: ThriftCLIService) - extends TProcessorFactory(null) { - override def getProcessor(trans: TTransport): TProcessor = { - val sqlProcessor = new TCLIService.Processor[TCLIService.Iface](service) - saslServer.wrapNonAssumingProcessor(sqlProcessor) - } - } - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala deleted file mode 100644 index d509645debb7..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/PlainSaslHelper.scala +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.auth - -import java.io.IOException -import java.security.Security -import java.util -import javax.security.auth.callback._ -import javax.security.auth.login.LoginException -import javax.security.sasl.{AuthenticationException, AuthorizeCallback, SaslException} - -import org.apache.thrift.{TProcessor, TProcessorFactory} -import org.apache.thrift.transport.{TSaslClientTransport, TSaslServerTransport, TTransport, TTransportFactory} - -import org.apache.spark.sql.thriftserver.auth.AuthenticationProviderFactory.AuthMethods -import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService.Iface -import org.apache.spark.sql.thriftserver.cli.thrift.ThriftCLIService - - -object PlainSaslHelper { - - // Register Plain SASL server provider - try { - Security.addProvider(new PlainSaslServer.SaslPlainProvider) - } catch { - case e: Exception => - throw new UnsupportedOperationException("Can't initialize class") - } - - def getPlainProcessorFactory(service: ThriftCLIService): SQLPlainProcessorFactory = { - new SQLPlainProcessorFactory(service) - } - - @throws[LoginException] - def getPlainTransportFactory(authTypeStr: String): TTransportFactory = { - val saslFactory: TSaslServerTransport.Factory = new TSaslServerTransport.Factory() - try - saslFactory.addServerDefinition("PLAIN", - authTypeStr, - null, - new util.HashMap[String, String](), - new PlainServerCallbackHandler(authTypeStr)) - catch { - case e: AuthenticationException => - throw new LoginException("Error setting callback handler" + e) - } - saslFactory - } - - - @throws[SaslException] - def getPlainTransport(username: String, - password: String, - underlyingTransport: TTransport): TSaslClientTransport = { - new TSaslClientTransport("PLAIN", - null, - null, - null, - new util.HashMap[String, String](), - new PlainCallbackHandler(username, password), - underlyingTransport) - } -} - - -private class PlainServerCallbackHandler @throws[AuthenticationException] -(val authMethodStr: String) extends CallbackHandler { - final private var authMethod = AuthMethods.getValidAuthMethod(authMethodStr) - - @throws[IOException] - @throws[UnsupportedCallbackException] - def handle(callbacks: Array[Callback]): Unit = { - var username: String = null - var password: String = null - var ac: AuthorizeCallback = null - for (callback <- callbacks) { - if (callback.isInstanceOf[NameCallback]) { - val nc = callback.asInstanceOf[NameCallback] - username = nc.getName - } else if (callback.isInstanceOf[PasswordCallback]) { - val pc = callback.asInstanceOf[PasswordCallback] - password = new String(pc.getPassword) - } else if (callback.isInstanceOf[AuthorizeCallback]) { - ac = callback.asInstanceOf[AuthorizeCallback] - } else { - throw new UnsupportedCallbackException(callback) - } - } - val provider = AuthenticationProviderFactory.getAuthenticationProvider(authMethod) - provider.authenticate(username, password) - if (ac != null) { - ac.setAuthorized(true) - } - } -} - - -class SQLPlainProcessorFactory(val service: ThriftCLIService) - extends TProcessorFactory(null) { - override def getProcessor(trans: TTransport): TProcessor = { - new TSetIpAddressProcessor[Iface](service) - } -} - -class PlainCallbackHandler(val username: String, val password: String) extends CallbackHandler { - @throws[IOException] - @throws[UnsupportedCallbackException] - def handle(callbacks: Array[Callback]): Unit = { - for (callback <- callbacks) { - if (callback.isInstanceOf[NameCallback]) { - val nameCallback = callback.asInstanceOf[NameCallback] - nameCallback.setName(username) - } - else if (callback.isInstanceOf[PasswordCallback]) { - val passCallback = callback.asInstanceOf[PasswordCallback] - passCallback.setPassword(password.toCharArray) - } - else throw new UnsupportedCallbackException(callback) - } - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala deleted file mode 100644 index 88856e667fe5..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/TSetIpAddressProcessor.scala +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.auth - -import org.apache.thrift.TException -import org.apache.thrift.protocol.TProtocol -import org.apache.thrift.transport.{TSaslClientTransport, TSaslServerTransport, TSocket, TTransport} - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService -import org.apache.spark.sql.thriftserver.cli.thrift.TCLIService.Iface - -/** - * This class is responsible for setting the ipAddress for operations executed via HiveServer2. - * - * - IP address is only set for operations that calls listeners with hookContext - * - IP address is only set if the underlying transport mechanism is socket - * - * @see org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext - */ -object TSetIpAddressProcessor extends Logging { - - private val THREAD_LOCAL_IP_ADDRESS = new ThreadLocal[String]() { - override protected def initialValue: String = null - } - private val THREAD_LOCAL_USER_NAME = new ThreadLocal[String]() { - override protected def initialValue: String = null - } - - def getUserIpAddress: String = THREAD_LOCAL_IP_ADDRESS.get - - def getUserName: String = THREAD_LOCAL_USER_NAME.get -} - -class TSetIpAddressProcessor[I <: Iface](val iface: Iface) - extends TCLIService.Processor[Iface](iface) - with Logging { - @throws[TException] - override def process(in: TProtocol, out: TProtocol): Boolean = { - setIpAddress(in) - setUserName(in) - try - super.process(in, out) - finally { - TSetIpAddressProcessor.THREAD_LOCAL_USER_NAME.remove() - TSetIpAddressProcessor.THREAD_LOCAL_IP_ADDRESS.remove() - } - } - - private def setUserName(in: TProtocol): Unit = { - val transport: TTransport = in.getTransport - transport match { - case transport1: TSaslServerTransport => - val userName = transport1.getSaslServer.getAuthorizationID - TSetIpAddressProcessor.THREAD_LOCAL_USER_NAME.set(userName) - case _ => - } - } - - protected def setIpAddress(in: TProtocol): Unit = { - val transport: TTransport = in.getTransport - val tSocket = getUnderlyingSocketFromTransport(transport) - if (tSocket == null) { - logWarning("Unknown Transport, cannot determine ipAddress") - } else { - TSetIpAddressProcessor.THREAD_LOCAL_IP_ADDRESS - .set(tSocket.getSocket.getInetAddress.getHostAddress) - } - } - - private def getUnderlyingSocketFromTransport(transport: TTransport): TSocket = transport match { - case t: TSaslServerTransport => getUnderlyingSocketFromTransport(t.getUnderlyingTransport) - case t: TSaslClientTransport => getUnderlyingSocketFromTransport(t.getUnderlyingTransport) - case t: TSocket => t - case _ => null - } - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala deleted file mode 100644 index 2d1f096ae5f2..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/ThriftserverDelegationTokenManager.scala +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.auth - -import java.io.IOException -import java.security.PrivilegedExceptionAction - -import org.apache.commons.lang.StringUtils -import org.apache.hadoop.conf.Configuration -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.shims.Utils -import org.apache.hadoop.hive.thrift._ -import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server -import org.apache.hadoop.security.UserGroupInformation -import org.apache.hadoop.security.authorize.ProxyUsers -import org.apache.hadoop.util.ReflectionUtils - -object ThriftserverDelegationTokenManager { - val DELEGATION_TOKEN_GC_INTERVAL = "hive.cluster.delegation.token.gc-interval" - val DELEGATION_TOKEN_GC_INTERVAL_DEFAULT = 3600000 // 1 hour - - // Delegation token related keys - val DELEGATION_KEY_UPDATE_INTERVAL_KEY = "hive.cluster.delegation.key.update-interval" - val DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT: Long = 24 * 60 * 60 * 1000 // 1 day - - val DELEGATION_TOKEN_RENEW_INTERVAL_KEY = "hive.cluster.delegation.token.renew-interval" - val DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT: Long = 24 * 60 * 60 * 1000 - val DELEGATION_TOKEN_MAX_LIFETIME_KEY = "hive.cluster.delegation.token.max-lifetime" - val DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT: Long = 7 * 24 * 60 * 60 * 1000 // 7 days - - val DELEGATION_TOKEN_STORE_CLS = "hive.cluster.delegation.token.store.class" - val DELEGATION_TOKEN_STORE_ZK_CONNECT_STR = - "hive.cluster.delegation.token.store.zookeeper.connectString" - // Alternate connect string specification configuration - val DELEGATION_TOKEN_STORE_ZK_CONNECT_STR_ALTERNATE = "hive.zookeeper.quorum" - - val DELEGATION_TOKEN_STORE_ZK_CONNECT_TIMEOUTMILLIS = - "hive.cluster.delegation.token.store.zookeeper.connectTimeoutMillis" - val DELEGATION_TOKEN_STORE_ZK_ZNODE = "hive.cluster.delegation.token.store.zookeeper.znode" - val DELEGATION_TOKEN_STORE_ZK_ACL = "hive.cluster.delegation.token.store.zookeeper.acl" - val DELEGATION_TOKEN_STORE_ZK_ZNODE_DEFAULT = "/hivedelegation" -} - -class ThriftserverDelegationTokenManager { - - import ThriftserverDelegationTokenManager._ - - protected var secretManager: DelegationTokenSecretManager = null - - def getSecretManager: DelegationTokenSecretManager = secretManager - - @throws[IOException] - def startDelegationTokenSecretManager(conf: HiveConf, - hms: Any, - smode: Server.ServerMode): Unit = { - val secretKeyInterval = - conf.getLong(DELEGATION_KEY_UPDATE_INTERVAL_KEY, - DELEGATION_KEY_UPDATE_INTERVAL_DEFAULT) - val tokenMaxLifetime = - conf.getLong(DELEGATION_TOKEN_MAX_LIFETIME_KEY, - DELEGATION_TOKEN_MAX_LIFETIME_DEFAULT) - val tokenRenewInterval = - conf.getLong(DELEGATION_TOKEN_RENEW_INTERVAL_KEY, - DELEGATION_TOKEN_RENEW_INTERVAL_DEFAULT) - val tokenGcInterval = - conf.getLong(DELEGATION_TOKEN_GC_INTERVAL, - DELEGATION_TOKEN_GC_INTERVAL_DEFAULT) - val dts: DelegationTokenStore = getTokenStore(conf) - dts.setConf(conf) - dts.init(hms, smode) - secretManager = - new TokenStoreDelegationTokenSecretManager( - secretKeyInterval, - tokenMaxLifetime, - tokenRenewInterval, - tokenGcInterval, - dts) - secretManager.startThreads - } - - @throws[IOException] - @throws[InterruptedException] - def getDelegationToken(owner: String, renewer: String, remoteAddr: String): String = { - /** - * If the user asking the token is same as the 'owner' then don't do - * any proxy authorization checks. For cases like oozie, where it gets - * a delegation token for another user, we need to make sure oozie is - * authorized to get a delegation token. - */ - // Do all checks on short names - val currUser = UserGroupInformation.getCurrentUser - var ownerUgi = UserGroupInformation.createRemoteUser(owner) - if (!(ownerUgi.getShortUserName == currUser.getShortUserName)) { - // in the case of proxy users, the getCurrentUser will return the - // real user (for e.g. oozie) due to the doAs that happened just before the - // server started executing the method getDelegationToken in the MetaStore - ownerUgi = UserGroupInformation.createProxyUser(owner, UserGroupInformation.getCurrentUser) - ProxyUsers.authorize(ownerUgi, remoteAddr, null) - } - ownerUgi.doAs(new PrivilegedExceptionAction[String]() { - @throws[IOException] - override def run: String = return secretManager.getDelegationToken(renewer) - }) - } - - @throws[IOException] - @throws[InterruptedException] - def getDelegationTokenWithService(owner: String, - renewer: String, - service: String, - remoteAddr: String): String = { - val token = getDelegationToken(owner, renewer, remoteAddr) - Utils.addServiceToToken(token, service) - } - - @throws[IOException] - def renewDelegationToken(tokenStrForm: String): Long = - secretManager.renewDelegationToken(tokenStrForm) - - @throws[IOException] - def getUserFromToken(tokenStr: String): String = secretManager.getUserFromToken(tokenStr) - - @throws[IOException] - def cancelDelegationToken(tokenStrForm: String): Unit = { - secretManager.cancelDelegationToken(tokenStrForm) - } - - @throws[IOException] - private def getTokenStore(conf: Configuration): DelegationTokenStore = { - val tokenStoreClassName = conf.get(DELEGATION_TOKEN_STORE_CLS, "") - if (StringUtils.isBlank(tokenStoreClassName)) { - return new MemoryTokenStore - } - try { - val storeClass = org.apache.spark.util.Utils.classForName(tokenStoreClassName) - .asSubclass(classOf[DelegationTokenStore]) - ReflectionUtils.newInstance(storeClass, conf) - } catch { - case e: ClassNotFoundException => - throw new IOException("Error initializing delegation token store: " + - tokenStoreClassName, e) - } - } - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala index 59e5680a8653..a7cf2f0e95d1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -99,6 +99,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex def getHttpUGI: UserGroupInformation = this.httpUGI + @throws[SparkThriftServerSQLException] def openSession(protocol: TProtocolVersion, username: String, password: String, @@ -165,6 +166,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex sessionHandle } + @throws[SparkThriftServerSQLException] override def closeSession(sessionHandle: SessionHandle): Unit = { sessionManager.closeSession(sessionHandle) logDebug(sessionHandle + ": closeSession()") @@ -358,12 +360,13 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex opStatus } + @throws[SparkThriftServerSQLException] override def getQueryId(opHandle: TOperationHandle): String = { val operation: Operation = sessionManager.getOperationManager.getOperation(new OperationHandle(opHandle)) val queryId = operation.statementId logDebug(opHandle + ": getQueryId() " + queryId) - return queryId + queryId } override def cancelOperation(opHandle: OperationHandle): Unit = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala index 134fe2ed6a60..b213dd8cd275 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala @@ -145,8 +145,8 @@ class ColumnBuffer() { return _stringVars(index) case Type.BINARY_TYPE => return _binaryVars(index).array + case _ => null } - null } def size: Int = _size diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala similarity index 64% rename from sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala rename to sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala index 490715bb46c8..a61a233f628d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/auth/AuthType.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala @@ -15,23 +15,25 @@ * limitations under the License. */ -package org.apache.spark.sql.thriftserver.auth +package org.apache.spark.sql.thriftserver.cli -abstract class AuthType(authType: String) { +import org.apache.spark.sql.Row +import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet - def getAuthName: String = authType +private[thriftserver] trait RowSet { + def addRow(row: Row): RowSet - override def toString: String = getAuthName -} + def extractSubset(maxRows: Int): RowSet -case object NOSASL extends AuthType("NOSASL") + def numColumns: Int -case object NONE extends AuthType("NONE") + def numRows: Int -case object LDAP extends AuthType("LDAP") + def getStartOffset: Long -case object KERBEROS extends AuthType("KERBEROS") + def setStartOffset(startOffset: Long): Unit -case object CUSTOM extends AuthType("CUSTOM") + def toTRowSet: TRowSet -case object PAM extends AuthType("PAM") + def iterator: Iterator[Row] +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala index 1e94a1186f3c..48848b4f4aeb 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala @@ -33,9 +33,9 @@ import org.apache.spark.internal.Logging import org.apache.spark.sql.{DataFrame, Row => SparkRow, SQLContext} import org.apache.spark.sql.execution.command.SetCommand import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types._ import org.apache.spark.util.{Utils => SparkUtils} @@ -75,7 +75,7 @@ private[thriftserver] class SparkExecuteStatementOperation( // RDDs will be cleaned automatically upon garbage collection. logInfo(s"Close statement with $statementId") cleanup(OperationState.CLOSED) - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } def getNextRowSet(order: FetchOrientation, maxRowsL: Long): RowSet = withSchedulerPool { @@ -156,12 +156,12 @@ private[thriftserver] class SparkExecuteStatementOperation( setState(OperationState.PENDING) setStatementId(UUID.randomUUID().toString) logInfo(s"Submitting query '$statement' with $statementId") - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, statement, statementId, - parentSession.getUsername) + parentSession.getUserName) setHasResultSet(true) // avoid no resultset for async run if (!runInBackground) { @@ -206,14 +206,14 @@ private[thriftserver] class SparkExecuteStatementOperation( case rejected: RejectedExecutionException => logError("Error submitting query in background, query rejected", rejected) setState(OperationState.ERROR) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, rejected.getMessage, SparkUtils.exceptionString(rejected)) throw new SparkThriftServerSQLException("The background threadpool cannot accept" + " new task for execution, please retry the operation", rejected) case NonFatal(e) => logError(s"Error executing query in background", e) setState(OperationState.ERROR) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, e.getMessage, SparkUtils.exceptionString(e)) throw new SparkThriftServerSQLException(e) } @@ -245,7 +245,7 @@ private[thriftserver] class SparkExecuteStatementOperation( "in this session.") case _ => } - SparkThriftServer2.listener.onStatementParsed(statementId, result.queryExecution.toString()) + SparkThriftServer.listener.onStatementParsed(statementId, result.queryExecution.toString()) iter = { if (sqlContext.getConf(SQLConf.THRIFTSERVER_INCREMENTAL_COLLECT.key).toBoolean) { resultList = None @@ -276,12 +276,12 @@ private[thriftserver] class SparkExecuteStatementOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error running query: " + root.toString, root) } @@ -290,7 +290,7 @@ private[thriftserver] class SparkExecuteStatementOperation( synchronized { if (!getStatus.getState.isTerminal) { setState(OperationState.FINISHED) - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } } sqlContext.sparkContext.clearJobGroup() @@ -302,7 +302,7 @@ private[thriftserver] class SparkExecuteStatementOperation( if (!getStatus.getState.isTerminal) { logInfo(s"Cancel query with $statementId") cleanup(OperationState.CANCELED) - SparkThriftServer2.listener.onStatementCanceled(statementId) + SparkThriftServer.listener.onStatementCanceled(statementId) } } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala index b57acb21fcec..f67120b0a245 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala @@ -24,9 +24,9 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types.{StringType, StructField, StructType} import org.apache.spark.util.{Utils => SparkUtils} @@ -48,7 +48,7 @@ private[thriftserver] class SparkGetCatalogsOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { @@ -60,12 +60,12 @@ private[thriftserver] class SparkGetCatalogsOperation( val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, statementId, - parentSession.getUsername) + parentSession.getUserName) try { if (isAuthV2Enabled) { @@ -78,18 +78,18 @@ private[thriftserver] class SparkGetCatalogsOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting catalogs: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala index 4745291e0c55..aa7591011990 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala @@ -30,9 +30,9 @@ import org.apache.spark.internal.Logging import org.apache.spark.sql.{Row, SQLContext} import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.SessionCatalog -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types._ import org.apache.spark.util.{Utils => SparkUtils} @@ -86,7 +86,7 @@ private[thriftserver] class SparkGetColumnsOperation( private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { @@ -101,12 +101,12 @@ private[thriftserver] class SparkGetColumnsOperation( val executionHiveClassLoader = sqlContext.sharedState.jarClassLoader Thread.currentThread().setContextClassLoader(executionHiveClassLoader) - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, statementId, - parentSession.getUsername) + parentSession.getUserName) val schemaPattern = convertSchemaPattern(schemaName) val tablePattern = convertIdentifierPattern(tableName, true) @@ -158,17 +158,17 @@ private[thriftserver] class SparkGetColumnsOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting columns: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } private def addToRowSet( diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala index ffd5664e40d0..62e3fb12a91f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala @@ -27,9 +27,9 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationTyp import org.apache.spark.internal.Logging import org.apache.spark.sql.{Row, SQLContext} -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType} import org.apache.spark.util.{Utils => SparkUtils} @@ -62,7 +62,7 @@ private[thriftserver] class SparkGetFunctionsOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { @@ -89,12 +89,12 @@ private[thriftserver] class SparkGetFunctionsOperation( authorizeMetaGets(HiveOperationType.GET_FUNCTIONS, privObjs, cmdStr) } - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, statementId, - parentSession.getUsername) + parentSession.getUserName) try { matchingDbs.foreach { db => @@ -118,18 +118,18 @@ private[thriftserver] class SparkGetFunctionsOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting functions: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala index 358b796303bb..f4ff205fc3ea 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala @@ -25,9 +25,9 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.spark.internal.Logging import org.apache.spark.sql.{Row, SQLContext} -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types.{StringType, StructField, StructType} import org.apache.spark.util.{Utils => SparkUtils} @@ -55,7 +55,7 @@ private[thriftserver] class SparkGetSchemasOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { @@ -73,12 +73,12 @@ private[thriftserver] class SparkGetSchemasOperation( authorizeMetaGets(HiveOperationType.GET_TABLES, null, cmdStr) } - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, statementId, - parentSession.getUsername) + parentSession.getUserName) try { val schemaPattern = convertSchemaPattern(schemaName) @@ -98,17 +98,17 @@ private[thriftserver] class SparkGetSchemasOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting schemas: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala index 507dadd25cb1..5e1b8dde8675 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala @@ -20,15 +20,14 @@ package org.apache.spark.sql.thriftserver.cli.operation import java.util.UUID import org.apache.commons.lang3.exception.ExceptionUtils -import org.apache.hadoop.hive.conf.HiveConf import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.spark.internal.Logging import org.apache.spark.sql.{Row, SQLContext} import org.apache.spark.sql.catalyst.catalog.CatalogTableType -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types.{StringType, StructField, StructType} import org.apache.spark.util.{Utils => SparkUtils} @@ -51,7 +50,7 @@ private[thriftserver] class SparkGetTableTypesOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { @@ -67,12 +66,12 @@ private[thriftserver] class SparkGetTableTypesOperation( authorizeMetaGets(HiveOperationType.GET_TABLETYPES, null) } - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, statementId, - parentSession.getUsername) + parentSession.getUserName) try { val tableTypes = CatalogTableType.tableTypes.map(tableTypeString).toSet @@ -86,18 +85,18 @@ private[thriftserver] class SparkGetTableTypesOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting table types: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala index 15f3496aa5b1..fd43c71a97f3 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -29,9 +29,9 @@ import org.apache.spark.internal.Logging import org.apache.spark.sql.{Row, SQLContext} import org.apache.spark.sql.catalyst.catalog.CatalogTableType._ import org.apache.spark.sql.hive.HiveUtils -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types.{StringType, StructField, StructType} import org.apache.spark.util.{Utils => SparkUtils} @@ -80,7 +80,7 @@ private[thriftserver] class SparkGetTablesOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { @@ -110,12 +110,12 @@ private[thriftserver] class SparkGetTablesOperation( authorizeMetaGets(HiveOperationType.GET_TABLES, privObjs, cmdStr) } - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, statementId, - parentSession.getUsername) + parentSession.getUserName) try { // Tables and views @@ -149,17 +149,17 @@ private[thriftserver] class SparkGetTablesOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting tables: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } private def addToRowSet( diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala index 080852415a55..34dd5a0525c0 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala @@ -24,9 +24,9 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.spark.internal.Logging import org.apache.spark.sql.{Row, SQLContext} -import org.apache.spark.sql.thriftserver.SparkThriftServer2 import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types._ import org.apache.spark.util.{Utils => SparkUtils} @@ -66,7 +66,7 @@ private[thriftserver] class SparkGetTypeInfoOperation( override def close(): Unit = { super.close() - SparkThriftServer2.listener.onOperationClosed(statementId) + SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { @@ -82,12 +82,12 @@ private[thriftserver] class SparkGetTypeInfoOperation( authorizeMetaGets(HiveOperationType.GET_TYPEINFO, null) } - SparkThriftServer2.listener.onStatementStart( + SparkThriftServer.listener.onStatementStart( statementId, parentSession.getSessionHandle.getSessionId.toString, logMsg, statementId, - parentSession.getUsername) + parentSession.getUserName) try { Type.values().foreach(typeInfo => { @@ -120,18 +120,18 @@ private[thriftserver] class SparkGetTypeInfoOperation( setState(OperationState.ERROR) e match { case hiveException: SparkThriftServerSQLException => - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) throw hiveException case _ => val root = ExceptionUtils.getRootCause(e) - SparkThriftServer2.listener.onStatementError( + SparkThriftServer.listener.onStatementError( statementId, root.getMessage, SparkUtils.exceptionString(root)) throw new SparkThriftServerSQLException("Error getting type info: " + root.toString, root) } } - SparkThriftServer2.listener.onStatementFinish(statementId) + SparkThriftServer.listener.onStatementFinish(statementId) } override def getResultSetSchema: StructType = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala index 4172a36711bf..0cbd19e0d06f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala @@ -43,7 +43,7 @@ private[thriftserver] abstract class SparkMetadataOperation( setHasResultSet(true) /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#close() + * @see org.apache.spark.sql.thriftserver.cli.Operation#close() */ @throws[SparkThriftServerSQLException] override def close(): Unit = { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index bc2633c074ed..5808489e9af3 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -28,7 +28,7 @@ import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext import org.apache.spark.sql.hive.HiveUtils -import org.apache.spark.sql.thriftserver.{CompositeService, SparkThriftServer2} +import org.apache.spark.sql.thriftserver.CompositeService import org.apache.spark.sql.thriftserver.cli.{SessionHandle, SparkThriftServerSQLException} import org.apache.spark.sql.thriftserver.cli.operation.OperationManager import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion @@ -260,8 +260,8 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo } handleToSession.put(session.getSessionHandle, session) val sessionHandle = session.getSessionHandle - SparkThriftServer2.listener.onSessionCreated( - session.getIpAddress, sessionHandle.getSessionId.toString, session.getUsername) + SparkThriftServer.listener.onSessionCreated( + session.getIpAddress, sessionHandle.getSessionId.toString, session.getUserName) val ctx = if (sqlContext.conf.hiveThriftServerSingleSession) { sqlContext } else { @@ -281,7 +281,7 @@ private[thriftserver] class SessionManager(hiveServer2: SparkThriftServer, sqlCo @throws[SparkThriftServerSQLException] def closeSession(sessionHandle: SessionHandle): Unit = { - SparkThriftServer2.listener.onSessionClosed(sessionHandle.getSessionId.toString) + SparkThriftServer.listener.onSessionClosed(sessionHandle.getSessionId.toString) val session = handleToSession.remove(sessionHandle) operationManager.sessionToActivePool.remove(sessionHandle) operationManager.sessionToContexts.remove(sessionHandle) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index 6e69c5d0075e..8918be7aa000 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -686,7 +686,7 @@ private[thriftserver] class ThriftServerSessionImpl( owner: String, renewer: String): String = { HiveAuthFactory.verifyProxyAccess( - getUsername, + getUserName, owner, getIpAddress, getHiveConf) @@ -695,7 +695,7 @@ private[thriftserver] class ThriftServerSessionImpl( override def cancelDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit = { HiveAuthFactory.verifyProxyAccess( - getUsername, + getUserName, getUserFromToken(authFactory, tokenStr), getIpAddress, getHiveConf) @@ -704,7 +704,7 @@ private[thriftserver] class ThriftServerSessionImpl( override def renewDelegationToken(authFactory: HiveAuthFactory, tokenStr: String): Unit = { HiveAuthFactory.verifyProxyAccess( - getUsername, + getUserName, getUserFromToken(authFactory, tokenStr), getIpAddress, getHiveConf) @@ -861,8 +861,6 @@ private[thriftserver] class ThriftServerSessionImpl( override def getSessionHandle: SessionHandle = _sessionHandle - override def getUsername: String = username - override def getPassword: String = password override def getHiveConf: HiveConf = _hiveConf diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala deleted file mode 100644 index 0cb96c0877d6..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.scala +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.thrift - -import java.util -import java.util.concurrent._ - -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.apache.hadoop.hive.shims.ShimLoader -import org.apache.thrift.TProcessorFactory -import org.apache.thrift.protocol.TBinaryProtocol -import org.apache.thrift.server.TThreadPoolServer -import org.apache.thrift.transport.{TServerSocket, TTransportFactory} - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory -import org.apache.spark.sql.thriftserver.cli.CLIService -import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup - - -private[thriftserver] class ThriftBinaryCLIService(cliService: CLIService) - extends ThriftCLIService(cliService, classOf[ThriftBinaryCLIService].getSimpleName) - with Logging { - - override def run(): Unit = { - try { // Server thread pool - val threadPoolName: String = "HiveServer2-Handler-Pool" - val executorService: ExecutorService = - new ThreadPoolExecutor(minWorkerThreads, - maxWorkerThreads, - workerKeepAliveTime, - TimeUnit.SECONDS, - new SynchronousQueue[Runnable], - new ThreadFactoryWithGarbageCleanup(threadPoolName)) - // Thrift configs - hiveAuthFactory = new HiveAuthFactory(hiveConf) - val transportFactory: TTransportFactory = hiveAuthFactory.getAuthTransFactory - val processorFactory: TProcessorFactory = hiveAuthFactory.getAuthProcFactory(this) - var serverSocket: TServerSocket = null - val sslVersionBlacklist: util.List[String] = new util.ArrayList[String] - for (sslVersion <- hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",")) { - sslVersionBlacklist.add(sslVersion) - } - if (!hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL)) { - serverSocket = HiveAuthFactory.getServerSocket(hiveHost, portNum) - } else { - val keyStorePath: String = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim - if (keyStorePath.isEmpty) { - throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + - " Not configured for SSL connection") - } - val keyStorePassword: String = ShimLoader.getHadoopShims - .getPassword(hiveConf, HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname) - serverSocket = HiveAuthFactory.getServerSSLSocket(hiveHost, portNum, keyStorePath, - keyStorePassword, sslVersionBlacklist) - } - // Server args - val maxMessageSize: Int = - hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_MAX_MESSAGE_SIZE) - val requestTimeout: Int = - hiveConf.getTimeVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_TIMEOUT, - TimeUnit.SECONDS).toInt - val beBackoffSlotLength: Int = - hiveConf.getTimeVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_BEBACKOFF_SLOT_LENGTH, - TimeUnit.MILLISECONDS).toInt - val sargs: TThreadPoolServer.Args = - new TThreadPoolServer.Args(serverSocket) - .processorFactory(processorFactory) - .transportFactory(transportFactory) - .protocolFactory(new TBinaryProtocol.Factory) - .inputProtocolFactory( - new TBinaryProtocol.Factory(true, true, maxMessageSize, maxMessageSize)) - .requestTimeout(requestTimeout) - .requestTimeoutUnit(TimeUnit.SECONDS) - .beBackoffSlotLength(beBackoffSlotLength) - .beBackoffSlotLengthUnit(TimeUnit.MILLISECONDS) - .executorService(executorService) - // TCP Server - server = new TThreadPoolServer(sargs) - server.setServerEventHandler(serverEventHandler) - val msg: String = "Starting " + classOf[ThriftBinaryCLIService].getSimpleName + - " on port " + serverSocket.getServerSocket.getLocalPort + " with " + - minWorkerThreads + "..." + maxWorkerThreads + " worker threads" - logInfo(msg) - server.serve() - } catch { - case t: Throwable => - logError("Error starting SparkThriftServer: could not start " + - classOf[ThriftBinaryCLIService].getSimpleName, t) - System.exit(-1) - } - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala deleted file mode 100644 index 99e158aeac95..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.scala +++ /dev/null @@ -1,806 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.thrift - -import java.io.IOException -import java.net.{InetAddress, UnknownHostException} -import java.util -import java.util.concurrent.TimeUnit -import javax.security.auth.login.LoginException - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.apache.thrift.TException -import org.apache.thrift.protocol.TProtocol -import org.apache.thrift.server.{ServerContext, TServer, TServerEventHandler} -import org.apache.thrift.transport.TTransport - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.{AbstractService, ServiceException, ServiceUtils} -import org.apache.spark.sql.thriftserver.auth.{HiveAuthFactory, KERBEROS, NONE, TSetIpAddressProcessor} -import org.apache.spark.sql.thriftserver.cli._ -import org.apache.spark.sql.thriftserver.cli.session.SessionManager -import org.apache.spark.sql.thriftserver.server.SparkThriftServer -import org.apache.spark.sql.types.StructType - - -private[thriftserver] abstract class ThriftCLIService(cliService: CLIService, serviceName: String) - extends AbstractService(serviceName) - with TCLIService.Iface - with Runnable - with Logging { - - private val OK_STATUS = new TStatus(TStatusCode.SUCCESS_STATUS) - protected var hiveAuthFactory: HiveAuthFactory = new HiveAuthFactory() - - protected var portNum: Int = 0 - protected var serverIPAddress: InetAddress = _ - protected var hiveHost: String = _ - protected var server: TServer = _ - protected var httpServer: org.eclipse.jetty.server.Server = _ - - private var isStarted = false - protected var isEmbedded = false - - protected var hiveConf: HiveConf = _ - - protected var minWorkerThreads: Int = 0 - protected var maxWorkerThreads: Int = 0 - protected var workerKeepAliveTime: Long = 0L - - private class ThriftCLIServerContext extends ServerContext { - private var sessionHandle: SessionHandle = _ - - def setSessionHandle(sessionHandle: SessionHandle): Unit = { - this.sessionHandle = sessionHandle - } - - def getSessionHandle: SessionHandle = sessionHandle - } - - protected var currentServerContext = new ThreadLocal[ServerContext] - - protected var serverEventHandler: TServerEventHandler = new TServerEventHandler { - def createContext(input: TProtocol, output: TProtocol): ServerContext = { - new ThriftCLIServerContext() - } - - def deleteContext(serverContext: ServerContext, input: TProtocol, output: TProtocol): Unit = { - val context: ThriftCLIServerContext = serverContext.asInstanceOf[ThriftCLIServerContext] - val sessionHandle = context.getSessionHandle - if (sessionHandle != null) { - logInfo("Session disconnected without closing properly, close it now") - try { - cliService.closeSession(sessionHandle) - } catch { - case e: SparkThriftServerSQLException => - logWarning("Failed to close session: " + e, e) - } - } - } - - def preServe(): Unit = {} - - def processContext(serverContext: ServerContext, - input: TTransport, - output: TTransport): Unit = { - currentServerContext.set(serverContext) - } - } - - - override def init(hiveConf: HiveConf): Unit = { - this.hiveConf = hiveConf - // Initialize common server configs needed in both binary & http modes - var portString: String = null - hiveHost = System.getenv("HIVE_SERVER2_THRIFT_BIND_HOST") - if (hiveHost == null) { - hiveHost = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST) - } - try { - if (hiveHost != null && !hiveHost.isEmpty) { - serverIPAddress = InetAddress.getByName(hiveHost) - } else { - serverIPAddress = InetAddress.getLocalHost - } - } catch { - case e: UnknownHostException => - throw new ServiceException(e) - } - // HTTP mode - if (SparkThriftServer.isHTTPTransportMode(hiveConf)) { - workerKeepAliveTime = hiveConf.getTimeVar( - ConfVars.HIVE_SERVER2_THRIFT_HTTP_WORKER_KEEPALIVE_TIME, - TimeUnit.SECONDS) - portString = System.getenv("HIVE_SERVER2_THRIFT_HTTP_PORT") - if (portString != null) { - portNum = Integer.valueOf(portString) - } else { - portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT) - } - } else { // Binary mode - workerKeepAliveTime = hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_WORKER_KEEPALIVE_TIME, - TimeUnit.SECONDS) - portString = System.getenv("HIVE_SERVER2_THRIFT_PORT") - if (portString != null) { - portNum = Integer.valueOf(portString) - } else { - portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_PORT) - } - } - minWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS) - maxWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS) - super.init(hiveConf) - } - - override def start(): Unit = { - super.start() - if (!isStarted && !isEmbedded) { - new Thread(this).start() - isStarted = true - } - } - - override def stop(): Unit = { - if (isStarted && !isEmbedded) { - if (server != null) { - server.stop() - logInfo("Thrift server has stopped") - } - if ((httpServer != null) && httpServer.isStarted) { - try { - httpServer.stop() - logInfo("Http server has stopped") - } catch { - case e: Exception => - logError("Error stopping Http server: ", e) - } - } - isStarted = false - } - super.stop() - } - - def getPortNumber: Int = portNum - - def getServerIPAddress: InetAddress = serverIPAddress - - @throws[TException] - override def GetDelegationToken(req: TGetDelegationTokenReq): TGetDelegationTokenResp = { - val resp: TGetDelegationTokenResp = new TGetDelegationTokenResp - if (hiveAuthFactory == null) { - resp.setStatus(notSupportTokenErrorStatus) - } else { - try { - val token = cliService.getDelegationToken( - new SessionHandle(req.getSessionHandle), - hiveAuthFactory, - req.getOwner, - req.getRenewer) - resp.setDelegationToken(token) - resp.setStatus(OK_STATUS) - } catch { - case e: SparkThriftServerSQLException => - logError("Error obtaining delegation token", e) - val tokenErrorStatus = SparkThriftServerSQLException.toTStatus(e) - tokenErrorStatus.setSqlState(e.getSQLState) - tokenErrorStatus.setErrorCode(e.getErrorCode) - tokenErrorStatus.setErrorMessage(e.getMessage) - resp.setStatus(tokenErrorStatus) - } - } - resp - } - - @throws[TException] - override def CancelDelegationToken(req: TCancelDelegationTokenReq): TCancelDelegationTokenResp = { - val resp: TCancelDelegationTokenResp = new TCancelDelegationTokenResp - if (hiveAuthFactory == null) { - resp.setStatus(notSupportTokenErrorStatus) - } else { - try { - cliService.cancelDelegationToken( - new SessionHandle(req.getSessionHandle), - hiveAuthFactory, - req.getDelegationToken) - resp.setStatus(OK_STATUS) - } catch { - case e: SparkThriftServerSQLException => - logError("Error cancel delegation token", e) - val tokenErrorStatus = SparkThriftServerSQLException.toTStatus(e) - tokenErrorStatus.setSqlState(e.getSQLState) - tokenErrorStatus.setErrorCode(e.getErrorCode) - tokenErrorStatus.setErrorMessage(e.getMessage) - resp.setStatus(tokenErrorStatus) - } - } - resp - } - - @throws[TException] - override def RenewDelegationToken(req: TRenewDelegationTokenReq): TRenewDelegationTokenResp = { - val resp: TRenewDelegationTokenResp = new TRenewDelegationTokenResp - if (hiveAuthFactory == null) { - resp.setStatus(notSupportTokenErrorStatus) - } else { - try { - cliService.renewDelegationToken( - new SessionHandle(req.getSessionHandle), - hiveAuthFactory, - req.getDelegationToken) - resp.setStatus(OK_STATUS) - } catch { - case e: SparkThriftServerSQLException => - logError("Error renew delegation token", e) - val tokenErrorStatus = SparkThriftServerSQLException.toTStatus(e) - tokenErrorStatus.setSqlState(e.getSQLState) - tokenErrorStatus.setErrorCode(e.getErrorCode) - tokenErrorStatus.setErrorMessage(e.getMessage) - resp.setStatus(tokenErrorStatus) - } - } - resp - } - - private def notSupportTokenErrorStatus: TStatus = { - val errorStatus: TStatus = new TStatus(TStatusCode.ERROR_STATUS) - errorStatus.setErrorMessage("Delegation token is not supported") - errorStatus - } - - @throws[TException] - override def OpenSession(req: TOpenSessionReq): TOpenSessionResp = { - logInfo("Client protocol version: " + req.getClient_protocol) - val resp: TOpenSessionResp = new TOpenSessionResp - try { - val sessionHandle: SessionHandle = getSessionHandle(req, resp) - resp.setSessionHandle(sessionHandle.toTSessionHandle) - // TODO: set real configuration map - resp.setConfiguration(new util.HashMap[String, String]) - resp.setStatus(OK_STATUS) - val context: ThriftCLIServerContext = - currentServerContext.get.asInstanceOf[ThriftCLIServerContext] - if (context != null) { - context.setSessionHandle(sessionHandle) - } - } catch { - case e: Exception => - logWarning("Error opening session: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - private def getIpAddress: String = { - var clientIpAddress: String = null - // Http transport mode. - // We set the thread local ip address, in ThriftHttpServlet. - if (cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE) - .equalsIgnoreCase("http")) { - clientIpAddress = SessionManager.getIpAddress - } else { // Kerberos - if (isKerberosAuthMode) { - clientIpAddress = hiveAuthFactory.getIpAddress - } else { // Except kerberos, NOSASL - clientIpAddress = TSetIpAddressProcessor.getUserIpAddress - } - } - logDebug("Client's IP Address: " + clientIpAddress) - clientIpAddress - } - - /** - * Returns the effective username. - * 1. If hive.server2.allow.user.substitution = false: the username of the connecting user - * 2. If hive.server2.allow.user.substitution = true: the username of the end user, - * that the connecting user is trying to proxy for. - * This includes a check whether the connecting user is allowed to proxy for the end user. - * - * @param req - * @return - * @throws SparkThriftServerSQLException - */ - @throws[SparkThriftServerSQLException] - private def getUserName(req: TOpenSessionReq): String = { - var userName: String = null - if (isKerberosAuthMode) { - userName = hiveAuthFactory.getRemoteUser - } - if (userName == null) { - userName = TSetIpAddressProcessor.getUserName - } - // We set the thread local username, in ThriftHttpServlet. - if (cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE) - .equalsIgnoreCase("http")) { - userName = SessionManager.getUserName - } - if (userName == null) { - userName = req.getUsername - } - userName = getShortName(userName) - val effectiveClientUser: String = getProxyUser(userName, req.getConfiguration, getIpAddress) - logDebug("Client's username: " + effectiveClientUser) - effectiveClientUser - } - - private def getShortName(userName: String): String = { - var ret: String = null - if (userName != null) { - val indexOfDomainMatch: Int = ServiceUtils.indexOfDomainMatch(userName) - ret = if (indexOfDomainMatch <= 0) { - userName - } else { - userName.substring(0, indexOfDomainMatch) - } - } - ret - } - - /** - * Create a session handle - * - * @param req - * @param res - * @return - * @throws SparkThriftServerSQLException - * @throws LoginException - * @throws IOException - */ - @throws[SparkThriftServerSQLException] - @throws[LoginException] - @throws[IOException] - private[thrift] def getSessionHandle(req: TOpenSessionReq, - res: TOpenSessionResp): SessionHandle = { - val userName: String = getUserName(req) - val ipAddress: String = getIpAddress - val protocol: TProtocolVersion = - getMinVersion(CLIService.SERVER_VERSION, req.getClient_protocol) - res.setServerProtocolVersion(protocol) - var sessionHandle: SessionHandle = null - if (cliService.getHiveConf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && - (userName != null)) { - val delegationTokenStr: String = getDelegationToken(userName) - sessionHandle = cliService.openSessionWithImpersonation( - protocol, - userName, - req.getPassword, - ipAddress, - req.getConfiguration, - delegationTokenStr) - } else sessionHandle = cliService.openSession( - protocol, - userName, - req.getPassword, - ipAddress, - req.getConfiguration) - sessionHandle - } - - - @throws[SparkThriftServerSQLException] - @throws[LoginException] - @throws[IOException] - private def getDelegationToken(userName: String): String = { - if (userName == null || - !cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) - .equalsIgnoreCase(KERBEROS.toString)) { - return null - } - try { - return cliService.getDelegationTokenFromMetaStore(userName) - } catch { - case e: UnsupportedOperationException => - // The delegation token is not applicable in the given deployment mode - } - null - } - - private def getMinVersion(versions: TProtocolVersion*): TProtocolVersion = { - val values: Array[TProtocolVersion] = TProtocolVersion.values - var current: Int = values(values.length - 1).getValue - for (version <- versions) { - if (current > version.getValue) { - current = version.getValue - } - } - for (version <- values) { - if (version.getValue == current) { - return version - } - } - throw new IllegalArgumentException("never") - } - - @throws[TException] - override def CloseSession(req: TCloseSessionReq): TCloseSessionResp = { - val resp: TCloseSessionResp = new TCloseSessionResp - try { - val sessionHandle: SessionHandle = new SessionHandle(req.getSessionHandle) - cliService.closeSession(sessionHandle) - resp.setStatus(OK_STATUS) - val context: ThriftCLIServerContext = - currentServerContext.get.asInstanceOf[ThriftCLIServerContext] - if (context != null) { - context.setSessionHandle(null) - } - } catch { - case e: Exception => - logWarning("Error closing session: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetInfo(req: TGetInfoReq): TGetInfoResp = { - val resp: TGetInfoResp = new TGetInfoResp - try { - val getInfoValue: GetInfoValue = - cliService.getInfo( - new SessionHandle(req.getSessionHandle), - GetInfoType.getGetInfoType(req.getInfoType)) - resp.setInfoValue(getInfoValue.toTGetInfoValue) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting info: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def ExecuteStatement(req: TExecuteStatementReq): TExecuteStatementResp = { - val resp: TExecuteStatementResp = new TExecuteStatementResp - try { - val sessionHandle: SessionHandle = new SessionHandle(req.getSessionHandle) - val statement: String = req.getStatement - val confOverlay: util.Map[String, String] = req.getConfOverlay - val runAsync: Boolean = req.isRunAsync - val operationHandle: OperationHandle = if (runAsync) { - cliService.executeStatementAsync(sessionHandle, statement, confOverlay) - } else { - cliService.executeStatement(sessionHandle, statement, confOverlay) - } - resp.setOperationHandle(operationHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error executing statement: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetTypeInfo(req: TGetTypeInfoReq): TGetTypeInfoResp = { - val resp: TGetTypeInfoResp = new TGetTypeInfoResp - try { - val operationHandle: OperationHandle = - cliService.getTypeInfo(new SessionHandle(req.getSessionHandle)) - resp.setOperationHandle(operationHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting type info: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetCatalogs(req: TGetCatalogsReq): TGetCatalogsResp = { - val resp: TGetCatalogsResp = new TGetCatalogsResp - try { - val opHandle: OperationHandle = - cliService.getCatalogs(new SessionHandle(req.getSessionHandle)) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting catalogs: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetSchemas(req: TGetSchemasReq): TGetSchemasResp = { - val resp: TGetSchemasResp = new TGetSchemasResp - try { - val opHandle: OperationHandle = - cliService.getSchemas(new SessionHandle(req.getSessionHandle), - req.getCatalogName, req.getSchemaName) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting schemas: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetTables(req: TGetTablesReq): TGetTablesResp = { - val resp: TGetTablesResp = new TGetTablesResp - try { - val opHandle: OperationHandle = - cliService.getTables( - new SessionHandle(req.getSessionHandle), - req.getCatalogName, - req.getSchemaName, - req.getTableName, - req.getTableTypes) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting tables: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetTableTypes(req: TGetTableTypesReq): TGetTableTypesResp = { - val resp: TGetTableTypesResp = new TGetTableTypesResp - try { - val opHandle: OperationHandle = - cliService.getTableTypes(new SessionHandle(req.getSessionHandle)) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting table types: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetColumns(req: TGetColumnsReq): TGetColumnsResp = { - val resp: TGetColumnsResp = new TGetColumnsResp - try { - val opHandle: OperationHandle = - cliService.getColumns( - new SessionHandle(req.getSessionHandle), - req.getCatalogName, - req.getSchemaName, - req.getTableName, - req.getColumnName) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting columns: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetFunctions(req: TGetFunctionsReq): TGetFunctionsResp = { - val resp: TGetFunctionsResp = new TGetFunctionsResp - try { - val opHandle: OperationHandle = cliService.getFunctions( - new SessionHandle(req.getSessionHandle), - req.getCatalogName, - req.getSchemaName, - req.getFunctionName) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting functions: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - override def GetPrimaryKeys(req: TGetPrimaryKeysReq): TGetPrimaryKeysResp = { - val resp = new TGetPrimaryKeysResp - try { - val opHandle: OperationHandle = - cliService.getPrimaryKeys(new SessionHandle(req.getSessionHandle), - req.getCatalogName, - req.getSchemaName, - req.getTableName) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting functions: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - override def GetCrossReference(req: TGetCrossReferenceReq): TGetCrossReferenceResp = { - val resp = new TGetCrossReferenceResp - try { - val opHandle = - cliService.getCrossReference( - new SessionHandle(req.getSessionHandle), - req.getParentCatalogName, - req.getParentSchemaName, - req.getParentTableName, - req.getForeignCatalogName, - req.getForeignSchemaName, - req.getForeignTableName) - resp.setOperationHandle(opHandle.toTOperationHandle) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logInfo("Error getting functions: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - override def GetQueryId(req: TGetQueryIdReq): TGetQueryIdResp = { - try { - new TGetQueryIdResp(cliService.getQueryId(req.getOperationHandle)) - } catch { - case e: SparkThriftServerSQLException => throw new TException(e) - } - } - - override def SetClientInfo(req: TSetClientInfoReq): TSetClientInfoResp = { - val resp = new TSetClientInfoResp() - resp.setStatus(notSupportTokenErrorStatus) - } - - @throws[TException] - override def GetOperationStatus(req: TGetOperationStatusReq): TGetOperationStatusResp = { - val resp: TGetOperationStatusResp = new TGetOperationStatusResp - try { - val operationStatus: OperationStatus = - cliService.getOperationStatus(new OperationHandle(req.getOperationHandle)) - resp.setOperationState(operationStatus.getState.toTOperationState) - val opException: SparkThriftServerSQLException = operationStatus.getOperationException - if (opException != null) { - resp.setSqlState(opException.getSQLState) - resp.setErrorCode(opException.getErrorCode) - resp.setErrorMessage(opException.getMessage) - } - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting operation status: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def CancelOperation(req: TCancelOperationReq): TCancelOperationResp = { - val resp: TCancelOperationResp = new TCancelOperationResp - try { - cliService.cancelOperation(new OperationHandle(req.getOperationHandle)) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error cancelling operation: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def CloseOperation(req: TCloseOperationReq): TCloseOperationResp = { - val resp: TCloseOperationResp = new TCloseOperationResp - try { - cliService.closeOperation(new OperationHandle(req.getOperationHandle)) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error closing operation: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def GetResultSetMetadata(req: TGetResultSetMetadataReq): TGetResultSetMetadataResp = { - val resp: TGetResultSetMetadataResp = new TGetResultSetMetadataResp - try { - val schema: StructType = - cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle)) - resp.setSchema(SchemaMapper.toTTableSchema(schema)) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error getting result set metadata: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - @throws[TException] - override def FetchResults(req: TFetchResultsReq): TFetchResultsResp = { - val resp: TFetchResultsResp = new TFetchResultsResp - try { - val rowSet: RowSet = - cliService.fetchResults( - new OperationHandle(req.getOperationHandle), - FetchOrientation.getFetchOrientation(req.getOrientation), - req.getMaxRows, - FetchType.getFetchType(req.getFetchType)) - resp.setResults(rowSet.toTRowSet) - resp.setHasMoreRows(false) - resp.setStatus(OK_STATUS) - } catch { - case e: Exception => - logWarning("Error fetching results: ", e) - resp.setStatus(SparkThriftServerSQLException.toTStatus(e)) - } - resp - } - - override def run(): Unit - - /** - * If the proxy user name is provided then check privileges to substitute the user. - * - * @param realUser - * @param sessionConf - * @param ipAddress - * @return - * @throws SparkThriftServerSQLException - */ - @throws[SparkThriftServerSQLException] - private def getProxyUser(realUser: String, - sessionConf: util.Map[String, String], - ipAddress: String): String = { - var proxyUser: String = null - // We set the thread local proxy username, in ThriftHttpServlet. - if (cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_TRANSPORT_MODE) - .equalsIgnoreCase("http")) { - proxyUser = SessionManager.getProxyUserName - logDebug("Proxy user from query string: " + proxyUser) - } - if (proxyUser == null && - sessionConf != null && - sessionConf.containsKey(HiveAuthFactory.HS2_PROXY_USER)) { - val proxyUserFromThriftBody: String = sessionConf.get(HiveAuthFactory.HS2_PROXY_USER) - logDebug("Proxy user from thrift body: " + proxyUserFromThriftBody) - proxyUser = proxyUserFromThriftBody - } - if (proxyUser == null) return realUser - // check whether substitution is allowed - if (!hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ALLOW_USER_SUBSTITUTION)) { - throw new SparkThriftServerSQLException("Proxy user substitution is not allowed") - } - // If there's no authentication, then directly substitute the user - if (NONE.toString.equalsIgnoreCase(hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION))) { - return proxyUser - } - // Verify proxy user privilege of the realUser for the proxyUser - HiveAuthFactory.verifyProxyAccess(realUser, proxyUser, ipAddress, hiveConf) - logDebug("Verified proxy user: " + proxyUser) - proxyUser - } - - private def isKerberosAuthMode: Boolean = { - cliService.getHiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) - .equalsIgnoreCase(KERBEROS.toString) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala deleted file mode 100644 index 47866ce2bc12..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.scala +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.thrift - -import java.util.{List => JList, Map => JMap} - -import org.apache.thrift.TException - -import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory -import org.apache.spark.sql.thriftserver.cli._ -import org.apache.spark.sql.types.StructType - - -/** - * ThriftCLIServiceClient. - * - */ -class ThriftCLIServiceClient(val cliService: TCLIService.Iface) extends CLIServiceClient { - @throws[SparkThriftServerSQLException] - def checkStatus(status: TStatus): Unit = { - if (TStatusCode.ERROR_STATUS == status.getStatusCode) { - throw new SparkThriftServerSQLException(status) - } - } - - - @throws[SparkThriftServerSQLException] - override def openSession(username: String, - password: String, - configuration: JMap[String, String]): SessionHandle = try { - val req = new TOpenSessionReq - req.setUsername(username) - req.setPassword(password) - req.setConfiguration(configuration) - val resp = cliService.OpenSession(req) - checkStatus(resp.getStatus) - new SessionHandle(resp.getSessionHandle, resp.getServerProtocolVersion) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def openSessionWithImpersonation(username: String, - password: String, - configuration: JMap[String, String], - delegationToken: String): SessionHandle = - throw new SparkThriftServerSQLException("open with impersonation operation " + - "is not supported in the client") - - @throws[SparkThriftServerSQLException] - override def closeSession(sessionHandle: SessionHandle): Unit = { - try { - val req = new TCloseSessionReq(sessionHandle.toTSessionHandle) - val resp = cliService.CloseSession(req) - checkStatus(resp.getStatus) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def getInfo(sessionHandle: SessionHandle, - infoType: GetInfoType): GetInfoValue = { - try { - // FIXME extract the right info type - val req = new TGetInfoReq(sessionHandle.toTSessionHandle, infoType.toTGetInfoType) - val resp = cliService.GetInfo(req) - checkStatus(resp.getStatus) - new GetInfoValue(resp.getInfoValue) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def executeStatement(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String]): OperationHandle = - executeStatementInternal(sessionHandle, statement, confOverlay, false, 0) - - @throws[SparkThriftServerSQLException] - override def executeStatement(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String], - queryTimeout: Long): OperationHandle = - executeStatementInternal(sessionHandle, statement, confOverlay, false, queryTimeout) - - @throws[SparkThriftServerSQLException] - override def executeStatementAsync(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String]): OperationHandle = - executeStatementInternal(sessionHandle, statement, confOverlay, true, 0) - - @throws[SparkThriftServerSQLException] - override def executeStatementAsync(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String], - queryTimeout: Long): OperationHandle = - executeStatementInternal(sessionHandle, statement, confOverlay, true, queryTimeout) - - @throws[SparkThriftServerSQLException] - private def executeStatementInternal(sessionHandle: SessionHandle, - statement: String, - confOverlay: JMap[String, String], - isAsync: Boolean, - queryTimeout: Long): OperationHandle = { - try { - val req = new TExecuteStatementReq(sessionHandle.toTSessionHandle, statement) - req.setConfOverlay(confOverlay) - req.setRunAsync(isAsync) - req.setQueryTimeout(queryTimeout) - val resp = cliService.ExecuteStatement(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def getTypeInfo(sessionHandle: SessionHandle): OperationHandle = try { - val req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle) - val resp = cliService.GetTypeInfo(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def getCatalogs(sessionHandle: SessionHandle): OperationHandle = try { - val req = new TGetCatalogsReq(sessionHandle.toTSessionHandle) - val resp = cliService.GetCatalogs(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def getSchemas(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String): OperationHandle = try { - val req = new TGetSchemasReq(sessionHandle.toTSessionHandle) - req.setCatalogName(catalogName) - req.setSchemaName(schemaName) - val resp = cliService.GetSchemas(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def getTables(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String, - tableName: String, - tableTypes: JList[String]): OperationHandle = try { - val req = new TGetTablesReq(sessionHandle.toTSessionHandle) - req.setTableName(tableName) - req.setTableTypes(tableTypes) - req.setSchemaName(schemaName) - val resp = cliService.GetTables(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def getTableTypes(sessionHandle: SessionHandle): OperationHandle = try { - val req = new TGetTableTypesReq(sessionHandle.toTSessionHandle) - val resp = cliService.GetTableTypes(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def getColumns(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String, - tableName: String, - columnName: String): OperationHandle = { - try { - val req = new TGetColumnsReq - req.setSessionHandle(sessionHandle.toTSessionHandle) - req.setCatalogName(catalogName) - req.setSchemaName(schemaName) - req.setTableName(tableName) - req.setColumnName(columnName) - val resp = cliService.GetColumns(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def getFunctions(sessionHandle: SessionHandle, - catalogName: String, - schemaName: String, - functionName: String): OperationHandle = { - try { - val req = new TGetFunctionsReq(sessionHandle.toTSessionHandle, functionName) - req.setCatalogName(catalogName) - req.setSchemaName(schemaName) - val resp = cliService.GetFunctions(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def getOperationStatus(opHandle: OperationHandle): OperationStatus = try { - val req = new TGetOperationStatusReq(opHandle.toTOperationHandle) - val resp = cliService.GetOperationStatus(req) - // Checks the status of the RPC call, throws an exception in case of error - checkStatus(resp.getStatus) - val opState = OperationState.getOperationState(resp.getOperationState) - var opException: SparkThriftServerSQLException = null - if (opState eq OperationState.ERROR) { - opException = - new SparkThriftServerSQLException( - resp.getErrorMessage, - resp.getSqlState, - resp.getErrorCode) - } - new OperationStatus(opState, opException) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def cancelOperation(opHandle: OperationHandle): Unit = { - try { - val req = new TCancelOperationReq(opHandle.toTOperationHandle) - val resp = cliService.CancelOperation(req) - checkStatus(resp.getStatus) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def closeOperation(opHandle: OperationHandle): Unit = { - try { - val req = new TCloseOperationReq(opHandle.toTOperationHandle) - val resp = cliService.CloseOperation(req) - checkStatus(resp.getStatus) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def getResultSetMetadata(opHandle: OperationHandle): StructType = try { - val req = new TGetResultSetMetadataReq(opHandle.toTOperationHandle) - val resp = cliService.GetResultSetMetadata(req) - checkStatus(resp.getStatus) - SchemaMapper.toStructType(resp.getSchema) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def fetchResults(opHandle: OperationHandle, - orientation: FetchOrientation, - maxRows: Long, - fetchType: FetchType): RowSet = try { - val req = new TFetchResultsReq - req.setOperationHandle(opHandle.toTOperationHandle) - req.setOrientation(orientation.toTFetchOrientation) - req.setMaxRows(maxRows) - req.setFetchType(fetchType.toTFetchType) - val resp = cliService.FetchResults(req) - checkStatus(resp.getStatus) - RowSetFactory.create(resp.getResults, opHandle.getProtocolVersion) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def fetchResults(opHandle: OperationHandle): RowSet = { - // TODO: set the correct default fetch size - fetchResults(opHandle, FetchOrientation.FETCH_NEXT, 10000, FetchType.QUERY_OUTPUT) - } - - @throws[SparkThriftServerSQLException] - override def getDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - owner: String, - renewer: String): String = { - val req = new TGetDelegationTokenReq(sessionHandle.toTSessionHandle, owner, renewer) - try { - val tokenResp = cliService.GetDelegationToken(req) - checkStatus(tokenResp.getStatus) - tokenResp.getDelegationToken - } catch { - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def cancelDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - tokenStr: String): Unit = { - val cancelReq = new TCancelDelegationTokenReq(sessionHandle.toTSessionHandle, tokenStr) - try { - val cancelResp = cliService.CancelDelegationToken(cancelReq) - checkStatus(cancelResp.getStatus) - } catch { - case e: TException => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def renewDelegationToken(sessionHandle: SessionHandle, - authFactory: HiveAuthFactory, - tokenStr: String): Unit = { - val cancelReq = new TRenewDelegationTokenReq(sessionHandle.toTSessionHandle, tokenStr) - try { - val renewResp = cliService.RenewDelegationToken(cancelReq) - checkStatus(renewResp.getStatus) - } catch { - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - } - - @throws[SparkThriftServerSQLException] - override def getPrimaryKeys(sessionHandle: SessionHandle, - catalog: String, - schema: String, - table: String): OperationHandle = try { - val req = new TGetPrimaryKeysReq(sessionHandle.toTSessionHandle) - req.setCatalogName(catalog) - req.setSchemaName(schema) - req.setTableName(table) - val resp = cliService.GetPrimaryKeys(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - @throws[SparkThriftServerSQLException] - override def getCrossReference(sessionHandle: SessionHandle, - primaryCatalog: String, - primarySchema: String, - primaryTable: String, - foreignCatalog: String, - foreignSchema: String, - foreignTable: String): OperationHandle = try { - val req = new TGetCrossReferenceReq(sessionHandle.toTSessionHandle) - req.setParentCatalogName(primaryCatalog) - req.setParentSchemaName(primarySchema) - req.setParentTableName(primaryTable) - req.setForeignCatalogName(foreignCatalog) - req.setForeignSchemaName(foreignSchema) - req.setForeignTableName(foreignTable) - val resp = cliService.GetCrossReference(req) - checkStatus(resp.getStatus) - val protocol = sessionHandle.getProtocolVersion - new OperationHandle(resp.getOperationHandle, protocol) - } catch { - case e: SparkThriftServerSQLException => - throw e - case e: Exception => - throw new SparkThriftServerSQLException(e) - } - - override def getQueryId(opHandle: TOperationHandle): String = try - return cliService.GetQueryId(new TGetQueryIdReq(opHandle)).getQueryId - catch { - case e: TException => - throw new SparkThriftServerSQLException(e) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala deleted file mode 100644 index fe363dca7904..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpCLIService.scala +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.thrift - -import java.util.concurrent.{SynchronousQueue, ThreadPoolExecutor, TimeUnit} - -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.apache.hadoop.hive.shims.ShimLoader -import org.apache.hadoop.security.UserGroupInformation -import org.apache.hadoop.util.Shell -import org.apache.thrift.TProcessor -import org.apache.thrift.protocol.{TBinaryProtocol, TProtocolFactory} -import org.apache.thrift.server.TServlet -import org.eclipse.jetty.server._ -import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder} -import org.eclipse.jetty.util.ssl.SslContextFactory -import org.eclipse.jetty.util.thread.{ExecutorThreadPool, ScheduledExecutorScheduler} - -import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory -import org.apache.spark.sql.thriftserver.cli.CLIService -import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup - - -private[thriftserver] class ThriftHttpCLIService(cliService: CLIService) - extends ThriftCLIService(cliService, classOf[ThriftHttpCLIService].getSimpleName) { - /** - * Configure Jetty to serve http requests. Example of a client connection URL: - * http://localhost:10000/servlets/thrifths2/ A gateway may cause actual target URL to differ, - * e.g. http://gateway:port/hive2/servlets/thrifths2/ - */ - override def run(): Unit = { - try { // Server thread pool - // Start with minWorkerThreads, expand till maxWorkerThreads and reject subsequent requests - val threadPoolName: String = "HiveServer2-HttpHandler-Pool" - val executorService: ThreadPoolExecutor = - new ThreadPoolExecutor(minWorkerThreads, - maxWorkerThreads, - workerKeepAliveTime, - TimeUnit.SECONDS, - new SynchronousQueue[Runnable], - new ThreadFactoryWithGarbageCleanup(threadPoolName)) - val threadPool: ExecutorThreadPool = new ExecutorThreadPool(executorService) - // HTTP Server - httpServer = new org.eclipse.jetty.server.Server(threadPool) - // Connector configs - var connectionFactories: Array[ConnectionFactory] = null - val useSsl: Boolean = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL) - val schemeName: String = if (useSsl) { - "https" - } else { - "http" - } - // Change connector if SSL is used - if (useSsl) { - val keyStorePath: String = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim - val keyStorePassword: String = - ShimLoader.getHadoopShims - .getPassword(hiveConf, HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname) - if (keyStorePath.isEmpty) { - throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + - " Not configured for SSL connection") - } - val sslContextFactory: SslContextFactory = new SslContextFactory.Server - val excludedProtocols: Array[String] = - hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",") - logInfo("HTTP Server SSL: adding excluded protocols: " + excludedProtocols.mkString(",")) - sslContextFactory.addExcludeProtocols(excludedProtocols: _*) - logInfo("HTTP Server SSL: SslContextFactory.getExcludeProtocols = " - + sslContextFactory.getExcludeProtocols.mkString(",")) - sslContextFactory.setKeyStorePath(keyStorePath) - sslContextFactory.setKeyStorePassword(keyStorePassword) - connectionFactories = - AbstractConnectionFactory.getFactories(sslContextFactory, new HttpConnectionFactory) - } else { - connectionFactories = Array[ConnectionFactory](new HttpConnectionFactory) - } - val connector: ServerConnector = - new ServerConnector( - httpServer, - null, - new ScheduledExecutorScheduler("SparkThriftServer-HttpHandler-JettyScheduler", true), - null, - -1, - -1, - connectionFactories: _*) - connector.setPort(portNum) - // Linux:yes, Windows:no - connector.setReuseAddress(!Shell.WINDOWS) - val maxIdleTime: Int = hiveConf.getTimeVar( - ConfVars.HIVE_SERVER2_THRIFT_HTTP_MAX_IDLE_TIME, - TimeUnit.MILLISECONDS).toInt - connector.setIdleTimeout(maxIdleTime) - httpServer.addConnector(connector) - // Thrift configs - hiveAuthFactory = new HiveAuthFactory(hiveConf) - val processor: TProcessor = new TCLIService.Processor[TCLIService.Iface](this) - val protocolFactory: TProtocolFactory = new TBinaryProtocol.Factory - // Set during the init phase of HiveServer2 if auth mode is kerberos - // UGI for the hive/_HOST (kerberos) principal - val serviceUGI: UserGroupInformation = cliService.getServiceUGI - // UGI for the http/_HOST (SPNego) principal - val httpUGI: UserGroupInformation = cliService.getHttpUGI - val authType: String = hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) - val thriftHttpServlet: TServlet = - new ThriftHttpServlet(processor, protocolFactory, authType, serviceUGI, httpUGI) - // Context handler - val context: ServletContextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS) - context.setContextPath("/") - val httpPath: String = - getHttpPath(hiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH)) - httpServer.setHandler(context) - context.addServlet(new ServletHolder(thriftHttpServlet), httpPath) - // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc. - // Finally, start the server - httpServer.start() - val msg: String = "Started " + classOf[ThriftHttpCLIService].getSimpleName + - " in " + schemeName + " mode on port " + connector.getLocalPort + - " path=" + httpPath + " with " + minWorkerThreads + "..." + - maxWorkerThreads + " worker threads" - logInfo(msg) - httpServer.join() - } catch { - case t: Throwable => - logError("Error starting SparkThriftServer: could not start " + - classOf[ThriftHttpCLIService].getSimpleName, t) - System.exit(-1) - } - } - - private def getHttpPath(path: String): String = { - var httpPath = path - if (httpPath == null || httpPath == "") { - httpPath = "/*" - } - else { - if (!httpPath.startsWith("/")) { - httpPath = "/" + httpPath - } - if (httpPath.endsWith("/")) { - httpPath = httpPath + "*" - } - if (!httpPath.endsWith("/*")) { - httpPath = httpPath + "/*" - } - } - httpPath - } - -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala deleted file mode 100644 index 344f4192f441..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/thrift/ThriftHttpServlet.scala +++ /dev/null @@ -1,490 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.thrift - -import java.io.{IOException, UnsupportedEncodingException} -import java.security.PrivilegedExceptionAction -import java.util -import java.util.concurrent.TimeUnit -import javax.servlet.ServletException -import javax.servlet.http.{Cookie, HttpServletRequest, HttpServletResponse} -import javax.ws.rs.core.NewCookie - -import scala.collection.JavaConverters._ -import scala.util.control.NonFatal - -import org.apache.commons.codec.binary.{Base64, StringUtils} -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.apache.hadoop.hive.shims.{HadoopShims, ShimLoader} -import org.apache.hadoop.security.UserGroupInformation -import org.apache.thrift.TProcessor -import org.apache.thrift.protocol.TProtocolFactory -import org.apache.thrift.server.TServlet -import org.ietf.jgss._ - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.CookieSigner -import org.apache.spark.sql.thriftserver.auth._ -import org.apache.spark.sql.thriftserver.auth.AuthenticationProviderFactory.AuthMethods -import org.apache.spark.sql.thriftserver.cli.session.SessionManager - -private[thriftserver] class ThriftHttpServlet(processor: TProcessor, - protocolFactory: TProtocolFactory, - authType: String, - serviceUGI: UserGroupInformation, - httpUGI: UserGroupInformation) - extends TServlet(processor, protocolFactory) with Logging { - private val hiveConf: HiveConf = new HiveConf - // Class members for cookie based authentication. - private var signer: CookieSigner = null - val AUTH_COOKIE = "hive.server2.auth" - private val RAN = new util.Random - private val isCookieAuthEnabled: Boolean = - hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_AUTH_ENABLED) - - private var cookieDomain: String = null - private var cookiePath: String = null - private var cookieMaxAge: Int = 0 - private var isCookieSecure: Boolean = false - private var isHttpOnlyCookie: Boolean = false - - try { - // Initialize the cookie based authentication related variables. - if (isCookieAuthEnabled) { - // Generate the signer with secret. - val secret = RAN.nextLong.toString - logDebug("Using the random number as the secret for cookie generation " + secret) - this.signer = new CookieSigner(secret.getBytes) - this.cookieMaxAge = - hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_MAX_AGE, - TimeUnit.SECONDS).toInt - this.cookieDomain = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_DOMAIN) - this.cookiePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_PATH) - this.isCookieSecure = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_SECURE) - this.isHttpOnlyCookie = - hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_HTTPONLY) - } - } catch { - case NonFatal(e) => - logError("Error initializing ThriftHttpServlet.", e) - } - - @throws[ServletException] - @throws[IOException] - override protected def doPost(request: HttpServletRequest, - response: HttpServletResponse): Unit = { - var clientUserName: String = null - var clientIpAddress: String = null - var requireNewCookie: Boolean = false - try { // If the cookie based authentication is already enabled, parse the - // request and validate the request cookies. - if (isCookieAuthEnabled) { - clientUserName = validateCookie(request) - requireNewCookie = clientUserName == null - if (requireNewCookie) { - logInfo("Could not validate cookie sent, will try to generate a new cookie") - } - } - // If the cookie based authentication is not enabled or the request does - // not have a valid cookie, use the kerberos or password based authentication - // depending on the server setup. - if (clientUserName == null) { // For a kerberos setup - if (isKerberosAuthMode(authType)) clientUserName = doKerberosAuth(request) - else { // For password based authentication - clientUserName = doPasswdAuth(request, authType) - } - } - logDebug("Client username: " + clientUserName) - // Set the thread local username to be used for doAs if true - SessionManager.setUserName(clientUserName) - // find proxy user if any from query param - val doAsQueryParam: String = getDoAsQueryParam(request.getQueryString) - if (doAsQueryParam != null) { - SessionManager.setProxyUserName(doAsQueryParam) - } - clientIpAddress = request.getRemoteAddr - logDebug("Client IP Address: " + clientIpAddress) - // Set the thread local ip address - SessionManager.setIpAddress(clientIpAddress) - // Generate new cookie and add it to the response - if (requireNewCookie && !authType.equalsIgnoreCase(NOSASL.toString)) { - val cookieToken: String = HttpAuthUtils.createCookieToken(clientUserName) - val hs2Cookie: Cookie = createCookie(signer.signCookie(cookieToken)) - if (isHttpOnlyCookie) { - response.setHeader("SET-COOKIE", getHttpOnlyCookieHeader(hs2Cookie)) - } else { - response.addCookie(hs2Cookie) - } - logInfo("Cookie added for clientUserName " + clientUserName) - } - super.doPost(request, response) - } catch { - case e: HttpAuthenticationException => - logError("Error: ", e) - // Send a 401 to the client - response.setStatus(HttpServletResponse.SC_UNAUTHORIZED) - if (isKerberosAuthMode(authType)) { - response.addHeader(HttpAuthUtils.WWW_AUTHENTICATE, HttpAuthUtils.NEGOTIATE) - } - // scalastyle:off - response.getWriter.println("Authentication Error: " + e.getMessage) - // scalastyle:on - } finally { - // Clear the thread locals - SessionManager.clearUserName - SessionManager.clearIpAddress - SessionManager.clearProxyUserName - } - } - - /** - * Retrieves the client name from cookieString. If the cookie does not - * correspond to a valid client, the function returns null. - * - * @param cookies HTTP Request cookies. - * @return Client Username if cookieString has a HS2 Generated cookie that is currently valid. - * Else, returns null. - */ - private def getClientNameFromCookie(cookies: Array[Cookie]): String = { - // Current Cookie Name, Current Cookie Value - var currName: String = null - var currValue: String = null - // Following is the main loop which iterates through all the cookies send by the client. - // The HS2 generated cookies are of the format hive.server2.auth= - // A cookie which is identified as a hiveserver2 generated cookie is validated - // by calling signer.verifyAndExtract(). If the validation passes, send the - // username for which the cookie is validated to the caller. If no client side - // cookie passes the validation, return null to the caller. - for (currCookie <- cookies) { // Get the cookie name - currName = currCookie.getName - if (currName == AUTH_COOKIE) { - // If we reached here, we have match for HS2 generated cookie - currValue = currCookie.getValue - // Validate the value. - currValue = signer.verifyAndExtract(currValue) - // Retrieve the user name, do the final validation step. - if (currValue != null) { - val userName: String = HttpAuthUtils.getUserNameFromCookieToken(currValue) - if (userName == null) { - logWarning("Invalid cookie token " + currValue) - } else { - // We have found a valid cookie in the client request. - logDebug("Validated the cookie for user " + userName) - return userName - } - } - } - } - // No valid HS2 generated cookies found, return null - null - } - - /** - * Convert cookie array to human readable cookie string - * - * @param cookies Cookie Array - * @return String containing all the cookies separated by a newline character. - * Each cookie is of the format [key]=[value] - */ - private def toCookieStr(cookies: Array[Cookie]): String = { - var cookieStr: String = "" - for (c <- cookies) { - cookieStr += c.getName + "=" + c.getValue + " ;\n" - } - cookieStr - } - - /** - * Validate the request cookie. This function iterates over the request cookie headers - * and finds a cookie that represents a valid client/server session. If it finds one, it - * returns the client name associated with the session. Else, it returns null. - * - * @param request The HTTP Servlet Request send by the client - * @return Client Username if the request has valid HS2 cookie, else returns null - * @throws UnsupportedEncodingException - */ - @throws[UnsupportedEncodingException] - private def validateCookie(request: HttpServletRequest): String = { - // Find all the valid cookies associated with the request. - val cookies: Array[Cookie] = request.getCookies - if (cookies == null) { - logDebug("No valid cookies associated with the request " + request) - return null - } - logDebug("Received cookies: " + toCookieStr(cookies)) - getClientNameFromCookie(cookies) - } - - /** - * Generate a server side cookie given the cookie value as the input. - * - * @param str Input string token. - * @return The generated cookie. - * @throws UnsupportedEncodingException - */ - @throws[UnsupportedEncodingException] - private def createCookie(str: String): Cookie = { - logDebug("Cookie name = " + AUTH_COOKIE + " value = " + str) - val cookie: Cookie = new Cookie(AUTH_COOKIE, str) - cookie.setMaxAge(cookieMaxAge) - if (cookieDomain != null) { - cookie.setDomain(cookieDomain) - } - if (cookiePath != null) { - cookie.setPath(cookiePath) - } - cookie.setSecure(isCookieSecure) - cookie - } - - /** - * Generate httponly cookie from HS2 cookie - * - * @param cookie HS2 generated cookie - * @return The httponly cookie - */ - private def getHttpOnlyCookieHeader(cookie: Cookie): String = { - val newCookie: NewCookie = - new NewCookie(cookie.getName, - cookie.getValue, - cookie.getPath, - cookie.getDomain, - cookie.getVersion, - cookie.getComment, - cookie.getMaxAge, - cookie.getSecure) - newCookie + "; HttpOnly" - } - - /** - * Do the LDAP/PAM authentication - * - * @param request - * @param authType - * @throws HttpAuthenticationException - */ - @throws[HttpAuthenticationException] - private def doPasswdAuth(request: HttpServletRequest, authType: String): String = { - val userName: String = getUsername(request, authType) - // No-op when authType is NOSASL - if (!authType.equalsIgnoreCase(NOSASL.toString)) { - try { - val authMethod: AuthMethods = - AuthMethods.getValidAuthMethod(authType) - val provider: PasswdAuthenticationProvider = - AuthenticationProviderFactory.getAuthenticationProvider(authMethod) - provider.authenticate(userName, getPassword(request, authType)) - } catch { - case e: Exception => - throw new HttpAuthenticationException(e) - } - } - userName - } - - /** - * Do the GSS-API kerberos authentication. - * We already have a logged in subject in the form of serviceUGI, - * which GSS-API will extract information from. - * In case of a SPNego request we use the httpUGI, - * for the authenticating service tickets. - * - * @param request - * @return - * @throws HttpAuthenticationException - */ - @throws[HttpAuthenticationException] - private def doKerberosAuth(request: HttpServletRequest): String = { - // Try authenticating with the http/_HOST principal - if (httpUGI != null) { - try - return httpUGI.doAs(new HttpKerberosServerAction(request, httpUGI)) - catch { - case e: Exception => - logInfo("Failed to authenticate with http/_HOST kerberos principal, " + - "trying with hive/_HOST kerberos principal") - } - } - // Now try with hive/_HOST principal - try { - serviceUGI.doAs(new HttpKerberosServerAction(request, serviceUGI)) - } catch { - case e: Exception => - logError("Failed to authenticate with hive/_HOST kerberos principal") - throw new HttpAuthenticationException(e) - } - } - - private[thrift] class HttpKerberosServerAction(var request: HttpServletRequest, - var serviceUGI: UserGroupInformation) - extends PrivilegedExceptionAction[String] { - @throws[HttpAuthenticationException] - override def run: String = { // Get own Kerberos credentials for accepting connection - val manager: GSSManager = GSSManager.getInstance - var gssContext: GSSContext = null - val serverPrincipal: String = getPrincipalWithoutRealm(serviceUGI.getUserName) - try { // This Oid for Kerberos GSS-API mechanism. - val kerberosMechOid: Oid = new Oid("1.2.840.113554.1.2.2") - // Oid for SPNego GSS-API mechanism. - val spnegoMechOid: Oid = new Oid("1.3.6.1.5.5.2") - // Oid for kerberos principal name - val krb5PrincipalOid: Oid = new Oid("1.2.840.113554.1.2.2.1") - // GSS name for server - val serverName: GSSName = manager.createName(serverPrincipal, krb5PrincipalOid) - // GSS credentials for server - val serverCreds: GSSCredential = manager.createCredential(serverName, - GSSCredential.DEFAULT_LIFETIME, - Array[Oid](kerberosMechOid, - spnegoMechOid), - GSSCredential.ACCEPT_ONLY) - // Create a GSS context - gssContext = manager.createContext(serverCreds) - // Get service ticket from the authorization header - val serviceTicketBase64: String = getAuthHeader(request, authType) - val inToken: Array[Byte] = Base64.decodeBase64(serviceTicketBase64.getBytes) - gssContext.acceptSecContext(inToken, 0, inToken.length) - // authenticate or deny based on its context completion - if (!gssContext.isEstablished) { - throw new HttpAuthenticationException("Kerberos authentication failed: " + - "unable to establish context with the service ticket " + "provided by the client.") - } - else getPrincipalWithoutRealmAndHost(gssContext.getSrcName.toString) - } catch { - case e: GSSException => - throw new HttpAuthenticationException("Kerberos authentication failed: ", e) - } finally if (gssContext != null) try - gssContext.dispose() - catch { - case e: GSSException => - - // No-op - } - } - - @throws[HttpAuthenticationException] - private def getPrincipalWithoutRealm(fullPrincipal: String): String = { - var fullKerberosName: HadoopShims.KerberosNameShim = null - try - fullKerberosName = ShimLoader.getHadoopShims.getKerberosNameShim(fullPrincipal) - catch { - case e: IOException => - throw new HttpAuthenticationException(e) - } - val serviceName: String = fullKerberosName.getServiceName - val hostName: String = fullKerberosName.getHostName - var principalWithoutRealm: String = serviceName - if (hostName != null) principalWithoutRealm = serviceName + "/" + hostName - principalWithoutRealm - } - - @throws[HttpAuthenticationException] - private def getPrincipalWithoutRealmAndHost(fullPrincipal: String): String = { - var fullKerberosName: HadoopShims.KerberosNameShim = null - try { - fullKerberosName = ShimLoader.getHadoopShims.getKerberosNameShim(fullPrincipal) - fullKerberosName.getShortName - } catch { - case e: IOException => - throw new HttpAuthenticationException(e) - } - } - } - - @throws[HttpAuthenticationException] - private def getUsername(request: HttpServletRequest, authType: String): String = { - val creds: Array[String] = getAuthHeaderTokens(request, authType) - // Username must be present - if (creds(0) == null || creds(0).isEmpty) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client does not contain username.") - } - creds(0) - } - - @throws[HttpAuthenticationException] - private def getPassword(request: HttpServletRequest, authType: String): String = { - val creds: Array[String] = getAuthHeaderTokens(request, authType) - // Password must be present - if (creds(1) == null || creds(1).isEmpty) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client does not contain username.") - } - creds(1) - } - - @throws[HttpAuthenticationException] - private def getAuthHeaderTokens(request: HttpServletRequest, authType: String): Array[String] = { - val authHeaderBase64: String = getAuthHeader(request, authType) - val authHeaderString: String = - StringUtils.newStringUtf8(Base64.decodeBase64(authHeaderBase64.getBytes)) - val creds: Array[String] = authHeaderString.split(":") - creds - } - - /** - * Returns the base64 encoded auth header payload - * - * @param request - * @param authType - * @return - * @throws HttpAuthenticationException - */ - @throws[HttpAuthenticationException] - private def getAuthHeader(request: HttpServletRequest, authType: String): String = { - val authHeader: String = request.getHeader(HttpAuthUtils.AUTHORIZATION) - // Each http request must have an Authorization header - if (authHeader == null || authHeader.isEmpty) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client is empty.") - } - var authHeaderBase64String: String = null - var beginIndex: Int = 0 - if (isKerberosAuthMode(authType)) { - beginIndex = (HttpAuthUtils.NEGOTIATE + " ").length - } else { - beginIndex = (HttpAuthUtils.BASIC + " ").length - } - authHeaderBase64String = authHeader.substring(beginIndex) - // Authorization header must have a payload - if (authHeaderBase64String == null || authHeaderBase64String.isEmpty) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client does not contain any data.") - } - authHeaderBase64String - } - - private def isKerberosAuthMode(authType: String): Boolean = - authType.equalsIgnoreCase(KERBEROS.toString) - - private def getDoAsQueryParam(queryString: String): String = { - logDebug("URL query string:" + queryString) - if (queryString == null) { - return null - } - val params: util.Hashtable[String, Array[String]] = - javax.servlet.http.HttpUtils.parseQueryString(queryString) - val keySet: Seq[String] = params.keySet.asScala.toSeq - keySet.foreach(key => { - if (key.equalsIgnoreCase("doAs")) { - return params.get(key)(0) - } - }) - null - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala deleted file mode 100644 index 895746d91f1e..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/LogHelper.scala +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.utils - -import java.io.PrintStream - -import org.apache.commons.lang.StringUtils -import org.apache.hadoop.hive.ql.session.SessionState -import org.slf4j.Logger - - -/** - * This class provides helper routines to emit informational and error - * messages to the user and log4j files while obeying the current session's - * verbosity levels. - * - * NEVER write directly to the SessionStates standard output other than to - * emit result data DO use printInfo and printError provided by LogHelper to - * emit non result data strings. - * - * It is perfectly acceptable to have global static LogHelper objects (for - * example - once per module) LogHelper always emits info/error to current - * session as required. - */ -private[thriftserver] object LogHelper { - def getInfoStream: PrintStream = { - val ss = SessionState.get - if ((ss != null) && (ss.info != null)) ss.info - else getErrStream - } - - def getErrStream: PrintStream = { - val ss = SessionState.get - if ((ss != null) && (ss.err != null)) ss.err - else System.err - } -} - -private[thriftserver] class LogHelper(var LOG: Logger, var isSilent: Boolean) { - def this(LOG: Nothing) { - this(LOG, false) - } - - def getOutStream: PrintStream = { - val ss = SessionState.get - if ((ss != null) && (ss.out != null)) ss.out - else System.out - } - - def getChildOutStream: PrintStream = { - val ss = SessionState.get - if ((ss != null) && (ss.childOut != null)) ss.childOut - else System.out - } - - def getChildErrStream: PrintStream = { - val ss = SessionState.get - if ((ss != null) && (ss.childErr != null)) ss.childErr - else System.err - } - - def getIsSilent: Boolean = { - val ss = SessionState.get - // use the session or the one supplied in constructor - if (ss != null) ss.getIsSilent - else isSilent - } - - def logInfo(info: String): Unit = { - logInfo(info, null) - } - - def logInfo(info: String, detail: String): Unit = { - LOG.info(info + StringUtils.defaultString(detail)) - } - - def printInfo(info: String): Unit = { - printInfo(info, null) - } - - def printInfo(info: String, isSilent: Boolean): Unit = { - printInfo(info, null, isSilent) - } - - def printInfo(info: String, detail: String): Unit = { - printInfo(info, detail, getIsSilent) - } - - def printInfo(info: String, detail: String, isSilent: Boolean): Unit = { - if (!isSilent) { - // scalastyle:off - LogHelper.getInfoStream.println(info) - // scalastyle:on - } - LOG.info(info + StringUtils.defaultString(detail)) - } - - def printInfoNoLog(info: String): Unit = { - if (!getIsSilent) { - // scalastyle:off - LogHelper.getInfoStream.println(info) - // scalastyle:on - } - } - - def printError(error: String): Unit = { - printError(error, null) - } - - def printError(error: String, detail: String): Unit = { - // scalastyle:off - LogHelper.getErrStream.println(error) - // scalastyle:on - LOG.error(error + StringUtils.defaultString(detail)) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala deleted file mode 100644 index 4fdcf701571e..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/utils/VariableSubstitution.scala +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -package org.apache.spark.sql.thriftserver.cli.utils - -import java.util - -import org.apache.hadoop.conf.Configuration -import org.apache.hadoop.hive.conf.{HiveConf, SystemVariables} -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.apache.hadoop.hive.conf.SystemVariables._ -import org.apache.hadoop.hive.ql.session.SessionState - -import org.apache.spark.internal.Logging - -private[thriftserver] class VariableSubstitution(hiveVariableSource: util.Map[String, String]) - extends SystemVariables - with Logging { - override protected def getSubstitute(conf: Configuration, variable: String): String = { - var value: String = super.getSubstitute(conf, variable) - if (value == null && SessionState.get != null) { - if (variable.startsWith(HIVEVAR_PREFIX)) { - value = hiveVariableSource.get(variable.substring(HIVEVAR_PREFIX.length)) - } else { - value = hiveVariableSource.get(variable) - } - } - value - } - - def substitute(conf: HiveConf, expr: String): String = { - if (expr == null) { - return expr - } - if (HiveConf.getBoolVar(conf, ConfVars.HIVEVARIABLESUBSTITUTE)) { - logDebug("Substitution is on: " + expr) - } else { - return expr - } - val depth = HiveConf.getIntVar(conf, ConfVars.HIVEVARIABLESUBSTITUTEDEPTH) - substitute(conf, expr, depth) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala index 2b4e976b1442..0b9da12e24d9 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/server/SparkThriftServer.scala @@ -17,22 +17,29 @@ package org.apache.spark.sql.thriftserver.server -import java.util import java.util.concurrent.atomic.AtomicBoolean import scala.collection.JavaConverters._ +import scala.collection.mutable +import scala.collection.mutable.ArrayBuffer import org.apache.commons.cli._ import org.apache.hadoop.hive.common.LogUtils import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hive.common.util.{HiveStringUtils, HiveVersionInfo} +import org.apache.spark.SparkContext +import org.apache.spark.annotation.DeveloperApi import org.apache.spark.internal.Logging +import org.apache.spark.internal.config.UI.UI_ENABLED +import org.apache.spark.scheduler.{SparkListener, SparkListenerApplicationEnd, SparkListenerJobStart} import org.apache.spark.sql.SQLContext +import org.apache.spark.sql.hive.HiveUtils +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.thriftserver.{CompositeService, SparkSQLEnv} import org.apache.spark.sql.thriftserver.cli.CLIService import org.apache.spark.sql.thriftserver.cli.thrift.{ThriftBinaryCLIService, ThriftCLIService, ThriftHttpCLIService} -import org.apache.spark.util.ShutdownHookManager +import org.apache.spark.sql.thriftserver.ui.ThriftServerTab +import org.apache.spark.util.{ShutdownHookManager, Utils} private[thriftserver] class SparkThriftServer(sqlContext: SQLContext) extends CompositeService(classOf[SparkThriftServer].getSimpleName) @@ -68,11 +75,11 @@ private[thriftserver] class SparkThriftServer(sqlContext: SQLContext) // function ShutdownHookManager.addShutdownHook(() => { try { - logInfo("Hive Server Shutdown hook invoked") + logInfo("Spark Thrift Server Shutdown hook invoked") stop() } catch { case e: Throwable => - logWarning("Ignoring Exception while stopping Hive Server from shutdown hook", e) + logWarning("Ignoring Exception while stopping Spark Thrift Server from shutdown hook", e) } }) } @@ -92,49 +99,252 @@ private[thriftserver] class SparkThriftServer(sqlContext: SQLContext) } object SparkThriftServer extends Logging { + var uiTab: scala.Option[ThriftServerTab] = None + var listener: SparkThriftServerListener = _ + + def hiveConfForExecution(sparkContext: SparkContext): HiveConf = { + val extraConfig = HiveUtils.newTemporaryConfiguration(true) + val hiveConf: HiveConf = new HiveConf() + (sparkContext.hadoopConfiguration + .iterator().asScala.map(kv => kv.getKey -> kv.getValue) + ++ sparkContext.conf.getAll.toMap ++ extraConfig).toMap + .foreach { case (k, v) => hiveConf.set(k, v) } + hiveConf + } + + /** + * :: DeveloperApi :: + * Starts a new thrift server with the given context. + */ + @DeveloperApi + def startWithContext(sqlContext: SQLContext): SparkThriftServer = { + val server = new SparkThriftServer(sqlContext) + + server.init(hiveConfForExecution(sqlContext.sparkContext)) + server.start() + listener = new SparkThriftServerListener(server, sqlContext.conf) + sqlContext.sparkContext.addSparkListener(listener) + uiTab = if (sqlContext.sparkContext.getConf.get(UI_ENABLED)) { + Some(new ThriftServerTab(sqlContext.sparkContext)) + } else { + None + } + server + } + + private[thriftserver] class SessionInfo( + val sessionId: String, + val startTimestamp: Long, + val ip: String, + val userName: String) { + var finishTimestamp: Long = 0L + var totalExecution: Int = 0 + + def totalTime: Long = { + if (finishTimestamp == 0L) { + System.currentTimeMillis - startTimestamp + } else { + finishTimestamp - startTimestamp + } + } + } + + private[thriftserver] object ExecutionState extends Enumeration { + val STARTED, CANCELED, COMPILED, FAILED, FINISHED, CLOSED = Value + type ExecutionState = Value + } + + private[thriftserver] class ExecutionInfo( + val statement: String, + val sessionId: String, + val startTimestamp: Long, + val userName: String) { + var finishTimestamp: Long = 0L + var closeTimestamp: Long = 0L + var executePlan: String = "" + var detail: String = "" + var state: ExecutionState.Value = ExecutionState.STARTED + val jobId: ArrayBuffer[String] = ArrayBuffer[String]() + var groupId: String = "" + + def totalTime(endTime: Long): Long = { + if (endTime == 0L) { + System.currentTimeMillis - startTimestamp + } else { + endTime - startTimestamp + } + } + } + + + /** + * An inner sparkListener called in sc.stop to clean up the HiveThriftServer2 + */ + private[thriftserver] class SparkThriftServerListener(val server: SparkThriftServer, + val conf: SQLConf) extends SparkListener { + + override def onApplicationEnd(applicationEnd: SparkListenerApplicationEnd): Unit = { + server.stop() + } + + private val sessionList = new mutable.LinkedHashMap[String, SessionInfo] + private val executionList = new mutable.LinkedHashMap[String, ExecutionInfo] + private val retainedStatements = conf.getConf(SQLConf.THRIFTSERVER_UI_STATEMENT_LIMIT) + private val retainedSessions = conf.getConf(SQLConf.THRIFTSERVER_UI_SESSION_LIMIT) + + def getOnlineSessionNum: Int = synchronized { + sessionList.count(_._2.finishTimestamp == 0) + } + + def isExecutionActive(execInfo: ExecutionInfo): Boolean = { + !(execInfo.state == ExecutionState.FAILED || + execInfo.state == ExecutionState.CANCELED || + execInfo.state == ExecutionState.CLOSED) + } + + /** + * When an error or a cancellation occurs, we set the finishTimestamp of the statement. + * Therefore, when we count the number of running statements, we need to exclude errors and + * cancellations and count all statements that have not been closed so far. + */ + def getTotalRunning: Int = synchronized { + executionList.count { + case (_, v) => isExecutionActive(v) + } + } + + def getSessionList: Seq[SessionInfo] = synchronized { + sessionList.values.toSeq + } + + def getSession(sessionId: String): scala.Option[SessionInfo] = synchronized { + sessionList.get(sessionId) + } + + def getExecutionList: Seq[ExecutionInfo] = synchronized { + executionList.values.toSeq + } + + override def onJobStart(jobStart: SparkListenerJobStart): Unit = synchronized { + for { + props <- scala.Option(jobStart.properties) + groupId <- scala.Option(props.getProperty(SparkContext.SPARK_JOB_GROUP_ID)) + (_, info) <- executionList if info.groupId == groupId + } { + info.jobId += jobStart.jobId.toString + info.groupId = groupId + } + } + + def onSessionCreated(ip: String, sessionId: String, userName: String = "UNKNOWN"): Unit = { + synchronized { + val info = new SessionInfo(sessionId, System.currentTimeMillis, ip, userName) + sessionList.put(sessionId, info) + trimSessionIfNecessary() + } + } + + def onSessionClosed(sessionId: String): Unit = synchronized { + sessionList(sessionId).finishTimestamp = System.currentTimeMillis + trimSessionIfNecessary() + } + + def onStatementStart( + id: String, + sessionId: String, + statement: String, + groupId: String, + userName: String = "UNKNOWN"): Unit = synchronized { + val info = new ExecutionInfo(statement, sessionId, System.currentTimeMillis, userName) + info.state = ExecutionState.STARTED + executionList.put(id, info) + trimExecutionIfNecessary() + sessionList(sessionId).totalExecution += 1 + executionList(id).groupId = groupId + } + + def onStatementParsed(id: String, executionPlan: String): Unit = synchronized { + executionList(id).executePlan = executionPlan + executionList(id).state = ExecutionState.COMPILED + } + + def onStatementCanceled(id: String): Unit = synchronized { + executionList(id).finishTimestamp = System.currentTimeMillis + executionList(id).state = ExecutionState.CANCELED + trimExecutionIfNecessary() + } + + def onStatementError(id: String, errorMsg: String, errorTrace: String): Unit = synchronized { + executionList(id).finishTimestamp = System.currentTimeMillis + executionList(id).detail = errorMsg + executionList(id).state = ExecutionState.FAILED + trimExecutionIfNecessary() + } + + def onStatementFinish(id: String): Unit = synchronized { + executionList(id).finishTimestamp = System.currentTimeMillis + executionList(id).state = ExecutionState.FINISHED + trimExecutionIfNecessary() + } + + def onOperationClosed(id: String): Unit = synchronized { + executionList(id).closeTimestamp = System.currentTimeMillis + executionList(id).state = ExecutionState.CLOSED + } + + private def trimExecutionIfNecessary() = { + if (executionList.size > retainedStatements) { + val toRemove = math.max(retainedStatements / 10, 1) + executionList.filter(_._2.finishTimestamp != 0).take(toRemove).foreach { s => + executionList.remove(s._1) + } + } + } + + private def trimSessionIfNecessary() = { + if (sessionList.size > retainedSessions) { + val toRemove = math.max(retainedSessions / 10, 1) + sessionList.filter(_._2.finishTimestamp != 0).take(toRemove).foreach { s => + sessionList.remove(s._1) + } + } + + } + } + @throws[Throwable] - private def startHiveServer2(): Unit = { - var attempts = 0 - var maxAttempts: Long = 1 - while (true) { - logInfo("Starting HiveServer2") - val hiveConf = new HiveConf - maxAttempts = hiveConf.getLongVar(HiveConf.ConfVars.HIVE_SERVER2_MAX_START_ATTEMPTS) - var server: SparkThriftServer = null - try { - server = new SparkThriftServer(SparkSQLEnv.sqlContext) - server.init(hiveConf) - server.start() + private def startSparkServer(): Unit = { + Utils.initDaemon(log) + logInfo("Starting SparkContext") + SparkSQLEnv.init() - // ToDo add a JVMPauseMonitor for spark + ShutdownHookManager.addShutdownHook { () => + SparkSQLEnv.stop() + uiTab.foreach(_.detach()) + } - } catch { - case throwable: Throwable => - if (server != null) { - try - server.stop() - catch { - case t: Throwable => - logInfo("Exception caught when calling stop of HiveServer2 " + - "before retrying start", t) - } finally server = null - } - if ( { - attempts += 1; - attempts - } >= maxAttempts) { - throw new Error("Max start attempts " + maxAttempts + " exhausted", throwable) - } else { - logWarning("Error starting HiveServer2 on attempt " + - attempts + ", will retry in 60 seconds", throwable) - try - Thread.sleep(60L * 1000L) - catch { - case e: InterruptedException => - Thread.currentThread.interrupt() - } - } + try { + val server = new SparkThriftServer(SparkSQLEnv.sqlContext) + server.init(hiveConfForExecution(SparkSQLEnv.sparkContext)) + server.start() + logInfo("SparkThriftServer started") + listener = new SparkThriftServerListener(server, SparkSQLEnv.sqlContext.conf) + SparkSQLEnv.sparkContext.addSparkListener(listener) + uiTab = if (SparkSQLEnv.sparkContext.getConf.get(UI_ENABLED)) { + Some(new ThriftServerTab(SparkSQLEnv.sparkContext)) + } else { + None } + // If application was killed before HiveThriftServer2 start successfully then SparkSubmit + // process can not exit, so check whether if SparkContext was stopped. + if (SparkSQLEnv.sparkContext.stopped.get()) { + logError("SparkContext has stopped even if SparkThriftServer has started, so exit") + System.exit(-1) + } + } catch { + case e: Exception => + logError("Error starting SparkThriftServer", e) + System.exit(-1) } } @@ -152,27 +362,8 @@ object SparkThriftServer extends Logging { def main(args: Array[String]): Unit = { HiveConf.setLoadHiveServer2Config(true) try { - val oproc = new ServerOptionsProcessor("hiveserver2") + val oproc = new ServerOptionsProcessor("SparkThriftServer") val oprocResponse = oproc.parse(args) - val classname = classOf[SparkThriftServer].getSimpleName - logInfo(toStartupShutdownString("STARTUP_MSG: ", - Array[String]("Starting " + classname, - " host = " + HiveStringUtils.getHostname, - " args = " + util.Arrays.asList(args), - " version = " + HiveVersionInfo.getVersion, - " classpath = " + System.getProperty("java.class.path"), - " build = " + HiveVersionInfo.getUrl + - " -r " + HiveVersionInfo.getRevision + - "; compiled by '" + HiveVersionInfo.getUser + - "' on " + HiveVersionInfo.getDate))) - ShutdownHookManager.addShutdownHook(0)(() => { - logInfo(toStartupShutdownString( - "SHUTDOWN_MSG: ", - Array[String]("Shutting down " + classname + - " at " + HiveStringUtils.getHostname))) - }) - // Log debug message from "oproc" after log4j initialize properly - logDebug(oproc.getDebugMessage.toString) // Call the executor which will execute the appropriate command based on the parsed options oprocResponse.getServerOptionsExecutor.execute() } catch { @@ -182,22 +373,6 @@ object SparkThriftServer extends Logging { } } - - private def toStartupShutdownString(prefix: String, msg: Array[String]) = { - val b = new StringBuilder(prefix) - b.append("\n/************************************************************") - val arr = msg - val len = msg.length - var i = 0 - while (i < len) { - val s = arr(i) - b.append("\n" + prefix + s) - i += 1 - } - b.append("\n************************************************************/") - b.toString - } - /** * ServerOptionsProcessor. * Process arguments given to HiveServer2 (-hiveconf property=value) @@ -242,7 +417,7 @@ object SparkThriftServer extends Logging { } catch { case e: ParseException => // Error out & exit - we were not able to parse the args successfully - logError("Error starting HiveServer2 with given arguments: ") + logError("Error starting Spark Thrift Server with given arguments: ") logError(e.getMessage) System.exit(-1) } @@ -287,10 +462,10 @@ object SparkThriftServer extends Logging { private[server] class StartOptionExecutor extends ServerOptionsExecutor { override def execute(): Unit = { try - startHiveServer2() + startSparkServer() catch { case t: Throwable => - logError("Error starting HiveServer2", t) + logError("Error starting SparkThriftServer", t) System.exit(-1) } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala index 39b1b17cf73c..cf6abcc75975 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerPage.scala @@ -25,7 +25,7 @@ import scala.xml.Node import org.apache.commons.text.StringEscapeUtils import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.SparkThriftServer2.{ExecutionInfo, SessionInfo} +import org.apache.spark.sql.thriftserver.server.SparkThriftServer.{ExecutionInfo, SessionInfo} import org.apache.spark.ui._ import org.apache.spark.ui.UIUtils._ diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala index 37b564ac77ae..9fd38f66f355 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerSessionPage.scala @@ -25,7 +25,7 @@ import scala.xml.Node import org.apache.commons.text.StringEscapeUtils import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.SparkThriftServer2.ExecutionInfo +import org.apache.spark.sql.thriftserver.server.SparkThriftServer.ExecutionInfo import org.apache.spark.ui._ import org.apache.spark.ui.UIUtils._ diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala index e818625c8040..bb8496ae02f1 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/ui/ThriftServerTab.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.thriftserver.ui import org.apache.spark.{SparkContext, SparkException} import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.SparkThriftServer2 +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.thriftserver.ui.ThriftServerTab._ import org.apache.spark.ui.{SparkUI, SparkUITab} /** @@ -32,7 +32,7 @@ private[thriftserver] class ThriftServerTab(sparkContext: SparkContext) override val name = "JDBC/ODBC Server" val parent = getSparkUI(sparkContext) - val listener = SparkThriftServer2.listener + val listener = SparkThriftServer.listener attachPage(new ThriftServerPage(this)) attachPage(new ThriftServerSessionPage(this)) diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala index 928f4cef6495..05869469dcb1 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/JdbcConnectionUriSuite.scala @@ -23,7 +23,7 @@ import org.apache.hive.jdbc.HiveDriver import org.apache.spark.util.Utils -class JdbcConnectionUriSuite extends SparkThriftServer2Test { +class JdbcConnectionUriSuite extends SparkThriftServerTest { Utils.classForName(classOf[HiveDriver].getCanonicalName) override def mode: ServerMode.Value = ServerMode.binary diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerSuites.scala similarity index 98% rename from sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala rename to sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerSuites.scala index 6ddc959f1190..59c8a1d57787 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/HiveThriftServer2Suites.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerSuites.scala @@ -46,6 +46,7 @@ import org.apache.spark.sql.test.ProcessTestUtils.ProcessOutputCapturer import org.apache.spark.sql.thriftserver.auth.PlainSaslHelper import org.apache.spark.sql.thriftserver.cli.{FetchOrientation, FetchType, GetInfoType, RowSet} import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIService, ThriftCLIServiceClient} +import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.util.{ThreadUtils, Utils} object TestData { @@ -914,7 +915,7 @@ object ServerMode extends Enumeration { val binary, http = Value } -abstract class SparkThriftJdbcTest extends SparkThriftServer2Test { +abstract class SparkThriftJdbcTest extends SparkThriftServerTest { Utils.classForName(classOf[HiveDriver].getCanonicalName) private def jdbcUri = if (mode == ServerMode.http) { @@ -970,10 +971,10 @@ abstract class SparkThriftJdbcTest extends SparkThriftServer2Test { } } -abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterAll with Logging { +abstract class SparkThriftServerTest extends SparkFunSuite with BeforeAndAfterAll with Logging { def mode: ServerMode.Value - private val CLASS_NAME = SparkThriftServer2.getClass.getCanonicalName.stripSuffix("$") + private val CLASS_NAME = SparkThriftServer.getClass.getCanonicalName.stripSuffix("$") private val LOG_FILE_MARK = s"starting $CLASS_NAME, logging to " protected val startScript = @@ -1076,12 +1077,12 @@ abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterA diagnosisBuffer ++= s""" |### Attempt $attempt ### - |SparkThriftServer2 command line: $command + |SparkThriftServer command line: $command |Listening port: $port |System user: $user """.stripMargin.split("\n") - logInfo(s"Trying to start SparkThriftServer2: port=$port, mode=$mode, attempt=$attempt") + logInfo(s"Trying to start SparkThriftServer: port=$port, mode=$mode, attempt=$attempt") logPath = { val lines = Utils.executeAndGetOutput( @@ -1101,7 +1102,7 @@ abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterA lines.split("\n").collectFirst { case line if line.contains(LOG_FILE_MARK) => new File(line.drop(LOG_FILE_MARK.length)) }.getOrElse { - throw new RuntimeException("Failed to find SparkThriftServer2 log file.") + throw new RuntimeException("Failed to find SparkThriftServer log file.") } } @@ -1165,11 +1166,11 @@ abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterA logError( s""" |===================================== - |SparkThriftServer2Suite failure output + |SparkThriftServerSuite failure output |===================================== |${diagnosisBuffer.mkString("\n")} |========================================= - |End SparkThriftServer2Suite failure output + |End SparkThriftServerSuite failure output |========================================= """.stripMargin) } @@ -1193,13 +1194,13 @@ abstract class SparkThriftServer2Test extends SparkFunSuite with BeforeAndAfterA throw cause }.get - logInfo(s"SparkThriftServer2 started successfully") + logInfo(s"SparkThriftServer started successfully") } override protected def afterAll(): Unit = { try { stopThriftServer() - logInfo("SparkThriftServer2 stopped") + logInfo("SparkThriftServer stopped") } finally { super.afterAll() } diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala index 4622bec8f046..2d0615bd5667 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/ThriftServerQueryTestSuite.scala @@ -286,7 +286,7 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite { logInfo(s"Trying to start HiveThriftServer2: port=$port, attempt=$attempt") val sqlContext = spark.newSession().sqlContext sqlContext.setConf(ConfVars.HIVE_SERVER2_THRIFT_PORT.varname, port.toString) - hiveServer2 = SparkThriftServer2.startWithContext(sqlContext) + hiveServer2 = SparkThriftServer.startWithContext(sqlContext) } private def withJdbcStatement(fs: (Statement => Unit)*): Unit = { From 5fae84204ef790d62dd4590f2179fcca32258076 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 18:19:10 +0800 Subject: [PATCH 44/55] Update ColumnBasedSet.scala --- .../sql/thriftserver/cli/ColumnBasedSet.scala | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index 6f6486dddff3..822250b6f609 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -18,6 +18,7 @@ package org.apache.spark.sql.thriftserver.cli import java.nio.ByteBuffer +import java.sql.Date import java.util.BitSet import scala.collection.JavaConverters._ @@ -27,6 +28,7 @@ import org.apache.spark.sql.Row import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.thriftserver.cli.thrift._ import org.apache.spark.sql.types.{BinaryType, _} +import org.apache.spark.unsafe.types.CalendarInterval private[thriftserver] case class ColumnBasedSet( types: StructType, @@ -172,6 +174,38 @@ private[thriftserver] case class ColumnBasedSet( } }.asJava TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) + case DateType => + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + EMPTY_STRING + } else { + String.valueOf(rows(i).getAs[Date](ordinal).toString) + } + }.asJava + TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) + case CalendarIntervalType => + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + val isNull = rows(i).isNullAt(ordinal) + nulls.set(i, isNull) + if (isNull) { + EMPTY_STRING + } else { + HiveResult.toHiveString( + (rows(i).getAs[CalendarInterval](ordinal), CalendarIntervalType)) + } + }.asJava + TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) + case NullType => + val values = rows.indices + .filter(i => ordinal < rows(i).length).map { i => + nulls.set(i, true) + EMPTY_STRING + }.asJava + TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) case _ => val values = rows.indices .filter(i => ordinal < rows(i).length).map { i => From fe39db05b0cb674d929fde9a66fc600f7edc2dbd Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 18:33:09 +0800 Subject: [PATCH 45/55] Update RowBasedSet.scala --- .../sql/thriftserver/cli/RowBasedSet.scala | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala index dd2ff900c0bf..46bb34fc3208 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala @@ -17,6 +17,8 @@ package org.apache.spark.sql.thriftserver.cli +import java.sql.Date + import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer @@ -24,6 +26,7 @@ import org.apache.spark.sql.Row import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.thriftserver.cli.thrift._ import org.apache.spark.sql.types._ +import org.apache.spark.unsafe.types.{CalendarInterval, UTF8String} /** * A result set of Spark's [[Row]]s with its [[StructType]] as its schema, @@ -116,11 +119,31 @@ private[thriftserver] case class RowBasedSet(types: StructType, val tStringValue = new TStringValue if (!row.isNullAt(ordinal)) { val bytes = row.getAs[Array[Byte]](ordinal) - tStringValue.setValue(HiveResult.toHiveString((bytes, types(ordinal).dataType))) + tStringValue.setValue(UTF8String.fromBytes(bytes).toString) + } + TColumnValue.stringVal(tStringValue) + + case DateType => + val tStringValue = new TStringValue + if (!row.isNullAt(ordinal)) { + val date = row.getAs[Date](ordinal) + tStringValue.setValue(date.toString) } TColumnValue.stringVal(tStringValue) - case _: ArrayType | _: StructType | _: MapType => + case CalendarIntervalType => + val tStringValue = new TStringValue + if (!row.isNullAt(ordinal)) { + val calendarInterval = row.getAs[CalendarInterval](ordinal) + tStringValue.setValue(HiveResult.toHiveString(calendarInterval, CalendarIntervalType)) + } + TColumnValue.stringVal(tStringValue) + + case NullType => + val tStringValue = new TStringValue + TColumnValue.stringVal(tStringValue) + + case _: ArrayType | _: StructType | _: MapType | _: UserDefinedType[_] => val tStrValue = new TStringValue if (!row.isNullAt(ordinal)) { tStrValue.setValue( From 1c303ba61dd672d45626d1285425643e9eee8dc9 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 19:14:33 +0800 Subject: [PATCH 46/55] Update type map --- .../apache/spark/sql/thriftserver/cli/SchemaMapper.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala index cfe3f2b84f95..bdb34b1cdc97 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala @@ -97,12 +97,12 @@ private[thriftserver] object SchemaMapper { case TTypeId.TIMESTAMP_TYPE => TimestampType case TTypeId.BINARY_TYPE => BinaryType case TTypeId.ARRAY_TYPE => - ArrayType(StringType, true) + ArrayType.defaultConcreteType case TTypeId.MAP_TYPE => - MapType(StringType, StringType, true) + MapType.defaultConcreteType case TTypeId.STRUCT_TYPE => - StringType - case TTypeId.USER_DEFINED_TYPE => StringType + StructType.defaultConcreteType + case TTypeId.USER_DEFINED_TYPE => UserDefinedType[Any] case _ => StringType } } From 9a32af81946b53e41f9739fb27d9435c29eb4d2c Mon Sep 17 00:00:00 2001 From: angerszhu Date: Fri, 1 Nov 2019 21:54:52 +0800 Subject: [PATCH 47/55] make RowSetFactory clean --- .../sql/thriftserver/cli/ColumnBasedSet.scala | 52 ++++++++++++++++++- .../sql/thriftserver/cli/RowBasedSet.scala | 12 ++++- .../sql/thriftserver/cli/RowSetFactory.scala | 46 +--------------- 3 files changed, 64 insertions(+), 46 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala index 822250b6f609..cd31a646abd2 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala @@ -17,13 +17,20 @@ package org.apache.spark.sql.thriftserver.cli +import java.io.ByteArrayInputStream import java.nio.ByteBuffer import java.sql.Date +import java.util import java.util.BitSet import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer +import org.apache.thrift.TException +import org.apache.thrift.protocol.TCompactProtocol +import org.apache.thrift.transport.TIOStreamTransport + +import org.apache.spark.internal.Logging import org.apache.spark.sql.Row import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.thriftserver.cli.thrift._ @@ -247,7 +254,50 @@ private[thriftserver] case class ColumnBasedSet( override def iterator: Iterator[Row] = rows.iterator } -object ColumnBasedSet { +object ColumnBasedSet extends Logging{ private val EMPTY_STRING = "" private val EMPTY_BINARY = ByteBuffer.allocate(0) + + def apply(tRowSet: TRowSet): ColumnBasedSet = { + val rows = new ArrayBuffer[Row]() + if (tRowSet.isSetBinaryColumns) { + val protocol = + new TCompactProtocol( + new TIOStreamTransport( + new ByteArrayInputStream(tRowSet.getBinaryColumns))) + // Read from the stream using the protocol for each column in final schema + val bufferMap = new util.HashMap[Int, ColumnBuffer] + var i = 0 + while (i < tRowSet.getColumnCount) { + val tvalue = new TColumn + try { + tvalue.read(protocol) + } catch { + case e: TException => + logError(e.getMessage, e) + throw new TException("Error reading column value from the row set blob", e) + } + bufferMap.put(i, new ColumnBuffer(tvalue)) + i = i + 1 + } + val columnsSize = bufferMap.values().asScala.map(_.size).max + val columnCount = tRowSet.getColumns.size() + (0 until columnsSize).foreach(index => { + val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) + rows += row + }) + } else { + val bufferMap = new util.HashMap[Int, ColumnBuffer] + tRowSet.getColumns.asScala.zipWithIndex.foreach { case (tColumn, i) => + bufferMap.put(i, new ColumnBuffer(tColumn)) + } + val columnsSize = bufferMap.values().asScala.map(_.size).max + val columnCount = tRowSet.getColumns.size() + (0 until columnsSize).foreach(index => { + val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) + rows += row + }) + } + ColumnBasedSet(null, rows, tRowSet.getStartRowOffset) + } } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala index 46bb34fc3208..3514c1b65160 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala @@ -34,7 +34,7 @@ import org.apache.spark.unsafe.types.{CalendarInterval, UTF8String} * transform to [[TRowSet]]. */ private[thriftserver] case class RowBasedSet(types: StructType, - rows: ArrayBuffer[Row], initStartOffset: Long) + rows: ArrayBuffer[Row], initStartOffset: Long) extends RowSet { var startOffset: Long = initStartOffset @@ -175,3 +175,13 @@ private[thriftserver] case class RowBasedSet(types: StructType, override def iterator: Iterator[Row] = rows.iterator } + +object RowBasedSet { + def apply(tRowSet: TRowSet): RowBasedSet = { + val rows = new ArrayBuffer[Row]() + tRowSet.getRows.asScala.foreach(row => { + rows += Row.fromSeq(row.getColVals.asScala.map(_.getFieldValue)) + }) + RowBasedSet(null, rows, tRowSet.getStartRowOffset) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala index f5a63201c2b5..5775c2057e6d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala @@ -51,52 +51,10 @@ private[thriftserver] object RowSetFactory extends Logging { } def create(tRowSet: TRowSet, version: TProtocolVersion): RowSet = { - val rows = new ArrayBuffer[Row]() if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { - if (tRowSet.isSetBinaryColumns) { - val protocol = - new TCompactProtocol( - new TIOStreamTransport( - new ByteArrayInputStream(tRowSet.getBinaryColumns))) - // Read from the stream using the protocol for each column in final schema - val bufferMap = new util.HashMap[Int, ColumnBuffer] - var i = 0 - while (i < tRowSet.getColumnCount) { - val tvalue = new TColumn - try { - tvalue.read(protocol) - } catch { - case e: TException => - logError(e.getMessage, e) - throw new TException("Error reading column value from the row set blob", e) - } - bufferMap.put(i, new ColumnBuffer(tvalue)) - i = i + 1 - } - val columnsSize = bufferMap.values().asScala.map(_.size).max - val columnCount = tRowSet.getColumns.size() - (0 until columnsSize).foreach(index => { - val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) - rows += row - }) - } else { - val bufferMap = new util.HashMap[Int, ColumnBuffer] - tRowSet.getColumns.asScala.zipWithIndex.foreach { case (tColumn, i) => - bufferMap.put(i, new ColumnBuffer(tColumn)) - } - val columnsSize = bufferMap.values().asScala.map(_.size).max - val columnCount = tRowSet.getColumns.size() - (0 until columnsSize).foreach(index => { - val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) - rows += row - }) - } - ColumnBasedSet(null, rows, tRowSet.getStartRowOffset) + ColumnBasedSet(tRowSet) } else { - tRowSet.getRows.asScala.foreach(row => { - rows += Row.fromSeq(row.getColVals.asScala.map(_.getFieldValue)) - }) - RowBasedSet(null, rows, tRowSet.getStartRowOffset) + RowBasedSet(tRowSet) } } } From 287c6be9be369a34a029e8738546530425552fa1 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Sat, 2 Nov 2019 11:55:36 +0800 Subject: [PATCH 48/55] update --- .../sql/thriftserver/auth/HiveAuthUtils.java | 125 +++++ .../sql/thriftserver/cli/ColumnBasedSet.java | 196 ++++++++ .../sql/thriftserver/cli/ColumnBuffer.java | 446 ++++++++++++++++++ .../thriftserver/cli/ColumnDescriptor.java | 91 ++++ .../sql/thriftserver/cli/ColumnValue.java | 287 +++++++++++ .../sql/thriftserver/cli/ICLIService.java | 2 +- .../sql/thriftserver/cli/RowBasedSet.java | 147 ++++++ .../spark/sql/thriftserver/cli/RowSet.java | 39 ++ .../sql/thriftserver/cli/RowSetFactory.java | 43 ++ .../sql/thriftserver/cli/TableSchema.java | 103 ++++ .../sql/thriftserver/cli/TypeDescriptor.java | 156 ++++++ .../sql/thriftserver/cli/TypeQualifiers.java | 133 ++++++ .../thriftserver/cli/operation/Operation.java | 340 +++++++++++++ .../cli/thrift/ThriftBinaryCLIService.java | 2 +- .../cli/thrift/ThriftCLIService.java | 4 +- .../cli/thrift/ThriftCLIServiceClient.java | 4 +- .../sql/thriftserver/cli/CLIService.scala | 4 +- .../sql/thriftserver/cli/ColumnBasedSet.scala | 303 ------------ .../sql/thriftserver/cli/ColumnBuffer.scala | 207 -------- .../thriftserver/cli/ColumnDescriptor.scala | 41 -- .../sql/thriftserver/cli/RowBasedSet.scala | 187 -------- .../spark/sql/thriftserver/cli/RowSet.scala | 39 -- .../sql/thriftserver/cli/RowSetFactory.scala | 60 --- .../sql/thriftserver/cli/SchemaMapper.scala | 108 ----- .../sql/thriftserver/cli/TypeDescriptor.scala | 41 -- .../sql/thriftserver/cli/TypeQualifiers.scala | 58 --- .../cli/operation/Operation.scala | 304 ------------ .../cli/operation/OperationManager.scala | 22 +- .../SparkExecuteStatementOperation.scala | 122 +++-- .../operation/SparkGetCatalogsOperation.scala | 11 +- .../operation/SparkGetColumnsOperation.scala | 112 +++-- .../SparkGetFunctionsOperation.scala | 33 +- .../operation/SparkGetSchemasOperation.scala | 17 +- .../SparkGetTableTypesOperation.scala | 15 +- .../operation/SparkGetTablesOperation.scala | 66 ++- .../operation/SparkGetTypeInfoOperation.scala | 74 +-- .../operation/SparkMetadataOperation.scala | 7 +- .../cli/session/ThriftServerSession.scala | 2 +- .../cli/session/ThriftServerSessionImpl.scala | 2 +- .../SparkThriftServerSuites.scala | 3 +- 40 files changed, 2440 insertions(+), 1516 deletions(-) create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthUtils.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnValue.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowBasedSet.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSetFactory.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TableSchema.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.java create mode 100644 sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/Operation.java delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala delete mode 100644 sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthUtils.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthUtils.java new file mode 100644 index 000000000000..e946404aa02c --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/auth/HiveAuthUtils.java @@ -0,0 +1,125 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.auth; + +import java.net.InetSocketAddress; +import java.net.UnknownHostException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLSocket; + +import org.apache.thrift.transport.TSSLTransportFactory; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TSocket; +import org.apache.thrift.transport.TTransport; +import org.apache.thrift.transport.TTransportException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * This class helps in some aspects of authentication. It creates the proper Thrift classes for the + * given configuration as well as helps with authenticating requests. + */ +public class HiveAuthUtils { + private static final Logger LOG = LoggerFactory.getLogger(HiveAuthUtils.class); + + public static TTransport getSocketTransport(String host, int port, int loginTimeout) { + return new TSocket(host, port, loginTimeout); + } + + public static TTransport getSSLSocket(String host, int port, int loginTimeout) + throws TTransportException { + // The underlying SSLSocket object is bound to host:port with the given SO_TIMEOUT + TSocket tSSLSocket = TSSLTransportFactory.getClientSocket(host, port, loginTimeout); + return getSSLSocketWithHttps(tSSLSocket); + } + + public static TTransport getSSLSocket(String host, int port, int loginTimeout, + String trustStorePath, String trustStorePassWord) throws TTransportException { + TSSLTransportFactory.TSSLTransportParameters params = + new TSSLTransportFactory.TSSLTransportParameters(); + params.setTrustStore(trustStorePath, trustStorePassWord); + params.requireClientAuth(true); + // The underlying SSLSocket object is bound to host:port with the given SO_TIMEOUT and + // SSLContext created with the given params + TSocket tSSLSocket = TSSLTransportFactory.getClientSocket(host, port, loginTimeout, params); + return getSSLSocketWithHttps(tSSLSocket); + } + + // Using endpoint identification algorithm as HTTPS enables us to do + // CNAMEs/subjectAltName verification + private static TSocket getSSLSocketWithHttps(TSocket tSSLSocket) throws TTransportException { + SSLSocket sslSocket = (SSLSocket) tSSLSocket.getSocket(); + SSLParameters sslParams = sslSocket.getSSLParameters(); + sslParams.setEndpointIdentificationAlgorithm("HTTPS"); + sslSocket.setSSLParameters(sslParams); + return new TSocket(sslSocket); + } + + public static TServerSocket getServerSocket(String hiveHost, int portNum) + throws TTransportException { + InetSocketAddress serverAddress; + if (hiveHost == null || hiveHost.isEmpty()) { + // Wildcard bind + serverAddress = new InetSocketAddress(portNum); + } else { + serverAddress = new InetSocketAddress(hiveHost, portNum); + } + return new TServerSocket(serverAddress); + } + + public static TServerSocket getServerSSLSocket(String hiveHost, int portNum, String keyStorePath, + String keyStorePassWord, List sslVersionBlacklist) throws TTransportException, + UnknownHostException { + TSSLTransportFactory.TSSLTransportParameters params = + new TSSLTransportFactory.TSSLTransportParameters(); + params.setKeyStore(keyStorePath, keyStorePassWord); + InetSocketAddress serverAddress; + if (hiveHost == null || hiveHost.isEmpty()) { + // Wildcard bind + serverAddress = new InetSocketAddress(portNum); + } else { + serverAddress = new InetSocketAddress(hiveHost, portNum); + } + TServerSocket thriftServerSocket = + TSSLTransportFactory.getServerSocket(portNum, 0, serverAddress.getAddress(), params); + if (thriftServerSocket.getServerSocket() instanceof SSLServerSocket) { + List sslVersionBlacklistLocal = new ArrayList(); + for (String sslVersion : sslVersionBlacklist) { + sslVersionBlacklistLocal.add(sslVersion.trim().toLowerCase()); + } + SSLServerSocket sslServerSocket = (SSLServerSocket) thriftServerSocket.getServerSocket(); + List enabledProtocols = new ArrayList(); + for (String protocol : sslServerSocket.getEnabledProtocols()) { + if (sslVersionBlacklistLocal.contains(protocol.toLowerCase())) { + LOG.debug("Disabling SSL Protocol: " + protocol); + } else { + enabledProtocols.add(protocol); + } + } + sslServerSocket.setEnabledProtocols(enabledProtocols.toArray(new String[0])); + LOG.info("SSL Server Socket Enabled Protocols: " + + Arrays.toString(sslServerSocket.getEnabledProtocols())); + } + return thriftServerSocket; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.java new file mode 100644 index 000000000000..da6a6661903e --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.java @@ -0,0 +1,196 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.io.ByteArrayInputStream; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import org.apache.spark.sql.thriftserver.cli.thrift.TColumn; +import org.apache.spark.sql.thriftserver.cli.thrift.TRow; +import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TCompactProtocol; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.transport.TIOStreamTransport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ColumnBasedSet. + */ +public class ColumnBasedSet implements RowSet { + + private long startOffset; + + private final TypeDescriptor[] descriptors; // non-null only for writing (server-side) + private final List columns; + private byte[] blob; + private boolean isBlobBased = false; + public static final Logger LOG = LoggerFactory.getLogger(ColumnBasedSet.class); + + public ColumnBasedSet(TableSchema schema) { + descriptors = schema.toTypeDescriptors(); + columns = new ArrayList(); + for (ColumnDescriptor colDesc : schema.getColumnDescriptors()) { + columns.add(new ColumnBuffer(colDesc.getType())); + } + } + + public ColumnBasedSet(TRowSet tRowSet) throws TException { + descriptors = null; + columns = new ArrayList(); + // Use TCompactProtocol to read serialized TColumns + if (tRowSet.isSetBinaryColumns()) { + TProtocol protocol = + new TCompactProtocol(new TIOStreamTransport(new ByteArrayInputStream( + tRowSet.getBinaryColumns()))); + // Read from the stream using the protocol for each column in final schema + for (int i = 0; i < tRowSet.getColumnCount(); i++) { + TColumn tvalue = new TColumn(); + try { + tvalue.read(protocol); + } catch (TException e) { + LOG.error(e.getMessage(), e); + throw new TException("Error reading column value from the row set blob", e); + } + columns.add(new ColumnBuffer(tvalue)); + } + } + else { + if (tRowSet.getColumns() != null) { + for (TColumn tvalue : tRowSet.getColumns()) { + columns.add(new ColumnBuffer(tvalue)); + } + } + } + startOffset = tRowSet.getStartRowOffset(); + } + + private ColumnBasedSet(TypeDescriptor[] descriptors, List columns, long startOffset) { + this.descriptors = descriptors; + this.columns = columns; + this.startOffset = startOffset; + } + + public ColumnBasedSet(TableSchema schema, boolean isBlobBased) { + this(schema); + this.isBlobBased = isBlobBased; + } + + @Override + public ColumnBasedSet addRow(Object[] fields) { + if (isBlobBased) { + this.blob = (byte[]) fields[0]; + } else { + for (int i = 0; i < fields.length; i++) { + TypeDescriptor descriptor = descriptors[i]; + columns.get(i).addValue(descriptor.getType(), fields[i]); + } + } + return this; + } + + public List getColumns() { + return columns; + } + + @Override + public int numColumns() { + return columns.size(); + } + + @Override + public int numRows() { + return columns.isEmpty() ? 0 : columns.get(0).size(); + } + + @Override + public ColumnBasedSet extractSubset(int maxRows) { + int numRows = Math.min(numRows(), maxRows); + + List subset = new ArrayList(); + for (int i = 0; i < columns.size(); i++) { + subset.add(columns.get(i).extractSubset(numRows)); + } + ColumnBasedSet result = new ColumnBasedSet(descriptors, subset, startOffset); + startOffset += numRows; + return result; + } + + @Override + public long getStartOffset() { + return startOffset; + } + + @Override + public void setStartOffset(long startOffset) { + this.startOffset = startOffset; + } + + public TRowSet toTRowSet() { + TRowSet tRowSet = new TRowSet(startOffset, new ArrayList()); + if (isBlobBased) { + tRowSet.setColumns(null); + tRowSet.setBinaryColumns(blob); + tRowSet.setColumnCount(numColumns()); + } else { + for (int i = 0; i < columns.size(); i++) { + tRowSet.addToColumns(columns.get(i).toTColumn()); + } + } + return tRowSet; + } + + @Override + public Iterator iterator() { + return new Iterator() { + + private int index; + private final Object[] convey = new Object[numColumns()]; + + @Override + public boolean hasNext() { + return index < numRows(); + } + + @Override + public Object[] next() { + for (int i = 0; i < columns.size(); i++) { + convey[i] = columns.get(i).get(index); + } + index++; + return convey; + } + + @Override + public void remove() { + throw new UnsupportedOperationException("remove"); + } + }; + } + + public Object[] fill(int index, Object[] convey) { + for (int i = 0; i < columns.size(); i++) { + convey[i] = columns.get(i).get(index); + } + return convey; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.java new file mode 100644 index 000000000000..35070aa024f5 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.java @@ -0,0 +1,446 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.nio.ByteBuffer; +import java.util.AbstractList; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; +import java.util.List; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.primitives.Booleans; +import com.google.common.primitives.Bytes; +import com.google.common.primitives.Doubles; +import com.google.common.primitives.Ints; +import com.google.common.primitives.Longs; +import com.google.common.primitives.Shorts; +import org.apache.spark.sql.thriftserver.cli.thrift.*; + +/** + * ColumnBuffer + */ +public class ColumnBuffer extends AbstractList { + + private static final int DEFAULT_SIZE = 100; + + private final Type type; + + private BitSet nulls; + + private int size; + private boolean[] boolVars; + private byte[] byteVars; + private short[] shortVars; + private int[] intVars; + private long[] longVars; + private double[] doubleVars; + private List stringVars; + private List binaryVars; + + public ColumnBuffer(Type type, BitSet nulls, Object values) { + this.type = type; + this.nulls = nulls; + if (type == Type.BOOLEAN_TYPE) { + boolVars = (boolean[]) values; + size = boolVars.length; + } else if (type == Type.TINYINT_TYPE) { + byteVars = (byte[]) values; + size = byteVars.length; + } else if (type == Type.SMALLINT_TYPE) { + shortVars = (short[]) values; + size = shortVars.length; + } else if (type == Type.INT_TYPE) { + intVars = (int[]) values; + size = intVars.length; + } else if (type == Type.BIGINT_TYPE) { + longVars = (long[]) values; + size = longVars.length; + } else if (type == Type.DOUBLE_TYPE || type == Type.FLOAT_TYPE) { + doubleVars = (double[]) values; + size = doubleVars.length; + } else if (type == Type.BINARY_TYPE) { + binaryVars = (List) values; + size = binaryVars.size(); + } else if (type == Type.STRING_TYPE) { + stringVars = (List) values; + size = stringVars.size(); + } else { + throw new IllegalStateException("invalid union object"); + } + } + + public ColumnBuffer(Type type) { + nulls = new BitSet(); + switch (type) { + case BOOLEAN_TYPE: + boolVars = new boolean[DEFAULT_SIZE]; + break; + case TINYINT_TYPE: + byteVars = new byte[DEFAULT_SIZE]; + break; + case SMALLINT_TYPE: + shortVars = new short[DEFAULT_SIZE]; + break; + case INT_TYPE: + intVars = new int[DEFAULT_SIZE]; + break; + case BIGINT_TYPE: + longVars = new long[DEFAULT_SIZE]; + break; + case FLOAT_TYPE: + type = Type.FLOAT_TYPE; + doubleVars = new double[DEFAULT_SIZE]; + break; + case DOUBLE_TYPE: + type = Type.DOUBLE_TYPE; + doubleVars = new double[DEFAULT_SIZE]; + break; + case BINARY_TYPE: + binaryVars = new ArrayList(); + break; + default: + type = Type.STRING_TYPE; + stringVars = new ArrayList(); + } + this.type = type; + } + + public ColumnBuffer(TColumn colValues) { + if (colValues.isSetBoolVal()) { + type = Type.BOOLEAN_TYPE; + nulls = toBitset(colValues.getBoolVal().getNulls()); + boolVars = Booleans.toArray(colValues.getBoolVal().getValues()); + size = boolVars.length; + } else if (colValues.isSetByteVal()) { + type = Type.TINYINT_TYPE; + nulls = toBitset(colValues.getByteVal().getNulls()); + byteVars = Bytes.toArray(colValues.getByteVal().getValues()); + size = byteVars.length; + } else if (colValues.isSetI16Val()) { + type = Type.SMALLINT_TYPE; + nulls = toBitset(colValues.getI16Val().getNulls()); + shortVars = Shorts.toArray(colValues.getI16Val().getValues()); + size = shortVars.length; + } else if (colValues.isSetI32Val()) { + type = Type.INT_TYPE; + nulls = toBitset(colValues.getI32Val().getNulls()); + intVars = Ints.toArray(colValues.getI32Val().getValues()); + size = intVars.length; + } else if (colValues.isSetI64Val()) { + type = Type.BIGINT_TYPE; + nulls = toBitset(colValues.getI64Val().getNulls()); + longVars = Longs.toArray(colValues.getI64Val().getValues()); + size = longVars.length; + } else if (colValues.isSetDoubleVal()) { + type = Type.DOUBLE_TYPE; + nulls = toBitset(colValues.getDoubleVal().getNulls()); + doubleVars = Doubles.toArray(colValues.getDoubleVal().getValues()); + size = doubleVars.length; + } else if (colValues.isSetBinaryVal()) { + type = Type.BINARY_TYPE; + nulls = toBitset(colValues.getBinaryVal().getNulls()); + binaryVars = colValues.getBinaryVal().getValues(); + size = binaryVars.size(); + } else if (colValues.isSetStringVal()) { + type = Type.STRING_TYPE; + nulls = toBitset(colValues.getStringVal().getNulls()); + stringVars = colValues.getStringVal().getValues(); + size = stringVars.size(); + } else { + throw new IllegalStateException("invalid union object"); + } + } + + /** + * Get a subset of this ColumnBuffer, starting from the 1st value. + * + * @param end index after the last value to include + */ + public ColumnBuffer extractSubset(int end) { + BitSet subNulls = nulls.get(0, end); + if (type == Type.BOOLEAN_TYPE) { + ColumnBuffer subset = + new ColumnBuffer(type, subNulls, Arrays.copyOfRange(boolVars, 0, end)); + boolVars = Arrays.copyOfRange(boolVars, end, size); + nulls = nulls.get(end, size); + size = boolVars.length; + return subset; + } + if (type == Type.TINYINT_TYPE) { + ColumnBuffer subset = + new ColumnBuffer(type, subNulls, Arrays.copyOfRange(byteVars, 0, end)); + byteVars = Arrays.copyOfRange(byteVars, end, size); + nulls = nulls.get(end, size); + size = byteVars.length; + return subset; + } + if (type == Type.SMALLINT_TYPE) { + ColumnBuffer subset = + new ColumnBuffer(type, subNulls, Arrays.copyOfRange(shortVars, 0, end)); + shortVars = Arrays.copyOfRange(shortVars, end, size); + nulls = nulls.get(end, size); + size = shortVars.length; + return subset; + } + if (type == Type.INT_TYPE) { + ColumnBuffer subset = + new ColumnBuffer(type, subNulls, Arrays.copyOfRange(intVars, 0, end)); + intVars = Arrays.copyOfRange(intVars, end, size); + nulls = nulls.get(end, size); + size = intVars.length; + return subset; + } + if (type == Type.BIGINT_TYPE) { + ColumnBuffer subset = + new ColumnBuffer(type, subNulls, Arrays.copyOfRange(longVars, 0, end)); + longVars = Arrays.copyOfRange(longVars, end, size); + nulls = nulls.get(end, size); + size = longVars.length; + return subset; + } + if (type == Type.DOUBLE_TYPE || type == Type.FLOAT_TYPE) { + ColumnBuffer subset = + new ColumnBuffer(type, subNulls, Arrays.copyOfRange(doubleVars, 0, end)); + doubleVars = Arrays.copyOfRange(doubleVars, end, size); + nulls = nulls.get(end, size); + size = doubleVars.length; + return subset; + } + if (type == Type.BINARY_TYPE) { + ColumnBuffer subset = new ColumnBuffer(type, subNulls, binaryVars.subList(0, end)); + binaryVars = binaryVars.subList(end, binaryVars.size()); + nulls = nulls.get(end, size); + size = binaryVars.size(); + return subset; + } + if (type == Type.STRING_TYPE) { + ColumnBuffer subset = new ColumnBuffer(type, subNulls, stringVars.subList(0, end)); + stringVars = stringVars.subList(end, stringVars.size()); + nulls = nulls.get(end, size); + size = stringVars.size(); + return subset; + } + throw new IllegalStateException("invalid union object"); + } + + @VisibleForTesting + BitSet getNulls() { + return nulls; + } + + private static final byte[] MASKS = new byte[] { + 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, (byte)0x80 + }; + + private static BitSet toBitset(byte[] nulls) { + BitSet bitset = new BitSet(); + int bits = nulls.length * 8; + for (int i = 0; i < bits; i++) { + bitset.set(i, (nulls[i / 8] & MASKS[i % 8]) != 0); + } + return bitset; + } + + private static byte[] toBinary(BitSet bitset) { + byte[] nulls = new byte[1 + (bitset.length() / 8)]; + for (int i = 0; i < bitset.length(); i++) { + nulls[i / 8] |= bitset.get(i) ? MASKS[i % 8] : 0; + } + return nulls; + } + + public Type getType() { + return type; + } + + @Override + public Object get(int index) { + if (nulls.get(index)) { + return null; + } + switch (type) { + case BOOLEAN_TYPE: + return boolVars[index]; + case TINYINT_TYPE: + return byteVars[index]; + case SMALLINT_TYPE: + return shortVars[index]; + case INT_TYPE: + return intVars[index]; + case BIGINT_TYPE: + return longVars[index]; + case FLOAT_TYPE: + case DOUBLE_TYPE: + return doubleVars[index]; + case STRING_TYPE: + return stringVars.get(index); + case BINARY_TYPE: + return binaryVars.get(index).array(); + } + return null; + } + + @Override + public int size() { + return size; + } + + public TColumn toTColumn() { + TColumn value = new TColumn(); + ByteBuffer nullMasks = ByteBuffer.wrap(toBinary(nulls)); + switch (type) { + case BOOLEAN_TYPE: + value.setBoolVal(new TBoolColumn(Booleans.asList(Arrays.copyOfRange(boolVars, 0, size)), + nullMasks)); + break; + case TINYINT_TYPE: + value.setByteVal(new TByteColumn(Bytes.asList(Arrays.copyOfRange(byteVars, 0, size)), + nullMasks)); + break; + case SMALLINT_TYPE: + value.setI16Val(new TI16Column(Shorts.asList(Arrays.copyOfRange(shortVars, 0, size)), + nullMasks)); + break; + case INT_TYPE: + value.setI32Val(new TI32Column(Ints.asList(Arrays.copyOfRange(intVars, 0, size)), nullMasks)); + break; + case BIGINT_TYPE: + value + .setI64Val(new TI64Column(Longs.asList(Arrays.copyOfRange(longVars, 0, size)), nullMasks)); + break; + case FLOAT_TYPE: + case DOUBLE_TYPE: + value.setDoubleVal(new TDoubleColumn(Doubles.asList(Arrays.copyOfRange(doubleVars, 0, size)), + nullMasks)); + break; + case STRING_TYPE: + value.setStringVal(new TStringColumn(stringVars, nullMasks)); + break; + case BINARY_TYPE: + value.setBinaryVal(new TBinaryColumn(binaryVars, nullMasks)); + break; + } + return value; + } + + private static final ByteBuffer EMPTY_BINARY = ByteBuffer.allocate(0); + private static final String EMPTY_STRING = ""; + + public void addValue(Object field) { + addValue(this.type, field); + } + + public void addValue(Type type, Object field) { + switch (type) { + case BOOLEAN_TYPE: + nulls.set(size, field == null); + boolVars()[size] = field == null ? true : (Boolean) field; + break; + case TINYINT_TYPE: + nulls.set(size, field == null); + byteVars()[size] = field == null ? 0 : (Byte) field; + break; + case SMALLINT_TYPE: + nulls.set(size, field == null); + shortVars()[size] = field == null ? 0 : (Short) field; + break; + case INT_TYPE: + nulls.set(size, field == null); + intVars()[size] = field == null ? 0 : (Integer) field; + break; + case BIGINT_TYPE: + nulls.set(size, field == null); + longVars()[size] = field == null ? 0 : (Long) field; + break; + case FLOAT_TYPE: + nulls.set(size, field == null); + doubleVars()[size] = field == null ? 0 : new Double(field.toString()); + break; + case DOUBLE_TYPE: + nulls.set(size, field == null); + doubleVars()[size] = field == null ? 0 : (Double) field; + break; + case BINARY_TYPE: + nulls.set(binaryVars.size(), field == null); + binaryVars.add(field == null ? EMPTY_BINARY : ByteBuffer.wrap((byte[]) field)); + break; + default: + nulls.set(stringVars.size(), field == null); + stringVars.add(field == null ? EMPTY_STRING : String.valueOf(field)); + break; + } + size++; + } + + private boolean[] boolVars() { + if (boolVars.length == size) { + boolean[] newVars = new boolean[size << 1]; + System.arraycopy(boolVars, 0, newVars, 0, size); + return boolVars = newVars; + } + return boolVars; + } + + private byte[] byteVars() { + if (byteVars.length == size) { + byte[] newVars = new byte[size << 1]; + System.arraycopy(byteVars, 0, newVars, 0, size); + return byteVars = newVars; + } + return byteVars; + } + + private short[] shortVars() { + if (shortVars.length == size) { + short[] newVars = new short[size << 1]; + System.arraycopy(shortVars, 0, newVars, 0, size); + return shortVars = newVars; + } + return shortVars; + } + + private int[] intVars() { + if (intVars.length == size) { + int[] newVars = new int[size << 1]; + System.arraycopy(intVars, 0, newVars, 0, size); + return intVars = newVars; + } + return intVars; + } + + private long[] longVars() { + if (longVars.length == size) { + long[] newVars = new long[size << 1]; + System.arraycopy(longVars, 0, newVars, 0, size); + return longVars = newVars; + } + return longVars; + } + + private double[] doubleVars() { + if (doubleVars.length == size) { + double[] newVars = new double[size << 1]; + System.arraycopy(doubleVars, 0, newVars, 0, size); + return doubleVars = newVars; + } + return doubleVars; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.java new file mode 100644 index 000000000000..c95dd82d023f --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.java @@ -0,0 +1,91 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + + +import org.apache.spark.sql.thriftserver.cli.thrift.TColumnDesc; + +/** + * ColumnDescriptor. + * + */ +public class ColumnDescriptor { + private final String name; + private final String comment; + private final TypeDescriptor type; + // ordinal position of this column in the schema + private final int position; + + public ColumnDescriptor(String name, String comment, TypeDescriptor type, int position) { + this.name = name; + this.comment = comment; + this.type = type; + this.position = position; + } + + public ColumnDescriptor(TColumnDesc tColumnDesc) { + name = tColumnDesc.getColumnName(); + comment = tColumnDesc.getComment(); + type = new TypeDescriptor(tColumnDesc.getTypeDesc()); + position = tColumnDesc.getPosition(); + } + + public static ColumnDescriptor newPrimitiveColumnDescriptor(String name, String comment, Type type, int position) { + // Current usage looks like it's only for metadata columns, but if that changes then + // this method may need to require a type qualifiers aruments. + return new ColumnDescriptor(name, comment, new TypeDescriptor(type), position); + } + + public String getName() { + return name; + } + + public String getComment() { + return comment; + } + + public TypeDescriptor getTypeDescriptor() { + return type; + } + + public int getOrdinalPosition() { + return position; + } + + public TColumnDesc toTColumnDesc() { + TColumnDesc tColumnDesc = new TColumnDesc(); + tColumnDesc.setColumnName(name); + tColumnDesc.setComment(comment); + tColumnDesc.setTypeDesc(type.toTTypeDesc()); + tColumnDesc.setPosition(position); + return tColumnDesc; + } + + public Type getType() { + return type.getType(); + } + + public boolean isPrimitive() { + return type.getType().isPrimitiveType(); + } + + public String getTypeName() { + return type.getTypeName(); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnValue.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnValue.java new file mode 100644 index 000000000000..e56cb3d44f0b --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ColumnValue.java @@ -0,0 +1,287 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.Timestamp; + +import org.apache.hadoop.hive.common.type.HiveChar; +import org.apache.hadoop.hive.common.type.HiveIntervalDayTime; +import org.apache.hadoop.hive.common.type.HiveIntervalYearMonth; +import org.apache.hadoop.hive.common.type.HiveVarchar; + +import org.apache.spark.sql.thriftserver.cli.thrift.*; +import org.apache.spark.unsafe.types.UTF8String; + +/** + * Protocols before HIVE_CLI_SERVICE_PROTOCOL_V6 (used by RowBasedSet) + * + */ +public class ColumnValue { + + private static TColumnValue booleanValue(Boolean value) { + TBoolValue tBoolValue = new TBoolValue(); + if (value != null) { + tBoolValue.setValue(value); + } + return TColumnValue.boolVal(tBoolValue); + } + + private static TColumnValue byteValue(Byte value) { + TByteValue tByteValue = new TByteValue(); + if (value != null) { + tByteValue.setValue(value); + } + return TColumnValue.byteVal(tByteValue); + } + + private static TColumnValue shortValue(Short value) { + TI16Value tI16Value = new TI16Value(); + if (value != null) { + tI16Value.setValue(value); + } + return TColumnValue.i16Val(tI16Value); + } + + private static TColumnValue intValue(Integer value) { + TI32Value tI32Value = new TI32Value(); + if (value != null) { + tI32Value.setValue(value); + } + return TColumnValue.i32Val(tI32Value); + } + + private static TColumnValue longValue(Long value) { + TI64Value tI64Value = new TI64Value(); + if (value != null) { + tI64Value.setValue(value); + } + return TColumnValue.i64Val(tI64Value); + } + + private static TColumnValue floatValue(Float value) { + TDoubleValue tDoubleValue = new TDoubleValue(); + if (value != null) { + tDoubleValue.setValue(value); + } + return TColumnValue.doubleVal(tDoubleValue); + } + + private static TColumnValue doubleValue(Double value) { + TDoubleValue tDoubleValue = new TDoubleValue(); + if (value != null) { + tDoubleValue.setValue(value); + } + return TColumnValue.doubleVal(tDoubleValue); + } + + private static TColumnValue stringValue(String value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value); + } + return TColumnValue.stringVal(tStringValue); + } + + private static TColumnValue stringValue(HiveChar value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStringValue); + } + + private static TColumnValue stringValue(HiveVarchar value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStringValue); + } + + private static TColumnValue dateValue(Date value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value.toString()); + } + return new TColumnValue(TColumnValue.stringVal(tStringValue)); + } + + private static TColumnValue timestampValue(Timestamp value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStringValue); + } + + private static TColumnValue stringValue(HiveIntervalYearMonth value) { + TStringValue tStrValue = new TStringValue(); + if (value != null) { + tStrValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStrValue); + } + + private static TColumnValue stringValue(HiveIntervalDayTime value) { + TStringValue tStrValue = new TStringValue(); + if (value != null) { + tStrValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStrValue); + } + + public static TColumnValue toTColumnValue(TypeDescriptor typeDescriptor, Object value) { + Type type = typeDescriptor.getType(); + + switch (type) { + case BOOLEAN_TYPE: + return booleanValue((Boolean)value); + case TINYINT_TYPE: + return byteValue((Byte)value); + case SMALLINT_TYPE: + return shortValue((Short)value); + case INT_TYPE: + return intValue((Integer)value); + case BIGINT_TYPE: + return longValue((Long)value); + case FLOAT_TYPE: + return floatValue((Float)value); + case DOUBLE_TYPE: + return doubleValue((Double)value); + case STRING_TYPE: + return stringValue((String)value); + case DATE_TYPE: + return dateValue((Date)value); + case TIMESTAMP_TYPE: + return timestampValue((Timestamp)value); + case DECIMAL_TYPE: + return stringValue(((BigDecimal)value).toPlainString()); + case BINARY_TYPE: + String strVal = value == null ? null : UTF8String.fromBytes((byte[])value).toString(); + return stringValue(strVal); + case ARRAY_TYPE: + case MAP_TYPE: + case STRUCT_TYPE: + case NULL_TYPE: + return stringValue((String)value); + default: + return null; + } + } + + private static Boolean getBooleanValue(TBoolValue tBoolValue) { + if (tBoolValue.isSetValue()) { + return tBoolValue.isValue(); + } + return null; + } + + private static Byte getByteValue(TByteValue tByteValue) { + if (tByteValue.isSetValue()) { + return tByteValue.getValue(); + } + return null; + } + + private static Short getShortValue(TI16Value tI16Value) { + if (tI16Value.isSetValue()) { + return tI16Value.getValue(); + } + return null; + } + + private static Integer getIntegerValue(TI32Value tI32Value) { + if (tI32Value.isSetValue()) { + return tI32Value.getValue(); + } + return null; + } + + private static Long getLongValue(TI64Value tI64Value) { + if (tI64Value.isSetValue()) { + return tI64Value.getValue(); + } + return null; + } + + private static Double getDoubleValue(TDoubleValue tDoubleValue) { + if (tDoubleValue.isSetValue()) { + return tDoubleValue.getValue(); + } + return null; + } + + private static String getStringValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return tStringValue.getValue(); + } + return null; + } + + private static Date getDateValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return Date.valueOf(tStringValue.getValue()); + } + return null; + } + + private static Timestamp getTimestampValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return Timestamp.valueOf(tStringValue.getValue()); + } + return null; + } + + private static byte[] getBinaryValue(TStringValue tString) { + if (tString.isSetValue()) { + return tString.getValue().getBytes(); + } + return null; + } + + private static BigDecimal getBigDecimalValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return new BigDecimal(tStringValue.getValue()); + } + return null; + } + + public static Object toColumnValue(TColumnValue value) { + TColumnValue._Fields field = value.getSetField(); + switch (field) { + case BOOL_VAL: + return getBooleanValue(value.getBoolVal()); + case BYTE_VAL: + return getByteValue(value.getByteVal()); + case I16_VAL: + return getShortValue(value.getI16Val()); + case I32_VAL: + return getIntegerValue(value.getI32Val()); + case I64_VAL: + return getLongValue(value.getI64Val()); + case DOUBLE_VAL: + return getDoubleValue(value.getDoubleVal()); + case STRING_VAL: + return getStringValue(value.getStringVal()); + } + throw new IllegalArgumentException("never"); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java index e56971f8f66f..de564a256075 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/ICLIService.java @@ -88,7 +88,7 @@ void cancelOperation(OperationHandle opHandle) void closeOperation(OperationHandle opHandle) throws SparkThriftServerSQLException; - StructType getResultSetMetadata(OperationHandle opHandle) + TableSchema getResultSetMetadata(OperationHandle opHandle) throws SparkThriftServerSQLException; RowSet fetchResults(OperationHandle opHandle) diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowBasedSet.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowBasedSet.java new file mode 100644 index 000000000000..967c0fc4e060 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowBasedSet.java @@ -0,0 +1,147 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.cli.thrift.TColumnValue; +import org.apache.spark.sql.thriftserver.cli.thrift.TRow; +import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * RowBasedSet + */ +public class RowBasedSet implements RowSet { + + private long startOffset; + + private final TypeDescriptor[] descriptors; // non-null only for writing (server-side) + private final RemovableList rows; + + public RowBasedSet(TableSchema schema) { + descriptors = schema.toTypeDescriptors(); + rows = new RemovableList(); + } + + public RowBasedSet(TRowSet tRowSet) { + descriptors = null; + rows = new RemovableList(tRowSet.getRows()); + startOffset = tRowSet.getStartRowOffset(); + } + + private RowBasedSet(TypeDescriptor[] descriptors, List rows, long startOffset) { + this.descriptors = descriptors; + this.rows = new RemovableList(rows); + this.startOffset = startOffset; + } + + @Override + public RowBasedSet addRow(Object[] fields) { + TRow tRow = new TRow(); + for (int i = 0; i < fields.length; i++) { + tRow.addToColVals(ColumnValue.toTColumnValue(descriptors[i], fields[i])); + } + rows.add(tRow); + return this; + } + + @Override + public int numColumns() { + return rows.isEmpty() ? 0 : rows.get(0).getColVals().size(); + } + + @Override + public int numRows() { + return rows.size(); + } + + public RowBasedSet extractSubset(int maxRows) { + int numRows = Math.min(numRows(), maxRows); + RowBasedSet result = new RowBasedSet(descriptors, rows.subList(0, numRows), startOffset); + rows.removeRange(0, numRows); + startOffset += numRows; + return result; + } + + public long getStartOffset() { + return startOffset; + } + + public void setStartOffset(long startOffset) { + this.startOffset = startOffset; + } + + public int getSize() { + return rows.size(); + } + + public TRowSet toTRowSet() { + TRowSet tRowSet = new TRowSet(); + tRowSet.setStartRowOffset(startOffset); + tRowSet.setRows(new ArrayList(rows)); + return tRowSet; + } + + @Override + public Iterator iterator() { + return new Iterator() { + + final Iterator iterator = rows.iterator(); + final Object[] convey = new Object[numColumns()]; + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public Object[] next() { + TRow row = iterator.next(); + List values = row.getColVals(); + for (int i = 0; i < values.size(); i++) { + convey[i] = ColumnValue.toColumnValue(values.get(i)); + } + return convey; + } + + @Override + public void remove() { + throw new UnsupportedOperationException("remove"); + } + }; + } + + private static class RemovableList extends ArrayList { + RemovableList() { + super(); + } + + RemovableList(List rows) { + super(rows); + } + + @Override + public void removeRange(int fromIndex, int toIndex) { + super.removeRange(fromIndex, toIndex); + } + } +} + diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java new file mode 100644 index 000000000000..c9d4038332b7 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSet.java @@ -0,0 +1,39 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + + +import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet; + +public interface RowSet extends Iterable { + + RowSet addRow(Object[] fields); + + RowSet extractSubset(int maxRows); + + int numColumns(); + + int numRows(); + + long getStartOffset(); + + void setStartOffset(long startOffset); + + TRowSet toTRowSet(); +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSetFactory.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSetFactory.java new file mode 100644 index 000000000000..4b2d68968ca2 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/RowSetFactory.java @@ -0,0 +1,43 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion; +import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet; +import org.apache.thrift.TException; + +import static org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6; + + +public class RowSetFactory { + + public static RowSet create(TableSchema schema, TProtocolVersion version, boolean isBlobBased) { + if (version.getValue() >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue()) { + return new ColumnBasedSet(schema, isBlobBased); + } + return new RowBasedSet(schema); + } + + public static RowSet create(TRowSet results, TProtocolVersion version) throws TException { + if (version.getValue() >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue()) { + return new ColumnBasedSet(results); + } + return new RowBasedSet(results); + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TableSchema.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TableSchema.java new file mode 100644 index 000000000000..8e47938e1fda --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TableSchema.java @@ -0,0 +1,103 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.util.ArrayList; +import java.util.List; + +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Schema; +import org.apache.spark.sql.thriftserver.cli.thrift.TColumnDesc; +import org.apache.spark.sql.thriftserver.cli.thrift.TTableSchema; + +/** + * TableSchema. + * + */ +public class TableSchema { + private final List columns = new ArrayList(); + + public TableSchema() { + } + + public TableSchema(int numColumns) { + // TODO: remove this constructor + } + + public TableSchema(TTableSchema tTableSchema) { + for (TColumnDesc tColumnDesc : tTableSchema.getColumns()) { + columns.add(new ColumnDescriptor(tColumnDesc)); + } + } + + public TableSchema(List fieldSchemas) { + int pos = 1; + for (FieldSchema field : fieldSchemas) { + columns.add(new ColumnDescriptor(field.getName(), field.getComment(), + new TypeDescriptor(field.getType()), pos++)); + } + } + + public TableSchema(Schema schema) { + this(schema.getFieldSchemas()); + } + + public List getColumnDescriptors() { + return new ArrayList(columns); + } + + public ColumnDescriptor getColumnDescriptorAt(int pos) { + return columns.get(pos); + } + + public int getSize() { + return columns.size(); + } + + public void clear() { + columns.clear(); + } + + + public TTableSchema toTTableSchema() { + TTableSchema tTableSchema = new TTableSchema(); + for (ColumnDescriptor col : columns) { + tTableSchema.addToColumns(col.toTColumnDesc()); + } + return tTableSchema; + } + + public TypeDescriptor[] toTypeDescriptors() { + TypeDescriptor[] types = new TypeDescriptor[columns.size()]; + for (int i = 0; i < types.length; i++) { + types[i] = columns.get(i).getTypeDescriptor(); + } + return types; + } + + public TableSchema addPrimitiveColumn(String columnName, Type columnType, String columnComment) { + columns.add(ColumnDescriptor.newPrimitiveColumnDescriptor(columnName, columnComment, columnType, columns.size() + 1)); + return this; + } + + public TableSchema addStringColumn(String columnName, String columnComment) { + columns.add(ColumnDescriptor.newPrimitiveColumnDescriptor(columnName, columnComment, Type.STRING_TYPE, columns.size() + 1)); + return this; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.java new file mode 100644 index 000000000000..b2578c0a5c48 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.java @@ -0,0 +1,156 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import java.util.List; + +import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; +import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; +import org.apache.spark.sql.thriftserver.cli.thrift.TPrimitiveTypeEntry; +import org.apache.spark.sql.thriftserver.cli.thrift.TTypeDesc; +import org.apache.spark.sql.thriftserver.cli.thrift.TTypeEntry; + +/** + * TypeDescriptor. + * + */ +public class TypeDescriptor { + + private final Type type; + private String typeName = null; + private TypeQualifiers typeQualifiers = null; + + public TypeDescriptor(Type type) { + this.type = type; + } + + public TypeDescriptor(TTypeDesc tTypeDesc) { + List tTypeEntries = tTypeDesc.getTypes(); + TPrimitiveTypeEntry top = tTypeEntries.get(0).getPrimitiveEntry(); + this.type = Type.getType(top.getType()); + if (top.isSetTypeQualifiers()) { + setTypeQualifiers(TypeQualifiers.fromTTypeQualifiers(top.getTypeQualifiers())); + } + } + + public TypeDescriptor(String typeName) { + this.type = Type.getType(typeName); + if (this.type.isComplexType()) { + this.typeName = typeName; + } else if (this.type.isQualifiedType()) { + PrimitiveTypeInfo pti = TypeInfoFactory.getPrimitiveTypeInfo(typeName); + setTypeQualifiers(TypeQualifiers.fromTypeInfo(pti)); + } + } + + public Type getType() { + return type; + } + + public TTypeDesc toTTypeDesc() { + TPrimitiveTypeEntry primitiveEntry = new TPrimitiveTypeEntry(type.toTType()); + if (getTypeQualifiers() != null) { + primitiveEntry.setTypeQualifiers(getTypeQualifiers().toTTypeQualifiers()); + } + TTypeEntry entry = TTypeEntry.primitiveEntry(primitiveEntry); + + TTypeDesc desc = new TTypeDesc(); + desc.addToTypes(entry); + return desc; + } + + public String getTypeName() { + if (typeName != null) { + return typeName; + } else { + return type.getName(); + } + } + + public TypeQualifiers getTypeQualifiers() { + return typeQualifiers; + } + + public void setTypeQualifiers(TypeQualifiers typeQualifiers) { + this.typeQualifiers = typeQualifiers; + } + + /** + * The column size for this type. + * For numeric data this is the maximum precision. + * For character data this is the length in characters. + * For datetime types this is the length in characters of the String representation + * (assuming the maximum allowed precision of the fractional seconds component). + * For binary data this is the length in bytes. + * Null is returned for data types where the column size is not applicable. + */ + public Integer getColumnSize() { + if (type.isNumericType()) { + return getPrecision(); + } + switch (type) { + case STRING_TYPE: + case BINARY_TYPE: + return Integer.MAX_VALUE; + case DATE_TYPE: + return 10; + case TIMESTAMP_TYPE: + return 29; + default: + return null; + } + } + + /** + * Maximum precision for numeric types. + * Returns null for non-numeric types. + * @return + */ + public Integer getPrecision() { + if (this.type == Type.DECIMAL_TYPE) { + return typeQualifiers.getPrecision(); + } + return this.type.getMaxPrecision(); + } + + /** + * The number of fractional digits for this type. + * Null is returned for data types where this is not applicable. + */ + public Integer getDecimalDigits() { + switch (this.type) { + case BOOLEAN_TYPE: + case TINYINT_TYPE: + case SMALLINT_TYPE: + case INT_TYPE: + case BIGINT_TYPE: + return 0; + case FLOAT_TYPE: + return 7; + case DOUBLE_TYPE: + return 15; + case DECIMAL_TYPE: + return typeQualifiers.getScale(); + case TIMESTAMP_TYPE: + return 9; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.java new file mode 100644 index 000000000000..f32a374f46f3 --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.java @@ -0,0 +1,133 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.spark.sql.thriftserver.cli; + +import org.apache.hadoop.hive.serde2.typeinfo.CharTypeInfo; +import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo; +import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; +import org.apache.hadoop.hive.serde2.typeinfo.VarcharTypeInfo; +import org.apache.spark.sql.thriftserver.cli.thrift.TCLIServiceConstants; +import org.apache.spark.sql.thriftserver.cli.thrift.TTypeQualifierValue; +import org.apache.spark.sql.thriftserver.cli.thrift.TTypeQualifiers; + +import java.util.HashMap; +import java.util.Map; + +/** + * This class holds type qualifier information for a primitive type, + * such as char/varchar length or decimal precision/scale. + */ +public class TypeQualifiers { + private Integer characterMaximumLength; + private Integer precision; + private Integer scale; + + public TypeQualifiers() {} + + public Integer getCharacterMaximumLength() { + return characterMaximumLength; + } + public void setCharacterMaximumLength(int characterMaximumLength) { + this.characterMaximumLength = characterMaximumLength; + } + + public TTypeQualifiers toTTypeQualifiers() { + TTypeQualifiers ret = null; + + Map qMap = new HashMap(); + if (getCharacterMaximumLength() != null) { + TTypeQualifierValue val = new TTypeQualifierValue(); + val.setI32Value(getCharacterMaximumLength().intValue()); + qMap.put(TCLIServiceConstants.CHARACTER_MAXIMUM_LENGTH, val); + } + + if (precision != null) { + TTypeQualifierValue val = new TTypeQualifierValue(); + val.setI32Value(precision.intValue()); + qMap.put(TCLIServiceConstants.PRECISION, val); + } + + if (scale != null) { + TTypeQualifierValue val = new TTypeQualifierValue(); + val.setI32Value(scale.intValue()); + qMap.put(TCLIServiceConstants.SCALE, val); + } + + if (qMap.size() > 0) { + ret = new TTypeQualifiers(qMap); + } + + return ret; + } + + public static TypeQualifiers fromTTypeQualifiers(TTypeQualifiers ttq) { + TypeQualifiers ret = null; + if (ttq != null) { + ret = new TypeQualifiers(); + Map tqMap = ttq.getQualifiers(); + + if (tqMap.containsKey(TCLIServiceConstants.CHARACTER_MAXIMUM_LENGTH)) { + ret.setCharacterMaximumLength( + tqMap.get(TCLIServiceConstants.CHARACTER_MAXIMUM_LENGTH).getI32Value()); + } + + if (tqMap.containsKey(TCLIServiceConstants.PRECISION)) { + ret.setPrecision(tqMap.get(TCLIServiceConstants.PRECISION).getI32Value()); + } + + if (tqMap.containsKey(TCLIServiceConstants.SCALE)) { + ret.setScale(tqMap.get(TCLIServiceConstants.SCALE).getI32Value()); + } + } + return ret; + } + + public static TypeQualifiers fromTypeInfo(PrimitiveTypeInfo pti) { + TypeQualifiers result = null; + if (pti instanceof VarcharTypeInfo) { + result = new TypeQualifiers(); + result.setCharacterMaximumLength(((VarcharTypeInfo)pti).getLength()); + } else if (pti instanceof CharTypeInfo) { + result = new TypeQualifiers(); + result.setCharacterMaximumLength(((CharTypeInfo)pti).getLength()); + } else if (pti instanceof DecimalTypeInfo) { + result = new TypeQualifiers(); + result.setPrecision(((DecimalTypeInfo)pti).precision()); + result.setScale(((DecimalTypeInfo)pti).scale()); + } + return result; + } + + public Integer getPrecision() { + return precision; + } + + public void setPrecision(Integer precision) { + this.precision = precision; + } + + public Integer getScale() { + return scale; + } + + public void setScale(Integer scale) { + this.scale = scale; + } + +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/Operation.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/Operation.java new file mode 100644 index 000000000000..02a7a34abcec --- /dev/null +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/operation/Operation.java @@ -0,0 +1,340 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.spark.sql.thriftserver.cli.operation; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; +import org.apache.hadoop.hive.ql.session.OperationLog; +import org.apache.spark.sql.thriftserver.cli.*; +import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession; +import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class Operation { + protected final ThriftServerSession parentSession; + private OperationState state = OperationState.INITIALIZED; + private final OperationHandle opHandle; + private HiveConf configuration; + public static final Logger LOG = LoggerFactory.getLogger(Operation.class.getName()); + public static final FetchOrientation DEFAULT_FETCH_ORIENTATION = FetchOrientation.FETCH_NEXT; + public static final long DEFAULT_FETCH_MAX_ROWS = 100; + protected boolean hasResultSet; + protected volatile SparkThriftServerSQLException operationException; + protected final boolean runAsync; + protected volatile Future backgroundHandle; + protected OperationLog operationLog; + protected boolean isOperationLogEnabled; + protected Map confOverlay = new HashMap(); + protected String statementId = null; + + private long operationTimeout; + private long lastAccessTime; + + + protected static final EnumSet DEFAULT_FETCH_ORIENTATION_SET = + EnumSet.of( + FetchOrientation.FETCH_NEXT, + FetchOrientation.FETCH_FIRST, + FetchOrientation.FETCH_PRIOR); + + protected Operation(ThriftServerSession parentSession, OperationType opType) { + this(parentSession, null, opType); + } + + protected Operation(ThriftServerSession parentSession, Map confOverlay, + OperationType opType) { + this(parentSession, confOverlay, opType, false); + } + + protected Operation(ThriftServerSession parentSession, + Map confOverlay, OperationType opType, boolean runInBackground) { + this.parentSession = parentSession; + this.confOverlay = confOverlay; + this.runAsync = runInBackground; + this.opHandle = new OperationHandle(opType, parentSession.getProtocolVersion()); + lastAccessTime = System.currentTimeMillis(); + operationTimeout = HiveConf.getTimeVar(parentSession.getHiveConf(), + HiveConf.ConfVars.HIVE_SERVER2_IDLE_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS); + } + + public Future getBackgroundHandle() { + return backgroundHandle; + } + + protected void setBackgroundHandle(Future backgroundHandle) { + this.backgroundHandle = backgroundHandle; + } + + public boolean shouldRunAsync() { + return runAsync; + } + + public void setConfiguration(HiveConf configuration) { + this.configuration = new HiveConf(configuration); + } + + public HiveConf getConfiguration() { + return new HiveConf(configuration); + } + + public ThriftServerSession getParentSession() { + return parentSession; + } + + public OperationHandle getHandle() { + return opHandle; + } + + public TProtocolVersion getProtocolVersion() { + return opHandle.getProtocolVersion(); + } + + public OperationType getType() { + return opHandle.getOperationType(); + } + + public OperationStatus getStatus() { + return new OperationStatus(state, operationException); + } + + public boolean hasResultSet() { + return hasResultSet; + } + + protected void setHasResultSet(boolean hasResultSet) { + this.hasResultSet = hasResultSet; + opHandle.setHasResultSet(hasResultSet); + } + + public String getStatementId() {return statementId; } + + public OperationLog getOperationLog() { + return operationLog; + } + + protected final OperationState setState(OperationState newState) throws SparkThriftServerSQLException { + state.validateTransition(newState); + this.state = newState; + this.lastAccessTime = System.currentTimeMillis(); + return this.state; + } + + public boolean isTimedOut(long current) { + if (operationTimeout == 0) { + return false; + } + if (operationTimeout > 0) { + // check only when it's in terminal state + return state.isTerminal() && lastAccessTime + operationTimeout <= current; + } + return lastAccessTime + -operationTimeout <= current; + } + + public long getLastAccessTime() { + return lastAccessTime; + } + + public long getOperationTimeout() { + return operationTimeout; + } + + public void setOperationTimeout(long operationTimeout) { + this.operationTimeout = operationTimeout; + } + + protected void setOperationException(SparkThriftServerSQLException operationException) { + this.operationException = operationException; + } + + protected final void assertState(OperationState state) throws SparkThriftServerSQLException { + if (this.state != state) { + throw new SparkThriftServerSQLException("Expected state " + state + ", but found " + this.state); + } + this.lastAccessTime = System.currentTimeMillis(); + } + + public boolean isRunning() { + return OperationState.RUNNING.equals(state); + } + + public boolean isFinished() { + return OperationState.FINISHED.equals(state); + } + + public boolean isCanceled() { + return OperationState.CANCELED.equals(state); + } + + public boolean isFailed() { + return OperationState.ERROR.equals(state); + } + + protected void createOperationLog() { + if (parentSession.isOperationLogEnabled()) { + File operationLogFile = new File(parentSession.getOperationLogSessionDir(), + opHandle.getHandleIdentifier().toString()); + isOperationLogEnabled = true; + + // create log file + try { + if (operationLogFile.exists()) { + LOG.warn("The operation log file should not exist, but it is already there: " + + operationLogFile.getAbsolutePath()); + operationLogFile.delete(); + } + if (!operationLogFile.createNewFile()) { + // the log file already exists and cannot be deleted. + // If it can be read/written, keep its contents and use it. + if (!operationLogFile.canRead() || !operationLogFile.canWrite()) { + LOG.warn("The already existed operation log file cannot be recreated, " + + "and it cannot be read or written: " + operationLogFile.getAbsolutePath()); + isOperationLogEnabled = false; + return; + } + } + } catch (Exception e) { + LOG.warn("Unable to create operation log file: " + operationLogFile.getAbsolutePath(), e); + isOperationLogEnabled = false; + return; + } + + // create OperationLog object with above log file + try { + operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); + } catch (FileNotFoundException e) { + LOG.warn("Unable to instantiate OperationLog object for operation: " + + opHandle, e); + isOperationLogEnabled = false; + return; + } + + // register this operationLog to current thread + OperationLog.setCurrentOperationLog(operationLog); + } + } + + protected void unregisterOperationLog() { + if (isOperationLogEnabled) { + OperationLog.removeCurrentOperationLog(); + } + } + + /** + * Invoked before runInternal(). + * Set up some preconditions, or configurations. + */ + protected void beforeRun() { + createOperationLog(); + } + + /** + * Invoked after runInternal(), even if an exception is thrown in runInternal(). + * Clean up resources, which was set up in beforeRun(). + */ + protected void afterRun() { + unregisterOperationLog(); + } + + /** + * Implemented by subclass of Operation class to execute specific behaviors. + * @throws SparkThriftServerSQLException + */ + protected abstract void runInternal() throws SparkThriftServerSQLException; + + public void run() throws SparkThriftServerSQLException { + beforeRun(); + try { + runInternal(); + } finally { + afterRun(); + } + } + + protected void cleanupOperationLog() { + if (isOperationLogEnabled) { + if (operationLog == null) { + LOG.error("Operation [ " + opHandle.getHandleIdentifier() + " ] " + + "logging is enabled, but its OperationLog object cannot be found."); + } else { + operationLog.close(); + } + } + } + + // TODO: make this abstract and implement in subclasses. + public void cancel() throws SparkThriftServerSQLException { + setState(OperationState.CANCELED); + throw new UnsupportedOperationException("SQLOperation.cancel()"); + } + + public abstract void close() throws SparkThriftServerSQLException; + + public abstract TableSchema getResultSetSchema() throws SparkThriftServerSQLException; + + public abstract RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws SparkThriftServerSQLException; + + public RowSet getNextRowSet() throws SparkThriftServerSQLException { + return getNextRowSet(FetchOrientation.FETCH_NEXT, DEFAULT_FETCH_MAX_ROWS); + } + + /** + * Verify if the given fetch orientation is part of the default orientation types. + * @param orientation + * @throws SparkThriftServerSQLException + */ + protected void validateDefaultFetchOrientation(FetchOrientation orientation) + throws SparkThriftServerSQLException { + validateFetchOrientation(orientation, DEFAULT_FETCH_ORIENTATION_SET); + } + + /** + * Verify if the given fetch orientation is part of the supported orientation types. + * @param orientation + * @param supportedOrientations + * @throws SparkThriftServerSQLException + */ + protected void validateFetchOrientation(FetchOrientation orientation, + EnumSet supportedOrientations) throws SparkThriftServerSQLException { + if (!supportedOrientations.contains(orientation)) { + throw new SparkThriftServerSQLException("The fetch type " + orientation.toString() + + " is not supported for this resultset", "HY106"); + } + } + + protected SparkThriftServerSQLException toSQLException(String prefix, CommandProcessorResponse response) { + SparkThriftServerSQLException ex = new SparkThriftServerSQLException(prefix + ": " + response.getErrorMessage(), + response.getSQLState(), response.getResponseCode()); + if (response.getException() != null) { + ex.initCause(response.getException()); + } + return ex; + } + + protected Map getConfOverlay() { + return confOverlay; + } +} diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java index 6a83dcafe9c6..b322015c0160 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftBinaryCLIService.java @@ -25,11 +25,11 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; -import org.apache.hadoop.hive.common.auth.HiveAuthUtils; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.conf.HiveConf.ConfVars; import org.apache.hadoop.hive.shims.ShimLoader; import org.apache.spark.sql.thriftserver.auth.HiveAuthFactory; +import org.apache.spark.sql.thriftserver.auth.HiveAuthUtils; import org.apache.spark.sql.thriftserver.cli.CLIService; import org.apache.spark.sql.thriftserver.server.ThreadFactoryWithGarbageCleanup; import org.apache.thrift.TProcessorFactory; diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java index 99d00cf4eb8c..4dea42ff6fd5 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIService.java @@ -607,8 +607,8 @@ public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq r throws TException { TGetResultSetMetadataResp resp = new TGetResultSetMetadataResp(); try { - StructType schema = cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle())); - resp.setSchema(SchemaMapper.toTTableSchema(schema)); + TableSchema schema = cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle())); + resp.setSchema(schema.toTTableSchema()); resp.setStatus(OK_STATUS); } catch (Exception e) { LOG.warn("Error getting result set metadata: ", e); diff --git a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java index 74b158772c83..7ed5f115f306 100644 --- a/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java +++ b/sql/thriftserver/src/main/java/org/apache/spark/sql/thriftserver/cli/thrift/ThriftCLIServiceClient.java @@ -365,13 +365,13 @@ public void closeOperation(OperationHandle opHandle) * @see org.apache.spark.sql.thriftserver.cli.ICLIService#getResultSetMetadata(org.apache.spark.sql.thriftserver.cli.OperationHandle) */ @Override - public StructType getResultSetMetadata(OperationHandle opHandle) + public TableSchema getResultSetMetadata(OperationHandle opHandle) throws SparkThriftServerSQLException { try { TGetResultSetMetadataReq req = new TGetResultSetMetadataReq(opHandle.toTOperationHandle()); TGetResultSetMetadataResp resp = cliService.GetResultSetMetadata(req); checkStatus(resp.getStatus()); - return SchemaMapper.toStructType(resp.getSchema()); + return new TableSchema(resp.getSchema()); } catch (SparkThriftServerSQLException e) { throw e; } catch (Exception e) { diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala index a7cf2f0e95d1..a497e65aad14 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/CLIService.scala @@ -364,7 +364,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex override def getQueryId(opHandle: TOperationHandle): String = { val operation: Operation = sessionManager.getOperationManager.getOperation(new OperationHandle(opHandle)) - val queryId = operation.statementId + val queryId = operation.getStatementId logDebug(opHandle + ": getQueryId() " + queryId) queryId } @@ -385,7 +385,7 @@ private[thriftserver] class CLIService(hiveServer2: SparkThriftServer, sqlContex logDebug(opHandle + ": closeOperation") } - override def getResultSetMetadata(opHandle: OperationHandle): StructType = { + override def getResultSetMetadata(opHandle: OperationHandle): TableSchema = { val tableSchema = sessionManager .getOperationManager .getOperation(opHandle) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala deleted file mode 100644 index cd31a646abd2..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBasedSet.scala +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.io.ByteArrayInputStream -import java.nio.ByteBuffer -import java.sql.Date -import java.util -import java.util.BitSet - -import scala.collection.JavaConverters._ -import scala.collection.mutable.ArrayBuffer - -import org.apache.thrift.TException -import org.apache.thrift.protocol.TCompactProtocol -import org.apache.thrift.transport.TIOStreamTransport - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.Row -import org.apache.spark.sql.execution.HiveResult -import org.apache.spark.sql.thriftserver.cli.thrift._ -import org.apache.spark.sql.types.{BinaryType, _} -import org.apache.spark.unsafe.types.CalendarInterval - -private[thriftserver] case class ColumnBasedSet( - types: StructType, - rows: ArrayBuffer[Row], - initStartOffset: Long) - extends RowSet { - - var startOffset: Long = initStartOffset - - import ColumnBasedSet._ - - override def toTRowSet: TRowSet = { - val tRowSet = new TRowSet(startOffset, Seq[TRow]().asJava) - if (rows != null) { - (0 until types.length).map(i => { - toTColumn(i, types(i).dataType) - } - ).foreach(tRowSet.addToColumns) - } - tRowSet - } - - private[this] def toTColumn(ordinal: Int, typ: DataType): TColumn = { - val nulls = new BitSet() - typ match { - case BooleanType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - true - } else { - rows(i).getBoolean(ordinal) - } - }.map(_.asInstanceOf[java.lang.Boolean]).asJava - TColumn.boolVal(new TBoolColumn(values, bitSetToBuffer(nulls))) - case ByteType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - 0.toByte - } else { - rows(i).getByte(ordinal) - } - }.map(_.asInstanceOf[java.lang.Byte]).asJava - TColumn.byteVal(new TByteColumn(values, bitSetToBuffer(nulls))) - case ShortType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - 0.toShort - } else { - rows(i).getShort(ordinal) - } - }.map(_.asInstanceOf[java.lang.Short]).asJava - TColumn.i16Val(new TI16Column(values, bitSetToBuffer(nulls))) - case IntegerType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - 0 - } else { - rows(i).getInt(ordinal) - } - }.map(_.asInstanceOf[java.lang.Integer]).asJava - TColumn.i32Val(new TI32Column(values, bitSetToBuffer(nulls))) - case LongType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - 0L - } else { - rows(i).getLong(ordinal) - } - }.map(_.asInstanceOf[java.lang.Long]).asJava - TColumn.i64Val(new TI64Column(values, bitSetToBuffer(nulls))) - case FloatType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - 0.toDouble.asInstanceOf[java.lang.Double] - } else { - new java.lang.Double(rows(i).get(ordinal).toString) - } - }.asJava - TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) - case DoubleType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - 0.toDouble.asInstanceOf[java.lang.Double] - } else { - new java.lang.Double(rows(i).get(ordinal).toString) - } - }.asJava - TColumn.doubleVal(new TDoubleColumn(values, bitSetToBuffer(nulls))) - case StringType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - EMPTY_STRING - } else { - rows(i).getString(ordinal) - } - }.asJava - TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) - case BinaryType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - EMPTY_BINARY - } else { - ByteBuffer.wrap(rows(i).getAs[Array[Byte]](ordinal)) - } - }.asJava - TColumn.binaryVal(new TBinaryColumn(values, bitSetToBuffer(nulls))) - case DecimalType() => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - EMPTY_STRING - } else { - rows(i).getDecimal(ordinal).toPlainString - } - }.asJava - TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) - case DateType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - EMPTY_STRING - } else { - String.valueOf(rows(i).getAs[Date](ordinal).toString) - } - }.asJava - TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) - case CalendarIntervalType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - EMPTY_STRING - } else { - HiveResult.toHiveString( - (rows(i).getAs[CalendarInterval](ordinal), CalendarIntervalType)) - } - }.asJava - TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) - case NullType => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - nulls.set(i, true) - EMPTY_STRING - }.asJava - TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) - case _ => - val values = rows.indices - .filter(i => ordinal < rows(i).length).map { i => - val isNull = rows(i).isNullAt(ordinal) - nulls.set(i, isNull) - if (isNull) { - EMPTY_STRING - } else { - HiveResult.toHiveString((rows(i).get(ordinal), typ)) - } - }.asJava - TColumn.stringVal(new TStringColumn(values, bitSetToBuffer(nulls))) - } - } - - private[this] def bitSetToBuffer(bitSet: BitSet): ByteBuffer = ByteBuffer.wrap(bitSet.toByteArray) - - override def addRow(row: Row): RowSet = { - rows.+=(row) - this - } - - override def extractSubset(maxRows: Int): RowSet = { - val numRows = Math.min(rows.size, maxRows) - val result = new ColumnBasedSet(types, rows.slice(0, numRows), startOffset) - rows.remove(0, numRows) - startOffset += numRows - return result - } - - override def numColumns: Int = types.size - - override def numRows: Int = rows.size - - override def getStartOffset: Long = startOffset - - override def setStartOffset(startOffset: Long): Unit = this.startOffset = startOffset - - override def iterator: Iterator[Row] = rows.iterator -} - -object ColumnBasedSet extends Logging{ - private val EMPTY_STRING = "" - private val EMPTY_BINARY = ByteBuffer.allocate(0) - - def apply(tRowSet: TRowSet): ColumnBasedSet = { - val rows = new ArrayBuffer[Row]() - if (tRowSet.isSetBinaryColumns) { - val protocol = - new TCompactProtocol( - new TIOStreamTransport( - new ByteArrayInputStream(tRowSet.getBinaryColumns))) - // Read from the stream using the protocol for each column in final schema - val bufferMap = new util.HashMap[Int, ColumnBuffer] - var i = 0 - while (i < tRowSet.getColumnCount) { - val tvalue = new TColumn - try { - tvalue.read(protocol) - } catch { - case e: TException => - logError(e.getMessage, e) - throw new TException("Error reading column value from the row set blob", e) - } - bufferMap.put(i, new ColumnBuffer(tvalue)) - i = i + 1 - } - val columnsSize = bufferMap.values().asScala.map(_.size).max - val columnCount = tRowSet.getColumns.size() - (0 until columnsSize).foreach(index => { - val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) - rows += row - }) - } else { - val bufferMap = new util.HashMap[Int, ColumnBuffer] - tRowSet.getColumns.asScala.zipWithIndex.foreach { case (tColumn, i) => - bufferMap.put(i, new ColumnBuffer(tColumn)) - } - val columnsSize = bufferMap.values().asScala.map(_.size).max - val columnCount = tRowSet.getColumns.size() - (0 until columnsSize).foreach(index => { - val row = Row.fromSeq((0 until columnCount).map(bufferMap.get(_).get(index))) - rows += row - }) - } - ColumnBasedSet(null, rows, tRowSet.getStartRowOffset) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala deleted file mode 100644 index b213dd8cd275..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnBuffer.scala +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.nio.ByteBuffer - -import scala.collection.JavaConverters._ - -import com.google.common.primitives._ -import java.util._ - -import org.apache.spark.sql.thriftserver.cli.thrift._ - -/** - * ColumnBuffer - */ -object ColumnBuffer { - private val DEFAULT_SIZE = 100 - private val MASKS = Array[Byte](0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80.toByte) - - private def toBitset(nulls: Array[Byte]) = { - val bitset = new BitSet - val bits = nulls.length * 8 - var i = 0 - while (i < bits) { - bitset.set(i, (nulls(i / 8) & MASKS(i % 8)) != 0) - i = i + 1 - } - bitset - } - - private val EMPTY_BINARY = ByteBuffer.allocate(0) - private val EMPTY_STRING = "" -} - -class ColumnBuffer() { - - import ColumnBuffer._ - - final private var `type`: Type = null - private var nulls: BitSet = null - private var _size: Int = 0 - private var _boolVars: Array[Boolean] = null - private var _byteVars: Array[Byte] = null - private var _shortVars: Array[Short] = null - private var _intVars: Array[Int] = null - private var _longVars: Array[Long] = null - private var _doubleVars: Array[Double] = null - private var _stringVars: Array[String] = null - private var _binaryVars: Array[ByteBuffer] = null - - - def this(colValues: TColumn) { - this() - if (colValues.isSetBoolVal) { - `type` = Type.BOOLEAN_TYPE - nulls = toBitset(colValues.getBoolVal.getNulls) - _boolVars = Booleans.toArray(colValues.getBoolVal.getValues) - _size = boolVars.length - } - else if (colValues.isSetByteVal) { - `type` = Type.TINYINT_TYPE - nulls = toBitset(colValues.getByteVal.getNulls) - _byteVars = Bytes.toArray(colValues.getByteVal.getValues) - _size = byteVars.length - } - else if (colValues.isSetI16Val) { - `type` = Type.SMALLINT_TYPE - nulls = toBitset(colValues.getI16Val.getNulls) - _shortVars = Shorts.toArray(colValues.getI16Val.getValues) - _size = shortVars.length - } - else if (colValues.isSetI32Val) { - `type` = Type.INT_TYPE - nulls = toBitset(colValues.getI32Val.getNulls) - _intVars = Ints.toArray(colValues.getI32Val.getValues) - _size = intVars.length - } - else if (colValues.isSetI64Val) { - `type` = Type.BIGINT_TYPE - nulls = toBitset(colValues.getI64Val.getNulls) - _longVars = Longs.toArray(colValues.getI64Val.getValues) - _size = longVars.length - } - else if (colValues.isSetDoubleVal) { - `type` = Type.DOUBLE_TYPE - nulls = toBitset(colValues.getDoubleVal.getNulls) - _doubleVars = Doubles.toArray(colValues.getDoubleVal.getValues) - _size = doubleVars.length - } - else if (colValues.isSetBinaryVal) { - `type` = Type.BINARY_TYPE - nulls = toBitset(colValues.getBinaryVal.getNulls) - _binaryVars = colValues.getBinaryVal.getValues.asScala.toArray - _size = _binaryVars.size - } - else if (colValues.isSetStringVal) { - `type` = Type.STRING_TYPE - nulls = toBitset(colValues.getStringVal.getNulls) - _stringVars = colValues.getStringVal.getValues.asScala.toArray - _size = _stringVars.size - } else { - throw new IllegalStateException("invalid union object") - } - } - - private[cli] def getNulls = nulls - - def getType: Type = `type` - - def get(index: Int): Any = { - if (nulls.get(index)) { - return null - } - `type` match { - case Type.BOOLEAN_TYPE => - return _boolVars(index) - case Type.TINYINT_TYPE => - return _byteVars(index) - case Type.SMALLINT_TYPE => - return _shortVars(index) - case Type.INT_TYPE => - return _intVars(index) - case Type.BIGINT_TYPE => - return _longVars(index) - case Type.FLOAT_TYPE => - case Type.DOUBLE_TYPE => - return _doubleVars(index) - case Type.STRING_TYPE => - return _stringVars(index) - case Type.BINARY_TYPE => - return _binaryVars(index).array - case _ => null - } - } - - def size: Int = _size - - private def boolVars: Array[Boolean] = { - if (_boolVars.length == _size) { - val newVars = new Array[Boolean](_size << 1) - System.arraycopy(_boolVars, 0, newVars, 0, _size) - _boolVars = newVars - } - _boolVars - } - - private def byteVars: Array[Byte] = { - if (_byteVars.length == _size) { - val newVars = new Array[Byte](_size << 1) - System.arraycopy(_byteVars, 0, newVars, 0, _size) - _byteVars = newVars - } - _byteVars - } - - private def shortVars: Array[Short] = { - if (_shortVars.length == _size) { - val newVars = new Array[Short](_size << 1) - System.arraycopy(_shortVars, 0, newVars, 0, _size) - _shortVars = newVars - } - _shortVars - } - - private def intVars: Array[Int] = { - if (_intVars.length == _size) { - val newVars = new Array[Int](_size << 1) - System.arraycopy(_intVars, 0, newVars, 0, _size) - _intVars = newVars - } - _intVars - } - - private def longVars: Array[Long] = { - if (_longVars.length == _size) { - val newVars = new Array[Long](_size << 1) - System.arraycopy(_longVars, 0, newVars, 0, _size) - _longVars = newVars - } - _longVars - } - - private def doubleVars: Array[Double] = { - if (_doubleVars.length == _size) { - val newVars = new Array[Double](_size << 1) - System.arraycopy(_doubleVars, 0, newVars, 0, _size) - _doubleVars = newVars - } - _doubleVars - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala deleted file mode 100644 index 81a8c83faadb..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/ColumnDescriptor.scala +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.TColumnDesc -import org.apache.spark.sql.types.StructField - -/** - * A wrapper class for Spark's [[StructField]] with a column position, - * and can be transform to [[TColumnDesc]] - */ -private[thriftserver] case class ColumnDescriptor(field: StructField, pos: Int) { - /** - * Transform a [[ColumnDescriptor]] to a [[TColumnDesc]] instance. - */ - def toTColumnDesc: TColumnDesc = { - val tColumnDesc = new TColumnDesc - if (field != null) { - tColumnDesc.setColumnName(field.name) - tColumnDesc.setComment(field.getComment().getOrElse("")) - tColumnDesc.setTypeDesc(TypeDescriptor(field.dataType).toTTypeDesc) - } - tColumnDesc.setPosition(pos) - tColumnDesc - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala deleted file mode 100644 index 3514c1b65160..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowBasedSet.scala +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.sql.Date - -import scala.collection.JavaConverters._ -import scala.collection.mutable.ArrayBuffer - -import org.apache.spark.sql.Row -import org.apache.spark.sql.execution.HiveResult -import org.apache.spark.sql.thriftserver.cli.thrift._ -import org.apache.spark.sql.types._ -import org.apache.spark.unsafe.types.{CalendarInterval, UTF8String} - -/** - * A result set of Spark's [[Row]]s with its [[StructType]] as its schema, - * with the ability of - * transform to [[TRowSet]]. - */ -private[thriftserver] case class RowBasedSet(types: StructType, - rows: ArrayBuffer[Row], initStartOffset: Long) - extends RowSet { - - var startOffset: Long = initStartOffset - - override def toTRowSet: TRowSet = new TRowSet(startOffset, toTRows.asJava) - - private[this] def toTRows: Seq[TRow] = { - if (rows != null) { - if (types == null || (rows.nonEmpty && rows.head.size != types.size)) { - throw new IllegalArgumentException("The given schema does't match the given row") - } - rows.map(toTRow) - } else { - Nil - } - } - - private[this] def toTRow(row: Row): TRow = { - val tRow = new TRow() - (0 until row.length).map(i => toTColumnValue(i, row)).foreach(tRow.addToColVals) - tRow - } - - private[this] def toTColumnValue(ordinal: Int, row: Row): TColumnValue = - types(ordinal).dataType match { - case BooleanType => - val boolValue = new TBoolValue - if (!row.isNullAt(ordinal)) boolValue.setValue(row.getBoolean(ordinal)) - TColumnValue.boolVal(boolValue) - - case ByteType => - val byteValue = new TByteValue - if (!row.isNullAt(ordinal)) byteValue.setValue(row.getByte(ordinal)) - TColumnValue.byteVal(byteValue) - - case ShortType => - val tI16Value = new TI16Value - if (!row.isNullAt(ordinal)) tI16Value.setValue(row.getShort(ordinal)) - TColumnValue.i16Val(tI16Value) - - case IntegerType => - val tI32Value = new TI32Value - if (!row.isNullAt(ordinal)) tI32Value.setValue(row.getInt(ordinal)) - TColumnValue.i32Val(tI32Value) - - case LongType => - val tI64Value = new TI64Value - if (!row.isNullAt(ordinal)) tI64Value.setValue(row.getLong(ordinal)) - TColumnValue.i64Val(tI64Value) - - case FloatType => - val tDoubleValue = new TDoubleValue - if (!row.isNullAt(ordinal)) tDoubleValue.setValue(row.getFloat(ordinal)) - TColumnValue.doubleVal(tDoubleValue) - - case DoubleType => - val tDoubleValue = new TDoubleValue - if (!row.isNullAt(ordinal)) tDoubleValue.setValue(row.getDouble(ordinal)) - TColumnValue.doubleVal(tDoubleValue) - - case StringType => - val tStringValue = new TStringValue - if (!row.isNullAt(ordinal)) tStringValue.setValue(row.getString(ordinal)) - TColumnValue.stringVal(tStringValue) - - case DecimalType() => - val tStrValue = new TStringValue - if (!row.isNullAt(ordinal)) tStrValue.setValue(row.getDecimal(ordinal).toString) - TColumnValue.stringVal(tStrValue) - - case DateType => - val tStringValue = new TStringValue - if (!row.isNullAt(ordinal)) tStringValue.setValue(row.get(ordinal).toString) - TColumnValue.stringVal(tStringValue) - - case TimestampType => - val tStringValue = new TStringValue - if (!row.isNullAt(ordinal)) tStringValue.setValue(row.get(ordinal).toString) - TColumnValue.stringVal(tStringValue) - - case BinaryType => - val tStringValue = new TStringValue - if (!row.isNullAt(ordinal)) { - val bytes = row.getAs[Array[Byte]](ordinal) - tStringValue.setValue(UTF8String.fromBytes(bytes).toString) - } - TColumnValue.stringVal(tStringValue) - - case DateType => - val tStringValue = new TStringValue - if (!row.isNullAt(ordinal)) { - val date = row.getAs[Date](ordinal) - tStringValue.setValue(date.toString) - } - TColumnValue.stringVal(tStringValue) - - case CalendarIntervalType => - val tStringValue = new TStringValue - if (!row.isNullAt(ordinal)) { - val calendarInterval = row.getAs[CalendarInterval](ordinal) - tStringValue.setValue(HiveResult.toHiveString(calendarInterval, CalendarIntervalType)) - } - TColumnValue.stringVal(tStringValue) - - case NullType => - val tStringValue = new TStringValue - TColumnValue.stringVal(tStringValue) - - case _: ArrayType | _: StructType | _: MapType | _: UserDefinedType[_] => - val tStrValue = new TStringValue - if (!row.isNullAt(ordinal)) { - tStrValue.setValue( - HiveResult.toHiveString((row.get(ordinal), types(ordinal).dataType))) - } - TColumnValue.stringVal(tStrValue) - } - - override def addRow(row: Row): RowSet = { - rows.+=(row) - this - } - - override def extractSubset(maxRows: Int): RowSet = { - val numRows = Math.min(rows.size, maxRows) - val result = new RowBasedSet(types, rows.slice(0, numRows), startOffset) - rows.remove(0, numRows) - startOffset += numRows - return result - } - - override def numColumns: Int = types.size - - override def numRows: Int = rows.size - - override def getStartOffset: Long = startOffset - - override def setStartOffset(startOffset: Long): Unit = this.startOffset = startOffset - - override def iterator: Iterator[Row] = rows.iterator -} - -object RowBasedSet { - def apply(tRowSet: TRowSet): RowBasedSet = { - val rows = new ArrayBuffer[Row]() - tRowSet.getRows.asScala.foreach(row => { - rows += Row.fromSeq(row.getColVals.asScala.map(_.getFieldValue)) - }) - RowBasedSet(null, rows, tRowSet.getStartRowOffset) - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala deleted file mode 100644 index a61a233f628d..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSet.scala +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.Row -import org.apache.spark.sql.thriftserver.cli.thrift.TRowSet - -private[thriftserver] trait RowSet { - def addRow(row: Row): RowSet - - def extractSubset(maxRows: Int): RowSet - - def numColumns: Int - - def numRows: Int - - def getStartOffset: Long - - def setStartOffset(startOffset: Long): Unit - - def toTRowSet: TRowSet - - def iterator: Iterator[Row] -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala deleted file mode 100644 index 5775c2057e6d..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/RowSetFactory.scala +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import java.io.ByteArrayInputStream -import java.util - -import scala.collection.JavaConverters._ -import scala.collection.mutable.ArrayBuffer - -import org.apache.thrift.TException -import org.apache.thrift.protocol.TCompactProtocol -import org.apache.thrift.transport.TIOStreamTransport - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.Row -import org.apache.spark.sql.thriftserver.cli.thrift.{TColumn, TProtocolVersion, TRowSet} -import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion._ -import org.apache.spark.sql.types.StructType - -private[thriftserver] object RowSetFactory extends Logging { - def create(types: StructType, rows: Seq[Row], version: TProtocolVersion): RowSet = { - if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { - ColumnBasedSet(types, ArrayBuffer(rows: _*), 0) - } else { - RowBasedSet(types, ArrayBuffer(rows: _*), 0) - } - } - - def create(types: StructType, version: TProtocolVersion): RowSet = { - if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { - ColumnBasedSet(types, new ArrayBuffer[Row](), 0) - } else { - RowBasedSet(types, new ArrayBuffer[Row](), 0) - } - } - - def create(tRowSet: TRowSet, version: TProtocolVersion): RowSet = { - if (version.getValue >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue) { - ColumnBasedSet(tRowSet) - } else { - RowBasedSet(tRowSet) - } - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala deleted file mode 100644 index bdb34b1cdc97..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/SchemaMapper.scala +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import scala.collection.JavaConverters._ - -import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIServiceConstants, TTableSchema, TTypeEntry, TTypeId} -import org.apache.spark.sql.types._ - -private[thriftserver] object SchemaMapper { - - def toTTableSchema(fields: StructType): TTableSchema = { - val tTableSchema = new TTableSchema - if (fields != null) { - fields.zipWithIndex.map { - case (field, i) => ColumnDescriptor(field, i) - }.map(_.toTColumnDesc).foreach(tTableSchema.addToColumns) - } - tTableSchema - } - - def toStructType(fields: TTableSchema): StructType = { - var schema = new StructType() - if (fields != null) { - val posToField: Map[Int, StructField] = fields.getColumns.asScala.map { tColumn => - tColumn.position -> - new StructField(tColumn.columnName, - toDataType(tColumn.typeDesc.getTypes.get(0))) - }.toMap - posToField.keys.toSeq.sorted.foreach { pos => - schema = schema.add(posToField(pos)) - } - } - schema - } - - def toTTypeId(typ: DataType): TTypeId = typ match { - case NullType => TTypeId.NULL_TYPE - case BooleanType => TTypeId.BOOLEAN_TYPE - case ByteType => TTypeId.TINYINT_TYPE - case ShortType => TTypeId.SMALLINT_TYPE - case IntegerType => TTypeId.INT_TYPE - case LongType => TTypeId.BIGINT_TYPE - case FloatType => TTypeId.FLOAT_TYPE - case DoubleType => TTypeId.DOUBLE_TYPE - case StringType => TTypeId.STRING_TYPE - case DecimalType() => TTypeId.DECIMAL_TYPE - case DateType => TTypeId.DATE_TYPE - case TimestampType => TTypeId.TIMESTAMP_TYPE - case BinaryType => TTypeId.BINARY_TYPE - case _: ArrayType => TTypeId.ARRAY_TYPE - case _: MapType => TTypeId.MAP_TYPE - case _: StructType => TTypeId.STRUCT_TYPE - case _: CalendarIntervalType => TTypeId.STRING_TYPE - case _: UserDefinedType[_] => TTypeId.USER_DEFINED_TYPE - case other => - val catalogString = if (other != null) { - other.catalogString - } else { - null - } - throw new IllegalArgumentException("Unrecognized type name: " + catalogString) - } - - def toDataType(entry: TTypeEntry): DataType = - entry.getPrimitiveEntry.`type` match { - case TTypeId.NULL_TYPE => NullType - case TTypeId.BOOLEAN_TYPE => BooleanType - case TTypeId.TINYINT_TYPE => ByteType - case TTypeId.SMALLINT_TYPE => ShortType - case TTypeId.INT_TYPE => IntegerType - case TTypeId.BIGINT_TYPE => LongType - case TTypeId.FLOAT_TYPE => FloatType - case TTypeId.DOUBLE_TYPE => DoubleType - case TTypeId.STRING_TYPE => StringType - case TTypeId.DECIMAL_TYPE => - val tQualifiers = entry.getPrimitiveEntry - .getTypeQualifiers.qualifiers - DecimalType(tQualifiers.get(TCLIServiceConstants.PRECISION).getI32Value, - tQualifiers.get(TCLIServiceConstants.SCALE).getI32Value) - case TTypeId.DATE_TYPE => DateType - case TTypeId.TIMESTAMP_TYPE => TimestampType - case TTypeId.BINARY_TYPE => BinaryType - case TTypeId.ARRAY_TYPE => - ArrayType.defaultConcreteType - case TTypeId.MAP_TYPE => - MapType.defaultConcreteType - case TTypeId.STRUCT_TYPE => - StructType.defaultConcreteType - case TTypeId.USER_DEFINED_TYPE => UserDefinedType[Any] - case _ => StringType - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala deleted file mode 100644 index d0d4a989272f..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeDescriptor.scala +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import org.apache.spark.sql.thriftserver.cli.thrift.{TPrimitiveTypeEntry, TTypeDesc, TTypeEntry} -import org.apache.spark.sql.types.{DataType, DecimalType} - -/** - * A wrapper class of Spark's [[DataType]] with [[TypeQualifiers]] for [[DecimalType]]s, and could - * be transformed to [[TTypeDesc]]. - */ -private[thriftserver] case class TypeDescriptor(typ: DataType) { - private[this] val typeQualifiers: Option[TypeQualifiers] = typ match { - case d: DecimalType => Some(TypeQualifiers.fromTypeInfo(d)) - case _ => None - } - - def toTTypeDesc: TTypeDesc = { - val primitiveEntry = new TPrimitiveTypeEntry(SchemaMapper.toTTypeId(typ)) - typeQualifiers.map(_.toTTypeQualifiers).foreach(primitiveEntry.setTypeQualifiers) - val entry = TTypeEntry.primitiveEntry(primitiveEntry) - val desc = new TTypeDesc - desc.addToTypes(entry) - desc - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala deleted file mode 100644 index 538eee15f077..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/TypeQualifiers.scala +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli - -import scala.collection.JavaConverters._ - -import org.apache.spark.sql.thriftserver.cli.thrift.{TCLIServiceConstants, TTypeQualifiers, TTypeQualifierValue} -import org.apache.spark.sql.types.{DataType, DecimalType} - -private[thriftserver] class TypeQualifiers private() { - private[this] var precision: Option[Int] = None - private[this] var scale: Option[Int] = None - - private def setPrecision(precision: Int): Unit = { - this.precision = Some(precision) - } - - private def setScale(scale: Int): Unit = { - this.scale = Some(scale) - } - - def toTTypeQualifiers: TTypeQualifiers = new TTypeQualifiers( - (precision - .map(TTypeQualifierValue.i32Value) - .map(TCLIServiceConstants.PRECISION -> _) ++ - scale - .map(TTypeQualifierValue.i32Value) - .map(TCLIServiceConstants.SCALE -> _)) - .toMap.asJava) -} - -private[thriftserver] object TypeQualifiers { - def fromTypeInfo(typ: DataType): TypeQualifiers = { - val result = new TypeQualifiers - typ match { - case decimalType: DecimalType => - result.setScale(decimalType.scale) - result.setPrecision(decimalType.precision) - case _ => - } - result - } -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala deleted file mode 100644 index f2ccccff0933..000000000000 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/Operation.scala +++ /dev/null @@ -1,304 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.spark.sql.thriftserver.cli.operation - -import java.io.{File, FileNotFoundException} -import java.util.concurrent.Future - -import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse -import org.apache.hadoop.hive.ql.session.OperationLog - -import org.apache.spark.internal.Logging -import org.apache.spark.sql.thriftserver.cli._ -import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession -import org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion -import org.apache.spark.sql.types.StructType -import org.apache.spark.util.Utils - -private[thriftserver] abstract class Operation( - session: ThriftServerSession, - opType: OperationType, - runInBackground: Boolean) extends Logging { - private[this] var _state: OperationState = OperationState.INITIALIZED - private[this] val _opHandle: OperationHandle = - new OperationHandle(opType, session.getProtocolVersion) - private[this] var _conf: HiveConf = session.getHiveConf - - protected var _statementId: String = _ - protected var _hasResultSet = false - protected var _operationException: SparkThriftServerSQLException = _ - protected val _runAsync: Boolean = runInBackground - protected var _backgroundHandle: Future[_] = _ - protected var _operationLog: OperationLog = _ - protected var _isOperationLogEnabled = false - - private var _operationTimeout: Long = - Utils.timeStringAsMs(_conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_IDLE_OPERATION_TIMEOUT)) - private var _lastAccessTime = System.currentTimeMillis() - - protected val DEFAULT_FETCH_ORIENTATION_SET: Set[FetchOrientation] = - Set(FetchOrientation.FETCH_NEXT, FetchOrientation.FETCH_FIRST, FetchOrientation.FETCH_PRIOR) - - def getBackgroundHandle: Future[_] = _backgroundHandle - - protected def setBackgroundHandle(backgroundHandle: Future[_]): Unit = { - this._backgroundHandle = backgroundHandle - } - - def shouldRunAsync: Boolean = _runAsync - - def setConfiguration(conf: HiveConf): Unit = { - this._conf = conf - } - - def getConfiguration: HiveConf = _conf - - def getParentSession: ThriftServerSession = session - - def getHandle: OperationHandle = _opHandle - - def getProtocolVersion: TProtocolVersion = _opHandle.getProtocolVersion - - def getType: OperationType = _opHandle.getOperationType - - def getStatus: OperationStatus = new OperationStatus(_state, _operationException) - - def setStatementId(statementId: String): Unit = _statementId = statementId - - def getStatementId: String = _statementId - - def statementId: String = getStatementId - - def hasResultSet: Boolean = _hasResultSet - - protected def setHasResultSet(hasResultSet: Boolean): Unit = { - this._hasResultSet = hasResultSet - _opHandle.setHasResultSet(this._hasResultSet) - } - - def getOperationLog: OperationLog = _operationLog - - - @throws[SparkThriftServerSQLException] - protected def setState(newState: OperationState): OperationState = { - _state.validateTransition(newState) - this._state = newState - this._lastAccessTime = System.currentTimeMillis() - this._state - } - - def isTimedOut(current: Long): Boolean = { - if (_operationTimeout == 0) { - return false - } - if (_operationTimeout > 0) { // check only when it's in terminal state - return _state.isTerminal && _lastAccessTime + _operationTimeout <= current - } - _lastAccessTime + -_operationTimeout <= current - } - - def getLastAccessTime: Long = _lastAccessTime - - def getOperationTimeout: Long = _operationTimeout - - def setOperationTimeout(operationTimeout: Long): Unit = { - this._operationTimeout = operationTimeout - } - - protected def setOperationException(opEx: SparkThriftServerSQLException): Unit = { - this._operationException = opEx - } - - @throws[SparkThriftServerSQLException] - protected final def assertState(state: OperationState): Unit = { - if (this._state ne state) { - throw new SparkThriftServerSQLException("Expected state " + - state + ", but found " + this._state) - } - this._lastAccessTime = System.currentTimeMillis - } - - def isRunning: Boolean = OperationState.RUNNING == _state - - def isFinished: Boolean = OperationState.FINISHED == _state - - def isCanceled: Boolean = OperationState.CANCELED == _state - - def isFailed: Boolean = OperationState.ERROR == _state - - - protected def createOperationLog(): Unit = { - if (session.isOperationLogEnabled) { - val logFile = - new File(session.getOperationLogSessionDir, _opHandle.getHandleIdentifier.toString) - val logFilePath = logFile.getAbsolutePath - this._isOperationLogEnabled = true - // create log file - try { - if (logFile.exists) { - logWarning( - s""" - |The operation log file should not exist, but it is already there: $logFilePath" - """.stripMargin) - logFile.delete - } - if (!logFile.createNewFile) { - // the log file already exists and cannot be deleted. - // If it can be read/written, keep its contents and use it. - if (!logFile.canRead || !logFile.canWrite) { - logWarning( - s""" - |The already existed operation log file cannot be recreated, - |and it cannot be read or written: $logFilePath" - """.stripMargin) - this._isOperationLogEnabled = false - return - } - } - } catch { - case e: Exception => - logWarning("Unable to create operation log file: " + logFilePath, e) - this._isOperationLogEnabled = false - return - } - // create OperationLog object with above log file - try - this._operationLog = new OperationLog(this._opHandle.toString, logFile, new HiveConf()) - catch { - case e: FileNotFoundException => - logWarning("Unable to instantiate OperationLog object for operation: " + - this._opHandle, e) - this._isOperationLogEnabled = false - return - } - // register this operationLog - // session.getSessionMgr.getOperationMgr - // .setOperationLog(session.getUserName, this._operationLog) - OperationLog.setCurrentOperationLog(_operationLog) - } - } - - protected def unregisterOperationLog(): Unit = { - if (_isOperationLogEnabled) { - OperationLog.removeCurrentOperationLog() - } - } - - - /** - * Invoked before runInternal(). - * Set up some preconditions, or configurations. - */ - protected def beforeRun(): Unit = { - createOperationLog() - } - - /** - * Invoked after runInternal(), even if an exception is thrown in runInternal(). - * Clean up resources, which was set up in beforeRun(). - */ - protected def afterRun(): Unit = { - unregisterOperationLog() - } - - /** - * Implemented by subclass of Operation class to execute specific behaviors. - * - * @throws SparkThriftServerSQLException - */ - @throws[SparkThriftServerSQLException] - protected def runInternal(): Unit - - @throws[SparkThriftServerSQLException] - def run(): Unit = { - beforeRun() - try - runInternal() - finally afterRun() - } - - - protected def cleanupOperationLog(): Unit = { - if (_isOperationLogEnabled) { - if (_operationLog == null) { - logError("Operation [ " + _opHandle.getHandleIdentifier + " ] " + - "logging is enabled, but its OperationLog object cannot be found.") - } else { - _operationLog.close() - } - } - } - - // TODO: make this abstract and implement in subclasses. - @throws[SparkThriftServerSQLException] - def cancel(): Unit = { - setState(OperationState.CANCELED) - throw new UnsupportedOperationException("SQLOperation.cancel()") - } - - @throws[SparkThriftServerSQLException] - def close(): Unit - - @throws[SparkThriftServerSQLException] - def getResultSetSchema: StructType - - @throws[SparkThriftServerSQLException] - def getNextRowSet(orientation: FetchOrientation, maxRows: Long): RowSet - - @throws[SparkThriftServerSQLException] - def getNextRowSet: RowSet = - getNextRowSet(FetchOrientation.FETCH_NEXT, Operation.DEFAULT_FETCH_MAX_ROWS) - - - /** - * Verify if the given fetch orientation is part of the default orientation types. - */ - @throws[SparkThriftServerSQLException] - protected def validateDefaultFetchOrientation(orientation: FetchOrientation): Unit = { - validateFetchOrientation(orientation, DEFAULT_FETCH_ORIENTATION_SET) - } - - /** - * Verify if the given fetch orientation is part of the supported orientation types. - */ - @throws[SparkThriftServerSQLException] - protected def validateFetchOrientation(orientation: FetchOrientation, - supportedOrientations: Set[FetchOrientation]): Unit = { - if (!supportedOrientations.contains(orientation)) { - throw new SparkThriftServerSQLException( - "The fetch type " + orientation.toString + " is not supported for this resultset", "HY106") - } - } - - protected def toSQLException( - prefix: String, - response: CommandProcessorResponse): SparkThriftServerSQLException = { - val ex = new SparkThriftServerSQLException(prefix + ": " + - response.getErrorMessage, response.getSQLState, response.getResponseCode) - if (response.getException != null) { - ex.initCause(response.getException) - } - ex - } -} - -object Operation { - final val DEFAULT_FETCH_ORIENTATION: FetchOrientation = FetchOrientation.FETCH_NEXT - final val DEFAULT_FETCH_MAX_ROWS = 100 -} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala index 5ca51553b956..a908aff7a5fe 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/OperationManager.scala @@ -25,11 +25,12 @@ import java.util.concurrent.ConcurrentHashMap import scala.collection.JavaConverters._ import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hadoop.hive.metastore.api.{FieldSchema, Schema} import org.apache.hadoop.hive.ql.session.OperationLog import org.apache.log4j.Logger import org.apache.spark.internal.Logging -import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.SQLContext import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.thriftserver.AbstractService @@ -268,7 +269,7 @@ private[thriftserver] class OperationManager } @throws[SparkThriftServerSQLException] - def getOperationResultSetSchema(opHandle: OperationHandle): StructType = { + def getOperationResultSetSchema(opHandle: OperationHandle): TableSchema = { getOperation(opHandle).getResultSetSchema } @@ -303,12 +304,25 @@ private[thriftserver] class OperationManager throw new SparkThriftServerSQLException(e.getMessage, e.getCause) } // convert logs to RowSet + // convert logs to RowSet + val tableSchema: TableSchema = new TableSchema(getLogSchema) val rowSet: RowSet = - RowSetFactory.create(logSchema, logs.asScala.map(Row(_)), - getOperation(opHandle).getProtocolVersion) + RowSetFactory.create(tableSchema, getOperation(opHandle).getProtocolVersion, false) + for (log <- logs.asScala) { + rowSet.addRow(Array[AnyRef](log)) + } rowSet } + private def getLogSchema = { + val schema = new Schema + val fieldSchema = new FieldSchema + fieldSchema.setName("operation_log") + fieldSchema.setType("string") + schema.addToFieldSchemas(fieldSchema) + schema + } + private def isFetchFirst(fetchOrientation: FetchOrientation): Boolean = { // TODO: Since OperationLog is moved to package o.a.h.h.ql.session, // we may add a Enum there and map FetchOrientation to it. diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala index 48848b4f4aeb..df685b044a56 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkExecuteStatementOperation.scala @@ -18,25 +18,29 @@ package org.apache.spark.sql.thriftserver.cli.operation import java.security.PrivilegedExceptionAction -import java.util.{Map => JMap, UUID} +import java.sql.{Date, Timestamp} +import java.util.{Arrays, Map => JMap, UUID} import java.util.concurrent.RejectedExecutionException import scala.collection.JavaConverters._ +import scala.collection.mutable.ArrayBuffer import scala.util.control.NonFatal import org.apache.commons.lang3.exception.ExceptionUtils -import org.apache.hadoop.hive.ql.session.OperationLog +import org.apache.hadoop.hive.metastore.api.FieldSchema import org.apache.hadoop.hive.shims.Utils import org.apache.spark.SparkContext import org.apache.spark.internal.Logging import org.apache.spark.sql.{DataFrame, Row => SparkRow, SQLContext} +import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.execution.command.SetCommand import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession import org.apache.spark.sql.thriftserver.server.SparkThriftServer import org.apache.spark.sql.types._ +import org.apache.spark.unsafe.types.CalendarInterval import org.apache.spark.util.{Utils => SparkUtils} private[thriftserver] class SparkExecuteStatementOperation( @@ -45,8 +49,8 @@ private[thriftserver] class SparkExecuteStatementOperation( confOverlay: JMap[String, String], runInBackground: Boolean = true)(sqlContext: SQLContext, sessionToActivePool: JMap[SessionHandle, String]) - extends Operation(parentSession, OperationType.EXECUTE_STATEMENT, runInBackground) - with Logging { + extends Operation(parentSession, confOverlay, OperationType.EXECUTE_STATEMENT, runInBackground) + with Logging { private var result: DataFrame = _ @@ -59,15 +63,26 @@ private[thriftserver] class SparkExecuteStatementOperation( private var iter: Iterator[SparkRow] = _ private var dataTypes: Array[DataType] = _ + private lazy val resultSchema: TableSchema = { + if (result == null || result.schema.isEmpty) { + new TableSchema(Arrays.asList(new FieldSchema("Result", "string", ""))) + } else { + logInfo(s"Result Schema: ${result.schema}") + SparkExecuteStatementOperation.getTableSchema(result.schema) + } + } + + import org.apache.hadoop.hive.ql.session.OperationLog + def registerCurrentOperationLog(): Unit = { - if (_isOperationLogEnabled) { - if (_operationLog == null) { - logWarning("Failed to get current OperationLog object of Operation: " - + getHandle.getHandleIdentifier) - _isOperationLogEnabled = false - } else { - OperationLog.setCurrentOperationLog(_operationLog) + if (isOperationLogEnabled) { + if (operationLog == null) { + logWarning("Failed to get current OperationLog object of Operation: " + + getHandle.getHandleIdentifier) + isOperationLogEnabled = false + return } + OperationLog.setCurrentOperationLog(operationLog) } } @@ -78,14 +93,48 @@ private[thriftserver] class SparkExecuteStatementOperation( SparkThriftServer.listener.onOperationClosed(statementId) } + def addNonNullColumnValue(from: SparkRow, to: ArrayBuffer[Any], ordinal: Int): Unit = { + dataTypes(ordinal) match { + case StringType => + to += from.getString(ordinal) + case IntegerType => + to += from.getInt(ordinal) + case BooleanType => + to += from.getBoolean(ordinal) + case DoubleType => + to += from.getDouble(ordinal) + case FloatType => + to += from.getFloat(ordinal) + case DecimalType() => + to += from.getDecimal(ordinal) + case LongType => + to += from.getLong(ordinal) + case ByteType => + to += from.getByte(ordinal) + case ShortType => + to += from.getShort(ordinal) + case DateType => + to += from.getAs[Date](ordinal) + case TimestampType => + to += from.getAs[Timestamp](ordinal) + case BinaryType => + to += from.getAs[Array[Byte]](ordinal) + case CalendarIntervalType => + to += HiveResult.toHiveString((from.getAs[CalendarInterval](ordinal), CalendarIntervalType)) + case _: ArrayType | _: StructType | _: MapType | _: UserDefinedType[_] => + val hiveString = HiveResult.toHiveString((from.get(ordinal), dataTypes(ordinal))) + to += hiveString + } + } + def getNextRowSet(order: FetchOrientation, maxRowsL: Long): RowSet = withSchedulerPool { - logInfo(s"Received getNextRowSet request order=${order} and maxRowsL=${maxRowsL} " + + log.info(s"Received getNextRowSet request order=${order} and maxRowsL=${maxRowsL} " + s"with ${statementId}") validateDefaultFetchOrientation(order) assertState(OperationState.FINISHED) setHasResultSet(true) val resultRowSet: RowSet = - RowSetFactory.create(getResultSetSchema, getProtocolVersion) + RowSetFactory.create(getResultSetSchema, getProtocolVersion, false) // Reset iter when FETCH_FIRST or FETCH_PRIOR if ((order.equals(FetchOrientation.FETCH_FIRST) || @@ -132,29 +181,32 @@ private[thriftserver] class SparkExecuteStatementOperation( var curRow = 0 while (curRow < maxRows && iter.hasNext) { val sparkRow = iter.next() - resultRowSet.addRow(sparkRow) + val row = ArrayBuffer[Any]() + var curCol = 0 + while (curCol < sparkRow.length) { + if (sparkRow.isNullAt(curCol)) { + row += null + } else { + addNonNullColumnValue(sparkRow, row, curCol) + } + curCol += 1 + } + resultRowSet.addRow(row.toArray.asInstanceOf[Array[Object]]) curRow += 1 resultOffset += 1 } previousFetchEndOffset = resultOffset - logInfo(s"Returning result set with ${curRow} rows from offsets " + + log.info(s"Returning result set with ${curRow} rows from offsets " + s"[$previousFetchStartOffset, $previousFetchEndOffset) with $statementId") resultRowSet } } - def getResultSetSchema: StructType = { - assertState(OperationState.FINISHED) - if (result == null || result.schema.isEmpty) { - new StructType().add("Result", "string") - } else { - result.schema - } - } + def getResultSetSchema: TableSchema = resultSchema override def runInternal(): Unit = { setState(OperationState.PENDING) - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString logInfo(s"Submitting query '$statement' with $statementId") SparkThriftServer.listener.onStatementStart( statementId, @@ -182,7 +234,7 @@ private[thriftserver] class SparkExecuteStatementOperation( } catch { case e: SparkThriftServerSQLException => setOperationException(e) - logError("Error running hive query: ", e) + log.error("Error running hive query: ", e) } } } @@ -200,7 +252,7 @@ private[thriftserver] class SparkExecuteStatementOperation( try { // This submit blocks if no background threads are available to run this operation val backgroundHandle = - parentSession.getSessionManager.submitBackgroundOperation(backgroundOperation) + parentSession.getSessionManager().submitBackgroundOperation(backgroundOperation) setBackgroundHandle(backgroundHandle) } catch { case rejected: RejectedExecutionException => @@ -267,7 +319,7 @@ private[thriftserver] class SparkExecuteStatementOperation( if (statementId != null) { sqlContext.sparkContext.cancelJobGroup(statementId) } - val currentState = getStatus.getState + val currentState = getStatus().getState() if (currentState.isTerminal) { // This may happen if the execution was cancelled, and then closed from another thread. logWarning(s"Ignore exception in terminal state with $statementId: $e") @@ -310,7 +362,7 @@ private[thriftserver] class SparkExecuteStatementOperation( private def cleanup(state: OperationState): Unit = { setState(state) if (runInBackground) { - val backgroundHandle = getBackgroundHandle + val backgroundHandle = getBackgroundHandle() if (backgroundHandle != null) { backgroundHandle.cancel(true) } @@ -334,3 +386,17 @@ private[thriftserver] class SparkExecuteStatementOperation( } } } + +object SparkExecuteStatementOperation { + def getTableSchema(structType: StructType): TableSchema = { + val schema = structType.map { field => + val attrTypeString = field.dataType match { + case NullType => "void" + case CalendarIntervalType => StringType.catalogString + case other => other.catalogString + } + new FieldSchema(field.name, attrTypeString, field.getComment.getOrElse("")) + } + new TableSchema(schema.asJava) + } +} diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala index f67120b0a245..64b55164722e 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetCatalogsOperation.scala @@ -41,10 +41,10 @@ private[thriftserver] class SparkGetCatalogsOperation( parentSession: ThriftServerSession) extends SparkMetadataOperation(parentSession, OperationType.GET_CATALOGS) with Logging { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TABLE_CAT", StringType)) + RESULT_SET_SCHEMA = new TableSchema() + .addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable.") - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion, false) override def close(): Unit = { super.close() @@ -52,7 +52,7 @@ private[thriftserver] class SparkGetCatalogsOperation( } override def runInternal(): Unit = { - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString val logMsg = "Listing catalogs" logInfo(s"$logMsg with $statementId") setState(OperationState.RUNNING) @@ -92,8 +92,7 @@ private[thriftserver] class SparkGetCatalogsOperation( SparkThriftServer.listener.onStatementFinish(statementId) } - override def getResultSetSchema: StructType = { - assertState(OperationState.FINISHED) + override def getResultSetSchema: TableSchema = { RESULT_SET_SCHEMA } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala index aa7591011990..a219c6e1b583 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetColumnsOperation.scala @@ -27,7 +27,7 @@ import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationTyp import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject.HivePrivilegeObjectType import org.apache.spark.internal.Logging -import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.SQLContext import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.SessionCatalog import org.apache.spark.sql.thriftserver.cli._ @@ -58,39 +58,86 @@ private[thriftserver] class SparkGetColumnsOperation( val catalog: SessionCatalog = sqlContext.sessionState.catalog - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TABLE_CAT", StringType)) - .add(StructField("TABLE_SCHEM", StringType)) - .add(StructField("TABLE_NAME", StringType)) - .add(StructField("COLUMN_NAME", StringType)) - .add(StructField("DATA_TYPE", IntegerType)) - .add(StructField("TYPE_NAME", StringType)) - .add(StructField("COLUMN_SIZE", IntegerType)) - .add(StructField("BUFFER_LENGTH", ShortType)) - .add(StructField("DECIMAL_DIGITS", IntegerType)) - .add(StructField("NUM_PREC_RADIX", IntegerType)) - .add(StructField("NULLABLE", IntegerType)) - .add(StructField("REMARKS", StringType)) - .add(StructField("COLUMN_DEF", StringType)) - .add(StructField("SQL_DATA_TYPE", IntegerType)) - .add(StructField("SQL_DATETIME_SUB", IntegerType)) - .add(StructField("CHAR_OCTET_LENGTH", IntegerType)) - .add(StructField("ORDINAL_POSITION", IntegerType)) - .add(StructField("IS_NULLABLE", StringType)) - .add(StructField("SCOPE_CATALOG", StringType)) - .add(StructField("SCOPE_SCHEMA", StringType)) - .add(StructField("SCOPE_TABLE", StringType)) - .add(StructField("SOURCE_DATA_TYPE", ShortType)) - .add(StructField("IS_AUTO_INCREMENT", StringType)) - - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + RESULT_SET_SCHEMA = + new TableSchema() + .addPrimitiveColumn( + "TABLE_CAT", + Type.STRING_TYPE, + "Catalog name. NULL if not applicable") + .addPrimitiveColumn( + "TABLE_SCHEM", + Type.STRING_TYPE, + "Schema name") + .addPrimitiveColumn( + "TABLE_NAME", + Type.STRING_TYPE, + "Table name") + .addPrimitiveColumn("COLUMN_NAME", + Type.STRING_TYPE, "Column name") + .addPrimitiveColumn("DATA_TYPE", + Type.INT_TYPE, + "SQL type from java.sql.Types") + .addPrimitiveColumn( + "TYPE_NAME", + Type.STRING_TYPE, "Data source dependent type name, " + + "for a UDT the type name is fully qualified") + .addPrimitiveColumn("COLUMN_SIZE", + Type.INT_TYPE, + "Column size. For char or date types this is the maximum number of characters, " + + "for numeric or decimal types this is precision.") + .addPrimitiveColumn("BUFFER_LENGTH", + Type.TINYINT_TYPE, "Unused") + .addPrimitiveColumn("DECIMAL_DIGITS", + Type.INT_TYPE, "The number of fractional digits") + .addPrimitiveColumn("NUM_PREC_RADIX", + Type.INT_TYPE, "Radix (typically either 10 or 2)") + .addPrimitiveColumn("NULLABLE", + Type.INT_TYPE, "Is NULL allowed") + .addPrimitiveColumn("REMARKS", + Type.STRING_TYPE, "Comment describing column (may be null)") + .addPrimitiveColumn("COLUMN_DEF", + Type.STRING_TYPE, "Default value (may be null)") + .addPrimitiveColumn("SQL_DATA_TYPE", + Type.INT_TYPE, "Unused") + .addPrimitiveColumn("SQL_DATETIME_SUB", + Type.INT_TYPE, "Unused") + .addPrimitiveColumn("CHAR_OCTET_LENGTH", + Type.INT_TYPE, "For char types the maximum" + + " number of bytes in the column") + .addPrimitiveColumn("ORDINAL_POSITION", + Type.INT_TYPE, "Index of column in table (starting at 1)") + .addPrimitiveColumn("IS_NULLABLE", + Type.STRING_TYPE, + "\"NO\" means column definitely does not allow NULL values; \"YES\" means the " + + "column might allow NULL values. An empty string means nobody knows.") + .addPrimitiveColumn("SCOPE_CATALOG", + Type.STRING_TYPE, + "Catalog of table that is the scope of a reference attribute " + + "(null if DATA_TYPE isn't REF)") + .addPrimitiveColumn("SCOPE_SCHEMA", + Type.STRING_TYPE, + "Schema of table that is the scope of a reference attribute " + + "(null if the DATA_TYPE isn't REF)") + .addPrimitiveColumn("SCOPE_TABLE", + Type.STRING_TYPE, + "Table name that this the scope of a reference attribure (null if the DATA_TYPE isn't REF)") + .addPrimitiveColumn("SOURCE_DATA_TYPE", + Type.SMALLINT_TYPE, + "Source type of a distinct type or user-generated Ref type, SQL type from java.sql.Types " + + "(null if DATA_TYPE isn't DISTINCT or user-generated REF)") + .addPrimitiveColumn("IS_AUTO_INCREMENT", + Type.STRING_TYPE, + "Indicates whether this column is auto incremented.") + + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion, false) override def close(): Unit = { super.close() SparkThriftServer.listener.onOperationClosed(statementId) } override def runInternal(): Unit = { - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName, tablePattern : $tableName" val logMsg = s"Listing columns '$cmdStr, columnName : $columnName'" @@ -179,18 +226,18 @@ private[thriftserver] class SparkGetColumnsOperation( schema.foreach { column => if (columnPattern != null && !columnPattern.matcher(column.name).matches()) { } else { - val rowData = Row( + val rowData = Array[AnyRef]( null, // TABLE_CAT dbName, // TABLE_SCHEM tableName, // TABLE_NAME column.name, // COLUMN_NAME - Type.getType(column.dataType.sql).toJavaSQLType, // DATA_TYPE + Type.getType(column.dataType.sql).toJavaSQLType.asInstanceOf[AnyRef], // DATA_TYPE column.dataType.sql, // TYPE_NAME null, // COLUMN_SIZE null, // BUFFER_LENGTH, unused null, // DECIMAL_DIGITS null, // NUM_PREC_RADIX - (if (column.nullable) 1 else 0), // NULLABLE + (if (column.nullable) 1 else 0).asInstanceOf[AnyRef], // NULLABLE column.getComment().getOrElse(""), // REMARKS null, // COLUMN_DEF null, // SQL_DATA_TYPE @@ -217,8 +264,7 @@ private[thriftserver] class SparkGetColumnsOperation( }) } - override def getResultSetSchema: StructType = { - assertState(OperationState.FINISHED) + override def getResultSetSchema: TableSchema = { RESULT_SET_SCHEMA } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala index 62e3fb12a91f..be04ecf3df14 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetFunctionsOperation.scala @@ -26,11 +26,10 @@ import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObjectUtils} import org.apache.spark.internal.Logging -import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.SQLContext import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession import org.apache.spark.sql.thriftserver.server.SparkThriftServer -import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType} import org.apache.spark.util.{Utils => SparkUtils} /** @@ -50,15 +49,21 @@ private[thriftserver] class SparkGetFunctionsOperation( functionName: String) extends SparkMetadataOperation(parentSession, OperationType.GET_FUNCTIONS) with Logging { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("FUNCTION_CAT", StringType)) - .add(StructField("FUNCTION_SCHEM", StringType)) - .add(StructField("FUNCTION_NAME", StringType)) - .add(StructField("REMARKS", StringType)) - .add(StructField("FUNCTION_TYPE", IntegerType)) - .add(StructField("SPECIFIC_NAME", StringType)) - - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + RESULT_SET_SCHEMA = new TableSchema() + .addPrimitiveColumn("FUNCTION_CAT", Type.STRING_TYPE, + "Function catalog (may be null)") + .addPrimitiveColumn("FUNCTION_SCHEM", Type.STRING_TYPE, + "Function schema (may be null)") + .addPrimitiveColumn("FUNCTION_NAME", Type.STRING_TYPE, + "Function name. This is the name used to invoke the function") + .addPrimitiveColumn("REMARKS", Type.STRING_TYPE, + "Explanatory comment on the function") + .addPrimitiveColumn("FUNCTION_TYPE", Type.INT_TYPE, + "Kind of function.") + .addPrimitiveColumn("SPECIFIC_NAME", Type.STRING_TYPE, + "The name which uniquely identifies this function within its schema") + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion, false) override def close(): Unit = { super.close() @@ -66,7 +71,7 @@ private[thriftserver] class SparkGetFunctionsOperation( } override def runInternal(): Unit = { - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing functions '$cmdStr, functionName : $functionName'" @@ -101,7 +106,7 @@ private[thriftserver] class SparkGetFunctionsOperation( catalog.listFunctions(db, functionPattern).foreach { case (funcIdentifier, _) => val info = catalog.lookupFunctionInfo(funcIdentifier) - val rowData = Row( + val rowData = Array[AnyRef]( DEFAULT_HIVE_CATALOG, // FUNCTION_CAT db, // FUNCTION_SCHEM funcIdentifier.funcName, // FUNCTION_NAME @@ -132,7 +137,7 @@ private[thriftserver] class SparkGetFunctionsOperation( SparkThriftServer.listener.onStatementFinish(statementId) } - override def getResultSetSchema: StructType = { + override def getResultSetSchema: TableSchema = { assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala index f4ff205fc3ea..48fe02099683 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetSchemasOperation.scala @@ -46,12 +46,11 @@ private[thriftserver] class SparkGetSchemasOperation( schemaName: String) extends SparkMetadataOperation(parentSession, OperationType.GET_SCHEMAS) with Logging { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TABLE_SCHEM", StringType)) - .add(StructField("TABLE_CATALOG", StringType)) + RESULT_SET_SCHEMA = new TableSchema() + .addStringColumn("TABLE_SCHEM", "Schema name.") + .addStringColumn("TABLE_CATALOG", "Catalog name.") - - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion, false) override def close(): Unit = { super.close() @@ -59,7 +58,7 @@ private[thriftserver] class SparkGetSchemasOperation( } override def runInternal(): Unit = { - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing databases '$cmdStr'" @@ -83,13 +82,13 @@ private[thriftserver] class SparkGetSchemasOperation( try { val schemaPattern = convertSchemaPattern(schemaName) sqlContext.sessionState.catalog.listDatabases(schemaPattern).foreach { dbName => - rowSet.addRow(Row(dbName, DEFAULT_HIVE_CATALOG)) + rowSet.addRow(Array[AnyRef](dbName, DEFAULT_HIVE_CATALOG)) } val globalTempViewDb = sqlContext.sessionState.catalog.globalTempViewManager.database val databasePattern = Pattern.compile(CLIServiceUtils.patternToRegex(schemaName)) if (databasePattern.matcher(globalTempViewDb).matches()) { - rowSet.addRow(Row(globalTempViewDb, DEFAULT_HIVE_CATALOG)) + rowSet.addRow(Array[AnyRef](globalTempViewDb, DEFAULT_HIVE_CATALOG)) } setState(OperationState.FINISHED) } catch { @@ -111,7 +110,7 @@ private[thriftserver] class SparkGetSchemasOperation( SparkThriftServer.listener.onStatementFinish(statementId) } - override def getResultSetSchema: StructType = { + override def getResultSetSchema: TableSchema = { assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala index 5e1b8dde8675..872864280977 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTableTypesOperation.scala @@ -23,12 +23,11 @@ import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.spark.internal.Logging -import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.SQLContext import org.apache.spark.sql.catalyst.catalog.CatalogTableType import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession import org.apache.spark.sql.thriftserver.server.SparkThriftServer -import org.apache.spark.sql.types.{StringType, StructField, StructType} import org.apache.spark.util.{Utils => SparkUtils} /** @@ -43,10 +42,10 @@ private[thriftserver] class SparkGetTableTypesOperation( extends SparkMetadataOperation(parentSession, OperationType.GET_TABLE_TYPES) with Logging { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TABLE_TYPE", StringType)) + RESULT_SET_SCHEMA = new TableSchema() + .addStringColumn("TABLE_TYPE", "Table type name.") - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion, false) override def close(): Unit = { super.close() @@ -54,7 +53,7 @@ private[thriftserver] class SparkGetTableTypesOperation( } override def runInternal(): Unit = { - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString val logMsg = "Listing table types" logInfo(s"$logMsg with $statementId") setState(OperationState.RUNNING) @@ -76,7 +75,7 @@ private[thriftserver] class SparkGetTableTypesOperation( try { val tableTypes = CatalogTableType.tableTypes.map(tableTypeString).toSet tableTypes.foreach { tableType => - rowSet.addRow(Row(tableType)) + rowSet.addRow(Array[AnyRef](tableType)) } setState(OperationState.FINISHED) } catch { @@ -99,7 +98,7 @@ private[thriftserver] class SparkGetTableTypesOperation( SparkThriftServer.listener.onStatementFinish(statementId) } - override def getResultSetSchema: StructType = { + override def getResultSetSchema: TableSchema = { assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala index fd43c71a97f3..7eff2811626f 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTablesOperation.scala @@ -56,27 +56,42 @@ private[thriftserver] class SparkGetTablesOperation( with Logging { if (HiveUtils.isHive23) { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TABLE_CAT", StringType)) - .add(StructField("TABLE_SCHEM", StringType)) - .add(StructField("TABLE_NAME", StringType)) - .add(StructField("TABLE_TYPE", StringType)) - .add(StructField("REMARKS", StringType)) - .add(StructField("TYPE_CAT", StringType)) - .add(StructField("TYPE_SCHEM", StringType)) - .add(StructField("TYPE_NAME", StringType)) - .add(StructField("SELF_REFERENCING_COL_NAME", StringType)) - .add(StructField("REF_GENERATION", StringType)) + RESULT_SET_SCHEMA = new TableSchema() + .addStringColumn("TABLE_CAT", + "Catalog name. NULL if not applicable.") + .addStringColumn("TABLE_SCHEM", + "Schema name.") + .addStringColumn("TABLE_NAME", + "Table name.") + .addStringColumn("TABLE_TYPE", + "The table type, e.g. \"TABLE\", \"VIEW\", etc.") + .addStringColumn("REMARKS", + "Comments about the table.") + .addStringColumn("TYPE_CAT", + "The types catalog.") + .addStringColumn("TYPE_SCHEM", + "The types schema.") + .addStringColumn("TYPE_NAME", + "Type name.") + .addStringColumn("SELF_REFERENCING_COL_NAME", + "Name of the designated \"identifier\" column of a typed table.") + .addStringColumn("REF_GENERATION", + "Specifies how values in SELF_REFERENCING_COL_NAME are created.") } else { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TABLE_CAT", StringType)) - .add(StructField("TABLE_SCHEM", StringType)) - .add(StructField("TABLE_NAME", StringType)) - .add(StructField("TABLE_TYPE", StringType)) - .add(StructField("REMARKS", StringType)) + RESULT_SET_SCHEMA = new TableSchema() + .addStringColumn("TABLE_CAT", + "Catalog name. NULL if not applicable.") + .addStringColumn("TABLE_SCHEM", + "Schema name.") + .addStringColumn("TABLE_NAME", + "Table name.") + .addStringColumn("TABLE_TYPE", + "The table type, e.g. \"TABLE\", \"VIEW\", etc.") + .addStringColumn("REMARKS", + "Comments about the table.") } - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion, false) override def close(): Unit = { super.close() @@ -84,7 +99,7 @@ private[thriftserver] class SparkGetTablesOperation( } override def runInternal(): Unit = { - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val tableTypesStr = if (tableTypes == null) { @@ -167,16 +182,21 @@ private[thriftserver] class SparkGetTablesOperation( tableName: String, tableType: String, comment: Option[String]): Unit = { + val rowData = Array[AnyRef]( + "", + dbName, + tableName, + tableType, + comment.getOrElse("")) // Since HIVE-7575(Hive 2.0.0), adds 5 additional columns to the ResultSet of GetTables. if (HiveUtils.isHive23) { - rowSet.addRow(Row("", dbName, tableName, tableType, comment.getOrElse(""), - null, null, null, null, null)) + rowSet.addRow(rowData ++ Array(null, null, null, null, null)) } else { - rowSet.addRow(Row("", dbName, tableName, tableType, comment.getOrElse(""))) + rowSet.addRow(rowData) } } - override def getResultSetSchema: StructType = { + override def getResultSetSchema: TableSchema = { assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala index 34dd5a0525c0..22b394464c8d 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkGetTypeInfoOperation.scala @@ -23,11 +23,10 @@ import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.spark.internal.Logging -import org.apache.spark.sql.{Row, SQLContext} +import org.apache.spark.sql.SQLContext import org.apache.spark.sql.thriftserver.cli._ import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession import org.apache.spark.sql.thriftserver.server.SparkThriftServer -import org.apache.spark.sql.types._ import org.apache.spark.util.{Utils => SparkUtils} /** @@ -41,28 +40,47 @@ private[thriftserver] class SparkGetTypeInfoOperation( parentSession: ThriftServerSession) extends SparkMetadataOperation(parentSession, OperationType.GET_TYPE_INFO) with Logging { - RESULT_SET_SCHEMA = new StructType() - .add(StructField("TYPE_NAME", StringType)) - .add(StructField("DATA_TYPE", IntegerType)) - .add(StructField("PRECISION", IntegerType)) - .add(StructField("LITERAL_PREFIX", StringType)) - .add(StructField("LITERAL_SUFFIX", StringType)) - .add(StructField("CREATE_PARAMS", StringType)) - .add(StructField("NULLABLE", ShortType)) - .add(StructField("CASE_SENSITIVE", BooleanType)) - .add(StructField("SEARCHABLE", ShortType)) - .add(StructField("UNSIGNED_ATTRIBUTE", BooleanType)) - .add(StructField("FIXED_PREC_SCALE", BooleanType)) - .add(StructField("AUTO_INCREMENT", BooleanType)) - .add(StructField("LOCAL_TYPE_NAME", StringType)) - .add(StructField("MINIMUM_SCALE", ShortType)) - .add(StructField("MAXIMUM_SCALE", ShortType)) - .add(StructField("SQL_DATA_TYPE", IntegerType)) - .add(StructField("SQL_DATETIME_SUB", IntegerType)) - .add(StructField("NUM_PREC_RADIX", IntegerType)) - - - private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion) + RESULT_SET_SCHEMA = new TableSchema() + .addPrimitiveColumn("TYPE_NAME", Type.STRING_TYPE, + "Type name") + .addPrimitiveColumn("DATA_TYPE", Type.INT_TYPE, + "SQL data type from java.sql.Types") + .addPrimitiveColumn("PRECISION", Type.INT_TYPE, + "Maximum precision") + .addPrimitiveColumn("LITERAL_PREFIX", Type.STRING_TYPE, + "Prefix used to quote a literal (may be null)") + .addPrimitiveColumn("LITERAL_SUFFIX", Type.STRING_TYPE, + "Suffix used to quote a literal (may be null)") + .addPrimitiveColumn("CREATE_PARAMS", Type.STRING_TYPE, + "Parameters used in creating the type (may be null)") + .addPrimitiveColumn("NULLABLE", Type.SMALLINT_TYPE, + "Can you use NULL for this type") + .addPrimitiveColumn("CASE_SENSITIVE", Type.BOOLEAN_TYPE, + "Is it case sensitive") + .addPrimitiveColumn("SEARCHABLE", Type.SMALLINT_TYPE, + "Can you use \"WHERE\" based on this type") + .addPrimitiveColumn("UNSIGNED_ATTRIBUTE", Type.BOOLEAN_TYPE, + "Is it unsigned") + .addPrimitiveColumn("FIXED_PREC_SCALE", Type.BOOLEAN_TYPE, + "Can it be a money value") + .addPrimitiveColumn("AUTO_INCREMENT", Type.BOOLEAN_TYPE, + "Can it be used for an auto-increment value") + .addPrimitiveColumn("LOCAL_TYPE_NAME", Type.STRING_TYPE, + "Localized version of type name (may be null)") + .addPrimitiveColumn("MINIMUM_SCALE", Type.SMALLINT_TYPE, + "Minimum scale supported") + .addPrimitiveColumn("MAXIMUM_SCALE", Type.SMALLINT_TYPE, + "Maximum scale supported") + .addPrimitiveColumn("SQL_DATA_TYPE", Type.INT_TYPE, + "Unused") + .addPrimitiveColumn("SQL_DATETIME_SUB", Type.INT_TYPE, + "Unused") + .addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE, + "Usually 2 or 10"); + + + + private val rowSet: RowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion, false) override def close(): Unit = { super.close() @@ -70,7 +88,7 @@ private[thriftserver] class SparkGetTypeInfoOperation( } override def runInternal(): Unit = { - setStatementId(UUID.randomUUID().toString) + statementId = UUID.randomUUID().toString val logMsg = "Listing type info" logInfo(s"$logMsg with $statementId") setState(OperationState.RUNNING) @@ -91,9 +109,9 @@ private[thriftserver] class SparkGetTypeInfoOperation( try { Type.values().foreach(typeInfo => { - val rowData = Row( + val rowData = Array[AnyRef]( typeInfo.getName, // TYPE_NAME - typeInfo.toJavaSQLType, // DATA_TYPE + typeInfo.toJavaSQLType.asInstanceOf[AnyRef], // DATA_TYPE typeInfo.getMaxPrecision, // PRECISION typeInfo.getLiteralPrefix, // LITERAL_PREFIX typeInfo.getLiteralSuffix, // LITERAL_SUFFIX @@ -134,7 +152,7 @@ private[thriftserver] class SparkGetTypeInfoOperation( SparkThriftServer.listener.onStatementFinish(statementId) } - override def getResultSetSchema: StructType = { + override def getResultSetSchema: TableSchema = { assertState(OperationState.FINISHED) RESULT_SET_SCHEMA } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala index 0cbd19e0d06f..7b8233585bc5 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/operation/SparkMetadataOperation.scala @@ -26,18 +26,17 @@ import org.apache.hadoop.hive.ql.session.SessionState import org.apache.spark.internal.Logging import org.apache.spark.sql.catalyst.catalog.CatalogTableType import org.apache.spark.sql.catalyst.catalog.CatalogTableType.{EXTERNAL, MANAGED, VIEW} -import org.apache.spark.sql.thriftserver.cli.{OperationState, OperationType, SparkThriftServerSQLException} +import org.apache.spark.sql.thriftserver.cli.{OperationState, OperationType, SparkThriftServerSQLException, TableSchema} import org.apache.spark.sql.thriftserver.cli.session.ThriftServerSession -import org.apache.spark.sql.types.StructType private[thriftserver] abstract class SparkMetadataOperation( session: ThriftServerSession, opType: OperationType) - extends Operation(session, opType, false) with Logging { + extends Operation(session, opType) with Logging { protected val DEFAULT_HIVE_CATALOG: String = "" - protected var RESULT_SET_SCHEMA: StructType = null + protected var RESULT_SET_SCHEMA: TableSchema = null protected val SEARCH_STRING_ESCAPE: Char = '\\' setHasResultSet(true) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala index 2af97a83880f..89f6a1dca976 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSession.scala @@ -199,7 +199,7 @@ private[thriftserver] trait ThriftServerSession extends ThriftServerSessionBase def closeOperation(opHandle: OperationHandle): Unit @throws[SparkThriftServerSQLException] - def getResultSetMetadata(opHandle: OperationHandle): StructType + def getResultSetMetadata(opHandle: OperationHandle): TableSchema @throws[SparkThriftServerSQLException] def fetchResults(opHandle: OperationHandle, diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index 8918be7aa000..c9cf5ab6a60c 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -658,7 +658,7 @@ private[thriftserver] class ThriftServerSessionImpl( } } - override def getResultSetMetadata(opHandle: OperationHandle): StructType = { + override def getResultSetMetadata(opHandle: OperationHandle): TableSchema = { acquire(true) try { _sessionManager.getOperationManager.getOperationResultSetSchema(opHandle) diff --git a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerSuites.scala b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerSuites.scala index 59c8a1d57787..532fe3e869d0 100644 --- a/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerSuites.scala +++ b/sql/thriftserver/src/test/scala/org/apache/spark/sql/thriftserver/SparkThriftServerSuites.scala @@ -23,6 +23,7 @@ import java.nio.charset.StandardCharsets import java.sql.{Date, DriverManager, SQLException, Statement} import java.util.{Locale, UUID} +import scala.collection.JavaConverters._ import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.concurrent.{ExecutionContext, Future, Promise} @@ -690,7 +691,7 @@ class SparkThriftBinaryServerSuite extends SparkThriftJdbcTest { def checkResult(rows: RowSet, start: Long, end: Long): Unit = { assert(rows.getStartOffset == start) assert(rows.numRows == end - start) - rows.iterator.zip((start until end).iterator).foreach { case (row, v) => + rows.iterator().asScala.zip((start until end).iterator).foreach { case (row, v) => assert(row(0).asInstanceOf[Long] === v) } } From f6a7736fa524621320a71b5abf82022c88f1a717 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Sat, 2 Nov 2019 14:23:28 +0800 Subject: [PATCH 49/55] format code --- .../cli/session/SessionManager.scala | 2 - .../cli/session/ThriftServerSessionImpl.scala | 154 +++++++++--------- 2 files changed, 77 insertions(+), 79 deletions(-) diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala index 5808489e9af3..29f2b6cedba6 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/SessionManager.scala @@ -335,7 +335,6 @@ private[thriftserver] object SessionManager extends Logging { threadLocalProxyUserName.remove() } - def setIpAddress(ipAddress: String): Unit = { threadLocalIpAddress.set(ipAddress) } @@ -346,7 +345,6 @@ private[thriftserver] object SessionManager extends Logging { def getIpAddress: String = threadLocalIpAddress.get - def setUserName(userName: String): Unit = { threadLocalUserName.set(userName) } diff --git a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala index c9cf5ab6a60c..00ade2dd2caa 100644 --- a/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala +++ b/sql/thriftserver/src/main/scala/org/apache/spark/sql/thriftserver/cli/session/ThriftServerSessionImpl.scala @@ -47,34 +47,34 @@ private[thriftserver] class ThriftServerSessionImpl( serverHiveConf: HiveConf, var ipAddress: String) extends ThriftServerSession with Logging { - private val _sessionHandle: SessionHandle = new SessionHandle(protocol) - private val _hiveConf: HiveConf = { + private val sessionHandle: SessionHandle = new SessionHandle(protocol) + private val hiveConf: HiveConf = { val conf = new HiveConf(serverHiveConf) // Set an explicit session name to control the download directory name - conf.set(ConfVars.HIVESESSIONID.varname, _sessionHandle.getHandleIdentifier.toString) + conf.set(ConfVars.HIVESESSIONID.varname, sessionHandle.getHandleIdentifier.toString) conf } - private var _sessionState: SessionState = null - private var _sessionManager: SessionManager = null - private var _operationManager: OperationManager = new OperationManager() - private val _opHandleSet: util.Set[OperationHandle] = new util.HashSet[OperationHandle]() - private var _isOperationLogEnabled: Boolean = false - private var _sessionLogDir: File = _ - private var _lastAccessTime: Long = 0L - private var _lastIdleTime: Long = 0L + private var sessionState: SessionState = null + private var sessionManager: SessionManager = null + private var operationManager: OperationManager = new OperationManager() + private val opHandleSet: util.Set[OperationHandle] = new util.HashSet[OperationHandle]() + private var operationLogEnabled: Boolean = false + private var sessionLogDir: File = _ + private var lastAccessTime: Long = 0L + private var lastIdleTime: Long = 0L @throws[SparkThriftServerSQLException] override def open(sessionConfMap: JMap[String, String]): Unit = { - _sessionState = new SessionState(_hiveConf, username) - _sessionState.setUserIpAddress(ipAddress) - _sessionState.setIsHiveServerQuery(true) - SessionState.start(_sessionState) + sessionState = new SessionState(hiveConf, username) + sessionState.setUserIpAddress(ipAddress) + sessionState.setIsHiveServerQuery(true) + SessionState.start(sessionState) processGlobalInitFile() if (sessionConfMap != null) { configureSession(sessionConfMap) } - _lastAccessTime = System.currentTimeMillis - _lastIdleTime = _lastAccessTime + lastAccessTime = System.currentTimeMillis + lastIdleTime = lastAccessTime } @@ -108,7 +108,7 @@ private[thriftserver] class ThriftServerSessionImpl( private def processGlobalInitFile(): Unit = { val processor = new GlobalHivercFileProcessor try { - val hiverc = _hiveConf.getVar(ConfVars.HIVE_SERVER2_GLOBAL_INIT_FILE_LOCATION) + val hiverc = hiveConf.getVar(ConfVars.HIVE_SERVER2_GLOBAL_INIT_FILE_LOCATION) if (hiverc != null) { var hivercFile = new File(hiverc) if (hivercFile.isDirectory) { @@ -132,7 +132,7 @@ private[thriftserver] class ThriftServerSessionImpl( @throws[SparkThriftServerSQLException] private def configureSession(sessionConfMap: JMap[String, String]): Unit = { - SessionState.setCurrentSessionState(_sessionState) + SessionState.setCurrentSessionState(sessionState) sessionConfMap.entrySet().forEach(entry => { val key = entry.getKey @@ -146,7 +146,7 @@ private[thriftserver] class ThriftServerSessionImpl( } else if (key.startsWith("use:")) { SessionState.get.setCurrentDatabase(entry.getValue) } else { - _hiveConf.verifyAndSet(key, entry.getValue) + hiveConf.verifyAndSet(key, entry.getValue) } }) } @@ -289,7 +289,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) opHandle } catch { case e: SparkThriftServerSQLException => @@ -318,7 +318,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) return opHandle } catch { case e: SparkThriftServerSQLException => @@ -343,7 +343,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) return opHandle } catch { case e: SparkThriftServerSQLException => @@ -370,7 +370,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) return opHandle } catch { case e: SparkThriftServerSQLException => @@ -407,7 +407,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) return opHandle } catch { case e: SparkThriftServerSQLException => @@ -432,7 +432,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) return opHandle } catch { case e: SparkThriftServerSQLException => @@ -469,7 +469,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) opHandle } catch { case e: SparkThriftServerSQLException => @@ -503,7 +503,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) opHandle } catch { case e: SparkThriftServerSQLException => @@ -527,7 +527,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) opHandle } catch { case e: SparkThriftServerSQLException => @@ -559,7 +559,7 @@ private[thriftserver] class ThriftServerSessionImpl( val opHandle = operation.getHandle try { operation.run - _opHandleSet.add(opHandle) + opHandleSet.add(opHandle) opHandle } catch { case e: SparkThriftServerSQLException => @@ -579,34 +579,34 @@ private[thriftserver] class ThriftServerSessionImpl( try { acquire(true) // Iterate through the opHandles and close their operations - for (opHandle <- _opHandleSet.asScala) { - _operationManager.closeOperation(opHandle) + for (opHandle <- opHandleSet.asScala) { + operationManager.closeOperation(opHandle) } - _opHandleSet.clear + opHandleSet.clear // Cleanup session log directory. cleanupSessionLogDir cleanupPipeoutFile - val hiveHist = _sessionState.getHiveHistory + val hiveHist = sessionState.getHiveHistory if (null != hiveHist) { hiveHist.closeStream() } try { - _sessionState.close + sessionState.close } finally { - _sessionState = null + sessionState = null } } catch { case ioe: IOException => throw new SparkThriftServerSQLException("Failure to close", ioe) } finally { - if (_sessionState != null) { + if (sessionState != null) { try { - _sessionState.close + sessionState.close } catch { case t: Throwable => logWarning("Error closing session", t) } - _sessionState = null + sessionState = null } release(true) } @@ -615,7 +615,7 @@ private[thriftserver] class ThriftServerSessionImpl( override def cancelOperation(opHandle: OperationHandle): Unit = { acquire(true) try { - _sessionManager.getOperationManager.cancelOperation(opHandle) + sessionManager.getOperationManager.cancelOperation(opHandle) } finally { release(true) } @@ -624,8 +624,8 @@ private[thriftserver] class ThriftServerSessionImpl( override def closeOperation(opHandle: OperationHandle): Unit = { acquire(true) try { - _operationManager.closeOperation(opHandle) - _opHandleSet.remove(opHandle) + operationManager.closeOperation(opHandle) + opHandleSet.remove(opHandle) } finally { release(true) } @@ -634,18 +634,18 @@ private[thriftserver] class ThriftServerSessionImpl( private def cleanupSessionLogDir(): Unit = { if (isOperationLogEnabled) { try { - FileUtils.forceDelete(_sessionLogDir) + FileUtils.forceDelete(sessionLogDir) } catch { case e: Exception => - logError("Failed to cleanup session log dir: " + _sessionHandle, e) + logError("Failed to cleanup session log dir: " + sessionHandle, e) } } } private def cleanupPipeoutFile(): Unit = { - val lScratchDir = _hiveConf.getVar(ConfVars.LOCALSCRATCHDIR) - val sessionID = _hiveConf.getVar(ConfVars.HIVESESSIONID) + val lScratchDir = hiveConf.getVar(ConfVars.LOCALSCRATCHDIR) + val sessionID = hiveConf.getVar(ConfVars.HIVESESSIONID) val fileAry = new File(lScratchDir) .listFiles((dir, name) => name.startsWith(sessionID) && name.endsWith(".pipeout")) for (file <- fileAry) { @@ -661,7 +661,7 @@ private[thriftserver] class ThriftServerSessionImpl( override def getResultSetMetadata(opHandle: OperationHandle): TableSchema = { acquire(true) try { - _sessionManager.getOperationManager.getOperationResultSetSchema(opHandle) + sessionManager.getOperationManager.getOperationResultSetSchema(opHandle) } finally { release(true) } @@ -674,9 +674,9 @@ private[thriftserver] class ThriftServerSessionImpl( acquire(true) try { if (fetchType eq FetchType.QUERY_OUTPUT) { - return _operationManager.getOperationNextRowSet(opHandle, orientation, maxRows) + return operationManager.getOperationNextRowSet(opHandle, orientation, maxRows) } - return _operationManager.getOperationLogRowSet(opHandle, orientation, maxRows) + return operationManager.getOperationLogRowSet(opHandle, orientation, maxRows) } finally { release(true) } @@ -721,9 +721,9 @@ private[thriftserver] class ThriftServerSessionImpl( protected def acquire(userAccess: Boolean): Unit = { // Need to make sure that the this HiveServer2's session's SessionState is // stored in the thread local for the handler thread. - SessionState.setCurrentSessionState(_sessionState) + SessionState.setCurrentSessionState(sessionState) if (userAccess) { - _lastAccessTime = System.currentTimeMillis + lastAccessTime = System.currentTimeMillis } } @@ -740,20 +740,20 @@ private[thriftserver] class ThriftServerSessionImpl( currentThread.cacheThreadLocalRawStore } if (userAccess) { - _lastAccessTime = System.currentTimeMillis + lastAccessTime = System.currentTimeMillis } - if (_opHandleSet.isEmpty) { - _lastIdleTime = System.currentTimeMillis + if (opHandleSet.isEmpty) { + lastIdleTime = System.currentTimeMillis } else { - _lastIdleTime = 0 + lastIdleTime = 0 } } override def closeExpiredOperations(): Unit = { - val handles = _opHandleSet.toArray(new Array[OperationHandle](_opHandleSet.size)) + val handles = opHandleSet.toArray(new Array[OperationHandle](opHandleSet.size)) if (handles.length > 0) { - val operations = _operationManager.removeExpiredOperations(handles) + val operations = operationManager.removeExpiredOperations(handles) if (!operations.isEmpty) { closeTimedOutOperations(operations) } @@ -764,7 +764,7 @@ private[thriftserver] class ThriftServerSessionImpl( acquire(false) try { for (operation <- operations) { - _opHandleSet.remove(operation.getHandle) + opHandleSet.remove(operation.getHandle) try { operation.close } catch { @@ -778,8 +778,8 @@ private[thriftserver] class ThriftServerSessionImpl( } override def getNoOperationTime: Long = { - if (_lastIdleTime > 0) { - System.currentTimeMillis - _lastIdleTime + if (lastIdleTime > 0) { + System.currentTimeMillis - lastIdleTime } else { 0 } @@ -793,16 +793,16 @@ private[thriftserver] class ThriftServerSessionImpl( * @param sessionManager */ override def setSessionManager(sessionManager: SessionManager): Unit = { - _sessionManager = sessionManager + this.sessionManager = sessionManager } /** * Get the session manager for the session */ - override def getSessionManager: SessionManager = _sessionManager + override def getSessionManager: SessionManager = sessionManager - private def getOperationManager: OperationManager = _operationManager + private def getOperationManager: OperationManager = operationManager /** * Set operation manager for the session @@ -810,20 +810,20 @@ private[thriftserver] class ThriftServerSessionImpl( * @param operationManager */ override def setOperationManager(operationManager: OperationManager): Unit = { - _operationManager = operationManager + this.operationManager = operationManager } /** * Check whether operation logging is enabled and session dir is created successfully */ - override def isOperationLogEnabled: Boolean = _isOperationLogEnabled + override def isOperationLogEnabled(): Boolean = this.operationLogEnabled /** * Get the session dir, which is the parent dir of operation logs * * @return a file representing the parent directory of operation logs */ - override def getOperationLogSessionDir: File = _sessionLogDir + override def getOperationLogSessionDir: File = sessionLogDir /** * Set the session dir, which is the parent dir of operation logs @@ -843,29 +843,29 @@ private[thriftserver] class ThriftServerSessionImpl( logWarning("The operation log root directory is not writable: " + operationLogRootDir.getAbsolutePath) } - _sessionLogDir = new File(operationLogRootDir, _sessionHandle.getHandleIdentifier.toString) - _isOperationLogEnabled = true - if (!_sessionLogDir.exists) { - if (!_sessionLogDir.mkdir) { + sessionLogDir = new File(operationLogRootDir, sessionHandle.getHandleIdentifier.toString) + operationLogEnabled = true + if (!sessionLogDir.exists) { + if (!sessionLogDir.mkdir) { logWarning("Unable to create operation log session directory: " + - _sessionLogDir.getAbsolutePath) - _isOperationLogEnabled = false + sessionLogDir.getAbsolutePath) + operationLogEnabled = false } } if (isOperationLogEnabled) { - logInfo("Operation log session directory is created: " + _sessionLogDir.getAbsolutePath) + logInfo("Operation log session directory is created: " + sessionLogDir.getAbsolutePath) } } protected def getSession: ThriftServerSession = this - override def getSessionHandle: SessionHandle = _sessionHandle + override def getSessionHandle: SessionHandle = sessionHandle override def getPassword: String = password - override def getHiveConf: HiveConf = _hiveConf + override def getHiveConf: HiveConf = hiveConf - override def getSessionState: SessionState = _sessionState + override def getSessionState: SessionState = sessionState override def getUserName: String = username @@ -875,6 +875,6 @@ private[thriftserver] class ThriftServerSessionImpl( override def setIpAddress(ipAddr: String): Unit = ipAddress = ipAddr - override def getLastAccessTime: Long = _lastAccessTime + override def getLastAccessTime: Long = lastAccessTime } From f8b7351fdb2ea3815c71dba5e257c351ecec306f Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 6 Nov 2019 14:39:42 +0800 Subject: [PATCH 50/55] add thrift file --- .../launcher/SparkSubmitCommandBuilder.java | 4 +- sql/thriftserver/pom.xml | 29 +- .../cli/thrift/TArrayTypeEntry.java | 363 + .../cli/thrift/TBinaryColumn.java | 531 + .../thriftserver/cli/thrift/TBoolColumn.java | 531 + .../thriftserver/cli/thrift/TBoolValue.java | 368 + .../thriftserver/cli/thrift/TByteColumn.java | 531 + .../thriftserver/cli/thrift/TByteValue.java | 368 + .../thriftserver/cli/thrift/TCLIService.java | 20448 ++++++++++++++++ .../cli/thrift/TCLIServiceConstants.java | 81 + .../cli/thrift/TCancelDelegationTokenReq.java | 474 + .../thrift/TCancelDelegationTokenResp.java | 373 + .../cli/thrift/TCancelOperationReq.java | 373 + .../cli/thrift/TCancelOperationResp.java | 373 + .../cli/thrift/TCloseOperationReq.java | 373 + .../cli/thrift/TCloseOperationResp.java | 373 + .../cli/thrift/TCloseSessionReq.java | 373 + .../cli/thrift/TCloseSessionResp.java | 373 + .../sql/thriftserver/cli/thrift/TColumn.java | 713 + .../thriftserver/cli/thrift/TColumnDesc.java | 680 + .../thriftserver/cli/thrift/TColumnValue.java | 652 + .../cli/thrift/TDoubleColumn.java | 531 + .../thriftserver/cli/thrift/TDoubleValue.java | 368 + .../cli/thrift/TExecuteStatementReq.java | 840 + .../cli/thrift/TExecuteStatementResp.java | 488 + .../cli/thrift/TFetchOrientation.java | 55 + .../cli/thrift/TFetchResultsReq.java | 689 + .../cli/thrift/TFetchResultsResp.java | 590 + .../cli/thrift/TGetCatalogsReq.java | 373 + .../cli/thrift/TGetCatalogsResp.java | 488 + .../cli/thrift/TGetColumnsReq.java | 801 + .../cli/thrift/TGetColumnsResp.java | 488 + .../cli/thrift/TGetCrossReferenceReq.java | 1013 + .../cli/thrift/TGetCrossReferenceResp.java | 488 + .../cli/thrift/TGetDelegationTokenReq.java | 575 + .../cli/thrift/TGetDelegationTokenResp.java | 483 + .../cli/thrift/TGetFunctionsReq.java | 690 + .../cli/thrift/TGetFunctionsResp.java | 488 + .../thriftserver/cli/thrift/TGetInfoReq.java | 486 + .../thriftserver/cli/thrift/TGetInfoResp.java | 476 + .../thriftserver/cli/thrift/TGetInfoType.java | 181 + .../cli/thrift/TGetInfoValue.java | 574 + .../cli/thrift/TGetOperationStatusReq.java | 479 + .../cli/thrift/TGetOperationStatusResp.java | 1317 + .../cli/thrift/TGetPrimaryKeysReq.java | 695 + .../cli/thrift/TGetPrimaryKeysResp.java | 488 + .../cli/thrift/TGetQueryIdReq.java | 373 + .../cli/thrift/TGetQueryIdResp.java | 368 + .../cli/thrift/TGetResultSetMetadataReq.java | 373 + .../cli/thrift/TGetResultSetMetadataResp.java | 488 + .../cli/thrift/TGetSchemasReq.java | 589 + .../cli/thrift/TGetSchemasResp.java | 488 + .../cli/thrift/TGetTableTypesReq.java | 373 + .../cli/thrift/TGetTableTypesResp.java | 488 + .../cli/thrift/TGetTablesReq.java | 851 + .../cli/thrift/TGetTablesResp.java | 488 + .../cli/thrift/TGetTypeInfoReq.java | 373 + .../cli/thrift/TGetTypeInfoResp.java | 488 + .../cli/thrift/THandleIdentifier.java | 493 + .../thriftserver/cli/thrift/TI16Column.java | 531 + .../thriftserver/cli/thrift/TI16Value.java | 368 + .../thriftserver/cli/thrift/TI32Column.java | 531 + .../thriftserver/cli/thrift/TI32Value.java | 368 + .../thriftserver/cli/thrift/TI64Column.java | 531 + .../thriftserver/cli/thrift/TI64Value.java | 368 + .../cli/thrift/TJobExecutionStatus.java | 46 + .../cli/thrift/TMapTypeEntry.java | 455 + .../cli/thrift/TOpenSessionReq.java | 757 + .../cli/thrift/TOpenSessionResp.java | 762 + .../cli/thrift/TOperationHandle.java | 684 + .../cli/thrift/TOperationState.java | 64 + .../cli/thrift/TOperationType.java | 64 + .../cli/thrift/TPrimitiveTypeEntry.java | 495 + .../cli/thrift/TProgressUpdateResp.java | 1008 + .../cli/thrift/TProtocolVersion.java | 70 + .../cli/thrift/TRenewDelegationTokenReq.java | 474 + .../cli/thrift/TRenewDelegationTokenResp.java | 373 + .../sql/thriftserver/cli/thrift/TRow.java | 423 + .../sql/thriftserver/cli/thrift/TRowSet.java | 900 + .../cli/thrift/TSessionHandle.java | 373 + .../cli/thrift/TSetClientInfoReq.java | 535 + .../cli/thrift/TSetClientInfoResp.java | 373 + .../sql/thriftserver/cli/thrift/TStatus.java | 854 + .../thriftserver/cli/thrift/TStatusCode.java | 52 + .../cli/thrift/TStringColumn.java | 531 + .../thriftserver/cli/thrift/TStringValue.java | 372 + .../cli/thrift/TStructTypeEntry.java | 431 + .../thriftserver/cli/thrift/TTableSchema.java | 423 + .../thriftserver/cli/thrift/TTypeDesc.java | 423 + .../thriftserver/cli/thrift/TTypeEntry.java | 591 + .../sql/thriftserver/cli/thrift/TTypeId.java | 106 + .../cli/thrift/TTypeQualifierValue.java | 342 + .../cli/thrift/TTypeQualifiers.java | 433 + .../cli/thrift/TUnionTypeEntry.java | 431 + .../cli/thrift/TUserDefinedTypeEntry.java | 368 + 95 files changed, 64642 insertions(+), 29 deletions(-) create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java create mode 100644 sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java diff --git a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java index 3a1e81a7e4d0..b5106ab5ad11 100644 --- a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java +++ b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java @@ -400,8 +400,8 @@ boolean isClientMode(Map userProps) { */ private boolean isThriftServer(String mainClass) { return (mainClass != null && - (mainClass.equals("org.apache.spark.sql.hive.thriftserver.HiveThriftServer2") || - mainClass.equals("org.apache.spark.sql.thriftserver.server.SparkThriftServer"))); + (mainClass.equals("org.apache.spark.sql.hive.thriftserver.HiveThriftServer2") + || mainClass.equals("org.apache.spark.sql.thriftserver.server.SparkThriftServer"))); } private List findExamplesJars() { diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index 8d5b2adf0851..bb03333c16a5 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -182,37 +182,12 @@ target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes - - org.apache.thrift - thrift-maven-plugin - 0.10.0 - - ../thriftserver/if - - - - thrift-sources - generate-sources - - compile - - - - thrift-test-sources - generate-test-sources - - testCompile - - - - - org.codehaus.mojo build-helper-maven-plugin - add-thrift-sources + add-sources generate-sources add-source @@ -220,7 +195,7 @@ - ${project.build.directory}/target/generated-sources/thrift + ${basedir}/src/gen/thrift/gen-javabean diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java new file mode 100644 index 000000000000..d001861b35da --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java @@ -0,0 +1,363 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry"); + + private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TArrayTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TArrayTypeEntryTupleSchemeFactory(); + + private int objectTypePtr; // 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 { + OBJECT_TYPE_PTR((short)1, "objectTypePtr"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // OBJECT_TYPE_PTR + return OBJECT_TYPE_PTR; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __OBJECTTYPEPTR_ISSET_ID = 0; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap); + } + + public TArrayTypeEntry() { + } + + public TArrayTypeEntry( + int objectTypePtr) + { + this(); + this.objectTypePtr = objectTypePtr; + setObjectTypePtrIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TArrayTypeEntry(TArrayTypeEntry other) { + __isset_bitfield = other.__isset_bitfield; + this.objectTypePtr = other.objectTypePtr; + } + + public TArrayTypeEntry deepCopy() { + return new TArrayTypeEntry(this); + } + + @Override + public void clear() { + setObjectTypePtrIsSet(false); + this.objectTypePtr = 0; + } + + public int getObjectTypePtr() { + return this.objectTypePtr; + } + + public void setObjectTypePtr(int objectTypePtr) { + this.objectTypePtr = objectTypePtr; + setObjectTypePtrIsSet(true); + } + + public void unsetObjectTypePtr() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + } + + /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetObjectTypePtr() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + } + + public void setObjectTypePtrIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OBJECT_TYPE_PTR: + if (value == null) { + unsetObjectTypePtr(); + } else { + setObjectTypePtr((java.lang.Integer)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OBJECT_TYPE_PTR: + return getObjectTypePtr(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OBJECT_TYPE_PTR: + return isSetObjectTypePtr(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TArrayTypeEntry) + return this.equals((TArrayTypeEntry)that); + return false; + } + + public boolean equals(TArrayTypeEntry that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_objectTypePtr = true; + boolean that_present_objectTypePtr = true; + if (this_present_objectTypePtr || that_present_objectTypePtr) { + if (!(this_present_objectTypePtr && that_present_objectTypePtr)) + return false; + if (this.objectTypePtr != that.objectTypePtr) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + objectTypePtr; + + return hashCode; + } + + @Override + public int compareTo(TArrayTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetObjectTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectTypePtr, other.objectTypePtr); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TArrayTypeEntry("); + boolean first = true; + + sb.append("objectTypePtr:"); + sb.append(this.objectTypePtr); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetObjectTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'objectTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TArrayTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TArrayTypeEntryStandardScheme getScheme() { + return new TArrayTypeEntryStandardScheme(); + } + } + + private static class TArrayTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry 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: // OBJECT_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.objectTypePtr = iprot.readI32(); + struct.setObjectTypePtrIsSet(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, TArrayTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(OBJECT_TYPE_PTR_FIELD_DESC); + oprot.writeI32(struct.objectTypePtr); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TArrayTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TArrayTypeEntryTupleScheme getScheme() { + return new TArrayTypeEntryTupleScheme(); + } + } + + private static class TArrayTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.objectTypePtr); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.objectTypePtr = iprot.readI32(); + struct.setObjectTypePtrIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java new file mode 100644 index 000000000000..b53748d37265 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBinaryColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBinaryColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryColumn.class, metaDataMap); + } + + public TBinaryColumn() { + } + + public TBinaryColumn( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TBinaryColumn(TBinaryColumn other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TBinaryColumn deepCopy() { + return new TBinaryColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(java.nio.ByteBuffer elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TBinaryColumn) + return this.equals((TBinaryColumn)that); + return false; + } + + public boolean equals(TBinaryColumn that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TBinaryColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TBinaryColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.values, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TBinaryColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TBinaryColumnStandardScheme getScheme() { + return new TBinaryColumnStandardScheme(); + } + } + + private static class TBinaryColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list110.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem111; + for (int _i112 = 0; _i112 < _list110.size; ++_i112) + { + _elem111 = iprot.readBinary(); + struct.values.add(_elem111); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TBinaryColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (java.nio.ByteBuffer _iter113 : struct.values) + { + oprot.writeBinary(_iter113); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TBinaryColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TBinaryColumnTupleScheme getScheme() { + return new TBinaryColumnTupleScheme(); + } + } + + private static class TBinaryColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (java.nio.ByteBuffer _iter114 : struct.values) + { + oprot.writeBinary(_iter114); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new java.util.ArrayList(_list115.size); + @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem116; + for (int _i117 = 0; _i117 < _list115.size; ++_i117) + { + _elem116 = iprot.readBinary(); + struct.values.add(_elem116); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java new file mode 100644 index 000000000000..b5b8060ee295 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolColumn.class, metaDataMap); + } + + public TBoolColumn() { + } + + public TBoolColumn( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TBoolColumn(TBoolColumn other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TBoolColumn deepCopy() { + return new TBoolColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(boolean elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TBoolColumn) + return this.equals((TBoolColumn)that); + return false; + } + + public boolean equals(TBoolColumn that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TBoolColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TBoolColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TBoolColumnStandardScheme getScheme() { + return new TBoolColumnStandardScheme(); + } + } + + private static class TBoolColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list54.size); + boolean _elem55; + for (int _i56 = 0; _i56 < _list54.size; ++_i56) + { + _elem55 = iprot.readBool(); + struct.values.add(_elem55); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TBoolColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.values.size())); + for (boolean _iter57 : struct.values) + { + oprot.writeBool(_iter57); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TBoolColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TBoolColumnTupleScheme getScheme() { + return new TBoolColumnTupleScheme(); + } + } + + private static class TBoolColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (boolean _iter58 : struct.values) + { + oprot.writeBool(_iter58); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); + struct.values = new java.util.ArrayList(_list59.size); + boolean _elem60; + for (int _i61 = 0; _i61 < _list59.size; ++_i61) + { + _elem60 = iprot.readBool(); + struct.values.add(_elem60); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java new file mode 100644 index 000000000000..01245aa110e7 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolValueTupleSchemeFactory(); + + private boolean value; // 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 { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolValue.class, metaDataMap); + } + + public TBoolValue() { + } + + /** + * Performs a deep copy on other. + */ + public TBoolValue(TBoolValue other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TBoolValue deepCopy() { + return new TBoolValue(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = false; + } + + public boolean isValue() { + return this.value; + } + + public void setValue(boolean value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return isValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TBoolValue) + return this.equals((TBoolValue)that); + return false; + } + + public boolean equals(TBoolValue that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + ((value) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(TBoolValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TBoolValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TBoolValueStandardScheme getScheme() { + return new TBoolValueStandardScheme(); + } + } + + private static class TBoolValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.value = iprot.readBool(); + struct.setValueIsSet(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, TBoolValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeBool(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TBoolValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TBoolValueTupleScheme getScheme() { + return new TBoolValueTupleScheme(); + } + } + + private static class TBoolValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeBool(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readBool(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java new file mode 100644 index 000000000000..432c498ac884 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteColumn.class, metaDataMap); + } + + public TByteColumn() { + } + + public TByteColumn( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TByteColumn(TByteColumn other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TByteColumn deepCopy() { + return new TByteColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(byte elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TByteColumn) + return this.equals((TByteColumn)that); + return false; + } + + public boolean equals(TByteColumn that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TByteColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TByteColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TByteColumnStandardScheme getScheme() { + return new TByteColumnStandardScheme(); + } + } + + private static class TByteColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list62.size); + byte _elem63; + for (int _i64 = 0; _i64 < _list62.size; ++_i64) + { + _elem63 = iprot.readByte(); + struct.values.add(_elem63); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TByteColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, struct.values.size())); + for (byte _iter65 : struct.values) + { + oprot.writeByte(_iter65); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TByteColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TByteColumnTupleScheme getScheme() { + return new TByteColumnTupleScheme(); + } + } + + private static class TByteColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (byte _iter66 : struct.values) + { + oprot.writeByte(_iter66); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); + struct.values = new java.util.ArrayList(_list67.size); + byte _elem68; + for (int _i69 = 0; _i69 < _list67.size; ++_i69) + { + _elem68 = iprot.readByte(); + struct.values.add(_elem68); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java new file mode 100644 index 000000000000..a78f429c6ecd --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteValueTupleSchemeFactory(); + + private byte value; // 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 { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteValue.class, metaDataMap); + } + + public TByteValue() { + } + + /** + * Performs a deep copy on other. + */ + public TByteValue(TByteValue other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TByteValue deepCopy() { + return new TByteValue(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public byte getValue() { + return this.value; + } + + public void setValue(byte value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((java.lang.Byte)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TByteValue) + return this.equals((TByteValue)that); + return false; + } + + public boolean equals(TByteValue that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + (int) (value); + + return hashCode; + } + + @Override + public int compareTo(TByteValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TByteValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TByteValueStandardScheme getScheme() { + return new TByteValueStandardScheme(); + } + } + + private static class TByteValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { + struct.value = iprot.readByte(); + struct.setValueIsSet(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, TByteValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeByte(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TByteValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TByteValueTupleScheme getScheme() { + return new TByteValueTupleScheme(); + } + } + + private static class TByteValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeByte(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readByte(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java new file mode 100644 index 000000000000..f82e22878573 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java @@ -0,0 +1,20448 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCLIService { + + public interface Iface { + + public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException; + + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException; + + public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException; + + public TExecuteStatementResp ExecuteStatement(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; + + public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException; + + public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException; + + public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException; + + public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException; + + public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException; + + public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException; + + public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException; + + public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException; + + public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException; + + public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException; + + public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException; + + public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException; + + public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException; + + public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException; + + public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException; + + public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException; + + public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException; + + } + + public interface AsyncIface { + + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void ExecuteStatement(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; + + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + } + + public static class Client extends org.apache.thrift.TServiceClient implements Iface { + public static class Factory implements org.apache.thrift.TServiceClientFactory { + public Factory() {} + public Client getClient(org.apache.thrift.protocol.TProtocol prot) { + return new Client(prot); + } + public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + return new Client(iprot, oprot); + } + } + + public Client(org.apache.thrift.protocol.TProtocol prot) + { + super(prot, prot); + } + + public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { + super(iprot, oprot); + } + + public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException + { + send_OpenSession(req); + return recv_OpenSession(); + } + + public void send_OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException + { + OpenSession_args args = new OpenSession_args(); + args.setReq(req); + sendBase("OpenSession", args); + } + + public TOpenSessionResp recv_OpenSession() throws org.apache.thrift.TException + { + OpenSession_result result = new OpenSession_result(); + receiveBase(result, "OpenSession"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result"); + } + + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException + { + send_CloseSession(req); + return recv_CloseSession(); + } + + public void send_CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException + { + CloseSession_args args = new CloseSession_args(); + args.setReq(req); + sendBase("CloseSession", args); + } + + public TCloseSessionResp recv_CloseSession() throws org.apache.thrift.TException + { + CloseSession_result result = new CloseSession_result(); + receiveBase(result, "CloseSession"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseSession failed: unknown result"); + } + + public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException + { + send_GetInfo(req); + return recv_GetInfo(); + } + + public void send_GetInfo(TGetInfoReq req) throws org.apache.thrift.TException + { + GetInfo_args args = new GetInfo_args(); + args.setReq(req); + sendBase("GetInfo", args); + } + + public TGetInfoResp recv_GetInfo() throws org.apache.thrift.TException + { + GetInfo_result result = new GetInfo_result(); + receiveBase(result, "GetInfo"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetInfo failed: unknown result"); + } + + public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException + { + send_ExecuteStatement(req); + return recv_ExecuteStatement(); + } + + public void send_ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException + { + ExecuteStatement_args args = new ExecuteStatement_args(); + args.setReq(req); + sendBase("ExecuteStatement", args); + } + + public TExecuteStatementResp recv_ExecuteStatement() throws org.apache.thrift.TException + { + ExecuteStatement_result result = new ExecuteStatement_result(); + receiveBase(result, "ExecuteStatement"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result"); + } + + public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException + { + send_GetTypeInfo(req); + return recv_GetTypeInfo(); + } + + public void send_GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException + { + GetTypeInfo_args args = new GetTypeInfo_args(); + args.setReq(req); + sendBase("GetTypeInfo", args); + } + + public TGetTypeInfoResp recv_GetTypeInfo() throws org.apache.thrift.TException + { + GetTypeInfo_result result = new GetTypeInfo_result(); + receiveBase(result, "GetTypeInfo"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTypeInfo failed: unknown result"); + } + + public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException + { + send_GetCatalogs(req); + return recv_GetCatalogs(); + } + + public void send_GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException + { + GetCatalogs_args args = new GetCatalogs_args(); + args.setReq(req); + sendBase("GetCatalogs", args); + } + + public TGetCatalogsResp recv_GetCatalogs() throws org.apache.thrift.TException + { + GetCatalogs_result result = new GetCatalogs_result(); + receiveBase(result, "GetCatalogs"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCatalogs failed: unknown result"); + } + + public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException + { + send_GetSchemas(req); + return recv_GetSchemas(); + } + + public void send_GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException + { + GetSchemas_args args = new GetSchemas_args(); + args.setReq(req); + sendBase("GetSchemas", args); + } + + public TGetSchemasResp recv_GetSchemas() throws org.apache.thrift.TException + { + GetSchemas_result result = new GetSchemas_result(); + receiveBase(result, "GetSchemas"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetSchemas failed: unknown result"); + } + + public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException + { + send_GetTables(req); + return recv_GetTables(); + } + + public void send_GetTables(TGetTablesReq req) throws org.apache.thrift.TException + { + GetTables_args args = new GetTables_args(); + args.setReq(req); + sendBase("GetTables", args); + } + + public TGetTablesResp recv_GetTables() throws org.apache.thrift.TException + { + GetTables_result result = new GetTables_result(); + receiveBase(result, "GetTables"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTables failed: unknown result"); + } + + public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException + { + send_GetTableTypes(req); + return recv_GetTableTypes(); + } + + public void send_GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException + { + GetTableTypes_args args = new GetTableTypes_args(); + args.setReq(req); + sendBase("GetTableTypes", args); + } + + public TGetTableTypesResp recv_GetTableTypes() throws org.apache.thrift.TException + { + GetTableTypes_result result = new GetTableTypes_result(); + receiveBase(result, "GetTableTypes"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTableTypes failed: unknown result"); + } + + public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException + { + send_GetColumns(req); + return recv_GetColumns(); + } + + public void send_GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException + { + GetColumns_args args = new GetColumns_args(); + args.setReq(req); + sendBase("GetColumns", args); + } + + public TGetColumnsResp recv_GetColumns() throws org.apache.thrift.TException + { + GetColumns_result result = new GetColumns_result(); + receiveBase(result, "GetColumns"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetColumns failed: unknown result"); + } + + public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException + { + send_GetFunctions(req); + return recv_GetFunctions(); + } + + public void send_GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException + { + GetFunctions_args args = new GetFunctions_args(); + args.setReq(req); + sendBase("GetFunctions", args); + } + + public TGetFunctionsResp recv_GetFunctions() throws org.apache.thrift.TException + { + GetFunctions_result result = new GetFunctions_result(); + receiveBase(result, "GetFunctions"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetFunctions failed: unknown result"); + } + + public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException + { + send_GetPrimaryKeys(req); + return recv_GetPrimaryKeys(); + } + + public void send_GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException + { + GetPrimaryKeys_args args = new GetPrimaryKeys_args(); + args.setReq(req); + sendBase("GetPrimaryKeys", args); + } + + public TGetPrimaryKeysResp recv_GetPrimaryKeys() throws org.apache.thrift.TException + { + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + receiveBase(result, "GetPrimaryKeys"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetPrimaryKeys failed: unknown result"); + } + + public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException + { + send_GetCrossReference(req); + return recv_GetCrossReference(); + } + + public void send_GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException + { + GetCrossReference_args args = new GetCrossReference_args(); + args.setReq(req); + sendBase("GetCrossReference", args); + } + + public TGetCrossReferenceResp recv_GetCrossReference() throws org.apache.thrift.TException + { + GetCrossReference_result result = new GetCrossReference_result(); + receiveBase(result, "GetCrossReference"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCrossReference failed: unknown result"); + } + + public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException + { + send_GetOperationStatus(req); + return recv_GetOperationStatus(); + } + + public void send_GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException + { + GetOperationStatus_args args = new GetOperationStatus_args(); + args.setReq(req); + sendBase("GetOperationStatus", args); + } + + public TGetOperationStatusResp recv_GetOperationStatus() throws org.apache.thrift.TException + { + GetOperationStatus_result result = new GetOperationStatus_result(); + receiveBase(result, "GetOperationStatus"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetOperationStatus failed: unknown result"); + } + + public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException + { + send_CancelOperation(req); + return recv_CancelOperation(); + } + + public void send_CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException + { + CancelOperation_args args = new CancelOperation_args(); + args.setReq(req); + sendBase("CancelOperation", args); + } + + public TCancelOperationResp recv_CancelOperation() throws org.apache.thrift.TException + { + CancelOperation_result result = new CancelOperation_result(); + receiveBase(result, "CancelOperation"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelOperation failed: unknown result"); + } + + public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException + { + send_CloseOperation(req); + return recv_CloseOperation(); + } + + public void send_CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException + { + CloseOperation_args args = new CloseOperation_args(); + args.setReq(req); + sendBase("CloseOperation", args); + } + + public TCloseOperationResp recv_CloseOperation() throws org.apache.thrift.TException + { + CloseOperation_result result = new CloseOperation_result(); + receiveBase(result, "CloseOperation"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseOperation failed: unknown result"); + } + + public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException + { + send_GetResultSetMetadata(req); + return recv_GetResultSetMetadata(); + } + + public void send_GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException + { + GetResultSetMetadata_args args = new GetResultSetMetadata_args(); + args.setReq(req); + sendBase("GetResultSetMetadata", args); + } + + public TGetResultSetMetadataResp recv_GetResultSetMetadata() throws org.apache.thrift.TException + { + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + receiveBase(result, "GetResultSetMetadata"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetResultSetMetadata failed: unknown result"); + } + + public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException + { + send_FetchResults(req); + return recv_FetchResults(); + } + + public void send_FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException + { + FetchResults_args args = new FetchResults_args(); + args.setReq(req); + sendBase("FetchResults", args); + } + + public TFetchResultsResp recv_FetchResults() throws org.apache.thrift.TException + { + FetchResults_result result = new FetchResults_result(); + receiveBase(result, "FetchResults"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result"); + } + + public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException + { + send_GetDelegationToken(req); + return recv_GetDelegationToken(); + } + + public void send_GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException + { + GetDelegationToken_args args = new GetDelegationToken_args(); + args.setReq(req); + sendBase("GetDelegationToken", args); + } + + public TGetDelegationTokenResp recv_GetDelegationToken() throws org.apache.thrift.TException + { + GetDelegationToken_result result = new GetDelegationToken_result(); + receiveBase(result, "GetDelegationToken"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result"); + } + + public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException + { + send_CancelDelegationToken(req); + return recv_CancelDelegationToken(); + } + + public void send_CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException + { + CancelDelegationToken_args args = new CancelDelegationToken_args(); + args.setReq(req); + sendBase("CancelDelegationToken", args); + } + + public TCancelDelegationTokenResp recv_CancelDelegationToken() throws org.apache.thrift.TException + { + CancelDelegationToken_result result = new CancelDelegationToken_result(); + receiveBase(result, "CancelDelegationToken"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result"); + } + + public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException + { + send_RenewDelegationToken(req); + return recv_RenewDelegationToken(); + } + + public void send_RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException + { + RenewDelegationToken_args args = new RenewDelegationToken_args(); + args.setReq(req); + sendBase("RenewDelegationToken", args); + } + + public TRenewDelegationTokenResp recv_RenewDelegationToken() throws org.apache.thrift.TException + { + RenewDelegationToken_result result = new RenewDelegationToken_result(); + receiveBase(result, "RenewDelegationToken"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result"); + } + + public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException + { + send_GetQueryId(req); + return recv_GetQueryId(); + } + + public void send_GetQueryId(TGetQueryIdReq req) throws org.apache.thrift.TException + { + GetQueryId_args args = new GetQueryId_args(); + args.setReq(req); + sendBase("GetQueryId", args); + } + + public TGetQueryIdResp recv_GetQueryId() throws org.apache.thrift.TException + { + GetQueryId_result result = new GetQueryId_result(); + receiveBase(result, "GetQueryId"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetQueryId failed: unknown result"); + } + + public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException + { + send_SetClientInfo(req); + return recv_SetClientInfo(); + } + + public void send_SetClientInfo(TSetClientInfoReq req) throws org.apache.thrift.TException + { + SetClientInfo_args args = new SetClientInfo_args(); + args.setReq(req); + sendBase("SetClientInfo", args); + } + + public TSetClientInfoResp recv_SetClientInfo() throws org.apache.thrift.TException + { + SetClientInfo_result result = new SetClientInfo_result(); + receiveBase(result, "SetClientInfo"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "SetClientInfo failed: unknown result"); + } + + } + public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { + public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { + private org.apache.thrift.async.TAsyncClientManager clientManager; + private org.apache.thrift.protocol.TProtocolFactory protocolFactory; + public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { + this.clientManager = clientManager; + this.protocolFactory = protocolFactory; + } + public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { + return new AsyncClient(protocolFactory, clientManager, transport); + } + } + + public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { + super(protocolFactory, clientManager, transport); + } + + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + OpenSession_call method_call = new OpenSession_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { + private TOpenSessionReq req; + public OpenSession_call(TOpenSessionReq 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("OpenSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); + OpenSession_args args = new OpenSession_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TOpenSessionResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_OpenSession(); + } + } + + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCloseSessionReq req; + public CloseSession_call(TCloseSessionReq 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("CloseSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CloseSession_args args = new CloseSession_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCloseSessionResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_CloseSession(); + } + } + + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetInfo_call method_call = new GetInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetInfoReq req; + public GetInfo_call(TGetInfoReq 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("GetInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetInfo_args args = new GetInfo_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetInfoResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetInfo(); + } + } + + public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + ExecuteStatement_call method_call = new ExecuteStatement_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { + private TExecuteStatementReq req; + public ExecuteStatement_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("ExecuteStatement", org.apache.thrift.protocol.TMessageType.CALL, 0)); + ExecuteStatement_args args = new ExecuteStatement_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TExecuteStatementResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_ExecuteStatement(); + } + } + + 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); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetTypeInfoReq req; + public GetTypeInfo_call(TGetTypeInfoReq 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("GetTypeInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetTypeInfo_args args = new GetTypeInfo_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetTypeInfo(); + } + } + + public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetCatalogs_call method_call = new GetCatalogs_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetCatalogsReq req; + public GetCatalogs_call(TGetCatalogsReq 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("GetCatalogs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetCatalogs_args args = new GetCatalogs_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetCatalogsResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetCatalogs(); + } + } + + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetSchemas_call method_call = new GetSchemas_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetSchemasReq req; + public GetSchemas_call(TGetSchemasReq 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("GetSchemas", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetSchemas_args args = new GetSchemas_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetSchemasResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetSchemas(); + } + } + + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetTables_call method_call = new GetTables_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetTablesReq req; + public GetTables_call(TGetTablesReq 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("GetTables", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetTables_args args = new GetTables_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetTablesResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetTables(); + } + } + + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetTableTypes_call method_call = new GetTableTypes_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetTableTypesReq req; + public GetTableTypes_call(TGetTableTypesReq 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("GetTableTypes", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetTableTypes_args args = new GetTableTypes_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetTableTypesResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetTableTypes(); + } + } + + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetColumns_call method_call = new GetColumns_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetColumnsReq req; + public GetColumns_call(TGetColumnsReq 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("GetColumns", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetColumns_args args = new GetColumns_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetColumnsResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetColumns(); + } + } + + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetFunctions_call method_call = new GetFunctions_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetFunctionsReq req; + public GetFunctions_call(TGetFunctionsReq 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("GetFunctions", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetFunctions_args args = new GetFunctions_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetFunctionsResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetFunctions(); + } + } + + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetPrimaryKeys_call method_call = new GetPrimaryKeys_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetPrimaryKeysReq req; + public GetPrimaryKeys_call(TGetPrimaryKeysReq 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("GetPrimaryKeys", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetPrimaryKeys_args args = new GetPrimaryKeys_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetPrimaryKeysResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetPrimaryKeys(); + } + } + + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetCrossReference_call method_call = new GetCrossReference_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetCrossReferenceReq req; + public GetCrossReference_call(TGetCrossReferenceReq 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("GetCrossReference", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetCrossReference_args args = new GetCrossReference_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetCrossReferenceResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetCrossReference(); + } + } + + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetOperationStatus_call method_call = new GetOperationStatus_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetOperationStatusReq req; + public GetOperationStatus_call(TGetOperationStatusReq 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("GetOperationStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetOperationStatus_args args = new GetOperationStatus_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetOperationStatus(); + } + } + + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CancelOperation_call method_call = new CancelOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCancelOperationReq req; + public CancelOperation_call(TCancelOperationReq 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("CancelOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CancelOperation_args args = new CancelOperation_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCancelOperationResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_CancelOperation(); + } + } + + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CloseOperation_call method_call = new CloseOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCloseOperationReq req; + public CloseOperation_call(TCloseOperationReq 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("CloseOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CloseOperation_args args = new CloseOperation_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCloseOperationResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_CloseOperation(); + } + } + + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetResultSetMetadata_call method_call = new GetResultSetMetadata_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetResultSetMetadataReq req; + public GetResultSetMetadata_call(TGetResultSetMetadataReq 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("GetResultSetMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetResultSetMetadata_args args = new GetResultSetMetadata_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetResultSetMetadata(); + } + } + + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + FetchResults_call method_call = new FetchResults_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { + private TFetchResultsReq req; + public FetchResults_call(TFetchResultsReq 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("FetchResults", org.apache.thrift.protocol.TMessageType.CALL, 0)); + FetchResults_args args = new FetchResults_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TFetchResultsResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_FetchResults(); + } + } + + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetDelegationToken_call method_call = new GetDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetDelegationTokenReq req; + public GetDelegationToken_call(TGetDelegationTokenReq 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("GetDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetDelegationToken_args args = new GetDelegationToken_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetDelegationToken(); + } + } + + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + CancelDelegationToken_call method_call = new CancelDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + private TCancelDelegationTokenReq req; + public CancelDelegationToken_call(TCancelDelegationTokenReq 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("CancelDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); + CancelDelegationToken_args args = new CancelDelegationToken_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_CancelDelegationToken(); + } + } + + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + RenewDelegationToken_call method_call = new RenewDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + private TRenewDelegationTokenReq req; + public RenewDelegationToken_call(TRenewDelegationTokenReq 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("RenewDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); + RenewDelegationToken_args args = new RenewDelegationToken_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_RenewDelegationToken(); + } + } + + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + GetQueryId_call method_call = new GetQueryId_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class GetQueryId_call extends org.apache.thrift.async.TAsyncMethodCall { + private TGetQueryIdReq req; + public GetQueryId_call(TGetQueryIdReq 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("GetQueryId", org.apache.thrift.protocol.TMessageType.CALL, 0)); + GetQueryId_args args = new GetQueryId_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TGetQueryIdResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_GetQueryId(); + } + } + + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + SetClientInfo_call method_call = new SetClientInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class SetClientInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private TSetClientInfoReq req; + public SetClientInfo_call(TSetClientInfoReq 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("SetClientInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + SetClientInfo_args args = new SetClientInfo_args(); + args.setReq(req); + args.write(prot); + prot.writeMessageEnd(); + } + + public TSetClientInfoResp getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new java.lang.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_SetClientInfo(); + } + } + + } + + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); + public Processor(I iface) { + super(iface, getProcessMap(new java.util.HashMap>())); + } + + protected Processor(I iface, java.util.Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static java.util.Map> getProcessMap(java.util.Map> processMap) { + processMap.put("OpenSession", new OpenSession()); + processMap.put("CloseSession", new CloseSession()); + processMap.put("GetInfo", new GetInfo()); + processMap.put("ExecuteStatement", new ExecuteStatement()); + processMap.put("GetTypeInfo", new GetTypeInfo()); + processMap.put("GetCatalogs", new GetCatalogs()); + processMap.put("GetSchemas", new GetSchemas()); + processMap.put("GetTables", new GetTables()); + processMap.put("GetTableTypes", new GetTableTypes()); + processMap.put("GetColumns", new GetColumns()); + processMap.put("GetFunctions", new GetFunctions()); + processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); + processMap.put("GetCrossReference", new GetCrossReference()); + processMap.put("GetOperationStatus", new GetOperationStatus()); + processMap.put("CancelOperation", new CancelOperation()); + processMap.put("CloseOperation", new CloseOperation()); + processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); + processMap.put("FetchResults", new FetchResults()); + processMap.put("GetDelegationToken", new GetDelegationToken()); + processMap.put("CancelDelegationToken", new CancelDelegationToken()); + processMap.put("RenewDelegationToken", new RenewDelegationToken()); + processMap.put("GetQueryId", new GetQueryId()); + processMap.put("SetClientInfo", new SetClientInfo()); + return processMap; + } + + public static class OpenSession extends org.apache.thrift.ProcessFunction { + public OpenSession() { + super("OpenSession"); + } + + public OpenSession_args getEmptyArgsInstance() { + return new OpenSession_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public OpenSession_result getResult(I iface, OpenSession_args args) throws org.apache.thrift.TException { + OpenSession_result result = new OpenSession_result(); + result.success = iface.OpenSession(args.req); + return result; + } + } + + public static class CloseSession extends org.apache.thrift.ProcessFunction { + public CloseSession() { + super("CloseSession"); + } + + public CloseSession_args getEmptyArgsInstance() { + return new CloseSession_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { + CloseSession_result result = new CloseSession_result(); + result.success = iface.CloseSession(args.req); + return result; + } + } + + public static class GetInfo extends org.apache.thrift.ProcessFunction { + public GetInfo() { + super("GetInfo"); + } + + public GetInfo_args getEmptyArgsInstance() { + return new GetInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.thrift.TException { + GetInfo_result result = new GetInfo_result(); + result.success = iface.GetInfo(args.req); + return result; + } + } + + public static class ExecuteStatement extends org.apache.thrift.ProcessFunction { + public ExecuteStatement() { + super("ExecuteStatement"); + } + + public ExecuteStatement_args getEmptyArgsInstance() { + return new ExecuteStatement_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) throws org.apache.thrift.TException { + ExecuteStatement_result result = new ExecuteStatement_result(); + result.success = iface.ExecuteStatement(args.req); + return result; + } + } + + public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { + public GetTypeInfo() { + super("GetTypeInfo"); + } + + public GetTypeInfo_args getEmptyArgsInstance() { + return new GetTypeInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.apache.thrift.TException { + GetTypeInfo_result result = new GetTypeInfo_result(); + result.success = iface.GetTypeInfo(args.req); + return result; + } + } + + public static class GetCatalogs extends org.apache.thrift.ProcessFunction { + public GetCatalogs() { + super("GetCatalogs"); + } + + public GetCatalogs_args getEmptyArgsInstance() { + return new GetCatalogs_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.apache.thrift.TException { + GetCatalogs_result result = new GetCatalogs_result(); + result.success = iface.GetCatalogs(args.req); + return result; + } + } + + public static class GetSchemas extends org.apache.thrift.ProcessFunction { + public GetSchemas() { + super("GetSchemas"); + } + + public GetSchemas_args getEmptyArgsInstance() { + return new GetSchemas_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apache.thrift.TException { + GetSchemas_result result = new GetSchemas_result(); + result.success = iface.GetSchemas(args.req); + return result; + } + } + + public static class GetTables extends org.apache.thrift.ProcessFunction { + public GetTables() { + super("GetTables"); + } + + public GetTables_args getEmptyArgsInstance() { + return new GetTables_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetTables_result getResult(I iface, GetTables_args args) throws org.apache.thrift.TException { + GetTables_result result = new GetTables_result(); + result.success = iface.GetTables(args.req); + return result; + } + } + + public static class GetTableTypes extends org.apache.thrift.ProcessFunction { + public GetTableTypes() { + super("GetTableTypes"); + } + + public GetTableTypes_args getEmptyArgsInstance() { + return new GetTableTypes_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws org.apache.thrift.TException { + GetTableTypes_result result = new GetTableTypes_result(); + result.success = iface.GetTableTypes(args.req); + return result; + } + } + + public static class GetColumns extends org.apache.thrift.ProcessFunction { + public GetColumns() { + super("GetColumns"); + } + + public GetColumns_args getEmptyArgsInstance() { + return new GetColumns_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apache.thrift.TException { + GetColumns_result result = new GetColumns_result(); + result.success = iface.GetColumns(args.req); + return result; + } + } + + public static class GetFunctions extends org.apache.thrift.ProcessFunction { + public GetFunctions() { + super("GetFunctions"); + } + + public GetFunctions_args getEmptyArgsInstance() { + return new GetFunctions_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org.apache.thrift.TException { + GetFunctions_result result = new GetFunctions_result(); + result.success = iface.GetFunctions(args.req); + return result; + } + } + + public static class GetPrimaryKeys extends org.apache.thrift.ProcessFunction { + public GetPrimaryKeys() { + super("GetPrimaryKeys"); + } + + public GetPrimaryKeys_args getEmptyArgsInstance() { + return new GetPrimaryKeys_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetPrimaryKeys_result getResult(I iface, GetPrimaryKeys_args args) throws org.apache.thrift.TException { + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + result.success = iface.GetPrimaryKeys(args.req); + return result; + } + } + + public static class GetCrossReference extends org.apache.thrift.ProcessFunction { + public GetCrossReference() { + super("GetCrossReference"); + } + + public GetCrossReference_args getEmptyArgsInstance() { + return new GetCrossReference_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetCrossReference_result getResult(I iface, GetCrossReference_args args) throws org.apache.thrift.TException { + GetCrossReference_result result = new GetCrossReference_result(); + result.success = iface.GetCrossReference(args.req); + return result; + } + } + + public static class GetOperationStatus extends org.apache.thrift.ProcessFunction { + public GetOperationStatus() { + super("GetOperationStatus"); + } + + public GetOperationStatus_args getEmptyArgsInstance() { + return new GetOperationStatus_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args) throws org.apache.thrift.TException { + GetOperationStatus_result result = new GetOperationStatus_result(); + result.success = iface.GetOperationStatus(args.req); + return result; + } + } + + public static class CancelOperation extends org.apache.thrift.ProcessFunction { + public CancelOperation() { + super("CancelOperation"); + } + + public CancelOperation_args getEmptyArgsInstance() { + return new CancelOperation_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public CancelOperation_result getResult(I iface, CancelOperation_args args) throws org.apache.thrift.TException { + CancelOperation_result result = new CancelOperation_result(); + result.success = iface.CancelOperation(args.req); + return result; + } + } + + public static class CloseOperation extends org.apache.thrift.ProcessFunction { + public CloseOperation() { + super("CloseOperation"); + } + + public CloseOperation_args getEmptyArgsInstance() { + return new CloseOperation_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public CloseOperation_result getResult(I iface, CloseOperation_args args) throws org.apache.thrift.TException { + CloseOperation_result result = new CloseOperation_result(); + result.success = iface.CloseOperation(args.req); + return result; + } + } + + public static class GetResultSetMetadata extends org.apache.thrift.ProcessFunction { + public GetResultSetMetadata() { + super("GetResultSetMetadata"); + } + + public GetResultSetMetadata_args getEmptyArgsInstance() { + return new GetResultSetMetadata_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args args) throws org.apache.thrift.TException { + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + result.success = iface.GetResultSetMetadata(args.req); + return result; + } + } + + public static class FetchResults extends org.apache.thrift.ProcessFunction { + public FetchResults() { + super("FetchResults"); + } + + public FetchResults_args getEmptyArgsInstance() { + return new FetchResults_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public FetchResults_result getResult(I iface, FetchResults_args args) throws org.apache.thrift.TException { + FetchResults_result result = new FetchResults_result(); + result.success = iface.FetchResults(args.req); + return result; + } + } + + public static class GetDelegationToken extends org.apache.thrift.ProcessFunction { + public GetDelegationToken() { + super("GetDelegationToken"); + } + + public GetDelegationToken_args getEmptyArgsInstance() { + return new GetDelegationToken_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args) throws org.apache.thrift.TException { + GetDelegationToken_result result = new GetDelegationToken_result(); + result.success = iface.GetDelegationToken(args.req); + return result; + } + } + + public static class CancelDelegationToken extends org.apache.thrift.ProcessFunction { + public CancelDelegationToken() { + super("CancelDelegationToken"); + } + + public CancelDelegationToken_args getEmptyArgsInstance() { + return new CancelDelegationToken_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_args args) throws org.apache.thrift.TException { + CancelDelegationToken_result result = new CancelDelegationToken_result(); + result.success = iface.CancelDelegationToken(args.req); + return result; + } + } + + public static class RenewDelegationToken extends org.apache.thrift.ProcessFunction { + public RenewDelegationToken() { + super("RenewDelegationToken"); + } + + public RenewDelegationToken_args getEmptyArgsInstance() { + return new RenewDelegationToken_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args args) throws org.apache.thrift.TException { + RenewDelegationToken_result result = new RenewDelegationToken_result(); + result.success = iface.RenewDelegationToken(args.req); + return result; + } + } + + public static class GetQueryId extends org.apache.thrift.ProcessFunction { + public GetQueryId() { + super("GetQueryId"); + } + + public GetQueryId_args getEmptyArgsInstance() { + return new GetQueryId_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public GetQueryId_result getResult(I iface, GetQueryId_args args) throws org.apache.thrift.TException { + GetQueryId_result result = new GetQueryId_result(); + result.success = iface.GetQueryId(args.req); + return result; + } + } + + public static class SetClientInfo extends org.apache.thrift.ProcessFunction { + public SetClientInfo() { + super("SetClientInfo"); + } + + public SetClientInfo_args getEmptyArgsInstance() { + return new SetClientInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + @Override + protected boolean rethrowUnhandledExceptions() { + return false; + } + + public SetClientInfo_result getResult(I iface, SetClientInfo_args args) throws org.apache.thrift.TException { + SetClientInfo_result result = new SetClientInfo_result(); + result.success = iface.SetClientInfo(args.req); + return result; + } + } + + } + + public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { + private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); + public AsyncProcessor(I iface) { + super(iface, getProcessMap(new java.util.HashMap>())); + } + + protected AsyncProcessor(I iface, java.util.Map> processMap) { + super(iface, getProcessMap(processMap)); + } + + private static java.util.Map> getProcessMap(java.util.Map> processMap) { + processMap.put("OpenSession", new OpenSession()); + processMap.put("CloseSession", new CloseSession()); + processMap.put("GetInfo", new GetInfo()); + processMap.put("ExecuteStatement", new ExecuteStatement()); + processMap.put("GetTypeInfo", new GetTypeInfo()); + processMap.put("GetCatalogs", new GetCatalogs()); + processMap.put("GetSchemas", new GetSchemas()); + processMap.put("GetTables", new GetTables()); + processMap.put("GetTableTypes", new GetTableTypes()); + processMap.put("GetColumns", new GetColumns()); + processMap.put("GetFunctions", new GetFunctions()); + processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); + processMap.put("GetCrossReference", new GetCrossReference()); + processMap.put("GetOperationStatus", new GetOperationStatus()); + processMap.put("CancelOperation", new CancelOperation()); + processMap.put("CloseOperation", new CloseOperation()); + processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); + processMap.put("FetchResults", new FetchResults()); + processMap.put("GetDelegationToken", new GetDelegationToken()); + processMap.put("CancelDelegationToken", new CancelDelegationToken()); + processMap.put("RenewDelegationToken", new RenewDelegationToken()); + processMap.put("GetQueryId", new GetQueryId()); + processMap.put("SetClientInfo", new SetClientInfo()); + return processMap; + } + + public static class OpenSession extends org.apache.thrift.AsyncProcessFunction { + public OpenSession() { + super("OpenSession"); + } + + public OpenSession_args getEmptyArgsInstance() { + return new OpenSession_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TOpenSessionResp o) { + OpenSession_result result = new OpenSession_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + OpenSession_result result = new OpenSession_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.OpenSession(args.req,resultHandler); + } + } + + public static class CloseSession extends org.apache.thrift.AsyncProcessFunction { + public CloseSession() { + super("CloseSession"); + } + + public CloseSession_args getEmptyArgsInstance() { + return new CloseSession_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TCloseSessionResp o) { + CloseSession_result result = new CloseSession_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + CloseSession_result result = new CloseSession_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.CloseSession(args.req,resultHandler); + } + } + + public static class GetInfo extends org.apache.thrift.AsyncProcessFunction { + public GetInfo() { + super("GetInfo"); + } + + public GetInfo_args getEmptyArgsInstance() { + return new GetInfo_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetInfoResp o) { + GetInfo_result result = new GetInfo_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetInfo_result result = new GetInfo_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetInfo(args.req,resultHandler); + } + } + + public static class ExecuteStatement extends org.apache.thrift.AsyncProcessFunction { + public ExecuteStatement() { + super("ExecuteStatement"); + } + + public ExecuteStatement_args getEmptyArgsInstance() { + return new ExecuteStatement_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TExecuteStatementResp o) { + ExecuteStatement_result result = new ExecuteStatement_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + ExecuteStatement_result result = new ExecuteStatement_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.ExecuteStatement(args.req,resultHandler); + } + } + + public static class GetTypeInfo extends org.apache.thrift.AsyncProcessFunction { + public GetTypeInfo() { + super("GetTypeInfo"); + } + + public GetTypeInfo_args getEmptyArgsInstance() { + return new GetTypeInfo_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetTypeInfoResp o) { + GetTypeInfo_result result = new GetTypeInfo_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetTypeInfo_result result = new GetTypeInfo_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetTypeInfo(args.req,resultHandler); + } + } + + public static class GetCatalogs extends org.apache.thrift.AsyncProcessFunction { + public GetCatalogs() { + super("GetCatalogs"); + } + + public GetCatalogs_args getEmptyArgsInstance() { + return new GetCatalogs_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetCatalogsResp o) { + GetCatalogs_result result = new GetCatalogs_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetCatalogs_result result = new GetCatalogs_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetCatalogs(args.req,resultHandler); + } + } + + public static class GetSchemas extends org.apache.thrift.AsyncProcessFunction { + public GetSchemas() { + super("GetSchemas"); + } + + public GetSchemas_args getEmptyArgsInstance() { + return new GetSchemas_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetSchemasResp o) { + GetSchemas_result result = new GetSchemas_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetSchemas_result result = new GetSchemas_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetSchemas(args.req,resultHandler); + } + } + + public static class GetTables extends org.apache.thrift.AsyncProcessFunction { + public GetTables() { + super("GetTables"); + } + + public GetTables_args getEmptyArgsInstance() { + return new GetTables_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetTablesResp o) { + GetTables_result result = new GetTables_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetTables_result result = new GetTables_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetTables(args.req,resultHandler); + } + } + + public static class GetTableTypes extends org.apache.thrift.AsyncProcessFunction { + public GetTableTypes() { + super("GetTableTypes"); + } + + public GetTableTypes_args getEmptyArgsInstance() { + return new GetTableTypes_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetTableTypesResp o) { + GetTableTypes_result result = new GetTableTypes_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetTableTypes_result result = new GetTableTypes_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetTableTypes(args.req,resultHandler); + } + } + + public static class GetColumns extends org.apache.thrift.AsyncProcessFunction { + public GetColumns() { + super("GetColumns"); + } + + public GetColumns_args getEmptyArgsInstance() { + return new GetColumns_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetColumnsResp o) { + GetColumns_result result = new GetColumns_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetColumns_result result = new GetColumns_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetColumns(args.req,resultHandler); + } + } + + public static class GetFunctions extends org.apache.thrift.AsyncProcessFunction { + public GetFunctions() { + super("GetFunctions"); + } + + public GetFunctions_args getEmptyArgsInstance() { + return new GetFunctions_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetFunctionsResp o) { + GetFunctions_result result = new GetFunctions_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetFunctions_result result = new GetFunctions_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetFunctions(args.req,resultHandler); + } + } + + public static class GetPrimaryKeys extends org.apache.thrift.AsyncProcessFunction { + public GetPrimaryKeys() { + super("GetPrimaryKeys"); + } + + public GetPrimaryKeys_args getEmptyArgsInstance() { + return new GetPrimaryKeys_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetPrimaryKeysResp o) { + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetPrimaryKeys_result result = new GetPrimaryKeys_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetPrimaryKeys(args.req,resultHandler); + } + } + + public static class GetCrossReference extends org.apache.thrift.AsyncProcessFunction { + public GetCrossReference() { + super("GetCrossReference"); + } + + public GetCrossReference_args getEmptyArgsInstance() { + return new GetCrossReference_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetCrossReferenceResp o) { + GetCrossReference_result result = new GetCrossReference_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetCrossReference_result result = new GetCrossReference_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetCrossReference(args.req,resultHandler); + } + } + + public static class GetOperationStatus extends org.apache.thrift.AsyncProcessFunction { + public GetOperationStatus() { + super("GetOperationStatus"); + } + + public GetOperationStatus_args getEmptyArgsInstance() { + return new GetOperationStatus_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetOperationStatusResp o) { + GetOperationStatus_result result = new GetOperationStatus_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetOperationStatus_result result = new GetOperationStatus_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetOperationStatus(args.req,resultHandler); + } + } + + public static class CancelOperation extends org.apache.thrift.AsyncProcessFunction { + public CancelOperation() { + super("CancelOperation"); + } + + public CancelOperation_args getEmptyArgsInstance() { + return new CancelOperation_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TCancelOperationResp o) { + CancelOperation_result result = new CancelOperation_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + CancelOperation_result result = new CancelOperation_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.CancelOperation(args.req,resultHandler); + } + } + + public static class CloseOperation extends org.apache.thrift.AsyncProcessFunction { + public CloseOperation() { + super("CloseOperation"); + } + + public CloseOperation_args getEmptyArgsInstance() { + return new CloseOperation_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TCloseOperationResp o) { + CloseOperation_result result = new CloseOperation_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + CloseOperation_result result = new CloseOperation_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.CloseOperation(args.req,resultHandler); + } + } + + public static class GetResultSetMetadata extends org.apache.thrift.AsyncProcessFunction { + public GetResultSetMetadata() { + super("GetResultSetMetadata"); + } + + public GetResultSetMetadata_args getEmptyArgsInstance() { + return new GetResultSetMetadata_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetResultSetMetadataResp o) { + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetResultSetMetadata_result result = new GetResultSetMetadata_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetResultSetMetadata(args.req,resultHandler); + } + } + + public static class FetchResults extends org.apache.thrift.AsyncProcessFunction { + public FetchResults() { + super("FetchResults"); + } + + public FetchResults_args getEmptyArgsInstance() { + return new FetchResults_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TFetchResultsResp o) { + FetchResults_result result = new FetchResults_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + FetchResults_result result = new FetchResults_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.FetchResults(args.req,resultHandler); + } + } + + public static class GetDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public GetDelegationToken() { + super("GetDelegationToken"); + } + + public GetDelegationToken_args getEmptyArgsInstance() { + return new GetDelegationToken_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetDelegationTokenResp o) { + GetDelegationToken_result result = new GetDelegationToken_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetDelegationToken_result result = new GetDelegationToken_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetDelegationToken(args.req,resultHandler); + } + } + + public static class CancelDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public CancelDelegationToken() { + super("CancelDelegationToken"); + } + + public CancelDelegationToken_args getEmptyArgsInstance() { + return new CancelDelegationToken_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TCancelDelegationTokenResp o) { + CancelDelegationToken_result result = new CancelDelegationToken_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + CancelDelegationToken_result result = new CancelDelegationToken_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.CancelDelegationToken(args.req,resultHandler); + } + } + + public static class RenewDelegationToken extends org.apache.thrift.AsyncProcessFunction { + public RenewDelegationToken() { + super("RenewDelegationToken"); + } + + public RenewDelegationToken_args getEmptyArgsInstance() { + return new RenewDelegationToken_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TRenewDelegationTokenResp o) { + RenewDelegationToken_result result = new RenewDelegationToken_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + RenewDelegationToken_result result = new RenewDelegationToken_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.RenewDelegationToken(args.req,resultHandler); + } + } + + public static class GetQueryId extends org.apache.thrift.AsyncProcessFunction { + public GetQueryId() { + super("GetQueryId"); + } + + public GetQueryId_args getEmptyArgsInstance() { + return new GetQueryId_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TGetQueryIdResp o) { + GetQueryId_result result = new GetQueryId_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + GetQueryId_result result = new GetQueryId_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, GetQueryId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.GetQueryId(args.req,resultHandler); + } + } + + public static class SetClientInfo extends org.apache.thrift.AsyncProcessFunction { + public SetClientInfo() { + super("SetClientInfo"); + } + + public SetClientInfo_args getEmptyArgsInstance() { + return new SetClientInfo_args(); + } + + public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new org.apache.thrift.async.AsyncMethodCallback() { + public void onComplete(TSetClientInfoResp o) { + SetClientInfo_result result = new SetClientInfo_result(); + result.success = o; + try { + fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + } catch (org.apache.thrift.transport.TTransportException e) { + _LOGGER.error("TTransportException writing to internal frame buffer", e); + fb.close(); + } catch (java.lang.Exception e) { + _LOGGER.error("Exception writing to internal frame buffer", e); + onError(e); + } + } + public void onError(java.lang.Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TSerializable msg; + SetClientInfo_result result = new SetClientInfo_result(); + if (e instanceof org.apache.thrift.transport.TTransportException) { + _LOGGER.error("TTransportException inside handler", e); + fb.close(); + return; + } else if (e instanceof org.apache.thrift.TApplicationException) { + _LOGGER.error("TApplicationException inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TApplicationException)e; + } else { + _LOGGER.error("Exception inside handler", e); + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + } catch (java.lang.Exception ex) { + _LOGGER.error("Exception writing to internal frame buffer", ex); + fb.close(); + } + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, SetClientInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + iface.SetClientInfo(args.req,resultHandler); + } + } + + } + + public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OpenSession_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OpenSession_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TOpenSessionReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TOpenSessionReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_args.class, metaDataMap); + } + + public OpenSession_args() { + } + + public OpenSession_args( + TOpenSessionReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public OpenSession_args(OpenSession_args other) { + if (other.isSetReq()) { + this.req = new TOpenSessionReq(other.req); + } + } + + public OpenSession_args deepCopy() { + return new OpenSession_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TOpenSessionReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TOpenSessionReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TOpenSessionReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof OpenSession_args) + return this.equals((OpenSession_args)that); + return false; + } + + public boolean equals(OpenSession_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(OpenSession_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_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, java.lang.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 OpenSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public OpenSession_argsStandardScheme getScheme() { + return new OpenSession_argsStandardScheme(); + } + } + + private static class OpenSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_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 TOpenSessionReq(); + 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, OpenSession_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 OpenSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public OpenSession_argsTupleScheme getScheme() { + return new OpenSession_argsTupleScheme(); + } + } + + private static class OpenSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, OpenSession_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TOpenSessionReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new OpenSession_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new OpenSession_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TOpenSessionResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TOpenSessionResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_result.class, metaDataMap); + } + + public OpenSession_result() { + } + + public OpenSession_result( + TOpenSessionResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public OpenSession_result(OpenSession_result other) { + if (other.isSetSuccess()) { + this.success = new TOpenSessionResp(other.success); + } + } + + public OpenSession_result deepCopy() { + return new OpenSession_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TOpenSessionResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TOpenSessionResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TOpenSessionResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof OpenSession_result) + return this.equals((OpenSession_result)that); + return false; + } + + public boolean equals(OpenSession_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(OpenSession_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_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, java.lang.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 OpenSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public OpenSession_resultStandardScheme getScheme() { + return new OpenSession_resultStandardScheme(); + } + } + + private static class OpenSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_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 TOpenSessionResp(); + 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, OpenSession_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 OpenSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public OpenSession_resultTupleScheme getScheme() { + return new OpenSession_resultTupleScheme(); + } + } + + private static class OpenSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, OpenSession_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TOpenSessionResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseSession_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseSession_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCloseSessionReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseSessionReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_args.class, metaDataMap); + } + + public CloseSession_args() { + } + + public CloseSession_args( + TCloseSessionReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CloseSession_args(CloseSession_args other) { + if (other.isSetReq()) { + this.req = new TCloseSessionReq(other.req); + } + } + + public CloseSession_args deepCopy() { + return new CloseSession_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TCloseSessionReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TCloseSessionReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TCloseSessionReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CloseSession_args) + return this.equals((CloseSession_args)that); + return false; + } + + public boolean equals(CloseSession_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CloseSession_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_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, java.lang.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 CloseSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseSession_argsStandardScheme getScheme() { + return new CloseSession_argsStandardScheme(); + } + } + + private static class CloseSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_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 TCloseSessionReq(); + 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, CloseSession_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 CloseSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseSession_argsTupleScheme getScheme() { + return new CloseSession_argsTupleScheme(); + } + } + + private static class CloseSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CloseSession_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCloseSessionReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseSession_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseSession_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCloseSessionResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseSessionResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_result.class, metaDataMap); + } + + public CloseSession_result() { + } + + public CloseSession_result( + TCloseSessionResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CloseSession_result(CloseSession_result other) { + if (other.isSetSuccess()) { + this.success = new TCloseSessionResp(other.success); + } + } + + public CloseSession_result deepCopy() { + return new CloseSession_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TCloseSessionResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseSessionResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TCloseSessionResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CloseSession_result) + return this.equals((CloseSession_result)that); + return false; + } + + public boolean equals(CloseSession_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CloseSession_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_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, java.lang.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 CloseSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseSession_resultStandardScheme getScheme() { + return new CloseSession_resultStandardScheme(); + } + } + + private static class CloseSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_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 TCloseSessionResp(); + 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, CloseSession_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 CloseSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseSession_resultTupleScheme getScheme() { + return new CloseSession_resultTupleScheme(); + } + } + + private static class CloseSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CloseSession_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCloseSessionResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetInfo_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetInfo_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetInfoReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetInfoReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_args.class, metaDataMap); + } + + public GetInfo_args() { + } + + public GetInfo_args( + TGetInfoReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetInfo_args(GetInfo_args other) { + if (other.isSetReq()) { + this.req = new TGetInfoReq(other.req); + } + } + + public GetInfo_args deepCopy() { + return new GetInfo_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetInfoReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetInfoReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetInfoReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetInfo_args) + return this.equals((GetInfo_args)that); + return false; + } + + public boolean equals(GetInfo_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_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, java.lang.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 GetInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetInfo_argsStandardScheme getScheme() { + return new GetInfo_argsStandardScheme(); + } + } + + private static class GetInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_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 TGetInfoReq(); + 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, GetInfo_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 GetInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetInfo_argsTupleScheme getScheme() { + return new GetInfo_argsTupleScheme(); + } + } + + private static class GetInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetInfoReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetInfo_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetInfo_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetInfoResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetInfoResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_result.class, metaDataMap); + } + + public GetInfo_result() { + } + + public GetInfo_result( + TGetInfoResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetInfo_result(GetInfo_result other) { + if (other.isSetSuccess()) { + this.success = new TGetInfoResp(other.success); + } + } + + public GetInfo_result deepCopy() { + return new GetInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetInfoResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetInfoResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetInfoResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetInfo_result) + return this.equals((GetInfo_result)that); + return false; + } + + public boolean equals(GetInfo_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_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, java.lang.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 GetInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetInfo_resultStandardScheme getScheme() { + return new GetInfo_resultStandardScheme(); + } + } + + private static class GetInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_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 TGetInfoResp(); + 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, GetInfo_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 GetInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetInfo_resultTupleScheme getScheme() { + return new GetInfo_resultTupleScheme(); + } + } + + private static class GetInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetInfoResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExecuteStatement_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExecuteStatement_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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 = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_args.class, metaDataMap); + } + + public ExecuteStatement_args() { + } + + public ExecuteStatement_args( + TExecuteStatementReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public ExecuteStatement_args(ExecuteStatement_args other) { + if (other.isSetReq()) { + this.req = new TExecuteStatementReq(other.req); + } + } + + public ExecuteStatement_args deepCopy() { + return new ExecuteStatement_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TExecuteStatementReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TExecuteStatementReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof ExecuteStatement_args) + return this.equals((ExecuteStatement_args)that); + return false; + } + + public boolean equals(ExecuteStatement_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(ExecuteStatement_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_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, java.lang.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 ExecuteStatement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public ExecuteStatement_argsStandardScheme getScheme() { + return new ExecuteStatement_argsStandardScheme(); + } + } + + private static class ExecuteStatement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_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, ExecuteStatement_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 ExecuteStatement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public ExecuteStatement_argsTupleScheme getScheme() { + return new ExecuteStatement_argsTupleScheme(); + } + } + + private static class ExecuteStatement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, ExecuteStatement_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TExecuteStatementReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ExecuteStatement_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ExecuteStatement_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TExecuteStatementResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TExecuteStatementResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_result.class, metaDataMap); + } + + public ExecuteStatement_result() { + } + + public ExecuteStatement_result( + TExecuteStatementResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public ExecuteStatement_result(ExecuteStatement_result other) { + if (other.isSetSuccess()) { + this.success = new TExecuteStatementResp(other.success); + } + } + + public ExecuteStatement_result deepCopy() { + return new ExecuteStatement_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TExecuteStatementResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TExecuteStatementResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TExecuteStatementResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof ExecuteStatement_result) + return this.equals((ExecuteStatement_result)that); + return false; + } + + public boolean equals(ExecuteStatement_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(ExecuteStatement_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_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, java.lang.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 ExecuteStatement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public ExecuteStatement_resultStandardScheme getScheme() { + return new ExecuteStatement_resultStandardScheme(); + } + } + + private static class ExecuteStatement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_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 TExecuteStatementResp(); + 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, ExecuteStatement_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 ExecuteStatement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public ExecuteStatement_resultTupleScheme getScheme() { + return new ExecuteStatement_resultTupleScheme(); + } + } + + private static class ExecuteStatement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, ExecuteStatement_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TExecuteStatementResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTypeInfo_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTypeInfo_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetTypeInfoReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTypeInfoReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_args.class, metaDataMap); + } + + public GetTypeInfo_args() { + } + + public GetTypeInfo_args( + TGetTypeInfoReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetTypeInfo_args(GetTypeInfo_args other) { + if (other.isSetReq()) { + this.req = new TGetTypeInfoReq(other.req); + } + } + + public GetTypeInfo_args deepCopy() { + return new GetTypeInfo_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetTypeInfoReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetTypeInfoReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetTypeInfoReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetTypeInfo_args) + return this.equals((GetTypeInfo_args)that); + return false; + } + + public boolean equals(GetTypeInfo_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetTypeInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_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, java.lang.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 GetTypeInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTypeInfo_argsStandardScheme getScheme() { + return new GetTypeInfo_argsStandardScheme(); + } + } + + private static class GetTypeInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_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 TGetTypeInfoReq(); + 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, GetTypeInfo_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 GetTypeInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTypeInfo_argsTupleScheme getScheme() { + return new GetTypeInfo_argsTupleScheme(); + } + } + + private static class GetTypeInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetTypeInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetTypeInfoReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTypeInfo_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTypeInfo_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetTypeInfoResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTypeInfoResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_result.class, metaDataMap); + } + + public GetTypeInfo_result() { + } + + public GetTypeInfo_result( + TGetTypeInfoResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetTypeInfo_result(GetTypeInfo_result other) { + if (other.isSetSuccess()) { + this.success = new TGetTypeInfoResp(other.success); + } + } + + public GetTypeInfo_result deepCopy() { + return new GetTypeInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetTypeInfoResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTypeInfoResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetTypeInfoResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetTypeInfo_result) + return this.equals((GetTypeInfo_result)that); + return false; + } + + public boolean equals(GetTypeInfo_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetTypeInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_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, java.lang.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 GetTypeInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTypeInfo_resultStandardScheme getScheme() { + return new GetTypeInfo_resultStandardScheme(); + } + } + + private static class GetTypeInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_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 TGetTypeInfoResp(); + 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, GetTypeInfo_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 GetTypeInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTypeInfo_resultTupleScheme getScheme() { + return new GetTypeInfo_resultTupleScheme(); + } + } + + private static class GetTypeInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetTypeInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetTypeInfoResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCatalogs_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCatalogs_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetCatalogsReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCatalogsReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_args.class, metaDataMap); + } + + public GetCatalogs_args() { + } + + public GetCatalogs_args( + TGetCatalogsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetCatalogs_args(GetCatalogs_args other) { + if (other.isSetReq()) { + this.req = new TGetCatalogsReq(other.req); + } + } + + public GetCatalogs_args deepCopy() { + return new GetCatalogs_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetCatalogsReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetCatalogsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetCatalogsReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetCatalogs_args) + return this.equals((GetCatalogs_args)that); + return false; + } + + public boolean equals(GetCatalogs_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetCatalogs_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_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, java.lang.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 GetCatalogs_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCatalogs_argsStandardScheme getScheme() { + return new GetCatalogs_argsStandardScheme(); + } + } + + private static class GetCatalogs_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_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 TGetCatalogsReq(); + 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, GetCatalogs_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 GetCatalogs_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCatalogs_argsTupleScheme getScheme() { + return new GetCatalogs_argsTupleScheme(); + } + } + + private static class GetCatalogs_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetCatalogs_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetCatalogsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCatalogs_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCatalogs_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetCatalogsResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCatalogsResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_result.class, metaDataMap); + } + + public GetCatalogs_result() { + } + + public GetCatalogs_result( + TGetCatalogsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetCatalogs_result(GetCatalogs_result other) { + if (other.isSetSuccess()) { + this.success = new TGetCatalogsResp(other.success); + } + } + + public GetCatalogs_result deepCopy() { + return new GetCatalogs_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetCatalogsResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCatalogsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetCatalogsResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetCatalogs_result) + return this.equals((GetCatalogs_result)that); + return false; + } + + public boolean equals(GetCatalogs_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetCatalogs_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_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, java.lang.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 GetCatalogs_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCatalogs_resultStandardScheme getScheme() { + return new GetCatalogs_resultStandardScheme(); + } + } + + private static class GetCatalogs_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_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 TGetCatalogsResp(); + 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, GetCatalogs_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 GetCatalogs_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCatalogs_resultTupleScheme getScheme() { + return new GetCatalogs_resultTupleScheme(); + } + } + + private static class GetCatalogs_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetCatalogs_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetCatalogsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetSchemas_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetSchemas_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetSchemasReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetSchemasReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_args.class, metaDataMap); + } + + public GetSchemas_args() { + } + + public GetSchemas_args( + TGetSchemasReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetSchemas_args(GetSchemas_args other) { + if (other.isSetReq()) { + this.req = new TGetSchemasReq(other.req); + } + } + + public GetSchemas_args deepCopy() { + return new GetSchemas_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetSchemasReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetSchemasReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetSchemasReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetSchemas_args) + return this.equals((GetSchemas_args)that); + return false; + } + + public boolean equals(GetSchemas_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetSchemas_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_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, java.lang.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 GetSchemas_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetSchemas_argsStandardScheme getScheme() { + return new GetSchemas_argsStandardScheme(); + } + } + + private static class GetSchemas_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_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 TGetSchemasReq(); + 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, GetSchemas_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 GetSchemas_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetSchemas_argsTupleScheme getScheme() { + return new GetSchemas_argsTupleScheme(); + } + } + + private static class GetSchemas_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetSchemas_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetSchemasReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetSchemas_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetSchemas_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetSchemasResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetSchemasResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_result.class, metaDataMap); + } + + public GetSchemas_result() { + } + + public GetSchemas_result( + TGetSchemasResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetSchemas_result(GetSchemas_result other) { + if (other.isSetSuccess()) { + this.success = new TGetSchemasResp(other.success); + } + } + + public GetSchemas_result deepCopy() { + return new GetSchemas_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetSchemasResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetSchemasResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetSchemasResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetSchemas_result) + return this.equals((GetSchemas_result)that); + return false; + } + + public boolean equals(GetSchemas_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetSchemas_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_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, java.lang.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 GetSchemas_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetSchemas_resultStandardScheme getScheme() { + return new GetSchemas_resultStandardScheme(); + } + } + + private static class GetSchemas_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_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 TGetSchemasResp(); + 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, GetSchemas_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 GetSchemas_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetSchemas_resultTupleScheme getScheme() { + return new GetSchemas_resultTupleScheme(); + } + } + + private static class GetSchemas_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetSchemas_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetSchemasResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTables_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTables_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetTablesReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTablesReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_args.class, metaDataMap); + } + + public GetTables_args() { + } + + public GetTables_args( + TGetTablesReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetTables_args(GetTables_args other) { + if (other.isSetReq()) { + this.req = new TGetTablesReq(other.req); + } + } + + public GetTables_args deepCopy() { + return new GetTables_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetTablesReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetTablesReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetTablesReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetTables_args) + return this.equals((GetTables_args)that); + return false; + } + + public boolean equals(GetTables_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetTables_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_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, java.lang.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 GetTables_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTables_argsStandardScheme getScheme() { + return new GetTables_argsStandardScheme(); + } + } + + private static class GetTables_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_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 TGetTablesReq(); + 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, GetTables_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 GetTables_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTables_argsTupleScheme getScheme() { + return new GetTables_argsTupleScheme(); + } + } + + private static class GetTables_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetTables_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetTablesReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTables_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTables_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetTablesResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTablesResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_result.class, metaDataMap); + } + + public GetTables_result() { + } + + public GetTables_result( + TGetTablesResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetTables_result(GetTables_result other) { + if (other.isSetSuccess()) { + this.success = new TGetTablesResp(other.success); + } + } + + public GetTables_result deepCopy() { + return new GetTables_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetTablesResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTablesResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetTablesResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetTables_result) + return this.equals((GetTables_result)that); + return false; + } + + public boolean equals(GetTables_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetTables_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_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, java.lang.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 GetTables_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTables_resultStandardScheme getScheme() { + return new GetTables_resultStandardScheme(); + } + } + + private static class GetTables_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_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 TGetTablesResp(); + 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, GetTables_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 GetTables_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTables_resultTupleScheme getScheme() { + return new GetTables_resultTupleScheme(); + } + } + + private static class GetTables_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetTables_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetTablesResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTableTypes_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTableTypes_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetTableTypesReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTableTypesReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_args.class, metaDataMap); + } + + public GetTableTypes_args() { + } + + public GetTableTypes_args( + TGetTableTypesReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetTableTypes_args(GetTableTypes_args other) { + if (other.isSetReq()) { + this.req = new TGetTableTypesReq(other.req); + } + } + + public GetTableTypes_args deepCopy() { + return new GetTableTypes_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetTableTypesReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetTableTypesReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetTableTypesReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetTableTypes_args) + return this.equals((GetTableTypes_args)that); + return false; + } + + public boolean equals(GetTableTypes_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetTableTypes_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_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, java.lang.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 GetTableTypes_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTableTypes_argsStandardScheme getScheme() { + return new GetTableTypes_argsStandardScheme(); + } + } + + private static class GetTableTypes_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_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 TGetTableTypesReq(); + 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, GetTableTypes_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 GetTableTypes_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTableTypes_argsTupleScheme getScheme() { + return new GetTableTypes_argsTupleScheme(); + } + } + + private static class GetTableTypes_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetTableTypes_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetTableTypesReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetTableTypes_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetTableTypes_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetTableTypesResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetTableTypesResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_result.class, metaDataMap); + } + + public GetTableTypes_result() { + } + + public GetTableTypes_result( + TGetTableTypesResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetTableTypes_result(GetTableTypes_result other) { + if (other.isSetSuccess()) { + this.success = new TGetTableTypesResp(other.success); + } + } + + public GetTableTypes_result deepCopy() { + return new GetTableTypes_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetTableTypesResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTableTypesResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetTableTypesResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetTableTypes_result) + return this.equals((GetTableTypes_result)that); + return false; + } + + public boolean equals(GetTableTypes_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetTableTypes_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_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, java.lang.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 GetTableTypes_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTableTypes_resultStandardScheme getScheme() { + return new GetTableTypes_resultStandardScheme(); + } + } + + private static class GetTableTypes_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_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 TGetTableTypesResp(); + 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, GetTableTypes_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 GetTableTypes_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetTableTypes_resultTupleScheme getScheme() { + return new GetTableTypes_resultTupleScheme(); + } + } + + private static class GetTableTypes_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetTableTypes_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetTableTypesResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetColumns_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetColumns_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetColumnsReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetColumnsReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_args.class, metaDataMap); + } + + public GetColumns_args() { + } + + public GetColumns_args( + TGetColumnsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetColumns_args(GetColumns_args other) { + if (other.isSetReq()) { + this.req = new TGetColumnsReq(other.req); + } + } + + public GetColumns_args deepCopy() { + return new GetColumns_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetColumnsReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetColumnsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetColumnsReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetColumns_args) + return this.equals((GetColumns_args)that); + return false; + } + + public boolean equals(GetColumns_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetColumns_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_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, java.lang.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 GetColumns_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetColumns_argsStandardScheme getScheme() { + return new GetColumns_argsStandardScheme(); + } + } + + private static class GetColumns_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_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 TGetColumnsReq(); + 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, GetColumns_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 GetColumns_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetColumns_argsTupleScheme getScheme() { + return new GetColumns_argsTupleScheme(); + } + } + + private static class GetColumns_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetColumns_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetColumnsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetColumns_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetColumns_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetColumnsResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetColumnsResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_result.class, metaDataMap); + } + + public GetColumns_result() { + } + + public GetColumns_result( + TGetColumnsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetColumns_result(GetColumns_result other) { + if (other.isSetSuccess()) { + this.success = new TGetColumnsResp(other.success); + } + } + + public GetColumns_result deepCopy() { + return new GetColumns_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetColumnsResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetColumnsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetColumnsResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetColumns_result) + return this.equals((GetColumns_result)that); + return false; + } + + public boolean equals(GetColumns_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetColumns_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_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, java.lang.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 GetColumns_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetColumns_resultStandardScheme getScheme() { + return new GetColumns_resultStandardScheme(); + } + } + + private static class GetColumns_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_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 TGetColumnsResp(); + 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, GetColumns_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 GetColumns_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetColumns_resultTupleScheme getScheme() { + return new GetColumns_resultTupleScheme(); + } + } + + private static class GetColumns_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetColumns_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetColumnsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetFunctions_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetFunctions_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetFunctionsReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetFunctionsReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_args.class, metaDataMap); + } + + public GetFunctions_args() { + } + + public GetFunctions_args( + TGetFunctionsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetFunctions_args(GetFunctions_args other) { + if (other.isSetReq()) { + this.req = new TGetFunctionsReq(other.req); + } + } + + public GetFunctions_args deepCopy() { + return new GetFunctions_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetFunctionsReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetFunctionsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetFunctionsReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetFunctions_args) + return this.equals((GetFunctions_args)that); + return false; + } + + public boolean equals(GetFunctions_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetFunctions_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_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, java.lang.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 GetFunctions_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetFunctions_argsStandardScheme getScheme() { + return new GetFunctions_argsStandardScheme(); + } + } + + private static class GetFunctions_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_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 TGetFunctionsReq(); + 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, GetFunctions_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 GetFunctions_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetFunctions_argsTupleScheme getScheme() { + return new GetFunctions_argsTupleScheme(); + } + } + + private static class GetFunctions_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetFunctions_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetFunctionsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetFunctions_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetFunctions_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetFunctionsResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetFunctionsResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_result.class, metaDataMap); + } + + public GetFunctions_result() { + } + + public GetFunctions_result( + TGetFunctionsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetFunctions_result(GetFunctions_result other) { + if (other.isSetSuccess()) { + this.success = new TGetFunctionsResp(other.success); + } + } + + public GetFunctions_result deepCopy() { + return new GetFunctions_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetFunctionsResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetFunctionsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetFunctionsResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetFunctions_result) + return this.equals((GetFunctions_result)that); + return false; + } + + public boolean equals(GetFunctions_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetFunctions_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_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, java.lang.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 GetFunctions_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetFunctions_resultStandardScheme getScheme() { + return new GetFunctions_resultStandardScheme(); + } + } + + private static class GetFunctions_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_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 TGetFunctionsResp(); + 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, GetFunctions_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 GetFunctions_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetFunctions_resultTupleScheme getScheme() { + return new GetFunctions_resultTupleScheme(); + } + } + + private static class GetFunctions_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetFunctions_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetFunctionsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetPrimaryKeys_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetPrimaryKeys_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetPrimaryKeysReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_args.class, metaDataMap); + } + + public GetPrimaryKeys_args() { + } + + public GetPrimaryKeys_args( + TGetPrimaryKeysReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetPrimaryKeys_args(GetPrimaryKeys_args other) { + if (other.isSetReq()) { + this.req = new TGetPrimaryKeysReq(other.req); + } + } + + public GetPrimaryKeys_args deepCopy() { + return new GetPrimaryKeys_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetPrimaryKeysReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetPrimaryKeysReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetPrimaryKeys_args) + return this.equals((GetPrimaryKeys_args)that); + return false; + } + + public boolean equals(GetPrimaryKeys_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetPrimaryKeys_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_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, java.lang.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 GetPrimaryKeys_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetPrimaryKeys_argsStandardScheme getScheme() { + return new GetPrimaryKeys_argsStandardScheme(); + } + } + + private static class GetPrimaryKeys_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_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 TGetPrimaryKeysReq(); + 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, GetPrimaryKeys_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 GetPrimaryKeys_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetPrimaryKeys_argsTupleScheme getScheme() { + return new GetPrimaryKeys_argsTupleScheme(); + } + } + + private static class GetPrimaryKeys_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetPrimaryKeysReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetPrimaryKeys_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetPrimaryKeys_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetPrimaryKeysResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_result.class, metaDataMap); + } + + public GetPrimaryKeys_result() { + } + + public GetPrimaryKeys_result( + TGetPrimaryKeysResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetPrimaryKeys_result(GetPrimaryKeys_result other) { + if (other.isSetSuccess()) { + this.success = new TGetPrimaryKeysResp(other.success); + } + } + + public GetPrimaryKeys_result deepCopy() { + return new GetPrimaryKeys_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetPrimaryKeysResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetPrimaryKeysResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetPrimaryKeys_result) + return this.equals((GetPrimaryKeys_result)that); + return false; + } + + public boolean equals(GetPrimaryKeys_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetPrimaryKeys_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_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, java.lang.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 GetPrimaryKeys_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetPrimaryKeys_resultStandardScheme getScheme() { + return new GetPrimaryKeys_resultStandardScheme(); + } + } + + private static class GetPrimaryKeys_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_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 TGetPrimaryKeysResp(); + 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, GetPrimaryKeys_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 GetPrimaryKeys_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetPrimaryKeys_resultTupleScheme getScheme() { + return new GetPrimaryKeys_resultTupleScheme(); + } + } + + private static class GetPrimaryKeys_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetPrimaryKeysResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetCrossReference_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCrossReference_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCrossReference_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetCrossReferenceReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCrossReferenceReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_args.class, metaDataMap); + } + + public GetCrossReference_args() { + } + + public GetCrossReference_args( + TGetCrossReferenceReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetCrossReference_args(GetCrossReference_args other) { + if (other.isSetReq()) { + this.req = new TGetCrossReferenceReq(other.req); + } + } + + public GetCrossReference_args deepCopy() { + return new GetCrossReference_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetCrossReferenceReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetCrossReferenceReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetCrossReferenceReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetCrossReference_args) + return this.equals((GetCrossReference_args)that); + return false; + } + + public boolean equals(GetCrossReference_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetCrossReference_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_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, java.lang.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 GetCrossReference_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCrossReference_argsStandardScheme getScheme() { + return new GetCrossReference_argsStandardScheme(); + } + } + + private static class GetCrossReference_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_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 TGetCrossReferenceReq(); + 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, GetCrossReference_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 GetCrossReference_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCrossReference_argsTupleScheme getScheme() { + return new GetCrossReference_argsTupleScheme(); + } + } + + private static class GetCrossReference_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetCrossReference_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetCrossReferenceReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetCrossReference_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCrossReference_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCrossReference_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetCrossReferenceResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetCrossReferenceResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_result.class, metaDataMap); + } + + public GetCrossReference_result() { + } + + public GetCrossReference_result( + TGetCrossReferenceResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetCrossReference_result(GetCrossReference_result other) { + if (other.isSetSuccess()) { + this.success = new TGetCrossReferenceResp(other.success); + } + } + + public GetCrossReference_result deepCopy() { + return new GetCrossReference_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetCrossReferenceResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCrossReferenceResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetCrossReferenceResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetCrossReference_result) + return this.equals((GetCrossReference_result)that); + return false; + } + + public boolean equals(GetCrossReference_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetCrossReference_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_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, java.lang.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 GetCrossReference_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCrossReference_resultStandardScheme getScheme() { + return new GetCrossReference_resultStandardScheme(); + } + } + + private static class GetCrossReference_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_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 TGetCrossReferenceResp(); + 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, GetCrossReference_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 GetCrossReference_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetCrossReference_resultTupleScheme getScheme() { + return new GetCrossReference_resultTupleScheme(); + } + } + + private static class GetCrossReference_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetCrossReference_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetCrossReferenceResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetOperationStatus_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetOperationStatus_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetOperationStatusReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetOperationStatusReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_args.class, metaDataMap); + } + + public GetOperationStatus_args() { + } + + public GetOperationStatus_args( + TGetOperationStatusReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetOperationStatus_args(GetOperationStatus_args other) { + if (other.isSetReq()) { + this.req = new TGetOperationStatusReq(other.req); + } + } + + public GetOperationStatus_args deepCopy() { + return new GetOperationStatus_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetOperationStatusReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetOperationStatusReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetOperationStatusReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetOperationStatus_args) + return this.equals((GetOperationStatus_args)that); + return false; + } + + public boolean equals(GetOperationStatus_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetOperationStatus_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_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, java.lang.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 GetOperationStatus_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetOperationStatus_argsStandardScheme getScheme() { + return new GetOperationStatus_argsStandardScheme(); + } + } + + private static class GetOperationStatus_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_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 TGetOperationStatusReq(); + 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, GetOperationStatus_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 GetOperationStatus_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetOperationStatus_argsTupleScheme getScheme() { + return new GetOperationStatus_argsTupleScheme(); + } + } + + private static class GetOperationStatus_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetOperationStatus_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetOperationStatusReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetOperationStatus_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetOperationStatus_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetOperationStatusResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetOperationStatusResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_result.class, metaDataMap); + } + + public GetOperationStatus_result() { + } + + public GetOperationStatus_result( + TGetOperationStatusResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetOperationStatus_result(GetOperationStatus_result other) { + if (other.isSetSuccess()) { + this.success = new TGetOperationStatusResp(other.success); + } + } + + public GetOperationStatus_result deepCopy() { + return new GetOperationStatus_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetOperationStatusResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetOperationStatusResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetOperationStatusResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetOperationStatus_result) + return this.equals((GetOperationStatus_result)that); + return false; + } + + public boolean equals(GetOperationStatus_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetOperationStatus_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_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, java.lang.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 GetOperationStatus_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetOperationStatus_resultStandardScheme getScheme() { + return new GetOperationStatus_resultStandardScheme(); + } + } + + private static class GetOperationStatus_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_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 TGetOperationStatusResp(); + 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, GetOperationStatus_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 GetOperationStatus_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetOperationStatus_resultTupleScheme getScheme() { + return new GetOperationStatus_resultTupleScheme(); + } + } + + private static class GetOperationStatus_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetOperationStatus_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetOperationStatusResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelOperation_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelOperation_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCancelOperationReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelOperationReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_args.class, metaDataMap); + } + + public CancelOperation_args() { + } + + public CancelOperation_args( + TCancelOperationReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CancelOperation_args(CancelOperation_args other) { + if (other.isSetReq()) { + this.req = new TCancelOperationReq(other.req); + } + } + + public CancelOperation_args deepCopy() { + return new CancelOperation_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TCancelOperationReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TCancelOperationReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TCancelOperationReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CancelOperation_args) + return this.equals((CancelOperation_args)that); + return false; + } + + public boolean equals(CancelOperation_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CancelOperation_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_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, java.lang.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 CancelOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelOperation_argsStandardScheme getScheme() { + return new CancelOperation_argsStandardScheme(); + } + } + + private static class CancelOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_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 TCancelOperationReq(); + 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, CancelOperation_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 CancelOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelOperation_argsTupleScheme getScheme() { + return new CancelOperation_argsTupleScheme(); + } + } + + private static class CancelOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CancelOperation_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCancelOperationReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelOperation_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelOperation_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCancelOperationResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelOperationResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_result.class, metaDataMap); + } + + public CancelOperation_result() { + } + + public CancelOperation_result( + TCancelOperationResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CancelOperation_result(CancelOperation_result other) { + if (other.isSetSuccess()) { + this.success = new TCancelOperationResp(other.success); + } + } + + public CancelOperation_result deepCopy() { + return new CancelOperation_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TCancelOperationResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelOperationResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TCancelOperationResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CancelOperation_result) + return this.equals((CancelOperation_result)that); + return false; + } + + public boolean equals(CancelOperation_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CancelOperation_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_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, java.lang.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 CancelOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelOperation_resultStandardScheme getScheme() { + return new CancelOperation_resultStandardScheme(); + } + } + + private static class CancelOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_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 TCancelOperationResp(); + 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, CancelOperation_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 CancelOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelOperation_resultTupleScheme getScheme() { + return new CancelOperation_resultTupleScheme(); + } + } + + private static class CancelOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CancelOperation_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCancelOperationResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseOperation_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseOperation_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCloseOperationReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseOperationReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_args.class, metaDataMap); + } + + public CloseOperation_args() { + } + + public CloseOperation_args( + TCloseOperationReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CloseOperation_args(CloseOperation_args other) { + if (other.isSetReq()) { + this.req = new TCloseOperationReq(other.req); + } + } + + public CloseOperation_args deepCopy() { + return new CloseOperation_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TCloseOperationReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TCloseOperationReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TCloseOperationReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CloseOperation_args) + return this.equals((CloseOperation_args)that); + return false; + } + + public boolean equals(CloseOperation_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CloseOperation_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_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, java.lang.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 CloseOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseOperation_argsStandardScheme getScheme() { + return new CloseOperation_argsStandardScheme(); + } + } + + private static class CloseOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_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 TCloseOperationReq(); + 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, CloseOperation_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 CloseOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseOperation_argsTupleScheme getScheme() { + return new CloseOperation_argsTupleScheme(); + } + } + + private static class CloseOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CloseOperation_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCloseOperationReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CloseOperation_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CloseOperation_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCloseOperationResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCloseOperationResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_result.class, metaDataMap); + } + + public CloseOperation_result() { + } + + public CloseOperation_result( + TCloseOperationResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CloseOperation_result(CloseOperation_result other) { + if (other.isSetSuccess()) { + this.success = new TCloseOperationResp(other.success); + } + } + + public CloseOperation_result deepCopy() { + return new CloseOperation_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TCloseOperationResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseOperationResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TCloseOperationResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CloseOperation_result) + return this.equals((CloseOperation_result)that); + return false; + } + + public boolean equals(CloseOperation_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CloseOperation_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_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, java.lang.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 CloseOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseOperation_resultStandardScheme getScheme() { + return new CloseOperation_resultStandardScheme(); + } + } + + private static class CloseOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_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 TCloseOperationResp(); + 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, CloseOperation_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 CloseOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CloseOperation_resultTupleScheme getScheme() { + return new CloseOperation_resultTupleScheme(); + } + } + + private static class CloseOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CloseOperation_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCloseOperationResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetResultSetMetadataReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_args.class, metaDataMap); + } + + public GetResultSetMetadata_args() { + } + + public GetResultSetMetadata_args( + TGetResultSetMetadataReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetResultSetMetadata_args(GetResultSetMetadata_args other) { + if (other.isSetReq()) { + this.req = new TGetResultSetMetadataReq(other.req); + } + } + + public GetResultSetMetadata_args deepCopy() { + return new GetResultSetMetadata_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetResultSetMetadataReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetResultSetMetadataReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetResultSetMetadata_args) + return this.equals((GetResultSetMetadata_args)that); + return false; + } + + public boolean equals(GetResultSetMetadata_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetResultSetMetadata_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_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, java.lang.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 GetResultSetMetadata_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetResultSetMetadata_argsStandardScheme getScheme() { + return new GetResultSetMetadata_argsStandardScheme(); + } + } + + private static class GetResultSetMetadata_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_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 TGetResultSetMetadataReq(); + 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, GetResultSetMetadata_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 GetResultSetMetadata_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetResultSetMetadata_argsTupleScheme getScheme() { + return new GetResultSetMetadata_argsTupleScheme(); + } + } + + private static class GetResultSetMetadata_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetResultSetMetadataReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetResultSetMetadataResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_result.class, metaDataMap); + } + + public GetResultSetMetadata_result() { + } + + public GetResultSetMetadata_result( + TGetResultSetMetadataResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetResultSetMetadata_result(GetResultSetMetadata_result other) { + if (other.isSetSuccess()) { + this.success = new TGetResultSetMetadataResp(other.success); + } + } + + public GetResultSetMetadata_result deepCopy() { + return new GetResultSetMetadata_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetResultSetMetadataResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetResultSetMetadataResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetResultSetMetadata_result) + return this.equals((GetResultSetMetadata_result)that); + return false; + } + + public boolean equals(GetResultSetMetadata_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetResultSetMetadata_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_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, java.lang.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 GetResultSetMetadata_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetResultSetMetadata_resultStandardScheme getScheme() { + return new GetResultSetMetadata_resultStandardScheme(); + } + } + + private static class GetResultSetMetadata_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_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 TGetResultSetMetadataResp(); + 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, GetResultSetMetadata_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 GetResultSetMetadata_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetResultSetMetadata_resultTupleScheme getScheme() { + return new GetResultSetMetadata_resultTupleScheme(); + } + } + + private static class GetResultSetMetadata_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetResultSetMetadataResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FetchResults_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FetchResults_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TFetchResultsReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TFetchResultsReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_args.class, metaDataMap); + } + + public FetchResults_args() { + } + + public FetchResults_args( + TFetchResultsReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public FetchResults_args(FetchResults_args other) { + if (other.isSetReq()) { + this.req = new TFetchResultsReq(other.req); + } + } + + public FetchResults_args deepCopy() { + return new FetchResults_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TFetchResultsReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TFetchResultsReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TFetchResultsReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof FetchResults_args) + return this.equals((FetchResults_args)that); + return false; + } + + public boolean equals(FetchResults_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(FetchResults_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_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, java.lang.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 FetchResults_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public FetchResults_argsStandardScheme getScheme() { + return new FetchResults_argsStandardScheme(); + } + } + + private static class FetchResults_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_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 TFetchResultsReq(); + 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, FetchResults_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 FetchResults_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public FetchResults_argsTupleScheme getScheme() { + return new FetchResults_argsTupleScheme(); + } + } + + private static class FetchResults_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, FetchResults_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TFetchResultsReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new FetchResults_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new FetchResults_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TFetchResultsResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TFetchResultsResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_result.class, metaDataMap); + } + + public FetchResults_result() { + } + + public FetchResults_result( + TFetchResultsResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public FetchResults_result(FetchResults_result other) { + if (other.isSetSuccess()) { + this.success = new TFetchResultsResp(other.success); + } + } + + public FetchResults_result deepCopy() { + return new FetchResults_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TFetchResultsResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TFetchResultsResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TFetchResultsResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof FetchResults_result) + return this.equals((FetchResults_result)that); + return false; + } + + public boolean equals(FetchResults_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(FetchResults_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_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, java.lang.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 FetchResults_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public FetchResults_resultStandardScheme getScheme() { + return new FetchResults_resultStandardScheme(); + } + } + + private static class FetchResults_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_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 TFetchResultsResp(); + 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, FetchResults_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 FetchResults_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public FetchResults_resultTupleScheme getScheme() { + return new FetchResults_resultTupleScheme(); + } + } + + private static class FetchResults_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, FetchResults_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TFetchResultsResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetDelegationToken_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetDelegationToken_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetDelegationTokenReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_args.class, metaDataMap); + } + + public GetDelegationToken_args() { + } + + public GetDelegationToken_args( + TGetDelegationTokenReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetDelegationToken_args(GetDelegationToken_args other) { + if (other.isSetReq()) { + this.req = new TGetDelegationTokenReq(other.req); + } + } + + public GetDelegationToken_args deepCopy() { + return new GetDelegationToken_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetDelegationTokenReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetDelegationTokenReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetDelegationTokenReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetDelegationToken_args) + return this.equals((GetDelegationToken_args)that); + return false; + } + + public boolean equals(GetDelegationToken_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetDelegationToken_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_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, java.lang.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 GetDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetDelegationToken_argsStandardScheme getScheme() { + return new GetDelegationToken_argsStandardScheme(); + } + } + + private static class GetDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_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 TGetDelegationTokenReq(); + 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, GetDelegationToken_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 GetDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetDelegationToken_argsTupleScheme getScheme() { + return new GetDelegationToken_argsTupleScheme(); + } + } + + private static class GetDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetDelegationToken_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetDelegationTokenReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetDelegationToken_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetDelegationToken_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetDelegationTokenResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_result.class, metaDataMap); + } + + public GetDelegationToken_result() { + } + + public GetDelegationToken_result( + TGetDelegationTokenResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetDelegationToken_result(GetDelegationToken_result other) { + if (other.isSetSuccess()) { + this.success = new TGetDelegationTokenResp(other.success); + } + } + + public GetDelegationToken_result deepCopy() { + return new GetDelegationToken_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetDelegationTokenResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetDelegationTokenResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetDelegationTokenResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetDelegationToken_result) + return this.equals((GetDelegationToken_result)that); + return false; + } + + public boolean equals(GetDelegationToken_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetDelegationToken_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_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, java.lang.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 GetDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetDelegationToken_resultStandardScheme getScheme() { + return new GetDelegationToken_resultStandardScheme(); + } + } + + private static class GetDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_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 TGetDelegationTokenResp(); + 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, GetDelegationToken_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 GetDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetDelegationToken_resultTupleScheme getScheme() { + return new GetDelegationToken_resultTupleScheme(); + } + } + + private static class GetDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetDelegationToken_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetDelegationTokenResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelDelegationTokenReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_args.class, metaDataMap); + } + + public CancelDelegationToken_args() { + } + + public CancelDelegationToken_args( + TCancelDelegationTokenReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public CancelDelegationToken_args(CancelDelegationToken_args other) { + if (other.isSetReq()) { + this.req = new TCancelDelegationTokenReq(other.req); + } + } + + public CancelDelegationToken_args deepCopy() { + return new CancelDelegationToken_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TCancelDelegationTokenReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TCancelDelegationTokenReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CancelDelegationToken_args) + return this.equals((CancelDelegationToken_args)that); + return false; + } + + public boolean equals(CancelDelegationToken_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CancelDelegationToken_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_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, java.lang.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 CancelDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelDelegationToken_argsStandardScheme getScheme() { + return new CancelDelegationToken_argsStandardScheme(); + } + } + + private static class CancelDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_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 TCancelDelegationTokenReq(); + 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, CancelDelegationToken_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 CancelDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelDelegationToken_argsTupleScheme getScheme() { + return new CancelDelegationToken_argsTupleScheme(); + } + } + + private static class CancelDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CancelDelegationToken_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TCancelDelegationTokenReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TCancelDelegationTokenResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_result.class, metaDataMap); + } + + public CancelDelegationToken_result() { + } + + public CancelDelegationToken_result( + TCancelDelegationTokenResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public CancelDelegationToken_result(CancelDelegationToken_result other) { + if (other.isSetSuccess()) { + this.success = new TCancelDelegationTokenResp(other.success); + } + } + + public CancelDelegationToken_result deepCopy() { + return new CancelDelegationToken_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TCancelDelegationTokenResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TCancelDelegationTokenResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof CancelDelegationToken_result) + return this.equals((CancelDelegationToken_result)that); + return false; + } + + public boolean equals(CancelDelegationToken_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(CancelDelegationToken_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_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, java.lang.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 CancelDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelDelegationToken_resultStandardScheme getScheme() { + return new CancelDelegationToken_resultStandardScheme(); + } + } + + private static class CancelDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_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 TCancelDelegationTokenResp(); + 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, CancelDelegationToken_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 CancelDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public CancelDelegationToken_resultTupleScheme getScheme() { + return new CancelDelegationToken_resultTupleScheme(); + } + } + + private static class CancelDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, CancelDelegationToken_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TCancelDelegationTokenResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TRenewDelegationTokenReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_args.class, metaDataMap); + } + + public RenewDelegationToken_args() { + } + + public RenewDelegationToken_args( + TRenewDelegationTokenReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public RenewDelegationToken_args(RenewDelegationToken_args other) { + if (other.isSetReq()) { + this.req = new TRenewDelegationTokenReq(other.req); + } + } + + public RenewDelegationToken_args deepCopy() { + return new RenewDelegationToken_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TRenewDelegationTokenReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TRenewDelegationTokenReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof RenewDelegationToken_args) + return this.equals((RenewDelegationToken_args)that); + return false; + } + + public boolean equals(RenewDelegationToken_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(RenewDelegationToken_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_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, java.lang.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 RenewDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public RenewDelegationToken_argsStandardScheme getScheme() { + return new RenewDelegationToken_argsStandardScheme(); + } + } + + private static class RenewDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_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 TRenewDelegationTokenReq(); + 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, RenewDelegationToken_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 RenewDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public RenewDelegationToken_argsTupleScheme getScheme() { + return new RenewDelegationToken_argsTupleScheme(); + } + } + + private static class RenewDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, RenewDelegationToken_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TRenewDelegationTokenReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TRenewDelegationTokenResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_result.class, metaDataMap); + } + + public RenewDelegationToken_result() { + } + + public RenewDelegationToken_result( + TRenewDelegationTokenResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public RenewDelegationToken_result(RenewDelegationToken_result other) { + if (other.isSetSuccess()) { + this.success = new TRenewDelegationTokenResp(other.success); + } + } + + public RenewDelegationToken_result deepCopy() { + return new RenewDelegationToken_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TRenewDelegationTokenResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TRenewDelegationTokenResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof RenewDelegationToken_result) + return this.equals((RenewDelegationToken_result)that); + return false; + } + + public boolean equals(RenewDelegationToken_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(RenewDelegationToken_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_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, java.lang.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 RenewDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public RenewDelegationToken_resultStandardScheme getScheme() { + return new RenewDelegationToken_resultStandardScheme(); + } + } + + private static class RenewDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_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 TRenewDelegationTokenResp(); + 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, RenewDelegationToken_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 RenewDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public RenewDelegationToken_resultTupleScheme getScheme() { + return new RenewDelegationToken_resultTupleScheme(); + } + } + + private static class RenewDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, RenewDelegationToken_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TRenewDelegationTokenResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetQueryId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetQueryId_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetQueryId_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetQueryIdReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetQueryIdReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_args.class, metaDataMap); + } + + public GetQueryId_args() { + } + + public GetQueryId_args( + TGetQueryIdReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public GetQueryId_args(GetQueryId_args other) { + if (other.isSetReq()) { + this.req = new TGetQueryIdReq(other.req); + } + } + + public GetQueryId_args deepCopy() { + return new GetQueryId_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetQueryIdReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TGetQueryIdReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TGetQueryIdReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetQueryId_args) + return this.equals((GetQueryId_args)that); + return false; + } + + public boolean equals(GetQueryId_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetQueryId_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_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, java.lang.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 GetQueryId_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetQueryId_argsStandardScheme getScheme() { + return new GetQueryId_argsStandardScheme(); + } + } + + private static class GetQueryId_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_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 TGetQueryIdReq(); + 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, GetQueryId_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 GetQueryId_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetQueryId_argsTupleScheme getScheme() { + return new GetQueryId_argsTupleScheme(); + } + } + + private static class GetQueryId_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetQueryId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TGetQueryIdReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class GetQueryId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetQueryId_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetQueryId_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetQueryId_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TGetQueryIdResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TGetQueryIdResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_result.class, metaDataMap); + } + + public GetQueryId_result() { + } + + public GetQueryId_result( + TGetQueryIdResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public GetQueryId_result(GetQueryId_result other) { + if (other.isSetSuccess()) { + this.success = new TGetQueryIdResp(other.success); + } + } + + public GetQueryId_result deepCopy() { + return new GetQueryId_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TGetQueryIdResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TGetQueryIdResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TGetQueryIdResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof GetQueryId_result) + return this.equals((GetQueryId_result)that); + return false; + } + + public boolean equals(GetQueryId_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(GetQueryId_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_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, java.lang.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 GetQueryId_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetQueryId_resultStandardScheme getScheme() { + return new GetQueryId_resultStandardScheme(); + } + } + + private static class GetQueryId_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_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 TGetQueryIdResp(); + 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, GetQueryId_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 GetQueryId_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public GetQueryId_resultTupleScheme getScheme() { + return new GetQueryId_resultTupleScheme(); + } + } + + private static class GetQueryId_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, GetQueryId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TGetQueryIdResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class SetClientInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SetClientInfo_argsStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SetClientInfo_argsTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSetClientInfoReq 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TSetClientInfoReq.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_args.class, metaDataMap); + } + + public SetClientInfo_args() { + } + + public SetClientInfo_args( + TSetClientInfoReq req) + { + this(); + this.req = req; + } + + /** + * Performs a deep copy on other. + */ + public SetClientInfo_args(SetClientInfo_args other) { + if (other.isSetReq()) { + this.req = new TSetClientInfoReq(other.req); + } + } + + public SetClientInfo_args deepCopy() { + return new SetClientInfo_args(this); + } + + @Override + public void clear() { + this.req = null; + } + + @org.apache.thrift.annotation.Nullable + public TSetClientInfoReq getReq() { + return this.req; + } + + public void setReq(@org.apache.thrift.annotation.Nullable TSetClientInfoReq 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case REQ: + if (value == null) { + unsetReq(); + } else { + setReq((TSetClientInfoReq)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case REQ: + return getReq(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case REQ: + return isSetReq(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof SetClientInfo_args) + return this.equals((SetClientInfo_args)that); + return false; + } + + public boolean equals(SetClientInfo_args that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); + if (isSetReq()) + hashCode = hashCode * 8191 + req.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(SetClientInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetReq()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_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, java.lang.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 SetClientInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public SetClientInfo_argsStandardScheme getScheme() { + return new SetClientInfo_argsStandardScheme(); + } + } + + private static class SetClientInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_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 TSetClientInfoReq(); + 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, SetClientInfo_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 SetClientInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public SetClientInfo_argsTupleScheme getScheme() { + return new SetClientInfo_argsTupleScheme(); + } + } + + private static class SetClientInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, SetClientInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.req = new TSetClientInfoReq(); + struct.req.read(iprot); + struct.setReqIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + + public static class SetClientInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SetClientInfo_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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new SetClientInfo_resultStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new SetClientInfo_resultTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSetClientInfoResp 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 java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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, TSetClientInfoResp.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_result.class, metaDataMap); + } + + public SetClientInfo_result() { + } + + public SetClientInfo_result( + TSetClientInfoResp success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public SetClientInfo_result(SetClientInfo_result other) { + if (other.isSetSuccess()) { + this.success = new TSetClientInfoResp(other.success); + } + } + + public SetClientInfo_result deepCopy() { + return new SetClientInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + @org.apache.thrift.annotation.Nullable + public TSetClientInfoResp getSuccess() { + return this.success; + } + + public void setSuccess(@org.apache.thrift.annotation.Nullable TSetClientInfoResp 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((TSetClientInfoResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof SetClientInfo_result) + return this.equals((SetClientInfo_result)that); + return false; + } + + public boolean equals(SetClientInfo_result that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); + if (isSetSuccess()) + hashCode = hashCode * 8191 + success.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(SetClientInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_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, java.lang.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 SetClientInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public SetClientInfo_resultStandardScheme getScheme() { + return new SetClientInfo_resultStandardScheme(); + } + } + + private static class SetClientInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_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 TSetClientInfoResp(); + 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, SetClientInfo_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 SetClientInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public SetClientInfo_resultTupleScheme getScheme() { + return new SetClientInfo_resultTupleScheme(); + } + } + + private static class SetClientInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.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, SetClientInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = new TSetClientInfoResp(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } + } + +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java new file mode 100644 index 000000000000..c526118f908c --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java @@ -0,0 +1,81 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +public class TCLIServiceConstants { + + public static final java.util.Set PRIMITIVE_TYPES = java.util.EnumSet.noneOf(TTypeId.class); + static { + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BOOLEAN_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TINYINT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.SMALLINT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BIGINT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.FLOAT_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DOUBLE_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.STRING_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMP_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BINARY_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DECIMAL_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.NULL_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DATE_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.VARCHAR_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.CHAR_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE); + PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE); + } + + public static final java.util.Set COMPLEX_TYPES = java.util.EnumSet.noneOf(TTypeId.class); + static { + COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.ARRAY_TYPE); + COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.MAP_TYPE); + COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.STRUCT_TYPE); + COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.UNION_TYPE); + COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.USER_DEFINED_TYPE); + } + + public static final java.util.Set COLLECTION_TYPES = java.util.EnumSet.noneOf(TTypeId.class); + static { + COLLECTION_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.ARRAY_TYPE); + COLLECTION_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.MAP_TYPE); + } + + public static final java.util.Map TYPE_NAMES = new java.util.EnumMap(TTypeId.class); + static { + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.ARRAY_TYPE, "ARRAY"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BIGINT_TYPE, "BIGINT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BINARY_TYPE, "BINARY"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BOOLEAN_TYPE, "BOOLEAN"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.CHAR_TYPE, "CHAR"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DATE_TYPE, "DATE"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DECIMAL_TYPE, "DECIMAL"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DOUBLE_TYPE, "DOUBLE"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.FLOAT_TYPE, "FLOAT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INT_TYPE, "INT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.MAP_TYPE, "MAP"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.NULL_TYPE, "NULL"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.SMALLINT_TYPE, "SMALLINT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.STRING_TYPE, "STRING"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.STRUCT_TYPE, "STRUCT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE, "TIMESTAMP WITH LOCAL TIME ZONE"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TINYINT_TYPE, "TINYINT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.UNION_TYPE, "UNIONTYPE"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.VARCHAR_TYPE, "VARCHAR"); + } + + public static final java.lang.String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; + + public static final java.lang.String PRECISION = "precision"; + + public static final java.lang.String SCALE = "scale"; + +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java new file mode 100644 index 000000000000..5873d2a95316 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java @@ -0,0 +1,474 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenReq"); + + 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), + DELEGATION_TOKEN((short)2, "delegationToken"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // DELEGATION_TOKEN + return DELEGATION_TOKEN; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenReq.class, metaDataMap); + } + + public TCancelDelegationTokenReq() { + } + + public TCancelDelegationTokenReq( + TSessionHandle sessionHandle, + java.lang.String delegationToken) + { + this(); + this.sessionHandle = sessionHandle; + this.delegationToken = delegationToken; + } + + /** + * Performs a deep copy on other. + */ + public TCancelDelegationTokenReq(TCancelDelegationTokenReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetDelegationToken()) { + this.delegationToken = other.delegationToken; + } + } + + public TCancelDelegationTokenReq deepCopy() { + return new TCancelDelegationTokenReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.delegationToken = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getDelegationToken() { + return this.delegationToken; + } + + public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { + this.delegationToken = delegationToken; + } + + public void unsetDelegationToken() { + this.delegationToken = null; + } + + /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ + public boolean isSetDelegationToken() { + return this.delegationToken != null; + } + + public void setDelegationTokenIsSet(boolean value) { + if (!value) { + this.delegationToken = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case DELEGATION_TOKEN: + if (value == null) { + unsetDelegationToken(); + } else { + setDelegationToken((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case DELEGATION_TOKEN: + return getDelegationToken(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case DELEGATION_TOKEN: + return isSetDelegationToken(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCancelDelegationTokenReq) + return this.equals((TCancelDelegationTokenReq)that); + return false; + } + + public boolean equals(TCancelDelegationTokenReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_delegationToken = true && this.isSetDelegationToken(); + boolean that_present_delegationToken = true && that.isSetDelegationToken(); + if (this_present_delegationToken || that_present_delegationToken) { + if (!(this_present_delegationToken && that_present_delegationToken)) + return false; + if (!this.delegationToken.equals(that.delegationToken)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); + if (isSetDelegationToken()) + hashCode = hashCode * 8191 + delegationToken.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCancelDelegationTokenReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelegationToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenReq("); + 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("delegationToken:"); + if (this.delegationToken == null) { + sb.append("null"); + } else { + sb.append(this.delegationToken); + } + 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 (!isSetDelegationToken()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TCancelDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelDelegationTokenReqStandardScheme getScheme() { + return new TCancelDelegationTokenReqStandardScheme(); + } + } + + private static class TCancelDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenReq 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: // DELEGATION_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(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, TCancelDelegationTokenReq 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.delegationToken != null) { + oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); + oprot.writeString(struct.delegationToken); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelDelegationTokenReqTupleScheme getScheme() { + return new TCancelDelegationTokenReqTupleScheme(); + } + } + + private static class TCancelDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.delegationToken); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java new file mode 100644 index 000000000000..70900ee26a33 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { + STATUS((short)1, "status"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap); + } + + public TCancelDelegationTokenResp() { + } + + public TCancelDelegationTokenResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCancelDelegationTokenResp(TCancelDelegationTokenResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCancelDelegationTokenResp deepCopy() { + return new TCancelDelegationTokenResp(this); + } + + @Override + public void clear() { + this.status = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCancelDelegationTokenResp) + return this.equals((TCancelDelegationTokenResp)that); + return false; + } + + public boolean equals(TCancelDelegationTokenResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCancelDelegationTokenResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TCancelDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelDelegationTokenRespStandardScheme getScheme() { + return new TCancelDelegationTokenRespStandardScheme(); + } + } + + private static class TCancelDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp 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; + 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, TCancelDelegationTokenResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelDelegationTokenRespTupleScheme getScheme() { + return new TCancelDelegationTokenRespTupleScheme(); + } + } + + private static class TCancelDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java new file mode 100644 index 000000000000..02b0c07df0f2 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq"); + + 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)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable 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 { + OPERATION_HANDLE((short)1, "operationHandle"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationReq.class, metaDataMap); + } + + public TCancelOperationReq() { + } + + public TCancelOperationReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TCancelOperationReq(TCancelOperationReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TCancelOperationReq deepCopy() { + return new TCancelOperationReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCancelOperationReq) + return this.equals((TCancelOperationReq)that); + return false; + } + + public boolean equals(TCancelOperationReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCancelOperationReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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, java.lang.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 TCancelOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelOperationReqStandardScheme getScheme() { + return new TCancelOperationReqStandardScheme(); + } + } + + private static class TCancelOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq 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: // 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, TCancelOperationReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelOperationReqTupleScheme getScheme() { + return new TCancelOperationReqTupleScheme(); + } + } + + private static class TCancelOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java new file mode 100644 index 000000000000..359a8cb7758b --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { + STATUS((short)1, "status"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationResp.class, metaDataMap); + } + + public TCancelOperationResp() { + } + + public TCancelOperationResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCancelOperationResp(TCancelOperationResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCancelOperationResp deepCopy() { + return new TCancelOperationResp(this); + } + + @Override + public void clear() { + this.status = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCancelOperationResp) + return this.equals((TCancelOperationResp)that); + return false; + } + + public boolean equals(TCancelOperationResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCancelOperationResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TCancelOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelOperationRespStandardScheme getScheme() { + return new TCancelOperationRespStandardScheme(); + } + } + + private static class TCancelOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationResp 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; + 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, TCancelOperationResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCancelOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCancelOperationRespTupleScheme getScheme() { + return new TCancelOperationRespTupleScheme(); + } + } + + private static class TCancelOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java new file mode 100644 index 000000000000..c2fd8ec30cdc --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationReq"); + + 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)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable 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 { + OPERATION_HANDLE((short)1, "operationHandle"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationReq.class, metaDataMap); + } + + public TCloseOperationReq() { + } + + public TCloseOperationReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TCloseOperationReq(TCloseOperationReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TCloseOperationReq deepCopy() { + return new TCloseOperationReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCloseOperationReq) + return this.equals((TCloseOperationReq)that); + return false; + } + + public boolean equals(TCloseOperationReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCloseOperationReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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, java.lang.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 TCloseOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseOperationReqStandardScheme getScheme() { + return new TCloseOperationReqStandardScheme(); + } + } + + private static class TCloseOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationReq 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: // 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, TCloseOperationReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseOperationReqTupleScheme getScheme() { + return new TCloseOperationReqTupleScheme(); + } + } + + private static class TCloseOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java new file mode 100644 index 000000000000..5415cd340277 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { + STATUS((short)1, "status"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationResp.class, metaDataMap); + } + + public TCloseOperationResp() { + } + + public TCloseOperationResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCloseOperationResp(TCloseOperationResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCloseOperationResp deepCopy() { + return new TCloseOperationResp(this); + } + + @Override + public void clear() { + this.status = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCloseOperationResp) + return this.equals((TCloseOperationResp)that); + return false; + } + + public boolean equals(TCloseOperationResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCloseOperationResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TCloseOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseOperationRespStandardScheme getScheme() { + return new TCloseOperationRespStandardScheme(); + } + } + + private static class TCloseOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationResp 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; + 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, TCloseOperationResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseOperationRespTupleScheme getScheme() { + return new TCloseOperationRespTupleScheme(); + } + } + + private static class TCloseOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java new file mode 100644 index 000000000000..43d65a7871ed --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionReq"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionReq.class, metaDataMap); + } + + public TCloseSessionReq() { + } + + public TCloseSessionReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TCloseSessionReq(TCloseSessionReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TCloseSessionReq deepCopy() { + return new TCloseSessionReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCloseSessionReq) + return this.equals((TCloseSessionReq)that); + return false; + } + + public boolean equals(TCloseSessionReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCloseSessionReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TCloseSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseSessionReqStandardScheme getScheme() { + return new TCloseSessionReqStandardScheme(); + } + } + + private static class TCloseSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionReq 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; + 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, TCloseSessionReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseSessionReqTupleScheme getScheme() { + return new TCloseSessionReqTupleScheme(); + } + } + + private static class TCloseSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java new file mode 100644 index 000000000000..85d9f4094155 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { + STATUS((short)1, "status"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionResp.class, metaDataMap); + } + + public TCloseSessionResp() { + } + + public TCloseSessionResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TCloseSessionResp(TCloseSessionResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TCloseSessionResp deepCopy() { + return new TCloseSessionResp(this); + } + + @Override + public void clear() { + this.status = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TCloseSessionResp) + return this.equals((TCloseSessionResp)that); + return false; + } + + public boolean equals(TCloseSessionResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TCloseSessionResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TCloseSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseSessionRespStandardScheme getScheme() { + return new TCloseSessionRespStandardScheme(); + } + } + + private static class TCloseSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionResp 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; + 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, TCloseSessionResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TCloseSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TCloseSessionRespTupleScheme getScheme() { + return new TCloseSessionRespTupleScheme(); + } + } + + private static class TCloseSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java new file mode 100644 index 000000000000..b7ad6d67dfec --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java @@ -0,0 +1,713 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TColumn extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); + private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); + private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); + private static final org.apache.thrift.protocol.TField BINARY_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryVal", org.apache.thrift.protocol.TType.STRUCT, (short)8); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + BOOL_VAL((short)1, "boolVal"), + BYTE_VAL((short)2, "byteVal"), + I16_VAL((short)3, "i16Val"), + I32_VAL((short)4, "i32Val"), + I64_VAL((short)5, "i64Val"), + DOUBLE_VAL((short)6, "doubleVal"), + STRING_VAL((short)7, "stringVal"), + BINARY_VAL((short)8, "binaryVal"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // BOOL_VAL + return BOOL_VAL; + case 2: // BYTE_VAL + return BYTE_VAL; + case 3: // I16_VAL + return I16_VAL; + case 4: // I32_VAL + return I32_VAL; + case 5: // I64_VAL + return I64_VAL; + case 6: // DOUBLE_VAL + return DOUBLE_VAL; + case 7: // STRING_VAL + return STRING_VAL; + case 8: // BINARY_VAL + return BINARY_VAL; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolColumn.class))); + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteColumn.class))); + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Column.class))); + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Column.class))); + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Column.class))); + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleColumn.class))); + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringColumn.class))); + tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryColumn.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); + } + + public TColumn() { + super(); + } + + public TColumn(_Fields setField, java.lang.Object value) { + super(setField, value); + } + + public TColumn(TColumn other) { + super(other); + } + public TColumn deepCopy() { + return new TColumn(this); + } + + public static TColumn boolVal(TBoolColumn value) { + TColumn x = new TColumn(); + x.setBoolVal(value); + return x; + } + + public static TColumn byteVal(TByteColumn value) { + TColumn x = new TColumn(); + x.setByteVal(value); + return x; + } + + public static TColumn i16Val(TI16Column value) { + TColumn x = new TColumn(); + x.setI16Val(value); + return x; + } + + public static TColumn i32Val(TI32Column value) { + TColumn x = new TColumn(); + x.setI32Val(value); + return x; + } + + public static TColumn i64Val(TI64Column value) { + TColumn x = new TColumn(); + x.setI64Val(value); + return x; + } + + public static TColumn doubleVal(TDoubleColumn value) { + TColumn x = new TColumn(); + x.setDoubleVal(value); + return x; + } + + public static TColumn stringVal(TStringColumn value) { + TColumn x = new TColumn(); + x.setStringVal(value); + return x; + } + + public static TColumn binaryVal(TBinaryColumn value) { + TColumn x = new TColumn(); + x.setBinaryVal(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + switch (setField) { + case BOOL_VAL: + if (value instanceof TBoolColumn) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); + case BYTE_VAL: + if (value instanceof TByteColumn) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); + case I16_VAL: + if (value instanceof TI16Column) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); + case I32_VAL: + if (value instanceof TI32Column) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); + case I64_VAL: + if (value instanceof TI64Column) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); + case DOUBLE_VAL: + if (value instanceof TDoubleColumn) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); + case STRING_VAL: + if (value instanceof TStringColumn) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); + case BINARY_VAL: + if (value instanceof TBinaryColumn) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + if (field.type == BOOL_VAL_FIELD_DESC.type) { + TBoolColumn boolVal; + boolVal = new TBoolColumn(); + boolVal.read(iprot); + return boolVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BYTE_VAL: + if (field.type == BYTE_VAL_FIELD_DESC.type) { + TByteColumn byteVal; + byteVal = new TByteColumn(); + byteVal.read(iprot); + return byteVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I16_VAL: + if (field.type == I16_VAL_FIELD_DESC.type) { + TI16Column i16Val; + i16Val = new TI16Column(); + i16Val.read(iprot); + return i16Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I32_VAL: + if (field.type == I32_VAL_FIELD_DESC.type) { + TI32Column i32Val; + i32Val = new TI32Column(); + i32Val.read(iprot); + return i32Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I64_VAL: + if (field.type == I64_VAL_FIELD_DESC.type) { + TI64Column i64Val; + i64Val = new TI64Column(); + i64Val.read(iprot); + return i64Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case DOUBLE_VAL: + if (field.type == DOUBLE_VAL_FIELD_DESC.type) { + TDoubleColumn doubleVal; + doubleVal = new TDoubleColumn(); + doubleVal.read(iprot); + return doubleVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRING_VAL: + if (field.type == STRING_VAL_FIELD_DESC.type) { + TStringColumn stringVal; + stringVal = new TStringColumn(); + stringVal.read(iprot); + return stringVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BINARY_VAL: + if (field.type == BINARY_VAL_FIELD_DESC.type) { + TBinaryColumn binaryVal; + binaryVal = new TBinaryColumn(); + binaryVal.read(iprot); + return binaryVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolColumn boolVal = (TBoolColumn)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteColumn byteVal = (TByteColumn)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Column i16Val = (TI16Column)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Column i32Val = (TI32Column)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Column i64Val = (TI64Column)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleColumn doubleVal = (TDoubleColumn)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringColumn stringVal = (TStringColumn)value_; + stringVal.write(oprot); + return; + case BINARY_VAL: + TBinaryColumn binaryVal = (TBinaryColumn)value_; + binaryVal.write(oprot); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + TBoolColumn boolVal; + boolVal = new TBoolColumn(); + boolVal.read(iprot); + return boolVal; + case BYTE_VAL: + TByteColumn byteVal; + byteVal = new TByteColumn(); + byteVal.read(iprot); + return byteVal; + case I16_VAL: + TI16Column i16Val; + i16Val = new TI16Column(); + i16Val.read(iprot); + return i16Val; + case I32_VAL: + TI32Column i32Val; + i32Val = new TI32Column(); + i32Val.read(iprot); + return i32Val; + case I64_VAL: + TI64Column i64Val; + i64Val = new TI64Column(); + i64Val.read(iprot); + return i64Val; + case DOUBLE_VAL: + TDoubleColumn doubleVal; + doubleVal = new TDoubleColumn(); + doubleVal.read(iprot); + return doubleVal; + case STRING_VAL: + TStringColumn stringVal; + stringVal = new TStringColumn(); + stringVal.read(iprot); + return stringVal; + case BINARY_VAL: + TBinaryColumn binaryVal; + binaryVal = new TBinaryColumn(); + binaryVal.read(iprot); + return binaryVal; + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolColumn boolVal = (TBoolColumn)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteColumn byteVal = (TByteColumn)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Column i16Val = (TI16Column)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Column i32Val = (TI32Column)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Column i64Val = (TI64Column)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleColumn doubleVal = (TDoubleColumn)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringColumn stringVal = (TStringColumn)value_; + stringVal.write(oprot); + return; + case BINARY_VAL: + TBinaryColumn binaryVal = (TBinaryColumn)value_; + binaryVal.write(oprot); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case BOOL_VAL: + return BOOL_VAL_FIELD_DESC; + case BYTE_VAL: + return BYTE_VAL_FIELD_DESC; + case I16_VAL: + return I16_VAL_FIELD_DESC; + case I32_VAL: + return I32_VAL_FIELD_DESC; + case I64_VAL: + return I64_VAL_FIELD_DESC; + case DOUBLE_VAL: + return DOUBLE_VAL_FIELD_DESC; + case STRING_VAL: + return STRING_VAL_FIELD_DESC; + case BINARY_VAL: + return BINARY_VAL_FIELD_DESC; + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public TBoolColumn getBoolVal() { + if (getSetField() == _Fields.BOOL_VAL) { + return (TBoolColumn)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBoolVal(TBoolColumn value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.BOOL_VAL; + value_ = value; + } + + public TByteColumn getByteVal() { + if (getSetField() == _Fields.BYTE_VAL) { + return (TByteColumn)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setByteVal(TByteColumn value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.BYTE_VAL; + value_ = value; + } + + public TI16Column getI16Val() { + if (getSetField() == _Fields.I16_VAL) { + return (TI16Column)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI16Val(TI16Column value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.I16_VAL; + value_ = value; + } + + public TI32Column getI32Val() { + if (getSetField() == _Fields.I32_VAL) { + return (TI32Column)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI32Val(TI32Column value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.I32_VAL; + value_ = value; + } + + public TI64Column getI64Val() { + if (getSetField() == _Fields.I64_VAL) { + return (TI64Column)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI64Val(TI64Column value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.I64_VAL; + value_ = value; + } + + public TDoubleColumn getDoubleVal() { + if (getSetField() == _Fields.DOUBLE_VAL) { + return (TDoubleColumn)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setDoubleVal(TDoubleColumn value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.DOUBLE_VAL; + value_ = value; + } + + public TStringColumn getStringVal() { + if (getSetField() == _Fields.STRING_VAL) { + return (TStringColumn)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringVal(TStringColumn value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.STRING_VAL; + value_ = value; + } + + public TBinaryColumn getBinaryVal() { + if (getSetField() == _Fields.BINARY_VAL) { + return (TBinaryColumn)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBinaryVal(TBinaryColumn value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.BINARY_VAL; + value_ = value; + } + + public boolean isSetBoolVal() { + return setField_ == _Fields.BOOL_VAL; + } + + + public boolean isSetByteVal() { + return setField_ == _Fields.BYTE_VAL; + } + + + public boolean isSetI16Val() { + return setField_ == _Fields.I16_VAL; + } + + + public boolean isSetI32Val() { + return setField_ == _Fields.I32_VAL; + } + + + public boolean isSetI64Val() { + return setField_ == _Fields.I64_VAL; + } + + + public boolean isSetDoubleVal() { + return setField_ == _Fields.DOUBLE_VAL; + } + + + public boolean isSetStringVal() { + return setField_ == _Fields.STRING_VAL; + } + + + public boolean isSetBinaryVal() { + return setField_ == _Fields.BINARY_VAL; + } + + + public boolean equals(java.lang.Object other) { + if (other instanceof TColumn) { + return equals((TColumn)other); + } else { + return false; + } + } + + public boolean equals(TColumn other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TColumn other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + java.util.List list = new java.util.ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + java.lang.Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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, java.lang.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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java new file mode 100644 index 000000000000..979298180798 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java @@ -0,0 +1,680 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnDesc"); + + private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField TYPE_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("typeDesc", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField POSITION_FIELD_DESC = new org.apache.thrift.protocol.TField("position", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TColumnDescStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TColumnDescTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // required + private @org.apache.thrift.annotation.Nullable TTypeDesc typeDesc; // required + private int position; // required + private @org.apache.thrift.annotation.Nullable java.lang.String comment; // 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 { + COLUMN_NAME((short)1, "columnName"), + TYPE_DESC((short)2, "typeDesc"), + POSITION((short)3, "position"), + COMMENT((short)4, "comment"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // COLUMN_NAME + return COLUMN_NAME; + case 2: // TYPE_DESC + return TYPE_DESC; + case 3: // POSITION + return POSITION; + case 4: // COMMENT + return COMMENT; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __POSITION_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.COMMENT}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TYPE_DESC, new org.apache.thrift.meta_data.FieldMetaData("typeDesc", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeDesc.class))); + tmpMap.put(_Fields.POSITION, new org.apache.thrift.meta_data.FieldMetaData("position", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); + } + + public TColumnDesc() { + } + + public TColumnDesc( + java.lang.String columnName, + TTypeDesc typeDesc, + int position) + { + this(); + this.columnName = columnName; + this.typeDesc = typeDesc; + this.position = position; + setPositionIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TColumnDesc(TColumnDesc other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetColumnName()) { + this.columnName = other.columnName; + } + if (other.isSetTypeDesc()) { + this.typeDesc = new TTypeDesc(other.typeDesc); + } + this.position = other.position; + if (other.isSetComment()) { + this.comment = other.comment; + } + } + + public TColumnDesc deepCopy() { + return new TColumnDesc(this); + } + + @Override + public void clear() { + this.columnName = null; + this.typeDesc = null; + setPositionIsSet(false); + this.position = 0; + this.comment = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getColumnName() { + return this.columnName; + } + + public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { + this.columnName = columnName; + } + + public void unsetColumnName() { + this.columnName = null; + } + + /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnName() { + return this.columnName != null; + } + + public void setColumnNameIsSet(boolean value) { + if (!value) { + this.columnName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public TTypeDesc getTypeDesc() { + return this.typeDesc; + } + + public void setTypeDesc(@org.apache.thrift.annotation.Nullable TTypeDesc typeDesc) { + this.typeDesc = typeDesc; + } + + public void unsetTypeDesc() { + this.typeDesc = null; + } + + /** Returns true if field typeDesc is set (has been assigned a value) and false otherwise */ + public boolean isSetTypeDesc() { + return this.typeDesc != null; + } + + public void setTypeDescIsSet(boolean value) { + if (!value) { + this.typeDesc = null; + } + } + + public int getPosition() { + return this.position; + } + + public void setPosition(int position) { + this.position = position; + setPositionIsSet(true); + } + + public void unsetPosition() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); + } + + /** Returns true if field position is set (has been assigned a value) and false otherwise */ + public boolean isSetPosition() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); + } + + public void setPositionIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getComment() { + return this.comment; + } + + public void setComment(@org.apache.thrift.annotation.Nullable java.lang.String comment) { + this.comment = comment; + } + + public void unsetComment() { + this.comment = null; + } + + /** Returns true if field comment is set (has been assigned a value) and false otherwise */ + public boolean isSetComment() { + return this.comment != null; + } + + public void setCommentIsSet(boolean value) { + if (!value) { + this.comment = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case COLUMN_NAME: + if (value == null) { + unsetColumnName(); + } else { + setColumnName((java.lang.String)value); + } + break; + + case TYPE_DESC: + if (value == null) { + unsetTypeDesc(); + } else { + setTypeDesc((TTypeDesc)value); + } + break; + + case POSITION: + if (value == null) { + unsetPosition(); + } else { + setPosition((java.lang.Integer)value); + } + break; + + case COMMENT: + if (value == null) { + unsetComment(); + } else { + setComment((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case COLUMN_NAME: + return getColumnName(); + + case TYPE_DESC: + return getTypeDesc(); + + case POSITION: + return getPosition(); + + case COMMENT: + return getComment(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case COLUMN_NAME: + return isSetColumnName(); + case TYPE_DESC: + return isSetTypeDesc(); + case POSITION: + return isSetPosition(); + case COMMENT: + return isSetComment(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TColumnDesc) + return this.equals((TColumnDesc)that); + return false; + } + + public boolean equals(TColumnDesc that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_columnName = true && this.isSetColumnName(); + boolean that_present_columnName = true && that.isSetColumnName(); + if (this_present_columnName || that_present_columnName) { + if (!(this_present_columnName && that_present_columnName)) + return false; + if (!this.columnName.equals(that.columnName)) + return false; + } + + boolean this_present_typeDesc = true && this.isSetTypeDesc(); + boolean that_present_typeDesc = true && that.isSetTypeDesc(); + if (this_present_typeDesc || that_present_typeDesc) { + if (!(this_present_typeDesc && that_present_typeDesc)) + return false; + if (!this.typeDesc.equals(that.typeDesc)) + return false; + } + + boolean this_present_position = true; + boolean that_present_position = true; + if (this_present_position || that_present_position) { + if (!(this_present_position && that_present_position)) + return false; + if (this.position != that.position) + return false; + } + + boolean this_present_comment = true && this.isSetComment(); + boolean that_present_comment = true && that.isSetComment(); + if (this_present_comment || that_present_comment) { + if (!(this_present_comment && that_present_comment)) + return false; + if (!this.comment.equals(that.comment)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); + if (isSetColumnName()) + hashCode = hashCode * 8191 + columnName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTypeDesc()) ? 131071 : 524287); + if (isSetTypeDesc()) + hashCode = hashCode * 8191 + typeDesc.hashCode(); + + hashCode = hashCode * 8191 + position; + + hashCode = hashCode * 8191 + ((isSetComment()) ? 131071 : 524287); + if (isSetComment()) + hashCode = hashCode * 8191 + comment.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TColumnDesc other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypeDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeDesc, other.typeDesc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPosition()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.position, other.position); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetComment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TColumnDesc("); + boolean first = true; + + sb.append("columnName:"); + if (this.columnName == null) { + sb.append("null"); + } else { + sb.append(this.columnName); + } + first = false; + if (!first) sb.append(", "); + sb.append("typeDesc:"); + if (this.typeDesc == null) { + sb.append("null"); + } else { + sb.append(this.typeDesc); + } + first = false; + if (!first) sb.append(", "); + sb.append("position:"); + sb.append(this.position); + first = false; + if (isSetComment()) { + if (!first) sb.append(", "); + sb.append("comment:"); + if (this.comment == null) { + sb.append("null"); + } else { + sb.append(this.comment); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetColumnName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnName' is unset! Struct:" + toString()); + } + + if (!isSetTypeDesc()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeDesc' is unset! Struct:" + toString()); + } + + if (!isSetPosition()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'position' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (typeDesc != null) { + typeDesc.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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TColumnDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TColumnDescStandardScheme getScheme() { + return new TColumnDescStandardScheme(); + } + } + + private static class TColumnDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc 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: // COLUMN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TYPE_DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.typeDesc = new TTypeDesc(); + struct.typeDesc.read(iprot); + struct.setTypeDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // POSITION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.position = iprot.readI32(); + struct.setPositionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COMMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(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, TColumnDesc struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.columnName != null) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeString(struct.columnName); + oprot.writeFieldEnd(); + } + if (struct.typeDesc != null) { + oprot.writeFieldBegin(TYPE_DESC_FIELD_DESC); + struct.typeDesc.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(POSITION_FIELD_DESC); + oprot.writeI32(struct.position); + oprot.writeFieldEnd(); + if (struct.comment != null) { + if (struct.isSetComment()) { + oprot.writeFieldBegin(COMMENT_FIELD_DESC); + oprot.writeString(struct.comment); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TColumnDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TColumnDescTupleScheme getScheme() { + return new TColumnDescTupleScheme(); + } + } + + private static class TColumnDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeString(struct.columnName); + struct.typeDesc.write(oprot); + oprot.writeI32(struct.position); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetComment()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetComment()) { + oprot.writeString(struct.comment); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(true); + struct.typeDesc = new TTypeDesc(); + struct.typeDesc.read(iprot); + struct.setTypeDescIsSet(true); + struct.position = iprot.readI32(); + struct.setPositionIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java new file mode 100644 index 000000000000..c2f9a6f0a0d6 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java @@ -0,0 +1,652 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TColumnValue extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); + private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); + private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + BOOL_VAL((short)1, "boolVal"), + BYTE_VAL((short)2, "byteVal"), + I16_VAL((short)3, "i16Val"), + I32_VAL((short)4, "i32Val"), + I64_VAL((short)5, "i64Val"), + DOUBLE_VAL((short)6, "doubleVal"), + STRING_VAL((short)7, "stringVal"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // BOOL_VAL + return BOOL_VAL; + case 2: // BYTE_VAL + return BYTE_VAL; + case 3: // I16_VAL + return I16_VAL; + case 4: // I32_VAL + return I32_VAL; + case 5: // I64_VAL + return I64_VAL; + case 6: // DOUBLE_VAL + return DOUBLE_VAL; + case 7: // STRING_VAL + return STRING_VAL; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolValue.class))); + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteValue.class))); + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Value.class))); + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Value.class))); + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Value.class))); + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); + } + + public TColumnValue() { + super(); + } + + public TColumnValue(_Fields setField, java.lang.Object value) { + super(setField, value); + } + + public TColumnValue(TColumnValue other) { + super(other); + } + public TColumnValue deepCopy() { + return new TColumnValue(this); + } + + public static TColumnValue boolVal(TBoolValue value) { + TColumnValue x = new TColumnValue(); + x.setBoolVal(value); + return x; + } + + public static TColumnValue byteVal(TByteValue value) { + TColumnValue x = new TColumnValue(); + x.setByteVal(value); + return x; + } + + public static TColumnValue i16Val(TI16Value value) { + TColumnValue x = new TColumnValue(); + x.setI16Val(value); + return x; + } + + public static TColumnValue i32Val(TI32Value value) { + TColumnValue x = new TColumnValue(); + x.setI32Val(value); + return x; + } + + public static TColumnValue i64Val(TI64Value value) { + TColumnValue x = new TColumnValue(); + x.setI64Val(value); + return x; + } + + public static TColumnValue doubleVal(TDoubleValue value) { + TColumnValue x = new TColumnValue(); + x.setDoubleVal(value); + return x; + } + + public static TColumnValue stringVal(TStringValue value) { + TColumnValue x = new TColumnValue(); + x.setStringVal(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + switch (setField) { + case BOOL_VAL: + if (value instanceof TBoolValue) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); + case BYTE_VAL: + if (value instanceof TByteValue) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); + case I16_VAL: + if (value instanceof TI16Value) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); + case I32_VAL: + if (value instanceof TI32Value) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); + case I64_VAL: + if (value instanceof TI64Value) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); + case DOUBLE_VAL: + if (value instanceof TDoubleValue) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); + case STRING_VAL: + if (value instanceof TStringValue) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + if (field.type == BOOL_VAL_FIELD_DESC.type) { + TBoolValue boolVal; + boolVal = new TBoolValue(); + boolVal.read(iprot); + return boolVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BYTE_VAL: + if (field.type == BYTE_VAL_FIELD_DESC.type) { + TByteValue byteVal; + byteVal = new TByteValue(); + byteVal.read(iprot); + return byteVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I16_VAL: + if (field.type == I16_VAL_FIELD_DESC.type) { + TI16Value i16Val; + i16Val = new TI16Value(); + i16Val.read(iprot); + return i16Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I32_VAL: + if (field.type == I32_VAL_FIELD_DESC.type) { + TI32Value i32Val; + i32Val = new TI32Value(); + i32Val.read(iprot); + return i32Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case I64_VAL: + if (field.type == I64_VAL_FIELD_DESC.type) { + TI64Value i64Val; + i64Val = new TI64Value(); + i64Val.read(iprot); + return i64Val; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case DOUBLE_VAL: + if (field.type == DOUBLE_VAL_FIELD_DESC.type) { + TDoubleValue doubleVal; + doubleVal = new TDoubleValue(); + doubleVal.read(iprot); + return doubleVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRING_VAL: + if (field.type == STRING_VAL_FIELD_DESC.type) { + TStringValue stringVal; + stringVal = new TStringValue(); + stringVal.read(iprot); + return stringVal; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolValue boolVal = (TBoolValue)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteValue byteVal = (TByteValue)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Value i16Val = (TI16Value)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Value i32Val = (TI32Value)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Value i64Val = (TI64Value)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleValue doubleVal = (TDoubleValue)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringValue stringVal = (TStringValue)value_; + stringVal.write(oprot); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case BOOL_VAL: + TBoolValue boolVal; + boolVal = new TBoolValue(); + boolVal.read(iprot); + return boolVal; + case BYTE_VAL: + TByteValue byteVal; + byteVal = new TByteValue(); + byteVal.read(iprot); + return byteVal; + case I16_VAL: + TI16Value i16Val; + i16Val = new TI16Value(); + i16Val.read(iprot); + return i16Val; + case I32_VAL: + TI32Value i32Val; + i32Val = new TI32Value(); + i32Val.read(iprot); + return i32Val; + case I64_VAL: + TI64Value i64Val; + i64Val = new TI64Value(); + i64Val.read(iprot); + return i64Val; + case DOUBLE_VAL: + TDoubleValue doubleVal; + doubleVal = new TDoubleValue(); + doubleVal.read(iprot); + return doubleVal; + case STRING_VAL: + TStringValue stringVal; + stringVal = new TStringValue(); + stringVal.read(iprot); + return stringVal; + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case BOOL_VAL: + TBoolValue boolVal = (TBoolValue)value_; + boolVal.write(oprot); + return; + case BYTE_VAL: + TByteValue byteVal = (TByteValue)value_; + byteVal.write(oprot); + return; + case I16_VAL: + TI16Value i16Val = (TI16Value)value_; + i16Val.write(oprot); + return; + case I32_VAL: + TI32Value i32Val = (TI32Value)value_; + i32Val.write(oprot); + return; + case I64_VAL: + TI64Value i64Val = (TI64Value)value_; + i64Val.write(oprot); + return; + case DOUBLE_VAL: + TDoubleValue doubleVal = (TDoubleValue)value_; + doubleVal.write(oprot); + return; + case STRING_VAL: + TStringValue stringVal = (TStringValue)value_; + stringVal.write(oprot); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case BOOL_VAL: + return BOOL_VAL_FIELD_DESC; + case BYTE_VAL: + return BYTE_VAL_FIELD_DESC; + case I16_VAL: + return I16_VAL_FIELD_DESC; + case I32_VAL: + return I32_VAL_FIELD_DESC; + case I64_VAL: + return I64_VAL_FIELD_DESC; + case DOUBLE_VAL: + return DOUBLE_VAL_FIELD_DESC; + case STRING_VAL: + return STRING_VAL_FIELD_DESC; + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public TBoolValue getBoolVal() { + if (getSetField() == _Fields.BOOL_VAL) { + return (TBoolValue)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBoolVal(TBoolValue value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.BOOL_VAL; + value_ = value; + } + + public TByteValue getByteVal() { + if (getSetField() == _Fields.BYTE_VAL) { + return (TByteValue)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setByteVal(TByteValue value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.BYTE_VAL; + value_ = value; + } + + public TI16Value getI16Val() { + if (getSetField() == _Fields.I16_VAL) { + return (TI16Value)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI16Val(TI16Value value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.I16_VAL; + value_ = value; + } + + public TI32Value getI32Val() { + if (getSetField() == _Fields.I32_VAL) { + return (TI32Value)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI32Val(TI32Value value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.I32_VAL; + value_ = value; + } + + public TI64Value getI64Val() { + if (getSetField() == _Fields.I64_VAL) { + return (TI64Value)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI64Val(TI64Value value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.I64_VAL; + value_ = value; + } + + public TDoubleValue getDoubleVal() { + if (getSetField() == _Fields.DOUBLE_VAL) { + return (TDoubleValue)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setDoubleVal(TDoubleValue value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.DOUBLE_VAL; + value_ = value; + } + + public TStringValue getStringVal() { + if (getSetField() == _Fields.STRING_VAL) { + return (TStringValue)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringVal(TStringValue value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.STRING_VAL; + value_ = value; + } + + public boolean isSetBoolVal() { + return setField_ == _Fields.BOOL_VAL; + } + + + public boolean isSetByteVal() { + return setField_ == _Fields.BYTE_VAL; + } + + + public boolean isSetI16Val() { + return setField_ == _Fields.I16_VAL; + } + + + public boolean isSetI32Val() { + return setField_ == _Fields.I32_VAL; + } + + + public boolean isSetI64Val() { + return setField_ == _Fields.I64_VAL; + } + + + public boolean isSetDoubleVal() { + return setField_ == _Fields.DOUBLE_VAL; + } + + + public boolean isSetStringVal() { + return setField_ == _Fields.STRING_VAL; + } + + + public boolean equals(java.lang.Object other) { + if (other instanceof TColumnValue) { + return equals((TColumnValue)other); + } else { + return false; + } + } + + public boolean equals(TColumnValue other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TColumnValue other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + java.util.List list = new java.util.ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + java.lang.Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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, java.lang.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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java new file mode 100644 index 000000000000..7618e0eecfe4 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleColumn.class, metaDataMap); + } + + public TDoubleColumn() { + } + + public TDoubleColumn( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TDoubleColumn(TDoubleColumn other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TDoubleColumn deepCopy() { + return new TDoubleColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(double elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TDoubleColumn) + return this.equals((TDoubleColumn)that); + return false; + } + + public boolean equals(TDoubleColumn that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TDoubleColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TDoubleColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TDoubleColumnStandardScheme getScheme() { + return new TDoubleColumnStandardScheme(); + } + } + + private static class TDoubleColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list94.size); + double _elem95; + for (int _i96 = 0; _i96 < _list94.size; ++_i96) + { + _elem95 = iprot.readDouble(); + struct.values.add(_elem95); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TDoubleColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, struct.values.size())); + for (double _iter97 : struct.values) + { + oprot.writeDouble(_iter97); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TDoubleColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TDoubleColumnTupleScheme getScheme() { + return new TDoubleColumnTupleScheme(); + } + } + + private static class TDoubleColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (double _iter98 : struct.values) + { + oprot.writeDouble(_iter98); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); + struct.values = new java.util.ArrayList(_list99.size); + double _elem100; + for (int _i101 = 0; _i101 < _list99.size; ++_i101) + { + _elem100 = iprot.readDouble(); + struct.values.add(_elem100); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java new file mode 100644 index 000000000000..e7f04ea788fa --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleValueTupleSchemeFactory(); + + private double value; // 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 { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleValue.class, metaDataMap); + } + + public TDoubleValue() { + } + + /** + * Performs a deep copy on other. + */ + public TDoubleValue(TDoubleValue other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TDoubleValue deepCopy() { + return new TDoubleValue(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0.0; + } + + public double getValue() { + return this.value; + } + + public void setValue(double value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((java.lang.Double)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TDoubleValue) + return this.equals((TDoubleValue)that); + return false; + } + + public boolean equals(TDoubleValue that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); + + return hashCode; + } + + @Override + public int compareTo(TDoubleValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TDoubleValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TDoubleValueStandardScheme getScheme() { + return new TDoubleValueStandardScheme(); + } + } + + private static class TDoubleValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.value = iprot.readDouble(); + struct.setValueIsSet(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, TDoubleValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeDouble(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TDoubleValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TDoubleValueTupleScheme getScheme() { + return new TDoubleValueTupleScheme(); + } + } + + private static class TDoubleValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeDouble(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readDouble(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java new file mode 100644 index 000000000000..4a935d8378aa --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java @@ -0,0 +1,840 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq"); + + 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 STATEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("statement", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CONF_OVERLAY_FIELD_DESC = new org.apache.thrift.protocol.TField("confOverlay", org.apache.thrift.protocol.TType.MAP, (short)3); + private static final org.apache.thrift.protocol.TField RUN_ASYNC_FIELD_DESC = new org.apache.thrift.protocol.TField("runAsync", org.apache.thrift.protocol.TType.BOOL, (short)4); + private static final org.apache.thrift.protocol.TField QUERY_TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("queryTimeout", org.apache.thrift.protocol.TType.I64, (short)5); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExecuteStatementReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExecuteStatementReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String statement; // required + private @org.apache.thrift.annotation.Nullable java.util.Map confOverlay; // optional + private boolean runAsync; // optional + private long queryTimeout; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + STATEMENT((short)2, "statement"), + CONF_OVERLAY((short)3, "confOverlay"), + RUN_ASYNC((short)4, "runAsync"), + QUERY_TIMEOUT((short)5, "queryTimeout"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // STATEMENT + return STATEMENT; + case 3: // CONF_OVERLAY + return CONF_OVERLAY; + case 4: // RUN_ASYNC + return RUN_ASYNC; + case 5: // QUERY_TIMEOUT + return QUERY_TIMEOUT; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __RUNASYNC_ISSET_ID = 0; + private static final int __QUERYTIMEOUT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC,_Fields.QUERY_TIMEOUT}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CONF_OVERLAY, new org.apache.thrift.meta_data.FieldMetaData("confOverlay", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.RUN_ASYNC, new org.apache.thrift.meta_data.FieldMetaData("runAsync", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.QUERY_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("queryTimeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap); + } + + public TExecuteStatementReq() { + this.runAsync = false; + + this.queryTimeout = 0L; + + } + + public TExecuteStatementReq( + TSessionHandle sessionHandle, + java.lang.String statement) + { + this(); + this.sessionHandle = sessionHandle; + this.statement = statement; + } + + /** + * Performs a deep copy on other. + */ + public TExecuteStatementReq(TExecuteStatementReq other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetStatement()) { + this.statement = other.statement; + } + if (other.isSetConfOverlay()) { + java.util.Map __this__confOverlay = new java.util.HashMap(other.confOverlay); + this.confOverlay = __this__confOverlay; + } + this.runAsync = other.runAsync; + this.queryTimeout = other.queryTimeout; + } + + public TExecuteStatementReq deepCopy() { + return new TExecuteStatementReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.statement = null; + this.confOverlay = null; + this.runAsync = false; + + this.queryTimeout = 0L; + + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getStatement() { + return this.statement; + } + + public void setStatement(@org.apache.thrift.annotation.Nullable java.lang.String statement) { + this.statement = statement; + } + + public void unsetStatement() { + this.statement = null; + } + + /** Returns true if field statement is set (has been assigned a value) and false otherwise */ + public boolean isSetStatement() { + return this.statement != null; + } + + public void setStatementIsSet(boolean value) { + if (!value) { + this.statement = null; + } + } + + public int getConfOverlaySize() { + return (this.confOverlay == null) ? 0 : this.confOverlay.size(); + } + + public void putToConfOverlay(java.lang.String key, java.lang.String val) { + if (this.confOverlay == null) { + this.confOverlay = new java.util.HashMap(); + } + this.confOverlay.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfOverlay() { + return this.confOverlay; + } + + public void setConfOverlay(@org.apache.thrift.annotation.Nullable java.util.Map confOverlay) { + this.confOverlay = confOverlay; + } + + public void unsetConfOverlay() { + this.confOverlay = null; + } + + /** Returns true if field confOverlay is set (has been assigned a value) and false otherwise */ + public boolean isSetConfOverlay() { + return this.confOverlay != null; + } + + public void setConfOverlayIsSet(boolean value) { + if (!value) { + this.confOverlay = null; + } + } + + public boolean isRunAsync() { + return this.runAsync; + } + + public void setRunAsync(boolean runAsync) { + this.runAsync = runAsync; + setRunAsyncIsSet(true); + } + + public void unsetRunAsync() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + } + + /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */ + public boolean isSetRunAsync() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + } + + public void setRunAsyncIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); + } + + public long getQueryTimeout() { + return this.queryTimeout; + } + + public void setQueryTimeout(long queryTimeout) { + this.queryTimeout = queryTimeout; + setQueryTimeoutIsSet(true); + } + + public void unsetQueryTimeout() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + } + + /** Returns true if field queryTimeout is set (has been assigned a value) and false otherwise */ + public boolean isSetQueryTimeout() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + } + + public void setQueryTimeoutIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case STATEMENT: + if (value == null) { + unsetStatement(); + } else { + setStatement((java.lang.String)value); + } + break; + + case CONF_OVERLAY: + if (value == null) { + unsetConfOverlay(); + } else { + setConfOverlay((java.util.Map)value); + } + break; + + case RUN_ASYNC: + if (value == null) { + unsetRunAsync(); + } else { + setRunAsync((java.lang.Boolean)value); + } + break; + + case QUERY_TIMEOUT: + if (value == null) { + unsetQueryTimeout(); + } else { + setQueryTimeout((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case STATEMENT: + return getStatement(); + + case CONF_OVERLAY: + return getConfOverlay(); + + case RUN_ASYNC: + return isRunAsync(); + + case QUERY_TIMEOUT: + return getQueryTimeout(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case STATEMENT: + return isSetStatement(); + case CONF_OVERLAY: + return isSetConfOverlay(); + case RUN_ASYNC: + return isSetRunAsync(); + case QUERY_TIMEOUT: + return isSetQueryTimeout(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TExecuteStatementReq) + return this.equals((TExecuteStatementReq)that); + return false; + } + + public boolean equals(TExecuteStatementReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_statement = true && this.isSetStatement(); + boolean that_present_statement = true && that.isSetStatement(); + if (this_present_statement || that_present_statement) { + if (!(this_present_statement && that_present_statement)) + return false; + if (!this.statement.equals(that.statement)) + return false; + } + + boolean this_present_confOverlay = true && this.isSetConfOverlay(); + boolean that_present_confOverlay = true && that.isSetConfOverlay(); + if (this_present_confOverlay || that_present_confOverlay) { + if (!(this_present_confOverlay && that_present_confOverlay)) + return false; + if (!this.confOverlay.equals(that.confOverlay)) + return false; + } + + boolean this_present_runAsync = true && this.isSetRunAsync(); + boolean that_present_runAsync = true && that.isSetRunAsync(); + if (this_present_runAsync || that_present_runAsync) { + if (!(this_present_runAsync && that_present_runAsync)) + return false; + if (this.runAsync != that.runAsync) + return false; + } + + boolean this_present_queryTimeout = true && this.isSetQueryTimeout(); + boolean that_present_queryTimeout = true && that.isSetQueryTimeout(); + if (this_present_queryTimeout || that_present_queryTimeout) { + if (!(this_present_queryTimeout && that_present_queryTimeout)) + return false; + if (this.queryTimeout != that.queryTimeout) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetStatement()) ? 131071 : 524287); + if (isSetStatement()) + hashCode = hashCode * 8191 + statement.hashCode(); + + hashCode = hashCode * 8191 + ((isSetConfOverlay()) ? 131071 : 524287); + if (isSetConfOverlay()) + hashCode = hashCode * 8191 + confOverlay.hashCode(); + + hashCode = hashCode * 8191 + ((isSetRunAsync()) ? 131071 : 524287); + if (isSetRunAsync()) + hashCode = hashCode * 8191 + ((runAsync) ? 131071 : 524287); + + hashCode = hashCode * 8191 + ((isSetQueryTimeout()) ? 131071 : 524287); + if (isSetQueryTimeout()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(queryTimeout); + + return hashCode; + } + + @Override + public int compareTo(TExecuteStatementReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatement()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statement, other.statement); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfOverlay()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.confOverlay, other.confOverlay); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRunAsync()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runAsync, other.runAsync); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryTimeout()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryTimeout, other.queryTimeout); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementReq("); + 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("statement:"); + if (this.statement == null) { + sb.append("null"); + } else { + sb.append(this.statement); + } + first = false; + if (isSetConfOverlay()) { + if (!first) sb.append(", "); + sb.append("confOverlay:"); + if (this.confOverlay == null) { + sb.append("null"); + } else { + sb.append(this.confOverlay); + } + first = false; + } + if (isSetRunAsync()) { + if (!first) sb.append(", "); + sb.append("runAsync:"); + sb.append(this.runAsync); + first = false; + } + if (isSetQueryTimeout()) { + if (!first) sb.append(", "); + sb.append("queryTimeout:"); + sb.append(this.queryTimeout); + 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 (!isSetStatement()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TExecuteStatementReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TExecuteStatementReqStandardScheme getScheme() { + return new TExecuteStatementReqStandardScheme(); + } + } + + private static class TExecuteStatementReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq 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: // STATEMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.statement = iprot.readString(); + struct.setStatementIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CONF_OVERLAY + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map172 = iprot.readMapBegin(); + struct.confOverlay = new java.util.HashMap(2*_map172.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key173; + @org.apache.thrift.annotation.Nullable java.lang.String _val174; + for (int _i175 = 0; _i175 < _map172.size; ++_i175) + { + _key173 = iprot.readString(); + _val174 = iprot.readString(); + struct.confOverlay.put(_key173, _val174); + } + iprot.readMapEnd(); + } + struct.setConfOverlayIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // RUN_ASYNC + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.runAsync = iprot.readBool(); + struct.setRunAsyncIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // QUERY_TIMEOUT + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.queryTimeout = iprot.readI64(); + struct.setQueryTimeoutIsSet(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, TExecuteStatementReq 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.statement != null) { + oprot.writeFieldBegin(STATEMENT_FIELD_DESC); + oprot.writeString(struct.statement); + oprot.writeFieldEnd(); + } + if (struct.confOverlay != null) { + if (struct.isSetConfOverlay()) { + oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); + for (java.util.Map.Entry _iter176 : struct.confOverlay.entrySet()) + { + oprot.writeString(_iter176.getKey()); + oprot.writeString(_iter176.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.isSetRunAsync()) { + oprot.writeFieldBegin(RUN_ASYNC_FIELD_DESC); + oprot.writeBool(struct.runAsync); + oprot.writeFieldEnd(); + } + if (struct.isSetQueryTimeout()) { + oprot.writeFieldBegin(QUERY_TIMEOUT_FIELD_DESC); + oprot.writeI64(struct.queryTimeout); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TExecuteStatementReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TExecuteStatementReqTupleScheme getScheme() { + return new TExecuteStatementReqTupleScheme(); + } + } + + private static class TExecuteStatementReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.statement); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetConfOverlay()) { + optionals.set(0); + } + if (struct.isSetRunAsync()) { + optionals.set(1); + } + if (struct.isSetQueryTimeout()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetConfOverlay()) { + { + oprot.writeI32(struct.confOverlay.size()); + for (java.util.Map.Entry _iter177 : struct.confOverlay.entrySet()) + { + oprot.writeString(_iter177.getKey()); + oprot.writeString(_iter177.getValue()); + } + } + } + if (struct.isSetRunAsync()) { + oprot.writeBool(struct.runAsync); + } + if (struct.isSetQueryTimeout()) { + oprot.writeI64(struct.queryTimeout); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.statement = iprot.readString(); + struct.setStatementIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.confOverlay = new java.util.HashMap(2*_map178.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key179; + @org.apache.thrift.annotation.Nullable java.lang.String _val180; + for (int _i181 = 0; _i181 < _map178.size; ++_i181) + { + _key179 = iprot.readString(); + _val180 = iprot.readString(); + struct.confOverlay.put(_key179, _val180); + } + } + struct.setConfOverlayIsSet(true); + } + if (incoming.get(1)) { + struct.runAsync = iprot.readBool(); + struct.setRunAsyncIsSet(true); + } + if (incoming.get(2)) { + struct.queryTimeout = iprot.readI64(); + struct.setQueryTimeoutIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java new file mode 100644 index 000000000000..47e1321e05b7 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExecuteStatementRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExecuteStatementRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementResp.class, metaDataMap); + } + + public TExecuteStatementResp() { + } + + public TExecuteStatementResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TExecuteStatementResp(TExecuteStatementResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TExecuteStatementResp deepCopy() { + return new TExecuteStatementResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TExecuteStatementResp) + return this.equals((TExecuteStatementResp)that); + return false; + } + + public boolean equals(TExecuteStatementResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TExecuteStatementResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TExecuteStatementRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TExecuteStatementRespStandardScheme getScheme() { + return new TExecuteStatementRespStandardScheme(); + } + } + + private static class TExecuteStatementRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementResp 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; + 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, TExecuteStatementResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TExecuteStatementRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TExecuteStatementRespTupleScheme getScheme() { + return new TExecuteStatementRespTupleScheme(); + } + } + + private static class TExecuteStatementRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java new file mode 100644 index 000000000000..2219f27445a6 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java @@ -0,0 +1,55 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TFetchOrientation implements org.apache.thrift.TEnum { + FETCH_NEXT(0), + FETCH_PRIOR(1), + FETCH_RELATIVE(2), + FETCH_ABSOLUTE(3), + FETCH_FIRST(4), + FETCH_LAST(5); + + private final int value; + + private TFetchOrientation(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TFetchOrientation findByValue(int value) { + switch (value) { + case 0: + return FETCH_NEXT; + case 1: + return FETCH_PRIOR; + case 2: + return FETCH_RELATIVE; + case 3: + return FETCH_ABSOLUTE; + case 4: + return FETCH_FIRST; + case 5: + return FETCH_LAST; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java new file mode 100644 index 000000000000..4de4a139b03b --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java @@ -0,0 +1,689 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq"); + + 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)1); + private static final org.apache.thrift.protocol.TField ORIENTATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orientation", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRows", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField FETCH_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchType", org.apache.thrift.protocol.TType.I16, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFetchResultsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFetchResultsReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required + private @org.apache.thrift.annotation.Nullable TFetchOrientation orientation; // required + private long maxRows; // required + private short fetchType; // 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 { + OPERATION_HANDLE((short)1, "operationHandle"), + /** + * + * @see TFetchOrientation + */ + ORIENTATION((short)2, "orientation"), + MAX_ROWS((short)3, "maxRows"), + FETCH_TYPE((short)4, "fetchType"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // OPERATION_HANDLE + return OPERATION_HANDLE; + case 2: // ORIENTATION + return ORIENTATION; + case 3: // MAX_ROWS + return MAX_ROWS; + case 4: // FETCH_TYPE + return FETCH_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __MAXROWS_ISSET_ID = 0; + private static final int __FETCHTYPE_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.FETCH_TYPE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFetchOrientation.class))); + tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("maxRows", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap); + } + + public TFetchResultsReq() { + this.orientation = org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation.FETCH_NEXT; + + this.fetchType = (short)0; + + } + + public TFetchResultsReq( + TOperationHandle operationHandle, + TFetchOrientation orientation, + long maxRows) + { + this(); + this.operationHandle = operationHandle; + this.orientation = orientation; + this.maxRows = maxRows; + setMaxRowsIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TFetchResultsReq(TFetchResultsReq other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + if (other.isSetOrientation()) { + this.orientation = other.orientation; + } + this.maxRows = other.maxRows; + this.fetchType = other.fetchType; + } + + public TFetchResultsReq deepCopy() { + return new TFetchResultsReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + this.orientation = org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation.FETCH_NEXT; + + setMaxRowsIsSet(false); + this.maxRows = 0; + this.fetchType = (short)0; + + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + /** + * + * @see TFetchOrientation + */ + @org.apache.thrift.annotation.Nullable + public TFetchOrientation getOrientation() { + return this.orientation; + } + + /** + * + * @see TFetchOrientation + */ + public void setOrientation(@org.apache.thrift.annotation.Nullable TFetchOrientation orientation) { + this.orientation = orientation; + } + + public void unsetOrientation() { + this.orientation = null; + } + + /** Returns true if field orientation is set (has been assigned a value) and false otherwise */ + public boolean isSetOrientation() { + return this.orientation != null; + } + + public void setOrientationIsSet(boolean value) { + if (!value) { + this.orientation = null; + } + } + + public long getMaxRows() { + return this.maxRows; + } + + public void setMaxRows(long maxRows) { + this.maxRows = maxRows; + setMaxRowsIsSet(true); + } + + public void unsetMaxRows() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); + } + + /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */ + public boolean isSetMaxRows() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); + } + + public void setMaxRowsIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); + } + + public short getFetchType() { + return this.fetchType; + } + + public void setFetchType(short fetchType) { + this.fetchType = fetchType; + setFetchTypeIsSet(true); + } + + public void unsetFetchType() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + } + + /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */ + public boolean isSetFetchType() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + } + + public void setFetchTypeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + case ORIENTATION: + if (value == null) { + unsetOrientation(); + } else { + setOrientation((TFetchOrientation)value); + } + break; + + case MAX_ROWS: + if (value == null) { + unsetMaxRows(); + } else { + setMaxRows((java.lang.Long)value); + } + break; + + case FETCH_TYPE: + if (value == null) { + unsetFetchType(); + } else { + setFetchType((java.lang.Short)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + case ORIENTATION: + return getOrientation(); + + case MAX_ROWS: + return getMaxRows(); + + case FETCH_TYPE: + return getFetchType(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OPERATION_HANDLE: + return isSetOperationHandle(); + case ORIENTATION: + return isSetOrientation(); + case MAX_ROWS: + return isSetMaxRows(); + case FETCH_TYPE: + return isSetFetchType(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TFetchResultsReq) + return this.equals((TFetchResultsReq)that); + return false; + } + + public boolean equals(TFetchResultsReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_orientation = true && this.isSetOrientation(); + boolean that_present_orientation = true && that.isSetOrientation(); + if (this_present_orientation || that_present_orientation) { + if (!(this_present_orientation && that_present_orientation)) + return false; + if (!this.orientation.equals(that.orientation)) + return false; + } + + boolean this_present_maxRows = true; + boolean that_present_maxRows = true; + if (this_present_maxRows || that_present_maxRows) { + if (!(this_present_maxRows && that_present_maxRows)) + return false; + if (this.maxRows != that.maxRows) + return false; + } + + boolean this_present_fetchType = true && this.isSetFetchType(); + boolean that_present_fetchType = true && that.isSetFetchType(); + if (this_present_fetchType || that_present_fetchType) { + if (!(this_present_fetchType && that_present_fetchType)) + return false; + if (this.fetchType != that.fetchType) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOrientation()) ? 131071 : 524287); + if (isSetOrientation()) + hashCode = hashCode * 8191 + orientation.getValue(); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(maxRows); + + hashCode = hashCode * 8191 + ((isSetFetchType()) ? 131071 : 524287); + if (isSetFetchType()) + hashCode = hashCode * 8191 + fetchType; + + return hashCode; + } + + @Override + public int compareTo(TFetchResultsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOrientation()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orientation, other.orientation); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMaxRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRows, other.maxRows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFetchType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchType, other.fetchType); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsReq("); + boolean first = true; + + sb.append("operationHandle:"); + if (this.operationHandle == null) { + sb.append("null"); + } else { + sb.append(this.operationHandle); + } + first = false; + if (!first) sb.append(", "); + sb.append("orientation:"); + if (this.orientation == null) { + sb.append("null"); + } else { + sb.append(this.orientation); + } + first = false; + if (!first) sb.append(", "); + sb.append("maxRows:"); + sb.append(this.maxRows); + first = false; + if (isSetFetchType()) { + if (!first) sb.append(", "); + sb.append("fetchType:"); + sb.append(this.fetchType); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + if (!isSetOrientation()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'orientation' is unset! Struct:" + toString()); + } + + if (!isSetMaxRows()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'maxRows' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TFetchResultsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TFetchResultsReqStandardScheme getScheme() { + return new TFetchResultsReqStandardScheme(); + } + } + + private static class TFetchResultsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq 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: // 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 2: // ORIENTATION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.orientation = org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation.findByValue(iprot.readI32()); + struct.setOrientationIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // MAX_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.maxRows = iprot.readI64(); + struct.setMaxRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // FETCH_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.fetchType = iprot.readI16(); + struct.setFetchTypeIsSet(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, TFetchResultsReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.orientation != null) { + oprot.writeFieldBegin(ORIENTATION_FIELD_DESC); + oprot.writeI32(struct.orientation.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC); + oprot.writeI64(struct.maxRows); + oprot.writeFieldEnd(); + if (struct.isSetFetchType()) { + oprot.writeFieldBegin(FETCH_TYPE_FIELD_DESC); + oprot.writeI16(struct.fetchType); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TFetchResultsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TFetchResultsReqTupleScheme getScheme() { + return new TFetchResultsReqTupleScheme(); + } + } + + private static class TFetchResultsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle.write(oprot); + oprot.writeI32(struct.orientation.getValue()); + oprot.writeI64(struct.maxRows); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetFetchType()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFetchType()) { + oprot.writeI16(struct.fetchType); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + struct.orientation = org.apache.spark.sql.thriftserver.cli.thrift.TFetchOrientation.findByValue(iprot.readI32()); + struct.setOrientationIsSet(true); + struct.maxRows = iprot.readI64(); + struct.setMaxRowsIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fetchType = iprot.readI16(); + struct.setFetchTypeIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java new file mode 100644 index 000000000000..449358755663 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java @@ -0,0 +1,590 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsResp"); + + 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 HAS_MORE_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMoreRows", org.apache.thrift.protocol.TType.BOOL, (short)2); + private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.STRUCT, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TFetchResultsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TFetchResultsRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private boolean hasMoreRows; // optional + private @org.apache.thrift.annotation.Nullable TRowSet results; // 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"), + HAS_MORE_ROWS((short)2, "hasMoreRows"), + RESULTS((short)3, "results"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + case 2: // HAS_MORE_ROWS + return HAS_MORE_ROWS; + case 3: // RESULTS + return RESULTS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __HASMOREROWS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.HAS_MORE_ROWS,_Fields.RESULTS}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.HAS_MORE_ROWS, new org.apache.thrift.meta_data.FieldMetaData("hasMoreRows", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsResp.class, metaDataMap); + } + + public TFetchResultsResp() { + } + + public TFetchResultsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TFetchResultsResp(TFetchResultsResp other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + this.hasMoreRows = other.hasMoreRows; + if (other.isSetResults()) { + this.results = new TRowSet(other.results); + } + } + + public TFetchResultsResp deepCopy() { + return new TFetchResultsResp(this); + } + + @Override + public void clear() { + this.status = null; + setHasMoreRowsIsSet(false); + this.hasMoreRows = false; + this.results = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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 boolean isHasMoreRows() { + return this.hasMoreRows; + } + + public void setHasMoreRows(boolean hasMoreRows) { + this.hasMoreRows = hasMoreRows; + setHasMoreRowsIsSet(true); + } + + public void unsetHasMoreRows() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + } + + /** Returns true if field hasMoreRows is set (has been assigned a value) and false otherwise */ + public boolean isSetHasMoreRows() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + } + + public void setHasMoreRowsIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); + } + + @org.apache.thrift.annotation.Nullable + public TRowSet getResults() { + return this.results; + } + + public void setResults(@org.apache.thrift.annotation.Nullable TRowSet results) { + this.results = results; + } + + public void unsetResults() { + this.results = null; + } + + /** Returns true if field results is set (has been assigned a value) and false otherwise */ + public boolean isSetResults() { + return this.results != null; + } + + public void setResultsIsSet(boolean value) { + if (!value) { + this.results = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case HAS_MORE_ROWS: + if (value == null) { + unsetHasMoreRows(); + } else { + setHasMoreRows((java.lang.Boolean)value); + } + break; + + case RESULTS: + if (value == null) { + unsetResults(); + } else { + setResults((TRowSet)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case HAS_MORE_ROWS: + return isHasMoreRows(); + + case RESULTS: + return getResults(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case HAS_MORE_ROWS: + return isSetHasMoreRows(); + case RESULTS: + return isSetResults(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TFetchResultsResp) + return this.equals((TFetchResultsResp)that); + return false; + } + + public boolean equals(TFetchResultsResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_hasMoreRows = true && this.isSetHasMoreRows(); + boolean that_present_hasMoreRows = true && that.isSetHasMoreRows(); + if (this_present_hasMoreRows || that_present_hasMoreRows) { + if (!(this_present_hasMoreRows && that_present_hasMoreRows)) + return false; + if (this.hasMoreRows != that.hasMoreRows) + return false; + } + + boolean this_present_results = true && this.isSetResults(); + boolean that_present_results = true && that.isSetResults(); + if (this_present_results || that_present_results) { + if (!(this_present_results && that_present_results)) + return false; + if (!this.results.equals(that.results)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetHasMoreRows()) ? 131071 : 524287); + if (isSetHasMoreRows()) + hashCode = hashCode * 8191 + ((hasMoreRows) ? 131071 : 524287); + + hashCode = hashCode * 8191 + ((isSetResults()) ? 131071 : 524287); + if (isSetResults()) + hashCode = hashCode * 8191 + results.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TFetchResultsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasMoreRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMoreRows, other.hasMoreRows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetResults()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.results, other.results); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetHasMoreRows()) { + if (!first) sb.append(", "); + sb.append("hasMoreRows:"); + sb.append(this.hasMoreRows); + first = false; + } + if (isSetResults()) { + if (!first) sb.append(", "); + sb.append("results:"); + if (this.results == null) { + sb.append("null"); + } else { + sb.append(this.results); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (results != null) { + results.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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TFetchResultsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TFetchResultsRespStandardScheme getScheme() { + return new TFetchResultsRespStandardScheme(); + } + } + + private static class TFetchResultsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsResp 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: // HAS_MORE_ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasMoreRows = iprot.readBool(); + struct.setHasMoreRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RESULTS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.results = new TRowSet(); + struct.results.read(iprot); + struct.setResultsIsSet(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, TFetchResultsResp 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.isSetHasMoreRows()) { + oprot.writeFieldBegin(HAS_MORE_ROWS_FIELD_DESC); + oprot.writeBool(struct.hasMoreRows); + oprot.writeFieldEnd(); + } + if (struct.results != null) { + if (struct.isSetResults()) { + oprot.writeFieldBegin(RESULTS_FIELD_DESC); + struct.results.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TFetchResultsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TFetchResultsRespTupleScheme getScheme() { + return new TFetchResultsRespTupleScheme(); + } + } + + private static class TFetchResultsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetHasMoreRows()) { + optionals.set(0); + } + if (struct.isSetResults()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetHasMoreRows()) { + oprot.writeBool(struct.hasMoreRows); + } + if (struct.isSetResults()) { + struct.results.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.hasMoreRows = iprot.readBool(); + struct.setHasMoreRowsIsSet(true); + } + if (incoming.get(1)) { + struct.results = new TRowSet(); + struct.results.read(iprot); + struct.setResultsIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java new file mode 100644 index 000000000000..5c69d3dcc23d --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsReq"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsReq.class, metaDataMap); + } + + public TGetCatalogsReq() { + } + + public TGetCatalogsReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetCatalogsReq(TGetCatalogsReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TGetCatalogsReq deepCopy() { + return new TGetCatalogsReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetCatalogsReq) + return this.equals((TGetCatalogsReq)that); + return false; + } + + public boolean equals(TGetCatalogsReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetCatalogsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetCatalogsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCatalogsReqStandardScheme getScheme() { + return new TGetCatalogsReqStandardScheme(); + } + } + + private static class TGetCatalogsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsReq 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; + 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, TGetCatalogsReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCatalogsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCatalogsReqTupleScheme getScheme() { + return new TGetCatalogsReqTupleScheme(); + } + } + + private static class TGetCatalogsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java new file mode 100644 index 000000000000..40fa7bd0c6bd --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsResp.class, metaDataMap); + } + + public TGetCatalogsResp() { + } + + public TGetCatalogsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetCatalogsResp(TGetCatalogsResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetCatalogsResp deepCopy() { + return new TGetCatalogsResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetCatalogsResp) + return this.equals((TGetCatalogsResp)that); + return false; + } + + public boolean equals(TGetCatalogsResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetCatalogsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetCatalogsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCatalogsRespStandardScheme getScheme() { + return new TGetCatalogsRespStandardScheme(); + } + } + + private static class TGetCatalogsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsResp 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; + 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, TGetCatalogsResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCatalogsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCatalogsRespTupleScheme getScheme() { + return new TGetCatalogsRespTupleScheme(); + } + } + + private static class TGetCatalogsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java new file mode 100644 index 000000000000..b457575597f5 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java @@ -0,0 +1,801 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)5); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetColumnsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetColumnsReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + TABLE_NAME((short)4, "tableName"), + COLUMN_NAME((short)5, "columnName"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // TABLE_NAME + return TABLE_NAME; + case 5: // COLUMN_NAME + return COLUMN_NAME; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap); + } + + public TGetColumnsReq() { + } + + public TGetColumnsReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetColumnsReq(TGetColumnsReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetColumnName()) { + this.columnName = other.columnName; + } + } + + public TGetColumnsReq deepCopy() { + return new TGetColumnsReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.tableName = null; + this.columnName = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getTableName() { + return this.tableName; + } + + public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { + this.tableName = tableName; + } + + public void unsetTableName() { + this.tableName = null; + } + + /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableName() { + return this.tableName != null; + } + + public void setTableNameIsSet(boolean value) { + if (!value) { + this.tableName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getColumnName() { + return this.columnName; + } + + public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { + this.columnName = columnName; + } + + public void unsetColumnName() { + this.columnName = null; + } + + /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnName() { + return this.columnName != null; + } + + public void setColumnNameIsSet(boolean value) { + if (!value) { + this.columnName = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((java.lang.String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((java.lang.String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((java.lang.String)value); + } + break; + + case COLUMN_NAME: + if (value == null) { + unsetColumnName(); + } else { + setColumnName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case TABLE_NAME: + return getTableName(); + + case COLUMN_NAME: + return getColumnName(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case TABLE_NAME: + return isSetTableName(); + case COLUMN_NAME: + return isSetColumnName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetColumnsReq) + return this.equals((TGetColumnsReq)that); + return false; + } + + public boolean equals(TGetColumnsReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_tableName = true && this.isSetTableName(); + boolean that_present_tableName = true && that.isSetTableName(); + if (this_present_tableName || that_present_tableName) { + if (!(this_present_tableName && that_present_tableName)) + return false; + if (!this.tableName.equals(that.tableName)) + return false; + } + + boolean this_present_columnName = true && this.isSetColumnName(); + boolean that_present_columnName = true && that.isSetColumnName(); + if (this_present_columnName || that_present_columnName) { + if (!(this_present_columnName && that_present_columnName)) + return false; + if (!this.columnName.equals(that.columnName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); + if (isSetTableName()) + hashCode = hashCode * 8191 + tableName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); + if (isSetColumnName()) + hashCode = hashCode * 8191 + columnName.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetColumnsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (isSetTableName()) { + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + sb.append(this.tableName); + } + first = false; + } + if (isSetColumnName()) { + if (!first) sb.append(", "); + sb.append("columnName:"); + if (this.columnName == null) { + sb.append("null"); + } else { + sb.append(this.columnName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetColumnsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetColumnsReqStandardScheme getScheme() { + return new TGetColumnsReqStandardScheme(); + } + } + + private static class TGetColumnsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COLUMN_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(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, TGetColumnsReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.tableName != null) { + if (struct.isSetTableName()) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.tableName); + oprot.writeFieldEnd(); + } + } + if (struct.columnName != null) { + if (struct.isSetColumnName()) { + oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); + oprot.writeString(struct.columnName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetColumnsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetColumnsReqTupleScheme getScheme() { + return new TGetColumnsReqTupleScheme(); + } + } + + private static class TGetColumnsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + if (struct.isSetTableName()) { + optionals.set(2); + } + if (struct.isSetColumnName()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + if (struct.isSetTableName()) { + oprot.writeString(struct.tableName); + } + if (struct.isSetColumnName()) { + oprot.writeString(struct.columnName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } + if (incoming.get(3)) { + struct.columnName = iprot.readString(); + struct.setColumnNameIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java new file mode 100644 index 000000000000..01758dc977bd --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetColumnsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetColumnsRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsResp.class, metaDataMap); + } + + public TGetColumnsResp() { + } + + public TGetColumnsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetColumnsResp(TGetColumnsResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetColumnsResp deepCopy() { + return new TGetColumnsResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetColumnsResp) + return this.equals((TGetColumnsResp)that); + return false; + } + + public boolean equals(TGetColumnsResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetColumnsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetColumnsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetColumnsRespStandardScheme getScheme() { + return new TGetColumnsRespStandardScheme(); + } + } + + private static class TGetColumnsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsResp 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; + 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, TGetColumnsResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetColumnsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetColumnsRespTupleScheme getScheme() { + return new TGetColumnsRespTupleScheme(); + } + } + + private static class TGetColumnsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java new file mode 100644 index 000000000000..685963bcc26b --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java @@ -0,0 +1,1013 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetCrossReferenceReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceReq"); + + 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 PARENT_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentCatalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PARENT_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentSchemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField PARENT_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentTableName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField FOREIGN_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignCatalogName", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField FOREIGN_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignSchemaName", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField FOREIGN_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignTableName", org.apache.thrift.protocol.TType.STRING, (short)7); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCrossReferenceReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCrossReferenceReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String parentTableName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String foreignTableName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + PARENT_CATALOG_NAME((short)2, "parentCatalogName"), + PARENT_SCHEMA_NAME((short)3, "parentSchemaName"), + PARENT_TABLE_NAME((short)4, "parentTableName"), + FOREIGN_CATALOG_NAME((short)5, "foreignCatalogName"), + FOREIGN_SCHEMA_NAME((short)6, "foreignSchemaName"), + FOREIGN_TABLE_NAME((short)7, "foreignTableName"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // PARENT_CATALOG_NAME + return PARENT_CATALOG_NAME; + case 3: // PARENT_SCHEMA_NAME + return PARENT_SCHEMA_NAME; + case 4: // PARENT_TABLE_NAME + return PARENT_TABLE_NAME; + case 5: // FOREIGN_CATALOG_NAME + return FOREIGN_CATALOG_NAME; + case 6: // FOREIGN_SCHEMA_NAME + return FOREIGN_SCHEMA_NAME; + case 7: // FOREIGN_TABLE_NAME + return FOREIGN_TABLE_NAME; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.PARENT_CATALOG_NAME,_Fields.PARENT_SCHEMA_NAME,_Fields.PARENT_TABLE_NAME,_Fields.FOREIGN_CATALOG_NAME,_Fields.FOREIGN_SCHEMA_NAME,_Fields.FOREIGN_TABLE_NAME}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.PARENT_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.PARENT_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.PARENT_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.FOREIGN_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.FOREIGN_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.FOREIGN_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceReq.class, metaDataMap); + } + + public TGetCrossReferenceReq() { + } + + public TGetCrossReferenceReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetCrossReferenceReq(TGetCrossReferenceReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetParentCatalogName()) { + this.parentCatalogName = other.parentCatalogName; + } + if (other.isSetParentSchemaName()) { + this.parentSchemaName = other.parentSchemaName; + } + if (other.isSetParentTableName()) { + this.parentTableName = other.parentTableName; + } + if (other.isSetForeignCatalogName()) { + this.foreignCatalogName = other.foreignCatalogName; + } + if (other.isSetForeignSchemaName()) { + this.foreignSchemaName = other.foreignSchemaName; + } + if (other.isSetForeignTableName()) { + this.foreignTableName = other.foreignTableName; + } + } + + public TGetCrossReferenceReq deepCopy() { + return new TGetCrossReferenceReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.parentCatalogName = null; + this.parentSchemaName = null; + this.parentTableName = null; + this.foreignCatalogName = null; + this.foreignSchemaName = null; + this.foreignTableName = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getParentCatalogName() { + return this.parentCatalogName; + } + + public void setParentCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName) { + this.parentCatalogName = parentCatalogName; + } + + public void unsetParentCatalogName() { + this.parentCatalogName = null; + } + + /** Returns true if field parentCatalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetParentCatalogName() { + return this.parentCatalogName != null; + } + + public void setParentCatalogNameIsSet(boolean value) { + if (!value) { + this.parentCatalogName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getParentSchemaName() { + return this.parentSchemaName; + } + + public void setParentSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName) { + this.parentSchemaName = parentSchemaName; + } + + public void unsetParentSchemaName() { + this.parentSchemaName = null; + } + + /** Returns true if field parentSchemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetParentSchemaName() { + return this.parentSchemaName != null; + } + + public void setParentSchemaNameIsSet(boolean value) { + if (!value) { + this.parentSchemaName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getParentTableName() { + return this.parentTableName; + } + + public void setParentTableName(@org.apache.thrift.annotation.Nullable java.lang.String parentTableName) { + this.parentTableName = parentTableName; + } + + public void unsetParentTableName() { + this.parentTableName = null; + } + + /** Returns true if field parentTableName is set (has been assigned a value) and false otherwise */ + public boolean isSetParentTableName() { + return this.parentTableName != null; + } + + public void setParentTableNameIsSet(boolean value) { + if (!value) { + this.parentTableName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getForeignCatalogName() { + return this.foreignCatalogName; + } + + public void setForeignCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName) { + this.foreignCatalogName = foreignCatalogName; + } + + public void unsetForeignCatalogName() { + this.foreignCatalogName = null; + } + + /** Returns true if field foreignCatalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetForeignCatalogName() { + return this.foreignCatalogName != null; + } + + public void setForeignCatalogNameIsSet(boolean value) { + if (!value) { + this.foreignCatalogName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getForeignSchemaName() { + return this.foreignSchemaName; + } + + public void setForeignSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName) { + this.foreignSchemaName = foreignSchemaName; + } + + public void unsetForeignSchemaName() { + this.foreignSchemaName = null; + } + + /** Returns true if field foreignSchemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetForeignSchemaName() { + return this.foreignSchemaName != null; + } + + public void setForeignSchemaNameIsSet(boolean value) { + if (!value) { + this.foreignSchemaName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getForeignTableName() { + return this.foreignTableName; + } + + public void setForeignTableName(@org.apache.thrift.annotation.Nullable java.lang.String foreignTableName) { + this.foreignTableName = foreignTableName; + } + + public void unsetForeignTableName() { + this.foreignTableName = null; + } + + /** Returns true if field foreignTableName is set (has been assigned a value) and false otherwise */ + public boolean isSetForeignTableName() { + return this.foreignTableName != null; + } + + public void setForeignTableNameIsSet(boolean value) { + if (!value) { + this.foreignTableName = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case PARENT_CATALOG_NAME: + if (value == null) { + unsetParentCatalogName(); + } else { + setParentCatalogName((java.lang.String)value); + } + break; + + case PARENT_SCHEMA_NAME: + if (value == null) { + unsetParentSchemaName(); + } else { + setParentSchemaName((java.lang.String)value); + } + break; + + case PARENT_TABLE_NAME: + if (value == null) { + unsetParentTableName(); + } else { + setParentTableName((java.lang.String)value); + } + break; + + case FOREIGN_CATALOG_NAME: + if (value == null) { + unsetForeignCatalogName(); + } else { + setForeignCatalogName((java.lang.String)value); + } + break; + + case FOREIGN_SCHEMA_NAME: + if (value == null) { + unsetForeignSchemaName(); + } else { + setForeignSchemaName((java.lang.String)value); + } + break; + + case FOREIGN_TABLE_NAME: + if (value == null) { + unsetForeignTableName(); + } else { + setForeignTableName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case PARENT_CATALOG_NAME: + return getParentCatalogName(); + + case PARENT_SCHEMA_NAME: + return getParentSchemaName(); + + case PARENT_TABLE_NAME: + return getParentTableName(); + + case FOREIGN_CATALOG_NAME: + return getForeignCatalogName(); + + case FOREIGN_SCHEMA_NAME: + return getForeignSchemaName(); + + case FOREIGN_TABLE_NAME: + return getForeignTableName(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case PARENT_CATALOG_NAME: + return isSetParentCatalogName(); + case PARENT_SCHEMA_NAME: + return isSetParentSchemaName(); + case PARENT_TABLE_NAME: + return isSetParentTableName(); + case FOREIGN_CATALOG_NAME: + return isSetForeignCatalogName(); + case FOREIGN_SCHEMA_NAME: + return isSetForeignSchemaName(); + case FOREIGN_TABLE_NAME: + return isSetForeignTableName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetCrossReferenceReq) + return this.equals((TGetCrossReferenceReq)that); + return false; + } + + public boolean equals(TGetCrossReferenceReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_parentCatalogName = true && this.isSetParentCatalogName(); + boolean that_present_parentCatalogName = true && that.isSetParentCatalogName(); + if (this_present_parentCatalogName || that_present_parentCatalogName) { + if (!(this_present_parentCatalogName && that_present_parentCatalogName)) + return false; + if (!this.parentCatalogName.equals(that.parentCatalogName)) + return false; + } + + boolean this_present_parentSchemaName = true && this.isSetParentSchemaName(); + boolean that_present_parentSchemaName = true && that.isSetParentSchemaName(); + if (this_present_parentSchemaName || that_present_parentSchemaName) { + if (!(this_present_parentSchemaName && that_present_parentSchemaName)) + return false; + if (!this.parentSchemaName.equals(that.parentSchemaName)) + return false; + } + + boolean this_present_parentTableName = true && this.isSetParentTableName(); + boolean that_present_parentTableName = true && that.isSetParentTableName(); + if (this_present_parentTableName || that_present_parentTableName) { + if (!(this_present_parentTableName && that_present_parentTableName)) + return false; + if (!this.parentTableName.equals(that.parentTableName)) + return false; + } + + boolean this_present_foreignCatalogName = true && this.isSetForeignCatalogName(); + boolean that_present_foreignCatalogName = true && that.isSetForeignCatalogName(); + if (this_present_foreignCatalogName || that_present_foreignCatalogName) { + if (!(this_present_foreignCatalogName && that_present_foreignCatalogName)) + return false; + if (!this.foreignCatalogName.equals(that.foreignCatalogName)) + return false; + } + + boolean this_present_foreignSchemaName = true && this.isSetForeignSchemaName(); + boolean that_present_foreignSchemaName = true && that.isSetForeignSchemaName(); + if (this_present_foreignSchemaName || that_present_foreignSchemaName) { + if (!(this_present_foreignSchemaName && that_present_foreignSchemaName)) + return false; + if (!this.foreignSchemaName.equals(that.foreignSchemaName)) + return false; + } + + boolean this_present_foreignTableName = true && this.isSetForeignTableName(); + boolean that_present_foreignTableName = true && that.isSetForeignTableName(); + if (this_present_foreignTableName || that_present_foreignTableName) { + if (!(this_present_foreignTableName && that_present_foreignTableName)) + return false; + if (!this.foreignTableName.equals(that.foreignTableName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetParentCatalogName()) ? 131071 : 524287); + if (isSetParentCatalogName()) + hashCode = hashCode * 8191 + parentCatalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetParentSchemaName()) ? 131071 : 524287); + if (isSetParentSchemaName()) + hashCode = hashCode * 8191 + parentSchemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetParentTableName()) ? 131071 : 524287); + if (isSetParentTableName()) + hashCode = hashCode * 8191 + parentTableName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetForeignCatalogName()) ? 131071 : 524287); + if (isSetForeignCatalogName()) + hashCode = hashCode * 8191 + foreignCatalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetForeignSchemaName()) ? 131071 : 524287); + if (isSetForeignSchemaName()) + hashCode = hashCode * 8191 + foreignSchemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetForeignTableName()) ? 131071 : 524287); + if (isSetForeignTableName()) + hashCode = hashCode * 8191 + foreignTableName.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetCrossReferenceReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentCatalogName, other.parentCatalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentSchemaName, other.parentSchemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentTableName, other.parentTableName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetForeignCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignCatalogName, other.foreignCatalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetForeignSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignSchemaName, other.foreignSchemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetForeignTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignTableName, other.foreignTableName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetParentCatalogName()) { + if (!first) sb.append(", "); + sb.append("parentCatalogName:"); + if (this.parentCatalogName == null) { + sb.append("null"); + } else { + sb.append(this.parentCatalogName); + } + first = false; + } + if (isSetParentSchemaName()) { + if (!first) sb.append(", "); + sb.append("parentSchemaName:"); + if (this.parentSchemaName == null) { + sb.append("null"); + } else { + sb.append(this.parentSchemaName); + } + first = false; + } + if (isSetParentTableName()) { + if (!first) sb.append(", "); + sb.append("parentTableName:"); + if (this.parentTableName == null) { + sb.append("null"); + } else { + sb.append(this.parentTableName); + } + first = false; + } + if (isSetForeignCatalogName()) { + if (!first) sb.append(", "); + sb.append("foreignCatalogName:"); + if (this.foreignCatalogName == null) { + sb.append("null"); + } else { + sb.append(this.foreignCatalogName); + } + first = false; + } + if (isSetForeignSchemaName()) { + if (!first) sb.append(", "); + sb.append("foreignSchemaName:"); + if (this.foreignSchemaName == null) { + sb.append("null"); + } else { + sb.append(this.foreignSchemaName); + } + first = false; + } + if (isSetForeignTableName()) { + if (!first) sb.append(", "); + sb.append("foreignTableName:"); + if (this.foreignTableName == null) { + sb.append("null"); + } else { + sb.append(this.foreignTableName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetCrossReferenceReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCrossReferenceReqStandardScheme getScheme() { + return new TGetCrossReferenceReqStandardScheme(); + } + } + + private static class TGetCrossReferenceReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceReq 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: // PARENT_CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentCatalogName = iprot.readString(); + struct.setParentCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PARENT_SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentSchemaName = iprot.readString(); + struct.setParentSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // PARENT_TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.parentTableName = iprot.readString(); + struct.setParentTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // FOREIGN_CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.foreignCatalogName = iprot.readString(); + struct.setForeignCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // FOREIGN_SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.foreignSchemaName = iprot.readString(); + struct.setForeignSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // FOREIGN_TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.foreignTableName = iprot.readString(); + struct.setForeignTableNameIsSet(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, TGetCrossReferenceReq 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.parentCatalogName != null) { + if (struct.isSetParentCatalogName()) { + oprot.writeFieldBegin(PARENT_CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.parentCatalogName); + oprot.writeFieldEnd(); + } + } + if (struct.parentSchemaName != null) { + if (struct.isSetParentSchemaName()) { + oprot.writeFieldBegin(PARENT_SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.parentSchemaName); + oprot.writeFieldEnd(); + } + } + if (struct.parentTableName != null) { + if (struct.isSetParentTableName()) { + oprot.writeFieldBegin(PARENT_TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.parentTableName); + oprot.writeFieldEnd(); + } + } + if (struct.foreignCatalogName != null) { + if (struct.isSetForeignCatalogName()) { + oprot.writeFieldBegin(FOREIGN_CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.foreignCatalogName); + oprot.writeFieldEnd(); + } + } + if (struct.foreignSchemaName != null) { + if (struct.isSetForeignSchemaName()) { + oprot.writeFieldBegin(FOREIGN_SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.foreignSchemaName); + oprot.writeFieldEnd(); + } + } + if (struct.foreignTableName != null) { + if (struct.isSetForeignTableName()) { + oprot.writeFieldBegin(FOREIGN_TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.foreignTableName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCrossReferenceReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCrossReferenceReqTupleScheme getScheme() { + return new TGetCrossReferenceReqTupleScheme(); + } + } + + private static class TGetCrossReferenceReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetParentCatalogName()) { + optionals.set(0); + } + if (struct.isSetParentSchemaName()) { + optionals.set(1); + } + if (struct.isSetParentTableName()) { + optionals.set(2); + } + if (struct.isSetForeignCatalogName()) { + optionals.set(3); + } + if (struct.isSetForeignSchemaName()) { + optionals.set(4); + } + if (struct.isSetForeignTableName()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetParentCatalogName()) { + oprot.writeString(struct.parentCatalogName); + } + if (struct.isSetParentSchemaName()) { + oprot.writeString(struct.parentSchemaName); + } + if (struct.isSetParentTableName()) { + oprot.writeString(struct.parentTableName); + } + if (struct.isSetForeignCatalogName()) { + oprot.writeString(struct.foreignCatalogName); + } + if (struct.isSetForeignSchemaName()) { + oprot.writeString(struct.foreignSchemaName); + } + if (struct.isSetForeignTableName()) { + oprot.writeString(struct.foreignTableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.parentCatalogName = iprot.readString(); + struct.setParentCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.parentSchemaName = iprot.readString(); + struct.setParentSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.parentTableName = iprot.readString(); + struct.setParentTableNameIsSet(true); + } + if (incoming.get(3)) { + struct.foreignCatalogName = iprot.readString(); + struct.setForeignCatalogNameIsSet(true); + } + if (incoming.get(4)) { + struct.foreignSchemaName = iprot.readString(); + struct.setForeignSchemaNameIsSet(true); + } + if (incoming.get(5)) { + struct.foreignTableName = iprot.readString(); + struct.setForeignTableNameIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java new file mode 100644 index 000000000000..ed70edbd9e54 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetCrossReferenceResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCrossReferenceRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCrossReferenceRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceResp.class, metaDataMap); + } + + public TGetCrossReferenceResp() { + } + + public TGetCrossReferenceResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetCrossReferenceResp(TGetCrossReferenceResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetCrossReferenceResp deepCopy() { + return new TGetCrossReferenceResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetCrossReferenceResp) + return this.equals((TGetCrossReferenceResp)that); + return false; + } + + public boolean equals(TGetCrossReferenceResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetCrossReferenceResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetCrossReferenceRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCrossReferenceRespStandardScheme getScheme() { + return new TGetCrossReferenceRespStandardScheme(); + } + } + + private static class TGetCrossReferenceRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceResp 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; + 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, TGetCrossReferenceResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetCrossReferenceRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetCrossReferenceRespTupleScheme getScheme() { + return new TGetCrossReferenceRespTupleScheme(); + } + } + + private static class TGetCrossReferenceRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java new file mode 100644 index 000000000000..354967cde192 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java @@ -0,0 +1,575 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq"); + + 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 OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField RENEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("renewer", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetDelegationTokenReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetDelegationTokenReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String owner; // required + private @org.apache.thrift.annotation.Nullable java.lang.String renewer; // 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"), + OWNER((short)2, "owner"), + RENEWER((short)3, "renewer"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // OWNER + return OWNER; + case 3: // RENEWER + return RENEWER; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap); + } + + public TGetDelegationTokenReq() { + } + + public TGetDelegationTokenReq( + TSessionHandle sessionHandle, + java.lang.String owner, + java.lang.String renewer) + { + this(); + this.sessionHandle = sessionHandle; + this.owner = owner; + this.renewer = renewer; + } + + /** + * Performs a deep copy on other. + */ + public TGetDelegationTokenReq(TGetDelegationTokenReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetOwner()) { + this.owner = other.owner; + } + if (other.isSetRenewer()) { + this.renewer = other.renewer; + } + } + + public TGetDelegationTokenReq deepCopy() { + return new TGetDelegationTokenReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.owner = null; + this.renewer = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getOwner() { + return this.owner; + } + + public void setOwner(@org.apache.thrift.annotation.Nullable java.lang.String owner) { + this.owner = owner; + } + + public void unsetOwner() { + this.owner = null; + } + + /** Returns true if field owner is set (has been assigned a value) and false otherwise */ + public boolean isSetOwner() { + return this.owner != null; + } + + public void setOwnerIsSet(boolean value) { + if (!value) { + this.owner = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getRenewer() { + return this.renewer; + } + + public void setRenewer(@org.apache.thrift.annotation.Nullable java.lang.String renewer) { + this.renewer = renewer; + } + + public void unsetRenewer() { + this.renewer = null; + } + + /** Returns true if field renewer is set (has been assigned a value) and false otherwise */ + public boolean isSetRenewer() { + return this.renewer != null; + } + + public void setRenewerIsSet(boolean value) { + if (!value) { + this.renewer = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case OWNER: + if (value == null) { + unsetOwner(); + } else { + setOwner((java.lang.String)value); + } + break; + + case RENEWER: + if (value == null) { + unsetRenewer(); + } else { + setRenewer((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case OWNER: + return getOwner(); + + case RENEWER: + return getRenewer(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case OWNER: + return isSetOwner(); + case RENEWER: + return isSetRenewer(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetDelegationTokenReq) + return this.equals((TGetDelegationTokenReq)that); + return false; + } + + public boolean equals(TGetDelegationTokenReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_owner = true && this.isSetOwner(); + boolean that_present_owner = true && that.isSetOwner(); + if (this_present_owner || that_present_owner) { + if (!(this_present_owner && that_present_owner)) + return false; + if (!this.owner.equals(that.owner)) + return false; + } + + boolean this_present_renewer = true && this.isSetRenewer(); + boolean that_present_renewer = true && that.isSetRenewer(); + if (this_present_renewer || that_present_renewer) { + if (!(this_present_renewer && that_present_renewer)) + return false; + if (!this.renewer.equals(that.renewer)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOwner()) ? 131071 : 524287); + if (isSetOwner()) + hashCode = hashCode * 8191 + owner.hashCode(); + + hashCode = hashCode * 8191 + ((isSetRenewer()) ? 131071 : 524287); + if (isSetRenewer()) + hashCode = hashCode * 8191 + renewer.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetDelegationTokenReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOwner()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRenewer()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.renewer, other.renewer); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenReq("); + 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("owner:"); + if (this.owner == null) { + sb.append("null"); + } else { + sb.append(this.owner); + } + first = false; + if (!first) sb.append(", "); + sb.append("renewer:"); + if (this.renewer == null) { + sb.append("null"); + } else { + sb.append(this.renewer); + } + 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 (!isSetOwner()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'owner' is unset! Struct:" + toString()); + } + + if (!isSetRenewer()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'renewer' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetDelegationTokenReqStandardScheme getScheme() { + return new TGetDelegationTokenReqStandardScheme(); + } + } + + private static class TGetDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq 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: // OWNER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.owner = iprot.readString(); + struct.setOwnerIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // RENEWER + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.renewer = iprot.readString(); + struct.setRenewerIsSet(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, TGetDelegationTokenReq 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.owner != null) { + oprot.writeFieldBegin(OWNER_FIELD_DESC); + oprot.writeString(struct.owner); + oprot.writeFieldEnd(); + } + if (struct.renewer != null) { + oprot.writeFieldBegin(RENEWER_FIELD_DESC); + oprot.writeString(struct.renewer); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetDelegationTokenReqTupleScheme getScheme() { + return new TGetDelegationTokenReqTupleScheme(); + } + } + + private static class TGetDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.owner); + oprot.writeString(struct.renewer); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.owner = iprot.readString(); + struct.setOwnerIsSet(true); + struct.renewer = iprot.readString(); + struct.setRenewerIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java new file mode 100644 index 000000000000..206c66410b44 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java @@ -0,0 +1,483 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenResp"); + + 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetDelegationTokenRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetDelegationTokenRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), + DELEGATION_TOKEN((short)2, "delegationToken"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + case 2: // DELEGATION_TOKEN + return DELEGATION_TOKEN; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.DELEGATION_TOKEN}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenResp.class, metaDataMap); + } + + public TGetDelegationTokenResp() { + } + + public TGetDelegationTokenResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetDelegationTokenResp(TGetDelegationTokenResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetDelegationToken()) { + this.delegationToken = other.delegationToken; + } + } + + public TGetDelegationTokenResp deepCopy() { + return new TGetDelegationTokenResp(this); + } + + @Override + public void clear() { + this.status = null; + this.delegationToken = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getDelegationToken() { + return this.delegationToken; + } + + public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { + this.delegationToken = delegationToken; + } + + public void unsetDelegationToken() { + this.delegationToken = null; + } + + /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ + public boolean isSetDelegationToken() { + return this.delegationToken != null; + } + + public void setDelegationTokenIsSet(boolean value) { + if (!value) { + this.delegationToken = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case DELEGATION_TOKEN: + if (value == null) { + unsetDelegationToken(); + } else { + setDelegationToken((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case DELEGATION_TOKEN: + return getDelegationToken(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case DELEGATION_TOKEN: + return isSetDelegationToken(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetDelegationTokenResp) + return this.equals((TGetDelegationTokenResp)that); + return false; + } + + public boolean equals(TGetDelegationTokenResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_delegationToken = true && this.isSetDelegationToken(); + boolean that_present_delegationToken = true && that.isSetDelegationToken(); + if (this_present_delegationToken || that_present_delegationToken) { + if (!(this_present_delegationToken && that_present_delegationToken)) + return false; + if (!this.delegationToken.equals(that.delegationToken)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); + if (isSetDelegationToken()) + hashCode = hashCode * 8191 + delegationToken.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetDelegationTokenResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelegationToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetDelegationToken()) { + if (!first) sb.append(", "); + sb.append("delegationToken:"); + if (this.delegationToken == null) { + sb.append("null"); + } else { + sb.append(this.delegationToken); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetDelegationTokenRespStandardScheme getScheme() { + return new TGetDelegationTokenRespStandardScheme(); + } + } + + private static class TGetDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenResp 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: // DELEGATION_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(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, TGetDelegationTokenResp 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.delegationToken != null) { + if (struct.isSetDelegationToken()) { + oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); + oprot.writeString(struct.delegationToken); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetDelegationTokenRespTupleScheme getScheme() { + return new TGetDelegationTokenRespTupleScheme(); + } + } + + private static class TGetDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetDelegationToken()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetDelegationToken()) { + oprot.writeString(struct.delegationToken); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java new file mode 100644 index 000000000000..899bc0f7aabc --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java @@ -0,0 +1,690 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetFunctionsReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetFunctionsReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String functionName; // 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"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + FUNCTION_NAME((short)4, "functionName"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // FUNCTION_NAME + return FUNCTION_NAME; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsReq.class, metaDataMap); + } + + public TGetFunctionsReq() { + } + + public TGetFunctionsReq( + TSessionHandle sessionHandle, + java.lang.String functionName) + { + this(); + this.sessionHandle = sessionHandle; + this.functionName = functionName; + } + + /** + * Performs a deep copy on other. + */ + public TGetFunctionsReq(TGetFunctionsReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetFunctionName()) { + this.functionName = other.functionName; + } + } + + public TGetFunctionsReq deepCopy() { + return new TGetFunctionsReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.functionName = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getFunctionName() { + return this.functionName; + } + + public void setFunctionName(@org.apache.thrift.annotation.Nullable java.lang.String functionName) { + this.functionName = functionName; + } + + public void unsetFunctionName() { + this.functionName = null; + } + + /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ + public boolean isSetFunctionName() { + return this.functionName != null; + } + + public void setFunctionNameIsSet(boolean value) { + if (!value) { + this.functionName = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((java.lang.String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((java.lang.String)value); + } + break; + + case FUNCTION_NAME: + if (value == null) { + unsetFunctionName(); + } else { + setFunctionName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case FUNCTION_NAME: + return getFunctionName(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case FUNCTION_NAME: + return isSetFunctionName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetFunctionsReq) + return this.equals((TGetFunctionsReq)that); + return false; + } + + public boolean equals(TGetFunctionsReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_functionName = true && this.isSetFunctionName(); + boolean that_present_functionName = true && that.isSetFunctionName(); + if (this_present_functionName || that_present_functionName) { + if (!(this_present_functionName && that_present_functionName)) + return false; + if (!this.functionName.equals(that.functionName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetFunctionName()) ? 131071 : 524287); + if (isSetFunctionName()) + hashCode = hashCode * 8191 + functionName.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetFunctionsReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFunctionName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, other.functionName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (!first) sb.append(", "); + sb.append("functionName:"); + if (this.functionName == null) { + sb.append("null"); + } else { + sb.append(this.functionName); + } + 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 (!isSetFunctionName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'functionName' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetFunctionsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetFunctionsReqStandardScheme getScheme() { + return new TGetFunctionsReqStandardScheme(); + } + } + + private static class TGetFunctionsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // FUNCTION_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.functionName = iprot.readString(); + struct.setFunctionNameIsSet(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, TGetFunctionsReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.functionName != null) { + oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); + oprot.writeString(struct.functionName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetFunctionsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetFunctionsReqTupleScheme getScheme() { + return new TGetFunctionsReqTupleScheme(); + } + } + + private static class TGetFunctionsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.functionName); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.functionName = iprot.readString(); + struct.setFunctionNameIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java new file mode 100644 index 000000000000..74bb9cb450a2 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetFunctionsRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetFunctionsRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsResp.class, metaDataMap); + } + + public TGetFunctionsResp() { + } + + public TGetFunctionsResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetFunctionsResp(TGetFunctionsResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetFunctionsResp deepCopy() { + return new TGetFunctionsResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetFunctionsResp) + return this.equals((TGetFunctionsResp)that); + return false; + } + + public boolean equals(TGetFunctionsResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetFunctionsResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetFunctionsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetFunctionsRespStandardScheme getScheme() { + return new TGetFunctionsRespStandardScheme(); + } + } + + private static class TGetFunctionsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsResp 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; + 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, TGetFunctionsResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetFunctionsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetFunctionsRespTupleScheme getScheme() { + return new TGetFunctionsRespTupleScheme(); + } + } + + private static class TGetFunctionsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java new file mode 100644 index 000000000000..681aa2b4c3cb --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java @@ -0,0 +1,486 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoReq"); + + 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 INFO_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoType", org.apache.thrift.protocol.TType.I32, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable TGetInfoType infoType; // 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"), + /** + * + * @see TGetInfoType + */ + INFO_TYPE((short)2, "infoType"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // INFO_TYPE + return INFO_TYPE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.INFO_TYPE, new org.apache.thrift.meta_data.FieldMetaData("infoType", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGetInfoType.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoReq.class, metaDataMap); + } + + public TGetInfoReq() { + } + + public TGetInfoReq( + TSessionHandle sessionHandle, + TGetInfoType infoType) + { + this(); + this.sessionHandle = sessionHandle; + this.infoType = infoType; + } + + /** + * Performs a deep copy on other. + */ + public TGetInfoReq(TGetInfoReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetInfoType()) { + this.infoType = other.infoType; + } + } + + public TGetInfoReq deepCopy() { + return new TGetInfoReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.infoType = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + /** + * + * @see TGetInfoType + */ + @org.apache.thrift.annotation.Nullable + public TGetInfoType getInfoType() { + return this.infoType; + } + + /** + * + * @see TGetInfoType + */ + public void setInfoType(@org.apache.thrift.annotation.Nullable TGetInfoType infoType) { + this.infoType = infoType; + } + + public void unsetInfoType() { + this.infoType = null; + } + + /** Returns true if field infoType is set (has been assigned a value) and false otherwise */ + public boolean isSetInfoType() { + return this.infoType != null; + } + + public void setInfoTypeIsSet(boolean value) { + if (!value) { + this.infoType = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case INFO_TYPE: + if (value == null) { + unsetInfoType(); + } else { + setInfoType((TGetInfoType)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case INFO_TYPE: + return getInfoType(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case INFO_TYPE: + return isSetInfoType(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetInfoReq) + return this.equals((TGetInfoReq)that); + return false; + } + + public boolean equals(TGetInfoReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_infoType = true && this.isSetInfoType(); + boolean that_present_infoType = true && that.isSetInfoType(); + if (this_present_infoType || that_present_infoType) { + if (!(this_present_infoType && that_present_infoType)) + return false; + if (!this.infoType.equals(that.infoType)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetInfoType()) ? 131071 : 524287); + if (isSetInfoType()) + hashCode = hashCode * 8191 + infoType.getValue(); + + return hashCode; + } + + @Override + public int compareTo(TGetInfoReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInfoType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoType, other.infoType); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoReq("); + 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("infoType:"); + if (this.infoType == null) { + sb.append("null"); + } else { + sb.append(this.infoType); + } + 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 (!isSetInfoType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoType' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetInfoReqStandardScheme getScheme() { + return new TGetInfoReqStandardScheme(); + } + } + + private static class TGetInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq 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: // INFO_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.infoType = org.apache.spark.sql.thriftserver.cli.thrift.TGetInfoType.findByValue(iprot.readI32()); + struct.setInfoTypeIsSet(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, TGetInfoReq 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.infoType != null) { + oprot.writeFieldBegin(INFO_TYPE_FIELD_DESC); + oprot.writeI32(struct.infoType.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetInfoReqTupleScheme getScheme() { + return new TGetInfoReqTupleScheme(); + } + } + + private static class TGetInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeI32(struct.infoType.getValue()); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.infoType = org.apache.spark.sql.thriftserver.cli.thrift.TGetInfoType.findByValue(iprot.readI32()); + struct.setInfoTypeIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java new file mode 100644 index 000000000000..d2688a919c0a --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java @@ -0,0 +1,476 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp"); + + 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 INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TGetInfoValue infoValue; // 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 { + STATUS((short)1, "status"), + INFO_VALUE((short)2, "infoValue"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + case 2: // INFO_VALUE + return INFO_VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap); + } + + public TGetInfoResp() { + } + + public TGetInfoResp( + TStatus status, + TGetInfoValue infoValue) + { + this(); + this.status = status; + this.infoValue = infoValue; + } + + /** + * Performs a deep copy on other. + */ + public TGetInfoResp(TGetInfoResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetInfoValue()) { + this.infoValue = new TGetInfoValue(other.infoValue); + } + } + + public TGetInfoResp deepCopy() { + return new TGetInfoResp(this); + } + + @Override + public void clear() { + this.status = null; + this.infoValue = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TGetInfoValue getInfoValue() { + return this.infoValue; + } + + public void setInfoValue(@org.apache.thrift.annotation.Nullable TGetInfoValue infoValue) { + this.infoValue = infoValue; + } + + public void unsetInfoValue() { + this.infoValue = null; + } + + /** Returns true if field infoValue is set (has been assigned a value) and false otherwise */ + public boolean isSetInfoValue() { + return this.infoValue != null; + } + + public void setInfoValueIsSet(boolean value) { + if (!value) { + this.infoValue = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case INFO_VALUE: + if (value == null) { + unsetInfoValue(); + } else { + setInfoValue((TGetInfoValue)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case INFO_VALUE: + return getInfoValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case INFO_VALUE: + return isSetInfoValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetInfoResp) + return this.equals((TGetInfoResp)that); + return false; + } + + public boolean equals(TGetInfoResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_infoValue = true && this.isSetInfoValue(); + boolean that_present_infoValue = true && that.isSetInfoValue(); + if (this_present_infoValue || that_present_infoValue) { + if (!(this_present_infoValue && that_present_infoValue)) + return false; + if (!this.infoValue.equals(that.infoValue)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetInfoValue()) ? 131071 : 524287); + if (isSetInfoValue()) + hashCode = hashCode * 8191 + infoValue.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetInfoResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInfoValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoValue, other.infoValue); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoResp("); + 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("infoValue:"); + if (this.infoValue == null) { + sb.append("null"); + } else { + sb.append(this.infoValue); + } + 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 (!isSetInfoValue()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoValue' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetInfoRespStandardScheme getScheme() { + return new TGetInfoRespStandardScheme(); + } + } + + private static class TGetInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp 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: // INFO_VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.infoValue = new TGetInfoValue(); + struct.infoValue.read(iprot); + struct.setInfoValueIsSet(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, TGetInfoResp 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.infoValue != null) { + oprot.writeFieldBegin(INFO_VALUE_FIELD_DESC); + struct.infoValue.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetInfoRespTupleScheme getScheme() { + return new TGetInfoRespTupleScheme(); + } + } + + private static class TGetInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + struct.infoValue.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + struct.infoValue = new TGetInfoValue(); + struct.infoValue.read(iprot); + struct.setInfoValueIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java new file mode 100644 index 000000000000..84729c5b779c --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java @@ -0,0 +1,181 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TGetInfoType implements org.apache.thrift.TEnum { + CLI_MAX_DRIVER_CONNECTIONS(0), + CLI_MAX_CONCURRENT_ACTIVITIES(1), + CLI_DATA_SOURCE_NAME(2), + CLI_FETCH_DIRECTION(8), + CLI_SERVER_NAME(13), + CLI_SEARCH_PATTERN_ESCAPE(14), + CLI_DBMS_NAME(17), + CLI_DBMS_VER(18), + CLI_ACCESSIBLE_TABLES(19), + CLI_ACCESSIBLE_PROCEDURES(20), + CLI_CURSOR_COMMIT_BEHAVIOR(23), + CLI_DATA_SOURCE_READ_ONLY(25), + CLI_DEFAULT_TXN_ISOLATION(26), + CLI_IDENTIFIER_CASE(28), + CLI_IDENTIFIER_QUOTE_CHAR(29), + CLI_MAX_COLUMN_NAME_LEN(30), + CLI_MAX_CURSOR_NAME_LEN(31), + CLI_MAX_SCHEMA_NAME_LEN(32), + CLI_MAX_CATALOG_NAME_LEN(34), + CLI_MAX_TABLE_NAME_LEN(35), + CLI_SCROLL_CONCURRENCY(43), + CLI_TXN_CAPABLE(46), + CLI_USER_NAME(47), + CLI_TXN_ISOLATION_OPTION(72), + CLI_INTEGRITY(73), + CLI_GETDATA_EXTENSIONS(81), + CLI_NULL_COLLATION(85), + CLI_ALTER_TABLE(86), + CLI_ORDER_BY_COLUMNS_IN_SELECT(90), + CLI_SPECIAL_CHARACTERS(94), + CLI_MAX_COLUMNS_IN_GROUP_BY(97), + CLI_MAX_COLUMNS_IN_INDEX(98), + CLI_MAX_COLUMNS_IN_ORDER_BY(99), + CLI_MAX_COLUMNS_IN_SELECT(100), + CLI_MAX_COLUMNS_IN_TABLE(101), + CLI_MAX_INDEX_SIZE(102), + CLI_MAX_ROW_SIZE(104), + CLI_MAX_STATEMENT_LEN(105), + CLI_MAX_TABLES_IN_SELECT(106), + CLI_MAX_USER_NAME_LEN(107), + CLI_OJ_CAPABILITIES(115), + CLI_XOPEN_CLI_YEAR(10000), + CLI_CURSOR_SENSITIVITY(10001), + CLI_DESCRIBE_PARAMETER(10002), + CLI_CATALOG_NAME(10003), + CLI_COLLATION_SEQ(10004), + CLI_MAX_IDENTIFIER_LEN(10005), + CLI_ODBC_KEYWORDS(10006); + + private final int value; + + private TGetInfoType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TGetInfoType findByValue(int value) { + switch (value) { + case 0: + return CLI_MAX_DRIVER_CONNECTIONS; + case 1: + return CLI_MAX_CONCURRENT_ACTIVITIES; + case 2: + return CLI_DATA_SOURCE_NAME; + case 8: + return CLI_FETCH_DIRECTION; + case 13: + return CLI_SERVER_NAME; + case 14: + return CLI_SEARCH_PATTERN_ESCAPE; + case 17: + return CLI_DBMS_NAME; + case 18: + return CLI_DBMS_VER; + case 19: + return CLI_ACCESSIBLE_TABLES; + case 20: + return CLI_ACCESSIBLE_PROCEDURES; + case 23: + return CLI_CURSOR_COMMIT_BEHAVIOR; + case 25: + return CLI_DATA_SOURCE_READ_ONLY; + case 26: + return CLI_DEFAULT_TXN_ISOLATION; + case 28: + return CLI_IDENTIFIER_CASE; + case 29: + return CLI_IDENTIFIER_QUOTE_CHAR; + case 30: + return CLI_MAX_COLUMN_NAME_LEN; + case 31: + return CLI_MAX_CURSOR_NAME_LEN; + case 32: + return CLI_MAX_SCHEMA_NAME_LEN; + case 34: + return CLI_MAX_CATALOG_NAME_LEN; + case 35: + return CLI_MAX_TABLE_NAME_LEN; + case 43: + return CLI_SCROLL_CONCURRENCY; + case 46: + return CLI_TXN_CAPABLE; + case 47: + return CLI_USER_NAME; + case 72: + return CLI_TXN_ISOLATION_OPTION; + case 73: + return CLI_INTEGRITY; + case 81: + return CLI_GETDATA_EXTENSIONS; + case 85: + return CLI_NULL_COLLATION; + case 86: + return CLI_ALTER_TABLE; + case 90: + return CLI_ORDER_BY_COLUMNS_IN_SELECT; + case 94: + return CLI_SPECIAL_CHARACTERS; + case 97: + return CLI_MAX_COLUMNS_IN_GROUP_BY; + case 98: + return CLI_MAX_COLUMNS_IN_INDEX; + case 99: + return CLI_MAX_COLUMNS_IN_ORDER_BY; + case 100: + return CLI_MAX_COLUMNS_IN_SELECT; + case 101: + return CLI_MAX_COLUMNS_IN_TABLE; + case 102: + return CLI_MAX_INDEX_SIZE; + case 104: + return CLI_MAX_ROW_SIZE; + case 105: + return CLI_MAX_STATEMENT_LEN; + case 106: + return CLI_MAX_TABLES_IN_SELECT; + case 107: + return CLI_MAX_USER_NAME_LEN; + case 115: + return CLI_OJ_CAPABILITIES; + case 10000: + return CLI_XOPEN_CLI_YEAR; + case 10001: + return CLI_CURSOR_SENSITIVITY; + case 10002: + return CLI_DESCRIBE_PARAMETER; + case 10003: + return CLI_CATALOG_NAME; + case 10004: + return CLI_COLLATION_SEQ; + case 10005: + return CLI_MAX_IDENTIFIER_LEN; + case 10006: + return CLI_ODBC_KEYWORDS; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java new file mode 100644 index 000000000000..7f7dd02a87b0 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java @@ -0,0 +1,574 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetInfoValue extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoValue"); + private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SMALL_INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("smallIntValue", org.apache.thrift.protocol.TType.I16, (short)2); + private static final org.apache.thrift.protocol.TField INTEGER_BITMASK_FIELD_DESC = new org.apache.thrift.protocol.TField("integerBitmask", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField INTEGER_FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("integerFlag", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField BINARY_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryValue", org.apache.thrift.protocol.TType.I32, (short)5); + private static final org.apache.thrift.protocol.TField LEN_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("lenValue", org.apache.thrift.protocol.TType.I64, (short)6); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + STRING_VALUE((short)1, "stringValue"), + SMALL_INT_VALUE((short)2, "smallIntValue"), + INTEGER_BITMASK((short)3, "integerBitmask"), + INTEGER_FLAG((short)4, "integerFlag"), + BINARY_VALUE((short)5, "binaryValue"), + LEN_VALUE((short)6, "lenValue"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STRING_VALUE + return STRING_VALUE; + case 2: // SMALL_INT_VALUE + return SMALL_INT_VALUE; + case 3: // INTEGER_BITMASK + return INTEGER_BITMASK; + case 4: // INTEGER_FLAG + return INTEGER_FLAG; + case 5: // BINARY_VALUE + return BINARY_VALUE; + case 6: // LEN_VALUE + return LEN_VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoValue.class, metaDataMap); + } + + public TGetInfoValue() { + super(); + } + + public TGetInfoValue(_Fields setField, java.lang.Object value) { + super(setField, value); + } + + public TGetInfoValue(TGetInfoValue other) { + super(other); + } + public TGetInfoValue deepCopy() { + return new TGetInfoValue(this); + } + + public static TGetInfoValue stringValue(java.lang.String value) { + TGetInfoValue x = new TGetInfoValue(); + x.setStringValue(value); + return x; + } + + public static TGetInfoValue smallIntValue(short value) { + TGetInfoValue x = new TGetInfoValue(); + x.setSmallIntValue(value); + return x; + } + + public static TGetInfoValue integerBitmask(int value) { + TGetInfoValue x = new TGetInfoValue(); + x.setIntegerBitmask(value); + return x; + } + + public static TGetInfoValue integerFlag(int value) { + TGetInfoValue x = new TGetInfoValue(); + x.setIntegerFlag(value); + return x; + } + + public static TGetInfoValue binaryValue(int value) { + TGetInfoValue x = new TGetInfoValue(); + x.setBinaryValue(value); + return x; + } + + public static TGetInfoValue lenValue(long value) { + TGetInfoValue x = new TGetInfoValue(); + x.setLenValue(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + switch (setField) { + case STRING_VALUE: + if (value instanceof java.lang.String) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); + case SMALL_INT_VALUE: + if (value instanceof java.lang.Short) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); + case INTEGER_BITMASK: + if (value instanceof java.lang.Integer) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); + case INTEGER_FLAG: + if (value instanceof java.lang.Integer) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); + case BINARY_VALUE: + if (value instanceof java.lang.Integer) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); + case LEN_VALUE: + if (value instanceof java.lang.Long) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Long for field 'lenValue', but got " + value.getClass().getSimpleName()); + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case STRING_VALUE: + if (field.type == STRING_VALUE_FIELD_DESC.type) { + java.lang.String stringValue; + stringValue = iprot.readString(); + return stringValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case SMALL_INT_VALUE: + if (field.type == SMALL_INT_VALUE_FIELD_DESC.type) { + java.lang.Short smallIntValue; + smallIntValue = iprot.readI16(); + return smallIntValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case INTEGER_BITMASK: + if (field.type == INTEGER_BITMASK_FIELD_DESC.type) { + java.lang.Integer integerBitmask; + integerBitmask = iprot.readI32(); + return integerBitmask; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case INTEGER_FLAG: + if (field.type == INTEGER_FLAG_FIELD_DESC.type) { + java.lang.Integer integerFlag; + integerFlag = iprot.readI32(); + return integerFlag; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case BINARY_VALUE: + if (field.type == BINARY_VALUE_FIELD_DESC.type) { + java.lang.Integer binaryValue; + binaryValue = iprot.readI32(); + return binaryValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case LEN_VALUE: + if (field.type == LEN_VALUE_FIELD_DESC.type) { + java.lang.Long lenValue; + lenValue = iprot.readI64(); + return lenValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case STRING_VALUE: + java.lang.String stringValue = (java.lang.String)value_; + oprot.writeString(stringValue); + return; + case SMALL_INT_VALUE: + java.lang.Short smallIntValue = (java.lang.Short)value_; + oprot.writeI16(smallIntValue); + return; + case INTEGER_BITMASK: + java.lang.Integer integerBitmask = (java.lang.Integer)value_; + oprot.writeI32(integerBitmask); + return; + case INTEGER_FLAG: + java.lang.Integer integerFlag = (java.lang.Integer)value_; + oprot.writeI32(integerFlag); + return; + case BINARY_VALUE: + java.lang.Integer binaryValue = (java.lang.Integer)value_; + oprot.writeI32(binaryValue); + return; + case LEN_VALUE: + java.lang.Long lenValue = (java.lang.Long)value_; + oprot.writeI64(lenValue); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case STRING_VALUE: + java.lang.String stringValue; + stringValue = iprot.readString(); + return stringValue; + case SMALL_INT_VALUE: + java.lang.Short smallIntValue; + smallIntValue = iprot.readI16(); + return smallIntValue; + case INTEGER_BITMASK: + java.lang.Integer integerBitmask; + integerBitmask = iprot.readI32(); + return integerBitmask; + case INTEGER_FLAG: + java.lang.Integer integerFlag; + integerFlag = iprot.readI32(); + return integerFlag; + case BINARY_VALUE: + java.lang.Integer binaryValue; + binaryValue = iprot.readI32(); + return binaryValue; + case LEN_VALUE: + java.lang.Long lenValue; + lenValue = iprot.readI64(); + return lenValue; + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case STRING_VALUE: + java.lang.String stringValue = (java.lang.String)value_; + oprot.writeString(stringValue); + return; + case SMALL_INT_VALUE: + java.lang.Short smallIntValue = (java.lang.Short)value_; + oprot.writeI16(smallIntValue); + return; + case INTEGER_BITMASK: + java.lang.Integer integerBitmask = (java.lang.Integer)value_; + oprot.writeI32(integerBitmask); + return; + case INTEGER_FLAG: + java.lang.Integer integerFlag = (java.lang.Integer)value_; + oprot.writeI32(integerFlag); + return; + case BINARY_VALUE: + java.lang.Integer binaryValue = (java.lang.Integer)value_; + oprot.writeI32(binaryValue); + return; + case LEN_VALUE: + java.lang.Long lenValue = (java.lang.Long)value_; + oprot.writeI64(lenValue); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case STRING_VALUE: + return STRING_VALUE_FIELD_DESC; + case SMALL_INT_VALUE: + return SMALL_INT_VALUE_FIELD_DESC; + case INTEGER_BITMASK: + return INTEGER_BITMASK_FIELD_DESC; + case INTEGER_FLAG: + return INTEGER_FLAG_FIELD_DESC; + case BINARY_VALUE: + return BINARY_VALUE_FIELD_DESC; + case LEN_VALUE: + return LEN_VALUE_FIELD_DESC; + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public java.lang.String getStringValue() { + if (getSetField() == _Fields.STRING_VALUE) { + return (java.lang.String)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringValue(java.lang.String value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.STRING_VALUE; + value_ = value; + } + + public short getSmallIntValue() { + if (getSetField() == _Fields.SMALL_INT_VALUE) { + return (java.lang.Short)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setSmallIntValue(short value) { + setField_ = _Fields.SMALL_INT_VALUE; + value_ = value; + } + + public int getIntegerBitmask() { + if (getSetField() == _Fields.INTEGER_BITMASK) { + return (java.lang.Integer)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setIntegerBitmask(int value) { + setField_ = _Fields.INTEGER_BITMASK; + value_ = value; + } + + public int getIntegerFlag() { + if (getSetField() == _Fields.INTEGER_FLAG) { + return (java.lang.Integer)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setIntegerFlag(int value) { + setField_ = _Fields.INTEGER_FLAG; + value_ = value; + } + + public int getBinaryValue() { + if (getSetField() == _Fields.BINARY_VALUE) { + return (java.lang.Integer)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setBinaryValue(int value) { + setField_ = _Fields.BINARY_VALUE; + value_ = value; + } + + public long getLenValue() { + if (getSetField() == _Fields.LEN_VALUE) { + return (java.lang.Long)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setLenValue(long value) { + setField_ = _Fields.LEN_VALUE; + value_ = value; + } + + public boolean isSetStringValue() { + return setField_ == _Fields.STRING_VALUE; + } + + + public boolean isSetSmallIntValue() { + return setField_ == _Fields.SMALL_INT_VALUE; + } + + + public boolean isSetIntegerBitmask() { + return setField_ == _Fields.INTEGER_BITMASK; + } + + + public boolean isSetIntegerFlag() { + return setField_ == _Fields.INTEGER_FLAG; + } + + + public boolean isSetBinaryValue() { + return setField_ == _Fields.BINARY_VALUE; + } + + + public boolean isSetLenValue() { + return setField_ == _Fields.LEN_VALUE; + } + + + public boolean equals(java.lang.Object other) { + if (other instanceof TGetInfoValue) { + return equals((TGetInfoValue)other); + } else { + return false; + } + } + + public boolean equals(TGetInfoValue other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TGetInfoValue other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + java.util.List list = new java.util.ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + java.lang.Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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, java.lang.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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java new file mode 100644 index 000000000000..56b74b866247 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java @@ -0,0 +1,479 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusReq"); + + 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)1); + private static final org.apache.thrift.protocol.TField GET_PROGRESS_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("getProgressUpdate", org.apache.thrift.protocol.TType.BOOL, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetOperationStatusReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetOperationStatusReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required + private boolean getProgressUpdate; // 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 { + OPERATION_HANDLE((short)1, "operationHandle"), + GET_PROGRESS_UPDATE((short)2, "getProgressUpdate"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // OPERATION_HANDLE + return OPERATION_HANDLE; + case 2: // GET_PROGRESS_UPDATE + return GET_PROGRESS_UPDATE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __GETPROGRESSUPDATE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.GET_PROGRESS_UPDATE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.GET_PROGRESS_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("getProgressUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusReq.class, metaDataMap); + } + + public TGetOperationStatusReq() { + } + + public TGetOperationStatusReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetOperationStatusReq(TGetOperationStatusReq other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + this.getProgressUpdate = other.getProgressUpdate; + } + + public TGetOperationStatusReq deepCopy() { + return new TGetOperationStatusReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + setGetProgressUpdateIsSet(false); + this.getProgressUpdate = false; + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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 boolean isGetProgressUpdate() { + return this.getProgressUpdate; + } + + public void setGetProgressUpdate(boolean getProgressUpdate) { + this.getProgressUpdate = getProgressUpdate; + setGetProgressUpdateIsSet(true); + } + + public void unsetGetProgressUpdate() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + } + + /** Returns true if field getProgressUpdate is set (has been assigned a value) and false otherwise */ + public boolean isSetGetProgressUpdate() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + } + + public void setGetProgressUpdateIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + case GET_PROGRESS_UPDATE: + if (value == null) { + unsetGetProgressUpdate(); + } else { + setGetProgressUpdate((java.lang.Boolean)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + case GET_PROGRESS_UPDATE: + return isGetProgressUpdate(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OPERATION_HANDLE: + return isSetOperationHandle(); + case GET_PROGRESS_UPDATE: + return isSetGetProgressUpdate(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetOperationStatusReq) + return this.equals((TGetOperationStatusReq)that); + return false; + } + + public boolean equals(TGetOperationStatusReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_getProgressUpdate = true && this.isSetGetProgressUpdate(); + boolean that_present_getProgressUpdate = true && that.isSetGetProgressUpdate(); + if (this_present_getProgressUpdate || that_present_getProgressUpdate) { + if (!(this_present_getProgressUpdate && that_present_getProgressUpdate)) + return false; + if (this.getProgressUpdate != that.getProgressUpdate) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetGetProgressUpdate()) ? 131071 : 524287); + if (isSetGetProgressUpdate()) + hashCode = hashCode * 8191 + ((getProgressUpdate) ? 131071 : 524287); + + return hashCode; + } + + @Override + public int compareTo(TGetOperationStatusReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGetProgressUpdate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.getProgressUpdate, other.getProgressUpdate); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusReq("); + boolean first = true; + + sb.append("operationHandle:"); + if (this.operationHandle == null) { + sb.append("null"); + } else { + sb.append(this.operationHandle); + } + first = false; + if (isSetGetProgressUpdate()) { + if (!first) sb.append(", "); + sb.append("getProgressUpdate:"); + sb.append(this.getProgressUpdate); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TGetOperationStatusReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetOperationStatusReqStandardScheme getScheme() { + return new TGetOperationStatusReqStandardScheme(); + } + } + + private static class TGetOperationStatusReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusReq 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: // 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 2: // GET_PROGRESS_UPDATE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.getProgressUpdate = iprot.readBool(); + struct.setGetProgressUpdateIsSet(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, TGetOperationStatusReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.isSetGetProgressUpdate()) { + oprot.writeFieldBegin(GET_PROGRESS_UPDATE_FIELD_DESC); + oprot.writeBool(struct.getProgressUpdate); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetOperationStatusReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetOperationStatusReqTupleScheme getScheme() { + return new TGetOperationStatusReqTupleScheme(); + } + } + + private static class TGetOperationStatusReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetGetProgressUpdate()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetGetProgressUpdate()) { + oprot.writeBool(struct.getProgressUpdate); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.getProgressUpdate = iprot.readBool(); + struct.setGetProgressUpdateIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java new file mode 100644 index 000000000000..9c4791d3b5f1 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java @@ -0,0 +1,1317 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusResp"); + + 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_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationState", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField TASK_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStatus", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField OPERATION_STARTED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationStarted", org.apache.thrift.protocol.TType.I64, (short)7); + private static final org.apache.thrift.protocol.TField OPERATION_COMPLETED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationCompleted", org.apache.thrift.protocol.TType.I64, (short)8); + private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)9); + private static final org.apache.thrift.protocol.TField PROGRESS_UPDATE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressUpdateResponse", org.apache.thrift.protocol.TType.STRUCT, (short)10); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetOperationStatusRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetOperationStatusRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationState operationState; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional + private int errorCode; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String taskStatus; // optional + private long operationStarted; // optional + private long operationCompleted; // optional + private boolean hasResultSet; // optional + private @org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse; // 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"), + /** + * + * @see TOperationState + */ + OPERATION_STATE((short)2, "operationState"), + SQL_STATE((short)3, "sqlState"), + ERROR_CODE((short)4, "errorCode"), + ERROR_MESSAGE((short)5, "errorMessage"), + TASK_STATUS((short)6, "taskStatus"), + OPERATION_STARTED((short)7, "operationStarted"), + OPERATION_COMPLETED((short)8, "operationCompleted"), + HAS_RESULT_SET((short)9, "hasResultSet"), + PROGRESS_UPDATE_RESPONSE((short)10, "progressUpdateResponse"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + case 2: // OPERATION_STATE + return OPERATION_STATE; + case 3: // SQL_STATE + return SQL_STATE; + case 4: // ERROR_CODE + return ERROR_CODE; + case 5: // ERROR_MESSAGE + return ERROR_MESSAGE; + case 6: // TASK_STATUS + return TASK_STATUS; + case 7: // OPERATION_STARTED + return OPERATION_STARTED; + case 8: // OPERATION_COMPLETED + return OPERATION_COMPLETED; + case 9: // HAS_RESULT_SET + return HAS_RESULT_SET; + case 10: // PROGRESS_UPDATE_RESPONSE + return PROGRESS_UPDATE_RESPONSE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERRORCODE_ISSET_ID = 0; + private static final int __OPERATIONSTARTED_ISSET_ID = 1; + private static final int __OPERATIONCOMPLETED_ISSET_ID = 2; + private static final int __HASRESULTSET_ISSET_ID = 3; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET,_Fields.PROGRESS_UPDATE_RESPONSE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationState.class))); + tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TASK_STATUS, new org.apache.thrift.meta_data.FieldMetaData("taskStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.OPERATION_STARTED, new org.apache.thrift.meta_data.FieldMetaData("operationStarted", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.OPERATION_COMPLETED, new org.apache.thrift.meta_data.FieldMetaData("operationCompleted", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.PROGRESS_UPDATE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("progressUpdateResponse", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TProgressUpdateResp"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap); + } + + public TGetOperationStatusResp() { + } + + public TGetOperationStatusResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetOperationStatusResp(TGetOperationStatusResp other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationState()) { + this.operationState = other.operationState; + } + if (other.isSetSqlState()) { + this.sqlState = other.sqlState; + } + this.errorCode = other.errorCode; + if (other.isSetErrorMessage()) { + this.errorMessage = other.errorMessage; + } + if (other.isSetTaskStatus()) { + this.taskStatus = other.taskStatus; + } + this.operationStarted = other.operationStarted; + this.operationCompleted = other.operationCompleted; + this.hasResultSet = other.hasResultSet; + if (other.isSetProgressUpdateResponse()) { + this.progressUpdateResponse = new TProgressUpdateResp(other.progressUpdateResponse); + } + } + + public TGetOperationStatusResp deepCopy() { + return new TGetOperationStatusResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationState = null; + this.sqlState = null; + setErrorCodeIsSet(false); + this.errorCode = 0; + this.errorMessage = null; + this.taskStatus = null; + setOperationStartedIsSet(false); + this.operationStarted = 0; + setOperationCompletedIsSet(false); + this.operationCompleted = 0; + setHasResultSetIsSet(false); + this.hasResultSet = false; + this.progressUpdateResponse = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + /** + * + * @see TOperationState + */ + @org.apache.thrift.annotation.Nullable + public TOperationState getOperationState() { + return this.operationState; + } + + /** + * + * @see TOperationState + */ + public void setOperationState(@org.apache.thrift.annotation.Nullable TOperationState operationState) { + this.operationState = operationState; + } + + public void unsetOperationState() { + this.operationState = null; + } + + /** Returns true if field operationState is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationState() { + return this.operationState != null; + } + + public void setOperationStateIsSet(boolean value) { + if (!value) { + this.operationState = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSqlState() { + return this.sqlState; + } + + public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { + this.sqlState = sqlState; + } + + public void unsetSqlState() { + this.sqlState = null; + } + + /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ + public boolean isSetSqlState() { + return this.sqlState != null; + } + + public void setSqlStateIsSet(boolean value) { + if (!value) { + this.sqlState = null; + } + } + + public int getErrorCode() { + return this.errorCode; + } + + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + setErrorCodeIsSet(true); + } + + public void unsetErrorCode() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorCode() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + public void setErrorCodeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getErrorMessage() { + return this.errorMessage; + } + + public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { + this.errorMessage = errorMessage; + } + + public void unsetErrorMessage() { + this.errorMessage = null; + } + + /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorMessage() { + return this.errorMessage != null; + } + + public void setErrorMessageIsSet(boolean value) { + if (!value) { + this.errorMessage = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getTaskStatus() { + return this.taskStatus; + } + + public void setTaskStatus(@org.apache.thrift.annotation.Nullable java.lang.String taskStatus) { + this.taskStatus = taskStatus; + } + + public void unsetTaskStatus() { + this.taskStatus = null; + } + + /** Returns true if field taskStatus is set (has been assigned a value) and false otherwise */ + public boolean isSetTaskStatus() { + return this.taskStatus != null; + } + + public void setTaskStatusIsSet(boolean value) { + if (!value) { + this.taskStatus = null; + } + } + + public long getOperationStarted() { + return this.operationStarted; + } + + public void setOperationStarted(long operationStarted) { + this.operationStarted = operationStarted; + setOperationStartedIsSet(true); + } + + public void unsetOperationStarted() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + } + + /** Returns true if field operationStarted is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationStarted() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + } + + public void setOperationStartedIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); + } + + public long getOperationCompleted() { + return this.operationCompleted; + } + + public void setOperationCompleted(long operationCompleted) { + this.operationCompleted = operationCompleted; + setOperationCompletedIsSet(true); + } + + public void unsetOperationCompleted() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + } + + /** Returns true if field operationCompleted is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationCompleted() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + } + + public void setOperationCompletedIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); + } + + public boolean isHasResultSet() { + return this.hasResultSet; + } + + public void setHasResultSet(boolean hasResultSet) { + this.hasResultSet = hasResultSet; + setHasResultSetIsSet(true); + } + + public void unsetHasResultSet() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ + public boolean isSetHasResultSet() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + public void setHasResultSetIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + } + + @org.apache.thrift.annotation.Nullable + public TProgressUpdateResp getProgressUpdateResponse() { + return this.progressUpdateResponse; + } + + public void setProgressUpdateResponse(@org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse) { + this.progressUpdateResponse = progressUpdateResponse; + } + + public void unsetProgressUpdateResponse() { + this.progressUpdateResponse = null; + } + + /** Returns true if field progressUpdateResponse is set (has been assigned a value) and false otherwise */ + public boolean isSetProgressUpdateResponse() { + return this.progressUpdateResponse != null; + } + + public void setProgressUpdateResponseIsSet(boolean value) { + if (!value) { + this.progressUpdateResponse = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case OPERATION_STATE: + if (value == null) { + unsetOperationState(); + } else { + setOperationState((TOperationState)value); + } + break; + + case SQL_STATE: + if (value == null) { + unsetSqlState(); + } else { + setSqlState((java.lang.String)value); + } + break; + + case ERROR_CODE: + if (value == null) { + unsetErrorCode(); + } else { + setErrorCode((java.lang.Integer)value); + } + break; + + case ERROR_MESSAGE: + if (value == null) { + unsetErrorMessage(); + } else { + setErrorMessage((java.lang.String)value); + } + break; + + case TASK_STATUS: + if (value == null) { + unsetTaskStatus(); + } else { + setTaskStatus((java.lang.String)value); + } + break; + + case OPERATION_STARTED: + if (value == null) { + unsetOperationStarted(); + } else { + setOperationStarted((java.lang.Long)value); + } + break; + + case OPERATION_COMPLETED: + if (value == null) { + unsetOperationCompleted(); + } else { + setOperationCompleted((java.lang.Long)value); + } + break; + + case HAS_RESULT_SET: + if (value == null) { + unsetHasResultSet(); + } else { + setHasResultSet((java.lang.Boolean)value); + } + break; + + case PROGRESS_UPDATE_RESPONSE: + if (value == null) { + unsetProgressUpdateResponse(); + } else { + setProgressUpdateResponse((TProgressUpdateResp)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_STATE: + return getOperationState(); + + case SQL_STATE: + return getSqlState(); + + case ERROR_CODE: + return getErrorCode(); + + case ERROR_MESSAGE: + return getErrorMessage(); + + case TASK_STATUS: + return getTaskStatus(); + + case OPERATION_STARTED: + return getOperationStarted(); + + case OPERATION_COMPLETED: + return getOperationCompleted(); + + case HAS_RESULT_SET: + return isHasResultSet(); + + case PROGRESS_UPDATE_RESPONSE: + return getProgressUpdateResponse(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_STATE: + return isSetOperationState(); + case SQL_STATE: + return isSetSqlState(); + case ERROR_CODE: + return isSetErrorCode(); + case ERROR_MESSAGE: + return isSetErrorMessage(); + case TASK_STATUS: + return isSetTaskStatus(); + case OPERATION_STARTED: + return isSetOperationStarted(); + case OPERATION_COMPLETED: + return isSetOperationCompleted(); + case HAS_RESULT_SET: + return isSetHasResultSet(); + case PROGRESS_UPDATE_RESPONSE: + return isSetProgressUpdateResponse(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetOperationStatusResp) + return this.equals((TGetOperationStatusResp)that); + return false; + } + + public boolean equals(TGetOperationStatusResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_operationState = true && this.isSetOperationState(); + boolean that_present_operationState = true && that.isSetOperationState(); + if (this_present_operationState || that_present_operationState) { + if (!(this_present_operationState && that_present_operationState)) + return false; + if (!this.operationState.equals(that.operationState)) + return false; + } + + boolean this_present_sqlState = true && this.isSetSqlState(); + boolean that_present_sqlState = true && that.isSetSqlState(); + if (this_present_sqlState || that_present_sqlState) { + if (!(this_present_sqlState && that_present_sqlState)) + return false; + if (!this.sqlState.equals(that.sqlState)) + return false; + } + + boolean this_present_errorCode = true && this.isSetErrorCode(); + boolean that_present_errorCode = true && that.isSetErrorCode(); + if (this_present_errorCode || that_present_errorCode) { + if (!(this_present_errorCode && that_present_errorCode)) + return false; + if (this.errorCode != that.errorCode) + return false; + } + + boolean this_present_errorMessage = true && this.isSetErrorMessage(); + boolean that_present_errorMessage = true && that.isSetErrorMessage(); + if (this_present_errorMessage || that_present_errorMessage) { + if (!(this_present_errorMessage && that_present_errorMessage)) + return false; + if (!this.errorMessage.equals(that.errorMessage)) + return false; + } + + boolean this_present_taskStatus = true && this.isSetTaskStatus(); + boolean that_present_taskStatus = true && that.isSetTaskStatus(); + if (this_present_taskStatus || that_present_taskStatus) { + if (!(this_present_taskStatus && that_present_taskStatus)) + return false; + if (!this.taskStatus.equals(that.taskStatus)) + return false; + } + + boolean this_present_operationStarted = true && this.isSetOperationStarted(); + boolean that_present_operationStarted = true && that.isSetOperationStarted(); + if (this_present_operationStarted || that_present_operationStarted) { + if (!(this_present_operationStarted && that_present_operationStarted)) + return false; + if (this.operationStarted != that.operationStarted) + return false; + } + + boolean this_present_operationCompleted = true && this.isSetOperationCompleted(); + boolean that_present_operationCompleted = true && that.isSetOperationCompleted(); + if (this_present_operationCompleted || that_present_operationCompleted) { + if (!(this_present_operationCompleted && that_present_operationCompleted)) + return false; + if (this.operationCompleted != that.operationCompleted) + return false; + } + + boolean this_present_hasResultSet = true && this.isSetHasResultSet(); + boolean that_present_hasResultSet = true && that.isSetHasResultSet(); + if (this_present_hasResultSet || that_present_hasResultSet) { + if (!(this_present_hasResultSet && that_present_hasResultSet)) + return false; + if (this.hasResultSet != that.hasResultSet) + return false; + } + + boolean this_present_progressUpdateResponse = true && this.isSetProgressUpdateResponse(); + boolean that_present_progressUpdateResponse = true && that.isSetProgressUpdateResponse(); + if (this_present_progressUpdateResponse || that_present_progressUpdateResponse) { + if (!(this_present_progressUpdateResponse && that_present_progressUpdateResponse)) + return false; + if (!this.progressUpdateResponse.equals(that.progressUpdateResponse)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationState()) ? 131071 : 524287); + if (isSetOperationState()) + hashCode = hashCode * 8191 + operationState.getValue(); + + hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); + if (isSetSqlState()) + hashCode = hashCode * 8191 + sqlState.hashCode(); + + hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); + if (isSetErrorCode()) + hashCode = hashCode * 8191 + errorCode; + + hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); + if (isSetErrorMessage()) + hashCode = hashCode * 8191 + errorMessage.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTaskStatus()) ? 131071 : 524287); + if (isSetTaskStatus()) + hashCode = hashCode * 8191 + taskStatus.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationStarted()) ? 131071 : 524287); + if (isSetOperationStarted()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationStarted); + + hashCode = hashCode * 8191 + ((isSetOperationCompleted()) ? 131071 : 524287); + if (isSetOperationCompleted()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationCompleted); + + hashCode = hashCode * 8191 + ((isSetHasResultSet()) ? 131071 : 524287); + if (isSetHasResultSet()) + hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); + + hashCode = hashCode * 8191 + ((isSetProgressUpdateResponse()) ? 131071 : 524287); + if (isSetProgressUpdateResponse()) + hashCode = hashCode * 8191 + progressUpdateResponse.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetOperationStatusResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationState, other.operationState); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSqlState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTaskStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStatus, other.taskStatus); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationStarted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationStarted, other.operationStarted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationCompleted()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationCompleted, other.operationCompleted); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasResultSet()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProgressUpdateResponse()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressUpdateResponse, other.progressUpdateResponse); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationState()) { + if (!first) sb.append(", "); + sb.append("operationState:"); + if (this.operationState == null) { + sb.append("null"); + } else { + sb.append(this.operationState); + } + first = false; + } + if (isSetSqlState()) { + if (!first) sb.append(", "); + sb.append("sqlState:"); + if (this.sqlState == null) { + sb.append("null"); + } else { + sb.append(this.sqlState); + } + first = false; + } + if (isSetErrorCode()) { + if (!first) sb.append(", "); + sb.append("errorCode:"); + sb.append(this.errorCode); + first = false; + } + if (isSetErrorMessage()) { + if (!first) sb.append(", "); + sb.append("errorMessage:"); + if (this.errorMessage == null) { + sb.append("null"); + } else { + sb.append(this.errorMessage); + } + first = false; + } + if (isSetTaskStatus()) { + if (!first) sb.append(", "); + sb.append("taskStatus:"); + if (this.taskStatus == null) { + sb.append("null"); + } else { + sb.append(this.taskStatus); + } + first = false; + } + if (isSetOperationStarted()) { + if (!first) sb.append(", "); + sb.append("operationStarted:"); + sb.append(this.operationStarted); + first = false; + } + if (isSetOperationCompleted()) { + if (!first) sb.append(", "); + sb.append("operationCompleted:"); + sb.append(this.operationCompleted); + first = false; + } + if (isSetHasResultSet()) { + if (!first) sb.append(", "); + sb.append("hasResultSet:"); + sb.append(this.hasResultSet); + first = false; + } + if (isSetProgressUpdateResponse()) { + if (!first) sb.append(", "); + sb.append("progressUpdateResponse:"); + if (this.progressUpdateResponse == null) { + sb.append("null"); + } else { + sb.append(this.progressUpdateResponse); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TGetOperationStatusRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetOperationStatusRespStandardScheme getScheme() { + return new TGetOperationStatusRespStandardScheme(); + } + } + + private static class TGetOperationStatusRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusResp 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_STATE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.operationState = org.apache.spark.sql.thriftserver.cli.thrift.TOperationState.findByValue(iprot.readI32()); + struct.setOperationStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SQL_STATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ERROR_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ERROR_MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // TASK_STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.taskStatus = iprot.readString(); + struct.setTaskStatusIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // OPERATION_STARTED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.operationStarted = iprot.readI64(); + struct.setOperationStartedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // OPERATION_COMPLETED + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.operationCompleted = iprot.readI64(); + struct.setOperationCompletedIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // HAS_RESULT_SET + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // PROGRESS_UPDATE_RESPONSE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.progressUpdateResponse = new TProgressUpdateResp(); + struct.progressUpdateResponse.read(iprot); + struct.setProgressUpdateResponseIsSet(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, TGetOperationStatusResp 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.operationState != null) { + if (struct.isSetOperationState()) { + oprot.writeFieldBegin(OPERATION_STATE_FIELD_DESC); + oprot.writeI32(struct.operationState.getValue()); + oprot.writeFieldEnd(); + } + } + if (struct.sqlState != null) { + if (struct.isSetSqlState()) { + oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); + oprot.writeString(struct.sqlState); + oprot.writeFieldEnd(); + } + } + if (struct.isSetErrorCode()) { + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(struct.errorCode); + oprot.writeFieldEnd(); + } + if (struct.errorMessage != null) { + if (struct.isSetErrorMessage()) { + oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); + oprot.writeString(struct.errorMessage); + oprot.writeFieldEnd(); + } + } + if (struct.taskStatus != null) { + if (struct.isSetTaskStatus()) { + oprot.writeFieldBegin(TASK_STATUS_FIELD_DESC); + oprot.writeString(struct.taskStatus); + oprot.writeFieldEnd(); + } + } + if (struct.isSetOperationStarted()) { + oprot.writeFieldBegin(OPERATION_STARTED_FIELD_DESC); + oprot.writeI64(struct.operationStarted); + oprot.writeFieldEnd(); + } + if (struct.isSetOperationCompleted()) { + oprot.writeFieldBegin(OPERATION_COMPLETED_FIELD_DESC); + oprot.writeI64(struct.operationCompleted); + oprot.writeFieldEnd(); + } + if (struct.isSetHasResultSet()) { + oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); + oprot.writeBool(struct.hasResultSet); + oprot.writeFieldEnd(); + } + if (struct.progressUpdateResponse != null) { + if (struct.isSetProgressUpdateResponse()) { + oprot.writeFieldBegin(PROGRESS_UPDATE_RESPONSE_FIELD_DESC); + struct.progressUpdateResponse.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetOperationStatusRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetOperationStatusRespTupleScheme getScheme() { + return new TGetOperationStatusRespTupleScheme(); + } + } + + private static class TGetOperationStatusRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationState()) { + optionals.set(0); + } + if (struct.isSetSqlState()) { + optionals.set(1); + } + if (struct.isSetErrorCode()) { + optionals.set(2); + } + if (struct.isSetErrorMessage()) { + optionals.set(3); + } + if (struct.isSetTaskStatus()) { + optionals.set(4); + } + if (struct.isSetOperationStarted()) { + optionals.set(5); + } + if (struct.isSetOperationCompleted()) { + optionals.set(6); + } + if (struct.isSetHasResultSet()) { + optionals.set(7); + } + if (struct.isSetProgressUpdateResponse()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetOperationState()) { + oprot.writeI32(struct.operationState.getValue()); + } + if (struct.isSetSqlState()) { + oprot.writeString(struct.sqlState); + } + if (struct.isSetErrorCode()) { + oprot.writeI32(struct.errorCode); + } + if (struct.isSetErrorMessage()) { + oprot.writeString(struct.errorMessage); + } + if (struct.isSetTaskStatus()) { + oprot.writeString(struct.taskStatus); + } + if (struct.isSetOperationStarted()) { + oprot.writeI64(struct.operationStarted); + } + if (struct.isSetOperationCompleted()) { + oprot.writeI64(struct.operationCompleted); + } + if (struct.isSetHasResultSet()) { + oprot.writeBool(struct.hasResultSet); + } + if (struct.isSetProgressUpdateResponse()) { + struct.progressUpdateResponse.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(9); + if (incoming.get(0)) { + struct.operationState = org.apache.spark.sql.thriftserver.cli.thrift.TOperationState.findByValue(iprot.readI32()); + struct.setOperationStateIsSet(true); + } + if (incoming.get(1)) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } + if (incoming.get(2)) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } + if (incoming.get(3)) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(true); + } + if (incoming.get(4)) { + struct.taskStatus = iprot.readString(); + struct.setTaskStatusIsSet(true); + } + if (incoming.get(5)) { + struct.operationStarted = iprot.readI64(); + struct.setOperationStartedIsSet(true); + } + if (incoming.get(6)) { + struct.operationCompleted = iprot.readI64(); + struct.setOperationCompletedIsSet(true); + } + if (incoming.get(7)) { + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + } + if (incoming.get(8)) { + struct.progressUpdateResponse = new TProgressUpdateResp(); + struct.progressUpdateResponse.read(iprot); + struct.setProgressUpdateResponseIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java new file mode 100644 index 000000000000..208ad832be4f --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java @@ -0,0 +1,695 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetPrimaryKeysReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetPrimaryKeysReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + TABLE_NAME((short)4, "tableName"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // TABLE_NAME + return TABLE_NAME; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysReq.class, metaDataMap); + } + + public TGetPrimaryKeysReq() { + } + + public TGetPrimaryKeysReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetPrimaryKeysReq(TGetPrimaryKeysReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + } + + public TGetPrimaryKeysReq deepCopy() { + return new TGetPrimaryKeysReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.tableName = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getTableName() { + return this.tableName; + } + + public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { + this.tableName = tableName; + } + + public void unsetTableName() { + this.tableName = null; + } + + /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableName() { + return this.tableName != null; + } + + public void setTableNameIsSet(boolean value) { + if (!value) { + this.tableName = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((java.lang.String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((java.lang.String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case TABLE_NAME: + return getTableName(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case TABLE_NAME: + return isSetTableName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetPrimaryKeysReq) + return this.equals((TGetPrimaryKeysReq)that); + return false; + } + + public boolean equals(TGetPrimaryKeysReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_tableName = true && this.isSetTableName(); + boolean that_present_tableName = true && that.isSetTableName(); + if (this_present_tableName || that_present_tableName) { + if (!(this_present_tableName && that_present_tableName)) + return false; + if (!this.tableName.equals(that.tableName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); + if (isSetTableName()) + hashCode = hashCode * 8191 + tableName.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetPrimaryKeysReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (isSetTableName()) { + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + sb.append(this.tableName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetPrimaryKeysReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetPrimaryKeysReqStandardScheme getScheme() { + return new TGetPrimaryKeysReqStandardScheme(); + } + } + + private static class TGetPrimaryKeysReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(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, TGetPrimaryKeysReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.tableName != null) { + if (struct.isSetTableName()) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.tableName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetPrimaryKeysReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetPrimaryKeysReqTupleScheme getScheme() { + return new TGetPrimaryKeysReqTupleScheme(); + } + } + + private static class TGetPrimaryKeysReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + if (struct.isSetTableName()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + if (struct.isSetTableName()) { + oprot.writeString(struct.tableName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java new file mode 100644 index 000000000000..b6d01fb6c3ef --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetPrimaryKeysResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetPrimaryKeysRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetPrimaryKeysRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysResp.class, metaDataMap); + } + + public TGetPrimaryKeysResp() { + } + + public TGetPrimaryKeysResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetPrimaryKeysResp(TGetPrimaryKeysResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetPrimaryKeysResp deepCopy() { + return new TGetPrimaryKeysResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetPrimaryKeysResp) + return this.equals((TGetPrimaryKeysResp)that); + return false; + } + + public boolean equals(TGetPrimaryKeysResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetPrimaryKeysResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetPrimaryKeysRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetPrimaryKeysRespStandardScheme getScheme() { + return new TGetPrimaryKeysRespStandardScheme(); + } + } + + private static class TGetPrimaryKeysRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysResp 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; + 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, TGetPrimaryKeysResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetPrimaryKeysRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetPrimaryKeysRespTupleScheme getScheme() { + return new TGetPrimaryKeysRespTupleScheme(); + } + } + + private static class TGetPrimaryKeysRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java new file mode 100644 index 000000000000..088b514d2f30 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetQueryIdReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdReq"); + + 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)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable 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 { + OPERATION_HANDLE((short)1, "operationHandle"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdReq.class, metaDataMap); + } + + public TGetQueryIdReq() { + } + + public TGetQueryIdReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetQueryIdReq(TGetQueryIdReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetQueryIdReq deepCopy() { + return new TGetQueryIdReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetQueryIdReq) + return this.equals((TGetQueryIdReq)that); + return false; + } + + public boolean equals(TGetQueryIdReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetQueryIdReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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, java.lang.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 TGetQueryIdReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetQueryIdReqStandardScheme getScheme() { + return new TGetQueryIdReqStandardScheme(); + } + } + + private static class TGetQueryIdReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdReq 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: // 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, TGetQueryIdReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetQueryIdReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetQueryIdReqTupleScheme getScheme() { + return new TGetQueryIdReqTupleScheme(); + } + } + + private static class TGetQueryIdReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java new file mode 100644 index 000000000000..bd425f987f30 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetQueryIdResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdResp"); + + private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.lang.String queryId; // 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 { + QUERY_ID((short)1, "queryId"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // QUERY_ID + return QUERY_ID; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdResp.class, metaDataMap); + } + + public TGetQueryIdResp() { + } + + public TGetQueryIdResp( + java.lang.String queryId) + { + this(); + this.queryId = queryId; + } + + /** + * Performs a deep copy on other. + */ + public TGetQueryIdResp(TGetQueryIdResp other) { + if (other.isSetQueryId()) { + this.queryId = other.queryId; + } + } + + public TGetQueryIdResp deepCopy() { + return new TGetQueryIdResp(this); + } + + @Override + public void clear() { + this.queryId = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getQueryId() { + return this.queryId; + } + + public void setQueryId(@org.apache.thrift.annotation.Nullable java.lang.String queryId) { + this.queryId = queryId; + } + + public void unsetQueryId() { + this.queryId = null; + } + + /** Returns true if field queryId is set (has been assigned a value) and false otherwise */ + public boolean isSetQueryId() { + return this.queryId != null; + } + + public void setQueryIdIsSet(boolean value) { + if (!value) { + this.queryId = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case QUERY_ID: + if (value == null) { + unsetQueryId(); + } else { + setQueryId((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case QUERY_ID: + return getQueryId(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case QUERY_ID: + return isSetQueryId(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetQueryIdResp) + return this.equals((TGetQueryIdResp)that); + return false; + } + + public boolean equals(TGetQueryIdResp that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_queryId = true && this.isSetQueryId(); + boolean that_present_queryId = true && that.isSetQueryId(); + if (this_present_queryId || that_present_queryId) { + if (!(this_present_queryId && that_present_queryId)) + return false; + if (!this.queryId.equals(that.queryId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetQueryId()) ? 131071 : 524287); + if (isSetQueryId()) + hashCode = hashCode * 8191 + queryId.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetQueryIdResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetQueryId()).compareTo(other.isSetQueryId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQueryId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryId, other.queryId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdResp("); + boolean first = true; + + sb.append("queryId:"); + if (this.queryId == null) { + sb.append("null"); + } else { + sb.append(this.queryId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetQueryId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'queryId' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TGetQueryIdRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetQueryIdRespStandardScheme getScheme() { + return new TGetQueryIdRespStandardScheme(); + } + } + + private static class TGetQueryIdRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdResp 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: // QUERY_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.queryId = iprot.readString(); + struct.setQueryIdIsSet(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, TGetQueryIdResp struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.queryId != null) { + oprot.writeFieldBegin(QUERY_ID_FIELD_DESC); + oprot.writeString(struct.queryId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetQueryIdRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetQueryIdRespTupleScheme getScheme() { + return new TGetQueryIdRespTupleScheme(); + } + } + + private static class TGetQueryIdRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeString(struct.queryId); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.queryId = iprot.readString(); + struct.setQueryIdIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java new file mode 100644 index 000000000000..0923214e9146 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataReq"); + + 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)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable 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 { + OPERATION_HANDLE((short)1, "operationHandle"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataReq.class, metaDataMap); + } + + public TGetResultSetMetadataReq() { + } + + public TGetResultSetMetadataReq( + TOperationHandle operationHandle) + { + this(); + this.operationHandle = operationHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetResultSetMetadataReq(TGetResultSetMetadataReq other) { + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetResultSetMetadataReq deepCopy() { + return new TGetResultSetMetadataReq(this); + } + + @Override + public void clear() { + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OPERATION_HANDLE: + if (value == null) { + unsetOperationHandle(); + } else { + setOperationHandle((TOperationHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetResultSetMetadataReq) + return this.equals((TGetResultSetMetadataReq)that); + return false; + } + + public boolean equals(TGetResultSetMetadataReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetResultSetMetadataReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataReq("); + boolean first = true; + + 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 (!isSetOperationHandle()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + 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, java.lang.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 TGetResultSetMetadataReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetResultSetMetadataReqStandardScheme getScheme() { + return new TGetResultSetMetadataReqStandardScheme(); + } + } + + private static class TGetResultSetMetadataReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataReq 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: // 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, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationHandle != null) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetResultSetMetadataReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetResultSetMetadataReqTupleScheme getScheme() { + return new TGetResultSetMetadataReqTupleScheme(); + } + } + + private static class TGetResultSetMetadataReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java new file mode 100644 index 000000000000..a647091ebcc8 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataResp"); + + 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 SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TTableSchema schema; // 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"), + SCHEMA((short)2, "schema"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + case 2: // SCHEMA + return SCHEMA; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.SCHEMA}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableSchema.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataResp.class, metaDataMap); + } + + public TGetResultSetMetadataResp() { + } + + public TGetResultSetMetadataResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetResultSetMetadataResp(TGetResultSetMetadataResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetSchema()) { + this.schema = new TTableSchema(other.schema); + } + } + + public TGetResultSetMetadataResp deepCopy() { + return new TGetResultSetMetadataResp(this); + } + + @Override + public void clear() { + this.status = null; + this.schema = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TTableSchema getSchema() { + return this.schema; + } + + public void setSchema(@org.apache.thrift.annotation.Nullable TTableSchema schema) { + this.schema = schema; + } + + public void unsetSchema() { + this.schema = null; + } + + /** Returns true if field schema is set (has been assigned a value) and false otherwise */ + public boolean isSetSchema() { + return this.schema != null; + } + + public void setSchemaIsSet(boolean value) { + if (!value) { + this.schema = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case SCHEMA: + if (value == null) { + unsetSchema(); + } else { + setSchema((TTableSchema)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case SCHEMA: + return getSchema(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case SCHEMA: + return isSetSchema(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetResultSetMetadataResp) + return this.equals((TGetResultSetMetadataResp)that); + return false; + } + + public boolean equals(TGetResultSetMetadataResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_schema = true && this.isSetSchema(); + boolean that_present_schema = true && that.isSetSchema(); + if (this_present_schema || that_present_schema) { + if (!(this_present_schema && that_present_schema)) + return false; + if (!this.schema.equals(that.schema)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSchema()) ? 131071 : 524287); + if (isSetSchema()) + hashCode = hashCode * 8191 + schema.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetResultSetMetadataResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchema()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, other.schema); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetSchema()) { + if (!first) sb.append(", "); + sb.append("schema:"); + if (this.schema == null) { + sb.append("null"); + } else { + sb.append(this.schema); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (schema != null) { + schema.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, java.lang.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 TGetResultSetMetadataRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetResultSetMetadataRespStandardScheme getScheme() { + return new TGetResultSetMetadataRespStandardScheme(); + } + } + + private static class TGetResultSetMetadataRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataResp 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: // SCHEMA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.schema = new TTableSchema(); + struct.schema.read(iprot); + struct.setSchemaIsSet(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, TGetResultSetMetadataResp 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.schema != null) { + if (struct.isSetSchema()) { + oprot.writeFieldBegin(SCHEMA_FIELD_DESC); + struct.schema.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetResultSetMetadataRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetResultSetMetadataRespTupleScheme getScheme() { + return new TGetResultSetMetadataRespTupleScheme(); + } + } + + private static class TGetResultSetMetadataRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSchema()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSchema()) { + struct.schema.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.schema = new TTableSchema(); + struct.schema.read(iprot); + struct.setSchemaIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java new file mode 100644 index 000000000000..ba1fdc2f3f81 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java @@ -0,0 +1,589 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetSchemasReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetSchemasReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasReq.class, metaDataMap); + } + + public TGetSchemasReq() { + } + + public TGetSchemasReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetSchemasReq(TGetSchemasReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + } + + public TGetSchemasReq deepCopy() { + return new TGetSchemasReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((java.lang.String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetSchemasReq) + return this.equals((TGetSchemasReq)that); + return false; + } + + public boolean equals(TGetSchemasReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetSchemasReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetSchemasReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetSchemasReqStandardScheme getScheme() { + return new TGetSchemasReqStandardScheme(); + } + } + + private static class TGetSchemasReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(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, TGetSchemasReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetSchemasReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetSchemasReqTupleScheme getScheme() { + return new TGetSchemasReqTupleScheme(); + } + } + + private static class TGetSchemasReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java new file mode 100644 index 000000000000..93df8cec34ed --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetSchemasRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetSchemasRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasResp.class, metaDataMap); + } + + public TGetSchemasResp() { + } + + public TGetSchemasResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetSchemasResp(TGetSchemasResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetSchemasResp deepCopy() { + return new TGetSchemasResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetSchemasResp) + return this.equals((TGetSchemasResp)that); + return false; + } + + public boolean equals(TGetSchemasResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetSchemasResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetSchemasRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetSchemasRespStandardScheme getScheme() { + return new TGetSchemasRespStandardScheme(); + } + } + + private static class TGetSchemasRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasResp 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; + 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, TGetSchemasResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetSchemasRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetSchemasRespTupleScheme getScheme() { + return new TGetSchemasRespTupleScheme(); + } + } + + private static class TGetSchemasRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java new file mode 100644 index 000000000000..2b846815eedc --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesReq"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesReq.class, metaDataMap); + } + + public TGetTableTypesReq() { + } + + public TGetTableTypesReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetTableTypesReq(TGetTableTypesReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TGetTableTypesReq deepCopy() { + return new TGetTableTypesReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetTableTypesReq) + return this.equals((TGetTableTypesReq)that); + return false; + } + + public boolean equals(TGetTableTypesReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetTableTypesReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetTableTypesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTableTypesReqStandardScheme getScheme() { + return new TGetTableTypesReqStandardScheme(); + } + } + + private static class TGetTableTypesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesReq 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; + 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, TGetTableTypesReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTableTypesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTableTypesReqTupleScheme getScheme() { + return new TGetTableTypesReqTupleScheme(); + } + } + + private static class TGetTableTypesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java new file mode 100644 index 000000000000..9c4df7158dfa --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesResp.class, metaDataMap); + } + + public TGetTableTypesResp() { + } + + public TGetTableTypesResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetTableTypesResp(TGetTableTypesResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetTableTypesResp deepCopy() { + return new TGetTableTypesResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetTableTypesResp) + return this.equals((TGetTableTypesResp)that); + return false; + } + + public boolean equals(TGetTableTypesResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetTableTypesResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetTableTypesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTableTypesRespStandardScheme getScheme() { + return new TGetTableTypesRespStandardScheme(); + } + } + + private static class TGetTableTypesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesResp 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; + 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, TGetTableTypesResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTableTypesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTableTypesRespTupleScheme getScheme() { + return new TGetTableTypesRespTupleScheme(); + } + } + + private static class TGetTableTypesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java new file mode 100644 index 000000000000..0c3d79e3d64a --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java @@ -0,0 +1,851 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq"); + + 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 CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField TABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("tableTypes", org.apache.thrift.protocol.TType.LIST, (short)5); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTablesReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTablesReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional + private @org.apache.thrift.annotation.Nullable java.util.List tableTypes; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CATALOG_NAME((short)2, "catalogName"), + SCHEMA_NAME((short)3, "schemaName"), + TABLE_NAME((short)4, "tableName"), + TABLE_TYPES((short)5, "tableTypes"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // CATALOG_NAME + return CATALOG_NAME; + case 3: // SCHEMA_NAME + return SCHEMA_NAME; + case 4: // TABLE_NAME + return TABLE_NAME; + case 5: // TABLE_TYPES + return TABLE_TYPES; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.TABLE_TYPES}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); + tmpMap.put(_Fields.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap); + } + + public TGetTablesReq() { + } + + public TGetTablesReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetTablesReq(TGetTablesReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetCatalogName()) { + this.catalogName = other.catalogName; + } + if (other.isSetSchemaName()) { + this.schemaName = other.schemaName; + } + if (other.isSetTableName()) { + this.tableName = other.tableName; + } + if (other.isSetTableTypes()) { + java.util.List __this__tableTypes = new java.util.ArrayList(other.tableTypes); + this.tableTypes = __this__tableTypes; + } + } + + public TGetTablesReq deepCopy() { + return new TGetTablesReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.catalogName = null; + this.schemaName = null; + this.tableName = null; + this.tableTypes = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getCatalogName() { + return this.catalogName; + } + + public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + this.catalogName = catalogName; + } + + public void unsetCatalogName() { + this.catalogName = null; + } + + /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ + public boolean isSetCatalogName() { + return this.catalogName != null; + } + + public void setCatalogNameIsSet(boolean value) { + if (!value) { + this.catalogName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSchemaName() { + return this.schemaName; + } + + public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + this.schemaName = schemaName; + } + + public void unsetSchemaName() { + this.schemaName = null; + } + + /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ + public boolean isSetSchemaName() { + return this.schemaName != null; + } + + public void setSchemaNameIsSet(boolean value) { + if (!value) { + this.schemaName = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getTableName() { + return this.tableName; + } + + public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { + this.tableName = tableName; + } + + public void unsetTableName() { + this.tableName = null; + } + + /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ + public boolean isSetTableName() { + return this.tableName != null; + } + + public void setTableNameIsSet(boolean value) { + if (!value) { + this.tableName = null; + } + } + + public int getTableTypesSize() { + return (this.tableTypes == null) ? 0 : this.tableTypes.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getTableTypesIterator() { + return (this.tableTypes == null) ? null : this.tableTypes.iterator(); + } + + public void addToTableTypes(java.lang.String elem) { + if (this.tableTypes == null) { + this.tableTypes = new java.util.ArrayList(); + } + this.tableTypes.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getTableTypes() { + return this.tableTypes; + } + + public void setTableTypes(@org.apache.thrift.annotation.Nullable java.util.List tableTypes) { + this.tableTypes = tableTypes; + } + + public void unsetTableTypes() { + this.tableTypes = null; + } + + /** Returns true if field tableTypes is set (has been assigned a value) and false otherwise */ + public boolean isSetTableTypes() { + return this.tableTypes != null; + } + + public void setTableTypesIsSet(boolean value) { + if (!value) { + this.tableTypes = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CATALOG_NAME: + if (value == null) { + unsetCatalogName(); + } else { + setCatalogName((java.lang.String)value); + } + break; + + case SCHEMA_NAME: + if (value == null) { + unsetSchemaName(); + } else { + setSchemaName((java.lang.String)value); + } + break; + + case TABLE_NAME: + if (value == null) { + unsetTableName(); + } else { + setTableName((java.lang.String)value); + } + break; + + case TABLE_TYPES: + if (value == null) { + unsetTableTypes(); + } else { + setTableTypes((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CATALOG_NAME: + return getCatalogName(); + + case SCHEMA_NAME: + return getSchemaName(); + + case TABLE_NAME: + return getTableName(); + + case TABLE_TYPES: + return getTableTypes(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case CATALOG_NAME: + return isSetCatalogName(); + case SCHEMA_NAME: + return isSetSchemaName(); + case TABLE_NAME: + return isSetTableName(); + case TABLE_TYPES: + return isSetTableTypes(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetTablesReq) + return this.equals((TGetTablesReq)that); + return false; + } + + public boolean equals(TGetTablesReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_catalogName = true && this.isSetCatalogName(); + boolean that_present_catalogName = true && that.isSetCatalogName(); + if (this_present_catalogName || that_present_catalogName) { + if (!(this_present_catalogName && that_present_catalogName)) + return false; + if (!this.catalogName.equals(that.catalogName)) + return false; + } + + boolean this_present_schemaName = true && this.isSetSchemaName(); + boolean that_present_schemaName = true && that.isSetSchemaName(); + if (this_present_schemaName || that_present_schemaName) { + if (!(this_present_schemaName && that_present_schemaName)) + return false; + if (!this.schemaName.equals(that.schemaName)) + return false; + } + + boolean this_present_tableName = true && this.isSetTableName(); + boolean that_present_tableName = true && that.isSetTableName(); + if (this_present_tableName || that_present_tableName) { + if (!(this_present_tableName && that_present_tableName)) + return false; + if (!this.tableName.equals(that.tableName)) + return false; + } + + boolean this_present_tableTypes = true && this.isSetTableTypes(); + boolean that_present_tableTypes = true && that.isSetTableTypes(); + if (this_present_tableTypes || that_present_tableTypes) { + if (!(this_present_tableTypes && that_present_tableTypes)) + return false; + if (!this.tableTypes.equals(that.tableTypes)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); + if (isSetCatalogName()) + hashCode = hashCode * 8191 + catalogName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); + if (isSetSchemaName()) + hashCode = hashCode * 8191 + schemaName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); + if (isSetTableName()) + hashCode = hashCode * 8191 + tableName.hashCode(); + + hashCode = hashCode * 8191 + ((isSetTableTypes()) ? 131071 : 524287); + if (isSetTableTypes()) + hashCode = hashCode * 8191 + tableTypes.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetTablesReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCatalogName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSchemaName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTableTypes()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableTypes, other.tableTypes); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetCatalogName()) { + if (!first) sb.append(", "); + sb.append("catalogName:"); + if (this.catalogName == null) { + sb.append("null"); + } else { + sb.append(this.catalogName); + } + first = false; + } + if (isSetSchemaName()) { + if (!first) sb.append(", "); + sb.append("schemaName:"); + if (this.schemaName == null) { + sb.append("null"); + } else { + sb.append(this.schemaName); + } + first = false; + } + if (isSetTableName()) { + if (!first) sb.append(", "); + sb.append("tableName:"); + if (this.tableName == null) { + sb.append("null"); + } else { + sb.append(this.tableName); + } + first = false; + } + if (isSetTableTypes()) { + if (!first) sb.append(", "); + sb.append("tableTypes:"); + if (this.tableTypes == null) { + sb.append("null"); + } else { + sb.append(this.tableTypes); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetTablesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTablesReqStandardScheme getScheme() { + return new TGetTablesReqStandardScheme(); + } + } + + private static class TGetTablesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq 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: // CATALOG_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SCHEMA_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TABLE_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // TABLE_TYPES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(); + struct.tableTypes = new java.util.ArrayList(_list182.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem183; + for (int _i184 = 0; _i184 < _list182.size; ++_i184) + { + _elem183 = iprot.readString(); + struct.tableTypes.add(_elem183); + } + iprot.readListEnd(); + } + struct.setTableTypesIsSet(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, TGetTablesReq 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.catalogName != null) { + if (struct.isSetCatalogName()) { + oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); + oprot.writeString(struct.catalogName); + oprot.writeFieldEnd(); + } + } + if (struct.schemaName != null) { + if (struct.isSetSchemaName()) { + oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); + oprot.writeString(struct.schemaName); + oprot.writeFieldEnd(); + } + } + if (struct.tableName != null) { + if (struct.isSetTableName()) { + oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); + oprot.writeString(struct.tableName); + oprot.writeFieldEnd(); + } + } + if (struct.tableTypes != null) { + if (struct.isSetTableTypes()) { + oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); + for (java.lang.String _iter185 : struct.tableTypes) + { + oprot.writeString(_iter185); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTablesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTablesReqTupleScheme getScheme() { + return new TGetTablesReqTupleScheme(); + } + } + + private static class TGetTablesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetCatalogName()) { + optionals.set(0); + } + if (struct.isSetSchemaName()) { + optionals.set(1); + } + if (struct.isSetTableName()) { + optionals.set(2); + } + if (struct.isSetTableTypes()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetCatalogName()) { + oprot.writeString(struct.catalogName); + } + if (struct.isSetSchemaName()) { + oprot.writeString(struct.schemaName); + } + if (struct.isSetTableName()) { + oprot.writeString(struct.tableName); + } + if (struct.isSetTableTypes()) { + { + oprot.writeI32(struct.tableTypes.size()); + for (java.lang.String _iter186 : struct.tableTypes) + { + oprot.writeString(_iter186); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.catalogName = iprot.readString(); + struct.setCatalogNameIsSet(true); + } + if (incoming.get(1)) { + struct.schemaName = iprot.readString(); + struct.setSchemaNameIsSet(true); + } + if (incoming.get(2)) { + struct.tableName = iprot.readString(); + struct.setTableNameIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tableTypes = new java.util.ArrayList(_list187.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem188; + for (int _i189 = 0; _i189 < _list187.size; ++_i189) + { + _elem188 = iprot.readString(); + struct.tableTypes.add(_elem188); + } + } + struct.setTableTypesIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java new file mode 100644 index 000000000000..d1f1837e903c --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTablesRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTablesRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesResp.class, metaDataMap); + } + + public TGetTablesResp() { + } + + public TGetTablesResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetTablesResp(TGetTablesResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetTablesResp deepCopy() { + return new TGetTablesResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetTablesResp) + return this.equals((TGetTablesResp)that); + return false; + } + + public boolean equals(TGetTablesResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetTablesResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetTablesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTablesRespStandardScheme getScheme() { + return new TGetTablesRespStandardScheme(); + } + } + + private static class TGetTablesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesResp 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; + 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, TGetTablesResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTablesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTablesRespTupleScheme getScheme() { + return new TGetTablesRespTupleScheme(); + } + } + + private static class TGetTablesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java new file mode 100644 index 000000000000..4e4a0d89aba8 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoReq"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoReq.class, metaDataMap); + } + + public TGetTypeInfoReq() { + } + + public TGetTypeInfoReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TGetTypeInfoReq(TGetTypeInfoReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + } + + public TGetTypeInfoReq deepCopy() { + return new TGetTypeInfoReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetTypeInfoReq) + return this.equals((TGetTypeInfoReq)that); + return false; + } + + public boolean equals(TGetTypeInfoReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetTypeInfoReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TGetTypeInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTypeInfoReqStandardScheme getScheme() { + return new TGetTypeInfoReqStandardScheme(); + } + } + + private static class TGetTypeInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoReq 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; + 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, TGetTypeInfoReq 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTypeInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTypeInfoReqTupleScheme getScheme() { + return new TGetTypeInfoReqTupleScheme(); + } + } + + private static class TGetTypeInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java new file mode 100644 index 000000000000..eaa8b0a99349 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java @@ -0,0 +1,488 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoResp.class, metaDataMap); + } + + public TGetTypeInfoResp() { + } + + public TGetTypeInfoResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TGetTypeInfoResp(TGetTypeInfoResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetOperationHandle()) { + this.operationHandle = new TOperationHandle(other.operationHandle); + } + } + + public TGetTypeInfoResp deepCopy() { + return new TGetTypeInfoResp(this); + } + + @Override + public void clear() { + this.status = null; + this.operationHandle = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public TOperationHandle getOperationHandle() { + return this.operationHandle; + } + + public void setOperationHandle(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.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; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case OPERATION_HANDLE: + return getOperationHandle(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case OPERATION_HANDLE: + return isSetOperationHandle(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TGetTypeInfoResp) + return this.equals((TGetTypeInfoResp)that); + return false; + } + + public boolean equals(TGetTypeInfoResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); + if (isSetOperationHandle()) + hashCode = hashCode * 8191 + operationHandle.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TGetTypeInfoResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (isSetOperationHandle()) { + 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 (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TGetTypeInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTypeInfoRespStandardScheme getScheme() { + return new TGetTypeInfoRespStandardScheme(); + } + } + + private static class TGetTypeInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoResp 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; + 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, TGetTypeInfoResp 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) { + if (struct.isSetOperationHandle()) { + oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); + struct.operationHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TGetTypeInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TGetTypeInfoRespTupleScheme getScheme() { + return new TGetTypeInfoRespTupleScheme(); + } + } + + private static class TGetTypeInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetOperationHandle()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetOperationHandle()) { + struct.operationHandle.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.operationHandle = new TOperationHandle(); + struct.operationHandle.read(iprot); + struct.setOperationHandleIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java new file mode 100644 index 000000000000..418dc0bdce08 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java @@ -0,0 +1,493 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THandleIdentifier"); + + private static final org.apache.thrift.protocol.TField GUID_FIELD_DESC = new org.apache.thrift.protocol.TField("guid", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("secret", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new THandleIdentifierStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new THandleIdentifierTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret; // 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 { + GUID((short)1, "guid"), + SECRET((short)2, "secret"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // GUID + return GUID; + case 2: // SECRET + return SECRET; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.GUID, new org.apache.thrift.meta_data.FieldMetaData("guid", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THandleIdentifier.class, metaDataMap); + } + + public THandleIdentifier() { + } + + public THandleIdentifier( + java.nio.ByteBuffer guid, + java.nio.ByteBuffer secret) + { + this(); + this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); + this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); + } + + /** + * Performs a deep copy on other. + */ + public THandleIdentifier(THandleIdentifier other) { + if (other.isSetGuid()) { + this.guid = org.apache.thrift.TBaseHelper.copyBinary(other.guid); + } + if (other.isSetSecret()) { + this.secret = org.apache.thrift.TBaseHelper.copyBinary(other.secret); + } + } + + public THandleIdentifier deepCopy() { + return new THandleIdentifier(this); + } + + @Override + public void clear() { + this.guid = null; + this.secret = null; + } + + public byte[] getGuid() { + setGuid(org.apache.thrift.TBaseHelper.rightSize(guid)); + return guid == null ? null : guid.array(); + } + + public java.nio.ByteBuffer bufferForGuid() { + return org.apache.thrift.TBaseHelper.copyBinary(guid); + } + + public void setGuid(byte[] guid) { + this.guid = guid == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(guid.clone()); + } + + public void setGuid(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid) { + this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); + } + + public void unsetGuid() { + this.guid = null; + } + + /** Returns true if field guid is set (has been assigned a value) and false otherwise */ + public boolean isSetGuid() { + return this.guid != null; + } + + public void setGuidIsSet(boolean value) { + if (!value) { + this.guid = null; + } + } + + public byte[] getSecret() { + setSecret(org.apache.thrift.TBaseHelper.rightSize(secret)); + return secret == null ? null : secret.array(); + } + + public java.nio.ByteBuffer bufferForSecret() { + return org.apache.thrift.TBaseHelper.copyBinary(secret); + } + + public void setSecret(byte[] secret) { + this.secret = secret == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(secret.clone()); + } + + public void setSecret(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret) { + this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); + } + + public void unsetSecret() { + this.secret = null; + } + + /** Returns true if field secret is set (has been assigned a value) and false otherwise */ + public boolean isSetSecret() { + return this.secret != null; + } + + public void setSecretIsSet(boolean value) { + if (!value) { + this.secret = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case GUID: + if (value == null) { + unsetGuid(); + } else { + if (value instanceof byte[]) { + setGuid((byte[])value); + } else { + setGuid((java.nio.ByteBuffer)value); + } + } + break; + + case SECRET: + if (value == null) { + unsetSecret(); + } else { + if (value instanceof byte[]) { + setSecret((byte[])value); + } else { + setSecret((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case GUID: + return getGuid(); + + case SECRET: + return getSecret(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case GUID: + return isSetGuid(); + case SECRET: + return isSetSecret(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof THandleIdentifier) + return this.equals((THandleIdentifier)that); + return false; + } + + public boolean equals(THandleIdentifier that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_guid = true && this.isSetGuid(); + boolean that_present_guid = true && that.isSetGuid(); + if (this_present_guid || that_present_guid) { + if (!(this_present_guid && that_present_guid)) + return false; + if (!this.guid.equals(that.guid)) + return false; + } + + boolean this_present_secret = true && this.isSetSecret(); + boolean that_present_secret = true && that.isSetSecret(); + if (this_present_secret || that_present_secret) { + if (!(this_present_secret && that_present_secret)) + return false; + if (!this.secret.equals(that.secret)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetGuid()) ? 131071 : 524287); + if (isSetGuid()) + hashCode = hashCode * 8191 + guid.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSecret()) ? 131071 : 524287); + if (isSetSecret()) + hashCode = hashCode * 8191 + secret.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(THandleIdentifier other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGuid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.guid, other.guid); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSecret()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secret, other.secret); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("THandleIdentifier("); + boolean first = true; + + sb.append("guid:"); + if (this.guid == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.guid, sb); + } + first = false; + if (!first) sb.append(", "); + sb.append("secret:"); + if (this.secret == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.secret, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetGuid()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'guid' is unset! Struct:" + toString()); + } + + if (!isSetSecret()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'secret' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 THandleIdentifierStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public THandleIdentifierStandardScheme getScheme() { + return new THandleIdentifierStandardScheme(); + } + } + + private static class THandleIdentifierStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, THandleIdentifier 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: // GUID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.guid = iprot.readBinary(); + struct.setGuidIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // SECRET + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.secret = iprot.readBinary(); + struct.setSecretIsSet(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, THandleIdentifier struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.guid != null) { + oprot.writeFieldBegin(GUID_FIELD_DESC); + oprot.writeBinary(struct.guid); + oprot.writeFieldEnd(); + } + if (struct.secret != null) { + oprot.writeFieldBegin(SECRET_FIELD_DESC); + oprot.writeBinary(struct.secret); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class THandleIdentifierTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public THandleIdentifierTupleScheme getScheme() { + return new THandleIdentifierTupleScheme(); + } + } + + private static class THandleIdentifierTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeBinary(struct.guid); + oprot.writeBinary(struct.secret); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.guid = iprot.readBinary(); + struct.setGuidIsSet(true); + struct.secret = iprot.readBinary(); + struct.setSecretIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java new file mode 100644 index 000000000000..31bb8fdd9b92 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Column"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Column.class, metaDataMap); + } + + public TI16Column() { + } + + public TI16Column( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TI16Column(TI16Column other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TI16Column deepCopy() { + return new TI16Column(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(short elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TI16Column) + return this.equals((TI16Column)that); + return false; + } + + public boolean equals(TI16Column that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TI16Column other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Column("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TI16ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI16ColumnStandardScheme getScheme() { + return new TI16ColumnStandardScheme(); + } + } + + private static class TI16ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list70.size); + short _elem71; + for (int _i72 = 0; _i72 < _list70.size; ++_i72) + { + _elem71 = iprot.readI16(); + struct.values.add(_elem71); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TI16Column struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.values.size())); + for (short _iter73 : struct.values) + { + oprot.writeI16(_iter73); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI16ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI16ColumnTupleScheme getScheme() { + return new TI16ColumnTupleScheme(); + } + } + + private static class TI16ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (short _iter74 : struct.values) + { + oprot.writeI16(_iter74); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); + struct.values = new java.util.ArrayList(_list75.size); + short _elem76; + for (int _i77 = 0; _i77 < _list75.size; ++_i77) + { + _elem76 = iprot.readI16(); + struct.values.add(_elem76); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java new file mode 100644 index 000000000000..174c7b09f56c --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Value"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ValueTupleSchemeFactory(); + + private short value; // 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 { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Value.class, metaDataMap); + } + + public TI16Value() { + } + + /** + * Performs a deep copy on other. + */ + public TI16Value(TI16Value other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TI16Value deepCopy() { + return new TI16Value(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public short getValue() { + return this.value; + } + + public void setValue(short value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((java.lang.Short)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TI16Value) + return this.equals((TI16Value)that); + return false; + } + + public boolean equals(TI16Value that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value; + + return hashCode; + } + + @Override + public int compareTo(TI16Value other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Value("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TI16ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI16ValueStandardScheme getScheme() { + return new TI16ValueStandardScheme(); + } + } + + private static class TI16ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I16) { + struct.value = iprot.readI16(); + struct.setValueIsSet(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, TI16Value struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI16(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI16ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI16ValueTupleScheme getScheme() { + return new TI16ValueTupleScheme(); + } + } + + private static class TI16ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeI16(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readI16(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java new file mode 100644 index 000000000000..f3226dd6f5f2 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Column"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Column.class, metaDataMap); + } + + public TI32Column() { + } + + public TI32Column( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TI32Column(TI32Column other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TI32Column deepCopy() { + return new TI32Column(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(int elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TI32Column) + return this.equals((TI32Column)that); + return false; + } + + public boolean equals(TI32Column that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TI32Column other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Column("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TI32ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI32ColumnStandardScheme getScheme() { + return new TI32ColumnStandardScheme(); + } + } + + private static class TI32ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list78.size); + int _elem79; + for (int _i80 = 0; _i80 < _list78.size; ++_i80) + { + _elem79 = iprot.readI32(); + struct.values.add(_elem79); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TI32Column struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.values.size())); + for (int _iter81 : struct.values) + { + oprot.writeI32(_iter81); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI32ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI32ColumnTupleScheme getScheme() { + return new TI32ColumnTupleScheme(); + } + } + + private static class TI32ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (int _iter82 : struct.values) + { + oprot.writeI32(_iter82); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.values = new java.util.ArrayList(_list83.size); + int _elem84; + for (int _i85 = 0; _i85 < _list83.size; ++_i85) + { + _elem84 = iprot.readI32(); + struct.values.add(_elem84); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java new file mode 100644 index 000000000000..91e936613542 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Value"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ValueTupleSchemeFactory(); + + private int value; // 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 { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Value.class, metaDataMap); + } + + public TI32Value() { + } + + /** + * Performs a deep copy on other. + */ + public TI32Value(TI32Value other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TI32Value deepCopy() { + return new TI32Value(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public int getValue() { + return this.value; + } + + public void setValue(int value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((java.lang.Integer)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TI32Value) + return this.equals((TI32Value)that); + return false; + } + + public boolean equals(TI32Value that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value; + + return hashCode; + } + + @Override + public int compareTo(TI32Value other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Value("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TI32ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI32ValueStandardScheme getScheme() { + return new TI32ValueStandardScheme(); + } + } + + private static class TI32ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.value = iprot.readI32(); + struct.setValueIsSet(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, TI32Value struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI32(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI32ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI32ValueTupleScheme getScheme() { + return new TI32ValueTupleScheme(); + } + } + + private static class TI32ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeI32(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readI32(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java new file mode 100644 index 000000000000..25ca62a1298c --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Column"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Column.class, metaDataMap); + } + + public TI64Column() { + } + + public TI64Column( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TI64Column(TI64Column other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TI64Column deepCopy() { + return new TI64Column(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(long elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TI64Column) + return this.equals((TI64Column)that); + return false; + } + + public boolean equals(TI64Column that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TI64Column other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Column("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TI64ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI64ColumnStandardScheme getScheme() { + return new TI64ColumnStandardScheme(); + } + } + + private static class TI64ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list86.size); + long _elem87; + for (int _i88 = 0; _i88 < _list86.size; ++_i88) + { + _elem87 = iprot.readI64(); + struct.values.add(_elem87); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TI64Column struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.values.size())); + for (long _iter89 : struct.values) + { + oprot.writeI64(_iter89); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI64ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI64ColumnTupleScheme getScheme() { + return new TI64ColumnTupleScheme(); + } + } + + private static class TI64ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (long _iter90 : struct.values) + { + oprot.writeI64(_iter90); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.values = new java.util.ArrayList(_list91.size); + long _elem92; + for (int _i93 = 0; _i93 < _list91.size; ++_i93) + { + _elem92 = iprot.readI64(); + struct.values.add(_elem92); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java new file mode 100644 index 000000000000..e7a68f26b4b7 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Value"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ValueTupleSchemeFactory(); + + private long value; // 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 { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __VALUE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Value.class, metaDataMap); + } + + public TI64Value() { + } + + /** + * Performs a deep copy on other. + */ + public TI64Value(TI64Value other) { + __isset_bitfield = other.__isset_bitfield; + this.value = other.value; + } + + public TI64Value deepCopy() { + return new TI64Value(this); + } + + @Override + public void clear() { + setValueIsSet(false); + this.value = 0; + } + + public long getValue() { + return this.value; + } + + public void setValue(long value) { + this.value = value; + setValueIsSet(true); + } + + public void unsetValue() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + } + + public void setValueIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TI64Value) + return this.equals((TI64Value)that); + return false; + } + + public boolean equals(TI64Value that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (this.value != that.value) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); + + return hashCode; + } + + @Override + public int compareTo(TI64Value other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Value("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + sb.append(this.value); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TI64ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI64ValueStandardScheme getScheme() { + return new TI64ValueStandardScheme(); + } + } + + private static class TI64ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.value = iprot.readI64(); + struct.setValueIsSet(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, TI64Value struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeI64(struct.value); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TI64ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TI64ValueTupleScheme getScheme() { + return new TI64ValueTupleScheme(); + } + } + + private static class TI64ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeI64(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readI64(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java new file mode 100644 index 000000000000..809ac46134ac --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java @@ -0,0 +1,46 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TJobExecutionStatus implements org.apache.thrift.TEnum { + IN_PROGRESS(0), + COMPLETE(1), + NOT_AVAILABLE(2); + + private final int value; + + private TJobExecutionStatus(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TJobExecutionStatus findByValue(int value) { + switch (value) { + case 0: + return IN_PROGRESS; + case 1: + return COMPLETE; + case 2: + return NOT_AVAILABLE; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java new file mode 100644 index 000000000000..54ccf26e8cd3 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java @@ -0,0 +1,455 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapTypeEntry"); + + private static final org.apache.thrift.protocol.TField KEY_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("keyTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField VALUE_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypePtr", org.apache.thrift.protocol.TType.I32, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TMapTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TMapTypeEntryTupleSchemeFactory(); + + private int keyTypePtr; // required + private int valueTypePtr; // 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 { + KEY_TYPE_PTR((short)1, "keyTypePtr"), + VALUE_TYPE_PTR((short)2, "valueTypePtr"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // KEY_TYPE_PTR + return KEY_TYPE_PTR; + case 2: // VALUE_TYPE_PTR + return VALUE_TYPE_PTR; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __KEYTYPEPTR_ISSET_ID = 0; + private static final int __VALUETYPEPTR_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.KEY_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("keyTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); + tmpMap.put(_Fields.VALUE_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("valueTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapTypeEntry.class, metaDataMap); + } + + public TMapTypeEntry() { + } + + public TMapTypeEntry( + int keyTypePtr, + int valueTypePtr) + { + this(); + this.keyTypePtr = keyTypePtr; + setKeyTypePtrIsSet(true); + this.valueTypePtr = valueTypePtr; + setValueTypePtrIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TMapTypeEntry(TMapTypeEntry other) { + __isset_bitfield = other.__isset_bitfield; + this.keyTypePtr = other.keyTypePtr; + this.valueTypePtr = other.valueTypePtr; + } + + public TMapTypeEntry deepCopy() { + return new TMapTypeEntry(this); + } + + @Override + public void clear() { + setKeyTypePtrIsSet(false); + this.keyTypePtr = 0; + setValueTypePtrIsSet(false); + this.valueTypePtr = 0; + } + + public int getKeyTypePtr() { + return this.keyTypePtr; + } + + public void setKeyTypePtr(int keyTypePtr) { + this.keyTypePtr = keyTypePtr; + setKeyTypePtrIsSet(true); + } + + public void unsetKeyTypePtr() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + } + + /** Returns true if field keyTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetKeyTypePtr() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + } + + public void setKeyTypePtrIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); + } + + public int getValueTypePtr() { + return this.valueTypePtr; + } + + public void setValueTypePtr(int valueTypePtr) { + this.valueTypePtr = valueTypePtr; + setValueTypePtrIsSet(true); + } + + public void unsetValueTypePtr() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + } + + /** Returns true if field valueTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetValueTypePtr() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + } + + public void setValueTypePtrIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case KEY_TYPE_PTR: + if (value == null) { + unsetKeyTypePtr(); + } else { + setKeyTypePtr((java.lang.Integer)value); + } + break; + + case VALUE_TYPE_PTR: + if (value == null) { + unsetValueTypePtr(); + } else { + setValueTypePtr((java.lang.Integer)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case KEY_TYPE_PTR: + return getKeyTypePtr(); + + case VALUE_TYPE_PTR: + return getValueTypePtr(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case KEY_TYPE_PTR: + return isSetKeyTypePtr(); + case VALUE_TYPE_PTR: + return isSetValueTypePtr(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TMapTypeEntry) + return this.equals((TMapTypeEntry)that); + return false; + } + + public boolean equals(TMapTypeEntry that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_keyTypePtr = true; + boolean that_present_keyTypePtr = true; + if (this_present_keyTypePtr || that_present_keyTypePtr) { + if (!(this_present_keyTypePtr && that_present_keyTypePtr)) + return false; + if (this.keyTypePtr != that.keyTypePtr) + return false; + } + + boolean this_present_valueTypePtr = true; + boolean that_present_valueTypePtr = true; + if (this_present_valueTypePtr || that_present_valueTypePtr) { + if (!(this_present_valueTypePtr && that_present_valueTypePtr)) + return false; + if (this.valueTypePtr != that.valueTypePtr) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + keyTypePtr; + + hashCode = hashCode * 8191 + valueTypePtr; + + return hashCode; + } + + @Override + public int compareTo(TMapTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetKeyTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyTypePtr, other.keyTypePtr); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValueTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueTypePtr, other.valueTypePtr); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TMapTypeEntry("); + boolean first = true; + + sb.append("keyTypePtr:"); + sb.append(this.keyTypePtr); + first = false; + if (!first) sb.append(", "); + sb.append("valueTypePtr:"); + sb.append(this.valueTypePtr); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetKeyTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyTypePtr' is unset! Struct:" + toString()); + } + + if (!isSetValueTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'valueTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TMapTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TMapTypeEntryStandardScheme getScheme() { + return new TMapTypeEntryStandardScheme(); + } + } + + private static class TMapTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TMapTypeEntry 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: // KEY_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.keyTypePtr = iprot.readI32(); + struct.setKeyTypePtrIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // VALUE_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.valueTypePtr = iprot.readI32(); + struct.setValueTypePtrIsSet(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, TMapTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(KEY_TYPE_PTR_FIELD_DESC); + oprot.writeI32(struct.keyTypePtr); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(VALUE_TYPE_PTR_FIELD_DESC); + oprot.writeI32(struct.valueTypePtr); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TMapTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TMapTypeEntryTupleScheme getScheme() { + return new TMapTypeEntryTupleScheme(); + } + } + + private static class TMapTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.keyTypePtr); + oprot.writeI32(struct.valueTypePtr); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.keyTypePtr = iprot.readI32(); + struct.setKeyTypePtrIsSet(true); + struct.valueTypePtr = iprot.readI32(); + struct.setValueTypePtrIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java new file mode 100644 index 000000000000..b33834a1bb72 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java @@ -0,0 +1,757 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq"); + + private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOpenSessionReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOpenSessionReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol; // required + private @org.apache.thrift.annotation.Nullable java.lang.String username; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String password; // optional + private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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 { + /** + * + * @see TProtocolVersion + */ + CLIENT_PROTOCOL((short)1, "client_protocol"), + USERNAME((short)2, "username"), + PASSWORD((short)3, "password"), + CONFIGURATION((short)4, "configuration"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // CLIENT_PROTOCOL + return CLIENT_PROTOCOL; + case 2: // USERNAME + return USERNAME; + case 3: // PASSWORD + return PASSWORD; + case 4: // CONFIGURATION + return CONFIGURATION; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); + tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap); + } + + public TOpenSessionReq() { + this.client_protocol = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + } + + public TOpenSessionReq( + TProtocolVersion client_protocol) + { + this(); + this.client_protocol = client_protocol; + } + + /** + * Performs a deep copy on other. + */ + public TOpenSessionReq(TOpenSessionReq other) { + if (other.isSetClient_protocol()) { + this.client_protocol = other.client_protocol; + } + if (other.isSetUsername()) { + this.username = other.username; + } + if (other.isSetPassword()) { + this.password = other.password; + } + if (other.isSetConfiguration()) { + java.util.Map __this__configuration = new java.util.HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TOpenSessionReq deepCopy() { + return new TOpenSessionReq(this); + } + + @Override + public void clear() { + this.client_protocol = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + this.username = null; + this.password = null; + this.configuration = null; + } + + /** + * + * @see TProtocolVersion + */ + @org.apache.thrift.annotation.Nullable + public TProtocolVersion getClient_protocol() { + return this.client_protocol; + } + + /** + * + * @see TProtocolVersion + */ + public void setClient_protocol(@org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol) { + this.client_protocol = client_protocol; + } + + public void unsetClient_protocol() { + this.client_protocol = null; + } + + /** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */ + public boolean isSetClient_protocol() { + return this.client_protocol != null; + } + + public void setClient_protocolIsSet(boolean value) { + if (!value) { + this.client_protocol = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getUsername() { + return this.username; + } + + public void setUsername(@org.apache.thrift.annotation.Nullable java.lang.String username) { + this.username = username; + } + + public void unsetUsername() { + this.username = null; + } + + /** Returns true if field username is set (has been assigned a value) and false otherwise */ + public boolean isSetUsername() { + return this.username != null; + } + + public void setUsernameIsSet(boolean value) { + if (!value) { + this.username = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getPassword() { + return this.password; + } + + public void setPassword(@org.apache.thrift.annotation.Nullable java.lang.String password) { + this.password = password; + } + + public void unsetPassword() { + this.password = null; + } + + /** Returns true if field password is set (has been assigned a value) and false otherwise */ + public boolean isSetPassword() { + return this.password != null; + } + + public void setPasswordIsSet(boolean value) { + if (!value) { + this.password = null; + } + } + + public int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(java.lang.String key, java.lang.String val) { + if (this.configuration == null) { + this.configuration = new java.util.HashMap(); + } + this.configuration.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case CLIENT_PROTOCOL: + if (value == null) { + unsetClient_protocol(); + } else { + setClient_protocol((TProtocolVersion)value); + } + break; + + case USERNAME: + if (value == null) { + unsetUsername(); + } else { + setUsername((java.lang.String)value); + } + break; + + case PASSWORD: + if (value == null) { + unsetPassword(); + } else { + setPassword((java.lang.String)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((java.util.Map)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case CLIENT_PROTOCOL: + return getClient_protocol(); + + case USERNAME: + return getUsername(); + + case PASSWORD: + return getPassword(); + + case CONFIGURATION: + return getConfiguration(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case CLIENT_PROTOCOL: + return isSetClient_protocol(); + case USERNAME: + return isSetUsername(); + case PASSWORD: + return isSetPassword(); + case CONFIGURATION: + return isSetConfiguration(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TOpenSessionReq) + return this.equals((TOpenSessionReq)that); + return false; + } + + public boolean equals(TOpenSessionReq that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_client_protocol = true && this.isSetClient_protocol(); + boolean that_present_client_protocol = true && that.isSetClient_protocol(); + if (this_present_client_protocol || that_present_client_protocol) { + if (!(this_present_client_protocol && that_present_client_protocol)) + return false; + if (!this.client_protocol.equals(that.client_protocol)) + return false; + } + + boolean this_present_username = true && this.isSetUsername(); + boolean that_present_username = true && that.isSetUsername(); + if (this_present_username || that_present_username) { + if (!(this_present_username && that_present_username)) + return false; + if (!this.username.equals(that.username)) + return false; + } + + boolean this_present_password = true && this.isSetPassword(); + boolean that_present_password = true && that.isSetPassword(); + if (this_present_password || that_present_password) { + if (!(this_present_password && that_present_password)) + return false; + if (!this.password.equals(that.password)) + return false; + } + + boolean this_present_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetClient_protocol()) ? 131071 : 524287); + if (isSetClient_protocol()) + hashCode = hashCode * 8191 + client_protocol.getValue(); + + hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287); + if (isSetUsername()) + hashCode = hashCode * 8191 + username.hashCode(); + + hashCode = hashCode * 8191 + ((isSetPassword()) ? 131071 : 524287); + if (isSetPassword()) + hashCode = hashCode * 8191 + password.hashCode(); + + hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); + if (isSetConfiguration()) + hashCode = hashCode * 8191 + configuration.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TOpenSessionReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClient_protocol()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, other.client_protocol); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUsername()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPassword()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionReq("); + boolean first = true; + + sb.append("client_protocol:"); + if (this.client_protocol == null) { + sb.append("null"); + } else { + sb.append(this.client_protocol); + } + first = false; + if (isSetUsername()) { + if (!first) sb.append(", "); + sb.append("username:"); + if (this.username == null) { + sb.append("null"); + } else { + sb.append(this.username); + } + first = false; + } + if (isSetPassword()) { + if (!first) sb.append(", "); + sb.append("password:"); + if (this.password == null) { + sb.append("null"); + } else { + sb.append(this.password); + } + first = false; + } + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetClient_protocol()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TOpenSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TOpenSessionReqStandardScheme getScheme() { + return new TOpenSessionReqStandardScheme(); + } + } + + private static class TOpenSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq 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: // CLIENT_PROTOCOL + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.client_protocol = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setClient_protocolIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // USERNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PASSWORD + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); + struct.configuration = new java.util.HashMap(2*_map142.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key143; + @org.apache.thrift.annotation.Nullable java.lang.String _val144; + for (int _i145 = 0; _i145 < _map142.size; ++_i145) + { + _key143 = iprot.readString(); + _val144 = iprot.readString(); + struct.configuration.put(_key143, _val144); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(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, TOpenSessionReq struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.client_protocol != null) { + oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC); + oprot.writeI32(struct.client_protocol.getValue()); + oprot.writeFieldEnd(); + } + if (struct.username != null) { + if (struct.isSetUsername()) { + oprot.writeFieldBegin(USERNAME_FIELD_DESC); + oprot.writeString(struct.username); + oprot.writeFieldEnd(); + } + } + if (struct.password != null) { + if (struct.isSetPassword()) { + oprot.writeFieldBegin(PASSWORD_FIELD_DESC); + oprot.writeString(struct.password); + oprot.writeFieldEnd(); + } + } + if (struct.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (java.util.Map.Entry _iter146 : struct.configuration.entrySet()) + { + oprot.writeString(_iter146.getKey()); + oprot.writeString(_iter146.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TOpenSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TOpenSessionReqTupleScheme getScheme() { + return new TOpenSessionReqTupleScheme(); + } + } + + private static class TOpenSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.client_protocol.getValue()); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetUsername()) { + optionals.set(0); + } + if (struct.isSetPassword()) { + optionals.set(1); + } + if (struct.isSetConfiguration()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUsername()) { + oprot.writeString(struct.username); + } + if (struct.isSetPassword()) { + oprot.writeString(struct.password); + } + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (java.util.Map.Entry _iter147 : struct.configuration.entrySet()) + { + oprot.writeString(_iter147.getKey()); + oprot.writeString(_iter147.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.client_protocol = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setClient_protocolIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.username = iprot.readString(); + struct.setUsernameIsSet(true); + } + if (incoming.get(1)) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new java.util.HashMap(2*_map148.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key149; + @org.apache.thrift.annotation.Nullable java.lang.String _val150; + for (int _i151 = 0; _i151 < _map148.size; ++_i151) + { + _key149 = iprot.readString(); + _val150 = iprot.readString(); + struct.configuration.put(_key149, _val150); + } + } + struct.setConfigurationIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java new file mode 100644 index 000000000000..9b66f188058a --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java @@ -0,0 +1,762 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp"); + + 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 SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2); + 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)3); + private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOpenSessionRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOpenSessionRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // required + private @org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion; // required + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // optional + private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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"), + /** + * + * @see TProtocolVersion + */ + SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"), + SESSION_HANDLE((short)3, "sessionHandle"), + CONFIGURATION((short)4, "configuration"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + case 2: // SERVER_PROTOCOL_VERSION + return SERVER_PROTOCOL_VERSION; + case 3: // SESSION_HANDLE + return SESSION_HANDLE; + case 4: // CONFIGURATION + return CONFIGURATION; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); + tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); + tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap); + } + + public TOpenSessionResp() { + this.serverProtocolVersion = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + } + + public TOpenSessionResp( + TStatus status, + TProtocolVersion serverProtocolVersion) + { + this(); + this.status = status; + this.serverProtocolVersion = serverProtocolVersion; + } + + /** + * Performs a deep copy on other. + */ + public TOpenSessionResp(TOpenSessionResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + if (other.isSetServerProtocolVersion()) { + this.serverProtocolVersion = other.serverProtocolVersion; + } + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetConfiguration()) { + java.util.Map __this__configuration = new java.util.HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TOpenSessionResp deepCopy() { + return new TOpenSessionResp(this); + } + + @Override + public void clear() { + this.status = null; + this.serverProtocolVersion = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; + + this.sessionHandle = null; + this.configuration = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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; + } + } + + /** + * + * @see TProtocolVersion + */ + @org.apache.thrift.annotation.Nullable + public TProtocolVersion getServerProtocolVersion() { + return this.serverProtocolVersion; + } + + /** + * + * @see TProtocolVersion + */ + public void setServerProtocolVersion(@org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion) { + this.serverProtocolVersion = serverProtocolVersion; + } + + public void unsetServerProtocolVersion() { + this.serverProtocolVersion = null; + } + + /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */ + public boolean isSetServerProtocolVersion() { + return this.serverProtocolVersion != null; + } + + public void setServerProtocolVersionIsSet(boolean value) { + if (!value) { + this.serverProtocolVersion = null; + } + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(java.lang.String key, java.lang.String val) { + if (this.configuration == null) { + this.configuration = new java.util.HashMap(); + } + this.configuration.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + case SERVER_PROTOCOL_VERSION: + if (value == null) { + unsetServerProtocolVersion(); + } else { + setServerProtocolVersion((TProtocolVersion)value); + } + break; + + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((java.util.Map)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + case SERVER_PROTOCOL_VERSION: + return getServerProtocolVersion(); + + case SESSION_HANDLE: + return getSessionHandle(); + + case CONFIGURATION: + return getConfiguration(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + case SERVER_PROTOCOL_VERSION: + return isSetServerProtocolVersion(); + case SESSION_HANDLE: + return isSetSessionHandle(); + case CONFIGURATION: + return isSetConfiguration(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TOpenSessionResp) + return this.equals((TOpenSessionResp)that); + return false; + } + + public boolean equals(TOpenSessionResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_serverProtocolVersion = true && this.isSetServerProtocolVersion(); + boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion(); + if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) { + if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion)) + return false; + if (!this.serverProtocolVersion.equals(that.serverProtocolVersion)) + 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_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + hashCode = hashCode * 8191 + ((isSetServerProtocolVersion()) ? 131071 : 524287); + if (isSetServerProtocolVersion()) + hashCode = hashCode * 8191 + serverProtocolVersion.getValue(); + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); + if (isSetConfiguration()) + hashCode = hashCode * 8191 + configuration.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TOpenSessionResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerProtocolVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, other.serverProtocolVersion); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionResp("); + 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("serverProtocolVersion:"); + if (this.serverProtocolVersion == null) { + sb.append("null"); + } else { + sb.append(this.serverProtocolVersion); + } + first = false; + if (isSetSessionHandle()) { + if (!first) sb.append(", "); + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + } + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + 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 (!isSetServerProtocolVersion()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (status != null) { + status.validate(); + } + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TOpenSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TOpenSessionRespStandardScheme getScheme() { + return new TOpenSessionRespStandardScheme(); + } + } + + private static class TOpenSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp 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: // SERVER_PROTOCOL_VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.serverProtocolVersion = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setServerProtocolVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // 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 4: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); + struct.configuration = new java.util.HashMap(2*_map152.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key153; + @org.apache.thrift.annotation.Nullable java.lang.String _val154; + for (int _i155 = 0; _i155 < _map152.size; ++_i155) + { + _key153 = iprot.readString(); + _val154 = iprot.readString(); + struct.configuration.put(_key153, _val154); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(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, TOpenSessionResp 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.serverProtocolVersion != null) { + oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC); + oprot.writeI32(struct.serverProtocolVersion.getValue()); + oprot.writeFieldEnd(); + } + if (struct.sessionHandle != null) { + if (struct.isSetSessionHandle()) { + oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); + struct.sessionHandle.write(oprot); + oprot.writeFieldEnd(); + } + } + if (struct.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (java.util.Map.Entry _iter156 : struct.configuration.entrySet()) + { + oprot.writeString(_iter156.getKey()); + oprot.writeString(_iter156.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TOpenSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TOpenSessionRespTupleScheme getScheme() { + return new TOpenSessionRespTupleScheme(); + } + } + + private static class TOpenSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + oprot.writeI32(struct.serverProtocolVersion.getValue()); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetSessionHandle()) { + optionals.set(0); + } + if (struct.isSetConfiguration()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSessionHandle()) { + struct.sessionHandle.write(oprot); + } + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (java.util.Map.Entry _iter157 : struct.configuration.entrySet()) + { + oprot.writeString(_iter157.getKey()); + oprot.writeString(_iter157.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + struct.serverProtocolVersion = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.findByValue(iprot.readI32()); + struct.setServerProtocolVersionIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new java.util.HashMap(2*_map158.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key159; + @org.apache.thrift.annotation.Nullable java.lang.String _val160; + for (int _i161 = 0; _i161 < _map158.size; ++_i161) + { + _key159 = iprot.readString(); + _val160 = iprot.readString(); + struct.configuration.put(_key159, _val160); + } + } + struct.setConfigurationIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java new file mode 100644 index 000000000000..690574983393 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java @@ -0,0 +1,684 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle"); + + private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3); + private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (short)4); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TOperationHandleStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TOperationHandleTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable THandleIdentifier operationId; // required + private @org.apache.thrift.annotation.Nullable TOperationType operationType; // required + private boolean hasResultSet; // required + private double modifiedRowCount; // 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 { + OPERATION_ID((short)1, "operationId"), + /** + * + * @see TOperationType + */ + OPERATION_TYPE((short)2, "operationType"), + HAS_RESULT_SET((short)3, "hasResultSet"), + MODIFIED_ROW_COUNT((short)4, "modifiedRowCount"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // OPERATION_ID + return OPERATION_ID; + case 2: // OPERATION_TYPE + return OPERATION_TYPE; + case 3: // HAS_RESULT_SET + return HAS_RESULT_SET; + case 4: // MODIFIED_ROW_COUNT + return MODIFIED_ROW_COUNT; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __HASRESULTSET_ISSET_ID = 0; + private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); + tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationType.class))); + tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap); + } + + public TOperationHandle() { + } + + public TOperationHandle( + THandleIdentifier operationId, + TOperationType operationType, + boolean hasResultSet) + { + this(); + this.operationId = operationId; + this.operationType = operationType; + this.hasResultSet = hasResultSet; + setHasResultSetIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TOperationHandle(TOperationHandle other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetOperationId()) { + this.operationId = new THandleIdentifier(other.operationId); + } + if (other.isSetOperationType()) { + this.operationType = other.operationType; + } + this.hasResultSet = other.hasResultSet; + this.modifiedRowCount = other.modifiedRowCount; + } + + public TOperationHandle deepCopy() { + return new TOperationHandle(this); + } + + @Override + public void clear() { + this.operationId = null; + this.operationType = null; + setHasResultSetIsSet(false); + this.hasResultSet = false; + setModifiedRowCountIsSet(false); + this.modifiedRowCount = 0.0; + } + + @org.apache.thrift.annotation.Nullable + public THandleIdentifier getOperationId() { + return this.operationId; + } + + public void setOperationId(@org.apache.thrift.annotation.Nullable THandleIdentifier operationId) { + this.operationId = operationId; + } + + public void unsetOperationId() { + this.operationId = null; + } + + /** Returns true if field operationId is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationId() { + return this.operationId != null; + } + + public void setOperationIdIsSet(boolean value) { + if (!value) { + this.operationId = null; + } + } + + /** + * + * @see TOperationType + */ + @org.apache.thrift.annotation.Nullable + public TOperationType getOperationType() { + return this.operationType; + } + + /** + * + * @see TOperationType + */ + public void setOperationType(@org.apache.thrift.annotation.Nullable TOperationType operationType) { + this.operationType = operationType; + } + + public void unsetOperationType() { + this.operationType = null; + } + + /** Returns true if field operationType is set (has been assigned a value) and false otherwise */ + public boolean isSetOperationType() { + return this.operationType != null; + } + + public void setOperationTypeIsSet(boolean value) { + if (!value) { + this.operationType = null; + } + } + + public boolean isHasResultSet() { + return this.hasResultSet; + } + + public void setHasResultSet(boolean hasResultSet) { + this.hasResultSet = hasResultSet; + setHasResultSetIsSet(true); + } + + public void unsetHasResultSet() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ + public boolean isSetHasResultSet() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + } + + public void setHasResultSetIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + } + + public double getModifiedRowCount() { + return this.modifiedRowCount; + } + + public void setModifiedRowCount(double modifiedRowCount) { + this.modifiedRowCount = modifiedRowCount; + setModifiedRowCountIsSet(true); + } + + public void unsetModifiedRowCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + } + + /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */ + public boolean isSetModifiedRowCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + } + + public void setModifiedRowCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case OPERATION_ID: + if (value == null) { + unsetOperationId(); + } else { + setOperationId((THandleIdentifier)value); + } + break; + + case OPERATION_TYPE: + if (value == null) { + unsetOperationType(); + } else { + setOperationType((TOperationType)value); + } + break; + + case HAS_RESULT_SET: + if (value == null) { + unsetHasResultSet(); + } else { + setHasResultSet((java.lang.Boolean)value); + } + break; + + case MODIFIED_ROW_COUNT: + if (value == null) { + unsetModifiedRowCount(); + } else { + setModifiedRowCount((java.lang.Double)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case OPERATION_ID: + return getOperationId(); + + case OPERATION_TYPE: + return getOperationType(); + + case HAS_RESULT_SET: + return isHasResultSet(); + + case MODIFIED_ROW_COUNT: + return getModifiedRowCount(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case OPERATION_ID: + return isSetOperationId(); + case OPERATION_TYPE: + return isSetOperationType(); + case HAS_RESULT_SET: + return isSetHasResultSet(); + case MODIFIED_ROW_COUNT: + return isSetModifiedRowCount(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TOperationHandle) + return this.equals((TOperationHandle)that); + return false; + } + + public boolean equals(TOperationHandle that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_operationId = true && this.isSetOperationId(); + boolean that_present_operationId = true && that.isSetOperationId(); + if (this_present_operationId || that_present_operationId) { + if (!(this_present_operationId && that_present_operationId)) + return false; + if (!this.operationId.equals(that.operationId)) + return false; + } + + boolean this_present_operationType = true && this.isSetOperationType(); + boolean that_present_operationType = true && that.isSetOperationType(); + if (this_present_operationType || that_present_operationType) { + if (!(this_present_operationType && that_present_operationType)) + return false; + if (!this.operationType.equals(that.operationType)) + return false; + } + + boolean this_present_hasResultSet = true; + boolean that_present_hasResultSet = true; + if (this_present_hasResultSet || that_present_hasResultSet) { + if (!(this_present_hasResultSet && that_present_hasResultSet)) + return false; + if (this.hasResultSet != that.hasResultSet) + return false; + } + + boolean this_present_modifiedRowCount = true && this.isSetModifiedRowCount(); + boolean that_present_modifiedRowCount = true && that.isSetModifiedRowCount(); + if (this_present_modifiedRowCount || that_present_modifiedRowCount) { + if (!(this_present_modifiedRowCount && that_present_modifiedRowCount)) + return false; + if (this.modifiedRowCount != that.modifiedRowCount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetOperationId()) ? 131071 : 524287); + if (isSetOperationId()) + hashCode = hashCode * 8191 + operationId.hashCode(); + + hashCode = hashCode * 8191 + ((isSetOperationType()) ? 131071 : 524287); + if (isSetOperationType()) + hashCode = hashCode * 8191 + operationType.getValue(); + + hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); + + hashCode = hashCode * 8191 + ((isSetModifiedRowCount()) ? 131071 : 524287); + if (isSetModifiedRowCount()) + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(modifiedRowCount); + + return hashCode; + } + + @Override + public int compareTo(TOperationHandle other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationId, other.operationId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetOperationType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationType, other.operationType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHasResultSet()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetModifiedRowCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modifiedRowCount, other.modifiedRowCount); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TOperationHandle("); + boolean first = true; + + sb.append("operationId:"); + if (this.operationId == null) { + sb.append("null"); + } else { + sb.append(this.operationId); + } + first = false; + if (!first) sb.append(", "); + sb.append("operationType:"); + if (this.operationType == null) { + sb.append("null"); + } else { + sb.append(this.operationType); + } + first = false; + if (!first) sb.append(", "); + sb.append("hasResultSet:"); + sb.append(this.hasResultSet); + first = false; + if (isSetModifiedRowCount()) { + if (!first) sb.append(", "); + sb.append("modifiedRowCount:"); + sb.append(this.modifiedRowCount); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetOperationId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' is unset! Struct:" + toString()); + } + + if (!isSetOperationType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationType' is unset! Struct:" + toString()); + } + + if (!isSetHasResultSet()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (operationId != null) { + operationId.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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TOperationHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TOperationHandleStandardScheme getScheme() { + return new TOperationHandleStandardScheme(); + } + } + + private static class TOperationHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle 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: // OPERATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.operationId = new THandleIdentifier(); + struct.operationId.read(iprot); + struct.setOperationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OPERATION_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.operationType = org.apache.spark.sql.thriftserver.cli.thrift.TOperationType.findByValue(iprot.readI32()); + struct.setOperationTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // HAS_RESULT_SET + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // MODIFIED_ROW_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.modifiedRowCount = iprot.readDouble(); + struct.setModifiedRowCountIsSet(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, TOperationHandle struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.operationId != null) { + oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC); + struct.operationId.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.operationType != null) { + oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC); + oprot.writeI32(struct.operationType.getValue()); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); + oprot.writeBool(struct.hasResultSet); + oprot.writeFieldEnd(); + if (struct.isSetModifiedRowCount()) { + oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC); + oprot.writeDouble(struct.modifiedRowCount); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TOperationHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TOperationHandleTupleScheme getScheme() { + return new TOperationHandleTupleScheme(); + } + } + + private static class TOperationHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationId.write(oprot); + oprot.writeI32(struct.operationType.getValue()); + oprot.writeBool(struct.hasResultSet); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetModifiedRowCount()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetModifiedRowCount()) { + oprot.writeDouble(struct.modifiedRowCount); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.operationId = new THandleIdentifier(); + struct.operationId.read(iprot); + struct.setOperationIdIsSet(true); + struct.operationType = org.apache.spark.sql.thriftserver.cli.thrift.TOperationType.findByValue(iprot.readI32()); + struct.setOperationTypeIsSet(true); + struct.hasResultSet = iprot.readBool(); + struct.setHasResultSetIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.modifiedRowCount = iprot.readDouble(); + struct.setModifiedRowCountIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java new file mode 100644 index 000000000000..cc9967738fa4 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java @@ -0,0 +1,64 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TOperationState implements org.apache.thrift.TEnum { + INITIALIZED_STATE(0), + RUNNING_STATE(1), + FINISHED_STATE(2), + CANCELED_STATE(3), + CLOSED_STATE(4), + ERROR_STATE(5), + UKNOWN_STATE(6), + PENDING_STATE(7), + TIMEDOUT_STATE(8); + + private final int value; + + private TOperationState(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TOperationState findByValue(int value) { + switch (value) { + case 0: + return INITIALIZED_STATE; + case 1: + return RUNNING_STATE; + case 2: + return FINISHED_STATE; + case 3: + return CANCELED_STATE; + case 4: + return CLOSED_STATE; + case 5: + return ERROR_STATE; + case 6: + return UKNOWN_STATE; + case 7: + return PENDING_STATE; + case 8: + return TIMEDOUT_STATE; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java new file mode 100644 index 000000000000..8fed2bf263f4 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java @@ -0,0 +1,64 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TOperationType implements org.apache.thrift.TEnum { + EXECUTE_STATEMENT(0), + GET_TYPE_INFO(1), + GET_CATALOGS(2), + GET_SCHEMAS(3), + GET_TABLES(4), + GET_TABLE_TYPES(5), + GET_COLUMNS(6), + GET_FUNCTIONS(7), + UNKNOWN(8); + + private final int value; + + private TOperationType(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TOperationType findByValue(int value) { + switch (value) { + case 0: + return EXECUTE_STATEMENT; + case 1: + return GET_TYPE_INFO; + case 2: + return GET_CATALOGS; + case 3: + return GET_SCHEMAS; + case 4: + return GET_TABLES; + case 5: + return GET_TABLE_TYPES; + case 6: + return GET_COLUMNS; + case 7: + return GET_FUNCTIONS; + case 8: + return UNKNOWN; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java new file mode 100644 index 000000000000..61fa650fcfd1 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java @@ -0,0 +1,495 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry"); + + private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPrimitiveTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPrimitiveTypeEntryTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TTypeId type; // required + private @org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers; // 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 { + /** + * + * @see TTypeId + */ + TYPE((short)1, "type"), + TYPE_QUALIFIERS((short)2, "typeQualifiers"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TYPE + return TYPE; + case 2: // TYPE_QUALIFIERS + return TYPE_QUALIFIERS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.TYPE_QUALIFIERS}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class))); + tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap); + } + + public TPrimitiveTypeEntry() { + } + + public TPrimitiveTypeEntry( + TTypeId type) + { + this(); + this.type = type; + } + + /** + * Performs a deep copy on other. + */ + public TPrimitiveTypeEntry(TPrimitiveTypeEntry other) { + if (other.isSetType()) { + this.type = other.type; + } + if (other.isSetTypeQualifiers()) { + this.typeQualifiers = new TTypeQualifiers(other.typeQualifiers); + } + } + + public TPrimitiveTypeEntry deepCopy() { + return new TPrimitiveTypeEntry(this); + } + + @Override + public void clear() { + this.type = null; + this.typeQualifiers = null; + } + + /** + * + * @see TTypeId + */ + @org.apache.thrift.annotation.Nullable + public TTypeId getType() { + return this.type; + } + + /** + * + * @see TTypeId + */ + public void setType(@org.apache.thrift.annotation.Nullable TTypeId type) { + this.type = type; + } + + public void unsetType() { + this.type = null; + } + + /** Returns true if field type is set (has been assigned a value) and false otherwise */ + public boolean isSetType() { + return this.type != null; + } + + public void setTypeIsSet(boolean value) { + if (!value) { + this.type = null; + } + } + + @org.apache.thrift.annotation.Nullable + public TTypeQualifiers getTypeQualifiers() { + return this.typeQualifiers; + } + + public void setTypeQualifiers(@org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers) { + this.typeQualifiers = typeQualifiers; + } + + public void unsetTypeQualifiers() { + this.typeQualifiers = null; + } + + /** Returns true if field typeQualifiers is set (has been assigned a value) and false otherwise */ + public boolean isSetTypeQualifiers() { + return this.typeQualifiers != null; + } + + public void setTypeQualifiersIsSet(boolean value) { + if (!value) { + this.typeQualifiers = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((TTypeId)value); + } + break; + + case TYPE_QUALIFIERS: + if (value == null) { + unsetTypeQualifiers(); + } else { + setTypeQualifiers((TTypeQualifiers)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TYPE: + return getType(); + + case TYPE_QUALIFIERS: + return getTypeQualifiers(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case TYPE: + return isSetType(); + case TYPE_QUALIFIERS: + return isSetTypeQualifiers(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TPrimitiveTypeEntry) + return this.equals((TPrimitiveTypeEntry)that); + return false; + } + + public boolean equals(TPrimitiveTypeEntry that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_type = true && this.isSetType(); + boolean that_present_type = true && that.isSetType(); + if (this_present_type || that_present_type) { + if (!(this_present_type && that_present_type)) + return false; + if (!this.type.equals(that.type)) + return false; + } + + boolean this_present_typeQualifiers = true && this.isSetTypeQualifiers(); + boolean that_present_typeQualifiers = true && that.isSetTypeQualifiers(); + if (this_present_typeQualifiers || that_present_typeQualifiers) { + if (!(this_present_typeQualifiers && that_present_typeQualifiers)) + return false; + if (!this.typeQualifiers.equals(that.typeQualifiers)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); + if (isSetType()) + hashCode = hashCode * 8191 + type.getValue(); + + hashCode = hashCode * 8191 + ((isSetTypeQualifiers()) ? 131071 : 524287); + if (isSetTypeQualifiers()) + hashCode = hashCode * 8191 + typeQualifiers.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TPrimitiveTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetType()).compareTo(other.isSetType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypeQualifiers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeQualifiers, other.typeQualifiers); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TPrimitiveTypeEntry("); + boolean first = true; + + sb.append("type:"); + if (this.type == null) { + sb.append("null"); + } else { + sb.append(this.type); + } + first = false; + if (isSetTypeQualifiers()) { + if (!first) sb.append(", "); + sb.append("typeQualifiers:"); + if (this.typeQualifiers == null) { + sb.append("null"); + } else { + sb.append(this.typeQualifiers); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (typeQualifiers != null) { + typeQualifiers.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, java.lang.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 TPrimitiveTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TPrimitiveTypeEntryStandardScheme getScheme() { + return new TPrimitiveTypeEntryStandardScheme(); + } + } + + private static class TPrimitiveTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry 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: // TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.type = org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.findByValue(iprot.readI32()); + struct.setTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TYPE_QUALIFIERS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.typeQualifiers = new TTypeQualifiers(); + struct.typeQualifiers.read(iprot); + struct.setTypeQualifiersIsSet(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, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.type != null) { + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeI32(struct.type.getValue()); + oprot.writeFieldEnd(); + } + if (struct.typeQualifiers != null) { + if (struct.isSetTypeQualifiers()) { + oprot.writeFieldBegin(TYPE_QUALIFIERS_FIELD_DESC); + struct.typeQualifiers.write(oprot); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPrimitiveTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TPrimitiveTypeEntryTupleScheme getScheme() { + return new TPrimitiveTypeEntryTupleScheme(); + } + } + + private static class TPrimitiveTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.type.getValue()); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetTypeQualifiers()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTypeQualifiers()) { + struct.typeQualifiers.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.type = org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.findByValue(iprot.readI32()); + struct.setTypeIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.typeQualifiers = new TTypeQualifiers(); + struct.typeQualifiers.read(iprot); + struct.setTypeQualifiersIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java new file mode 100644 index 000000000000..3f558b3733b6 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java @@ -0,0 +1,1008 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TProgressUpdateResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TProgressUpdateResp"); + + private static final org.apache.thrift.protocol.TField HEADER_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("headerNames", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField PROGRESSED_PERCENTAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressedPercentage", org.apache.thrift.protocol.TType.DOUBLE, (short)3); + private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField FOOTER_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("footerSummary", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)6); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TProgressUpdateRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TProgressUpdateRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List headerNames; // required + private @org.apache.thrift.annotation.Nullable java.util.List> rows; // required + private double progressedPercentage; // required + private @org.apache.thrift.annotation.Nullable TJobExecutionStatus status; // required + private @org.apache.thrift.annotation.Nullable java.lang.String footerSummary; // required + private long startTime; // 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 { + HEADER_NAMES((short)1, "headerNames"), + ROWS((short)2, "rows"), + PROGRESSED_PERCENTAGE((short)3, "progressedPercentage"), + /** + * + * @see TJobExecutionStatus + */ + STATUS((short)4, "status"), + FOOTER_SUMMARY((short)5, "footerSummary"), + START_TIME((short)6, "startTime"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // HEADER_NAMES + return HEADER_NAMES; + case 2: // ROWS + return ROWS; + case 3: // PROGRESSED_PERCENTAGE + return PROGRESSED_PERCENTAGE; + case 4: // STATUS + return STATUS; + case 5: // FOOTER_SUMMARY + return FOOTER_SUMMARY; + case 6: // START_TIME + return START_TIME; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __PROGRESSEDPERCENTAGE_ISSET_ID = 0; + private static final int __STARTTIME_ISSET_ID = 1; + private byte __isset_bitfield = 0; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.HEADER_NAMES, new org.apache.thrift.meta_data.FieldMetaData("headerNames", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); + tmpMap.put(_Fields.PROGRESSED_PERCENTAGE, new org.apache.thrift.meta_data.FieldMetaData("progressedPercentage", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); + tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TJobExecutionStatus.class))); + tmpMap.put(_Fields.FOOTER_SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("footerSummary", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TProgressUpdateResp.class, metaDataMap); + } + + public TProgressUpdateResp() { + } + + public TProgressUpdateResp( + java.util.List headerNames, + java.util.List> rows, + double progressedPercentage, + TJobExecutionStatus status, + java.lang.String footerSummary, + long startTime) + { + this(); + this.headerNames = headerNames; + this.rows = rows; + this.progressedPercentage = progressedPercentage; + setProgressedPercentageIsSet(true); + this.status = status; + this.footerSummary = footerSummary; + this.startTime = startTime; + setStartTimeIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public TProgressUpdateResp(TProgressUpdateResp other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetHeaderNames()) { + java.util.List __this__headerNames = new java.util.ArrayList(other.headerNames); + this.headerNames = __this__headerNames; + } + if (other.isSetRows()) { + java.util.List> __this__rows = new java.util.ArrayList>(other.rows.size()); + for (java.util.List other_element : other.rows) { + java.util.List __this__rows_copy = new java.util.ArrayList(other_element); + __this__rows.add(__this__rows_copy); + } + this.rows = __this__rows; + } + this.progressedPercentage = other.progressedPercentage; + if (other.isSetStatus()) { + this.status = other.status; + } + if (other.isSetFooterSummary()) { + this.footerSummary = other.footerSummary; + } + this.startTime = other.startTime; + } + + public TProgressUpdateResp deepCopy() { + return new TProgressUpdateResp(this); + } + + @Override + public void clear() { + this.headerNames = null; + this.rows = null; + setProgressedPercentageIsSet(false); + this.progressedPercentage = 0.0; + this.status = null; + this.footerSummary = null; + setStartTimeIsSet(false); + this.startTime = 0; + } + + public int getHeaderNamesSize() { + return (this.headerNames == null) ? 0 : this.headerNames.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getHeaderNamesIterator() { + return (this.headerNames == null) ? null : this.headerNames.iterator(); + } + + public void addToHeaderNames(java.lang.String elem) { + if (this.headerNames == null) { + this.headerNames = new java.util.ArrayList(); + } + this.headerNames.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getHeaderNames() { + return this.headerNames; + } + + public void setHeaderNames(@org.apache.thrift.annotation.Nullable java.util.List headerNames) { + this.headerNames = headerNames; + } + + public void unsetHeaderNames() { + this.headerNames = null; + } + + /** Returns true if field headerNames is set (has been assigned a value) and false otherwise */ + public boolean isSetHeaderNames() { + return this.headerNames != null; + } + + public void setHeaderNamesIsSet(boolean value) { + if (!value) { + this.headerNames = null; + } + } + + public int getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator> getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(java.util.List elem) { + if (this.rows == null) { + this.rows = new java.util.ArrayList>(); + } + this.rows.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List> getRows() { + return this.rows; + } + + public void setRows(@org.apache.thrift.annotation.Nullable java.util.List> rows) { + this.rows = rows; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = null; + } + } + + public double getProgressedPercentage() { + return this.progressedPercentage; + } + + public void setProgressedPercentage(double progressedPercentage) { + this.progressedPercentage = progressedPercentage; + setProgressedPercentageIsSet(true); + } + + public void unsetProgressedPercentage() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + } + + /** Returns true if field progressedPercentage is set (has been assigned a value) and false otherwise */ + public boolean isSetProgressedPercentage() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + } + + public void setProgressedPercentageIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); + } + + /** + * + * @see TJobExecutionStatus + */ + @org.apache.thrift.annotation.Nullable + public TJobExecutionStatus getStatus() { + return this.status; + } + + /** + * + * @see TJobExecutionStatus + */ + public void setStatus(@org.apache.thrift.annotation.Nullable TJobExecutionStatus 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getFooterSummary() { + return this.footerSummary; + } + + public void setFooterSummary(@org.apache.thrift.annotation.Nullable java.lang.String footerSummary) { + this.footerSummary = footerSummary; + } + + public void unsetFooterSummary() { + this.footerSummary = null; + } + + /** Returns true if field footerSummary is set (has been assigned a value) and false otherwise */ + public boolean isSetFooterSummary() { + return this.footerSummary != null; + } + + public void setFooterSummaryIsSet(boolean value) { + if (!value) { + this.footerSummary = null; + } + } + + public long getStartTime() { + return this.startTime; + } + + public void setStartTime(long startTime) { + this.startTime = startTime; + setStartTimeIsSet(true); + } + + public void unsetStartTime() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ + public boolean isSetStartTime() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); + } + + public void setStartTimeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case HEADER_NAMES: + if (value == null) { + unsetHeaderNames(); + } else { + setHeaderNames((java.util.List)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((java.util.List>)value); + } + break; + + case PROGRESSED_PERCENTAGE: + if (value == null) { + unsetProgressedPercentage(); + } else { + setProgressedPercentage((java.lang.Double)value); + } + break; + + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TJobExecutionStatus)value); + } + break; + + case FOOTER_SUMMARY: + if (value == null) { + unsetFooterSummary(); + } else { + setFooterSummary((java.lang.String)value); + } + break; + + case START_TIME: + if (value == null) { + unsetStartTime(); + } else { + setStartTime((java.lang.Long)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case HEADER_NAMES: + return getHeaderNames(); + + case ROWS: + return getRows(); + + case PROGRESSED_PERCENTAGE: + return getProgressedPercentage(); + + case STATUS: + return getStatus(); + + case FOOTER_SUMMARY: + return getFooterSummary(); + + case START_TIME: + return getStartTime(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case HEADER_NAMES: + return isSetHeaderNames(); + case ROWS: + return isSetRows(); + case PROGRESSED_PERCENTAGE: + return isSetProgressedPercentage(); + case STATUS: + return isSetStatus(); + case FOOTER_SUMMARY: + return isSetFooterSummary(); + case START_TIME: + return isSetStartTime(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TProgressUpdateResp) + return this.equals((TProgressUpdateResp)that); + return false; + } + + public boolean equals(TProgressUpdateResp that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_headerNames = true && this.isSetHeaderNames(); + boolean that_present_headerNames = true && that.isSetHeaderNames(); + if (this_present_headerNames || that_present_headerNames) { + if (!(this_present_headerNames && that_present_headerNames)) + return false; + if (!this.headerNames.equals(that.headerNames)) + return false; + } + + boolean this_present_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + return false; + } + + boolean this_present_progressedPercentage = true; + boolean that_present_progressedPercentage = true; + if (this_present_progressedPercentage || that_present_progressedPercentage) { + if (!(this_present_progressedPercentage && that_present_progressedPercentage)) + return false; + if (this.progressedPercentage != that.progressedPercentage) + 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_footerSummary = true && this.isSetFooterSummary(); + boolean that_present_footerSummary = true && that.isSetFooterSummary(); + if (this_present_footerSummary || that_present_footerSummary) { + if (!(this_present_footerSummary && that_present_footerSummary)) + return false; + if (!this.footerSummary.equals(that.footerSummary)) + return false; + } + + boolean this_present_startTime = true; + boolean that_present_startTime = true; + if (this_present_startTime || that_present_startTime) { + if (!(this_present_startTime && that_present_startTime)) + return false; + if (this.startTime != that.startTime) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetHeaderNames()) ? 131071 : 524287); + if (isSetHeaderNames()) + hashCode = hashCode * 8191 + headerNames.hashCode(); + + hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); + if (isSetRows()) + hashCode = hashCode * 8191 + rows.hashCode(); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(progressedPercentage); + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.getValue(); + + hashCode = hashCode * 8191 + ((isSetFooterSummary()) ? 131071 : 524287); + if (isSetFooterSummary()) + hashCode = hashCode * 8191 + footerSummary.hashCode(); + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTime); + + return hashCode; + } + + @Override + public int compareTo(TProgressUpdateResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetHeaderNames()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.headerNames, other.headerNames); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetProgressedPercentage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressedPercentage, other.progressedPercentage); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFooterSummary()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.footerSummary, other.footerSummary); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TProgressUpdateResp("); + boolean first = true; + + sb.append("headerNames:"); + if (this.headerNames == null) { + sb.append("null"); + } else { + sb.append(this.headerNames); + } + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + sb.append(this.rows); + } + first = false; + if (!first) sb.append(", "); + sb.append("progressedPercentage:"); + sb.append(this.progressedPercentage); + first = false; + if (!first) sb.append(", "); + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + first = false; + if (!first) sb.append(", "); + sb.append("footerSummary:"); + if (this.footerSummary == null) { + sb.append("null"); + } else { + sb.append(this.footerSummary); + } + first = false; + if (!first) sb.append(", "); + sb.append("startTime:"); + sb.append(this.startTime); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetHeaderNames()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'headerNames' is unset! Struct:" + toString()); + } + + if (!isSetRows()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); + } + + if (!isSetProgressedPercentage()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'progressedPercentage' is unset! Struct:" + toString()); + } + + if (!isSetStatus()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); + } + + if (!isSetFooterSummary()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'footerSummary' is unset! Struct:" + toString()); + } + + if (!isSetStartTime()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'startTime' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TProgressUpdateRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TProgressUpdateRespStandardScheme getScheme() { + return new TProgressUpdateRespStandardScheme(); + } + } + + private static class TProgressUpdateRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp 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: // HEADER_NAMES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(); + struct.headerNames = new java.util.ArrayList(_list190.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem191; + for (int _i192 = 0; _i192 < _list190.size; ++_i192) + { + _elem191 = iprot.readString(); + struct.headerNames.add(_elem191); + } + iprot.readListEnd(); + } + struct.setHeaderNamesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list193 = iprot.readListBegin(); + struct.rows = new java.util.ArrayList>(_list193.size); + @org.apache.thrift.annotation.Nullable java.util.List _elem194; + for (int _i195 = 0; _i195 < _list193.size; ++_i195) + { + { + org.apache.thrift.protocol.TList _list196 = iprot.readListBegin(); + _elem194 = new java.util.ArrayList(_list196.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem197; + for (int _i198 = 0; _i198 < _list196.size; ++_i198) + { + _elem197 = iprot.readString(); + _elem194.add(_elem197); + } + iprot.readListEnd(); + } + struct.rows.add(_elem194); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PROGRESSED_PERCENTAGE + if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { + struct.progressedPercentage = iprot.readDouble(); + struct.setProgressedPercentageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // STATUS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.status = org.apache.spark.sql.thriftserver.cli.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); + struct.setStatusIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // FOOTER_SUMMARY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.footerSummary = iprot.readString(); + struct.setFooterSummaryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // START_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(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, TProgressUpdateResp struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.headerNames != null) { + oprot.writeFieldBegin(HEADER_NAMES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.headerNames.size())); + for (java.lang.String _iter199 : struct.headerNames) + { + oprot.writeString(_iter199); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.rows.size())); + for (java.util.List _iter200 : struct.rows) + { + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter200.size())); + for (java.lang.String _iter201 : _iter200) + { + oprot.writeString(_iter201); + } + oprot.writeListEnd(); + } + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(PROGRESSED_PERCENTAGE_FIELD_DESC); + oprot.writeDouble(struct.progressedPercentage); + oprot.writeFieldEnd(); + if (struct.status != null) { + oprot.writeFieldBegin(STATUS_FIELD_DESC); + oprot.writeI32(struct.status.getValue()); + oprot.writeFieldEnd(); + } + if (struct.footerSummary != null) { + oprot.writeFieldBegin(FOOTER_SUMMARY_FIELD_DESC); + oprot.writeString(struct.footerSummary); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(START_TIME_FIELD_DESC); + oprot.writeI64(struct.startTime); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TProgressUpdateRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TProgressUpdateRespTupleScheme getScheme() { + return new TProgressUpdateRespTupleScheme(); + } + } + + private static class TProgressUpdateRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.headerNames.size()); + for (java.lang.String _iter202 : struct.headerNames) + { + oprot.writeString(_iter202); + } + } + { + oprot.writeI32(struct.rows.size()); + for (java.util.List _iter203 : struct.rows) + { + { + oprot.writeI32(_iter203.size()); + for (java.lang.String _iter204 : _iter203) + { + oprot.writeString(_iter204); + } + } + } + } + oprot.writeDouble(struct.progressedPercentage); + oprot.writeI32(struct.status.getValue()); + oprot.writeString(struct.footerSummary); + oprot.writeI64(struct.startTime); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list205 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.headerNames = new java.util.ArrayList(_list205.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem206; + for (int _i207 = 0; _i207 < _list205.size; ++_i207) + { + _elem206 = iprot.readString(); + struct.headerNames.add(_elem206); + } + } + struct.setHeaderNamesIsSet(true); + { + org.apache.thrift.protocol.TList _list208 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.rows = new java.util.ArrayList>(_list208.size); + @org.apache.thrift.annotation.Nullable java.util.List _elem209; + for (int _i210 = 0; _i210 < _list208.size; ++_i210) + { + { + org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + _elem209 = new java.util.ArrayList(_list211.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem212; + for (int _i213 = 0; _i213 < _list211.size; ++_i213) + { + _elem212 = iprot.readString(); + _elem209.add(_elem212); + } + } + struct.rows.add(_elem209); + } + } + struct.setRowsIsSet(true); + struct.progressedPercentage = iprot.readDouble(); + struct.setProgressedPercentageIsSet(true); + struct.status = org.apache.spark.sql.thriftserver.cli.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); + struct.setStatusIsSet(true); + struct.footerSummary = iprot.readString(); + struct.setFooterSummaryIsSet(true); + struct.startTime = iprot.readI64(); + struct.setStartTimeIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java new file mode 100644 index 000000000000..c1e1807873bf --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java @@ -0,0 +1,70 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TProtocolVersion implements org.apache.thrift.TEnum { + HIVE_CLI_SERVICE_PROTOCOL_V1(0), + HIVE_CLI_SERVICE_PROTOCOL_V2(1), + HIVE_CLI_SERVICE_PROTOCOL_V3(2), + HIVE_CLI_SERVICE_PROTOCOL_V4(3), + HIVE_CLI_SERVICE_PROTOCOL_V5(4), + HIVE_CLI_SERVICE_PROTOCOL_V6(5), + HIVE_CLI_SERVICE_PROTOCOL_V7(6), + HIVE_CLI_SERVICE_PROTOCOL_V8(7), + HIVE_CLI_SERVICE_PROTOCOL_V9(8), + HIVE_CLI_SERVICE_PROTOCOL_V10(9), + HIVE_CLI_SERVICE_PROTOCOL_V11(10); + + private final int value; + + private TProtocolVersion(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TProtocolVersion findByValue(int value) { + switch (value) { + case 0: + return HIVE_CLI_SERVICE_PROTOCOL_V1; + case 1: + return HIVE_CLI_SERVICE_PROTOCOL_V2; + case 2: + return HIVE_CLI_SERVICE_PROTOCOL_V3; + case 3: + return HIVE_CLI_SERVICE_PROTOCOL_V4; + case 4: + return HIVE_CLI_SERVICE_PROTOCOL_V5; + case 5: + return HIVE_CLI_SERVICE_PROTOCOL_V6; + case 6: + return HIVE_CLI_SERVICE_PROTOCOL_V7; + case 7: + return HIVE_CLI_SERVICE_PROTOCOL_V8; + case 8: + return HIVE_CLI_SERVICE_PROTOCOL_V9; + case 9: + return HIVE_CLI_SERVICE_PROTOCOL_V10; + case 10: + return HIVE_CLI_SERVICE_PROTOCOL_V11; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java new file mode 100644 index 000000000000..3dac24beb2e7 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java @@ -0,0 +1,474 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenReq"); + + 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // 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"), + DELEGATION_TOKEN((short)2, "delegationToken"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // DELEGATION_TOKEN + return DELEGATION_TOKEN; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenReq.class, metaDataMap); + } + + public TRenewDelegationTokenReq() { + } + + public TRenewDelegationTokenReq( + TSessionHandle sessionHandle, + java.lang.String delegationToken) + { + this(); + this.sessionHandle = sessionHandle; + this.delegationToken = delegationToken; + } + + /** + * Performs a deep copy on other. + */ + public TRenewDelegationTokenReq(TRenewDelegationTokenReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetDelegationToken()) { + this.delegationToken = other.delegationToken; + } + } + + public TRenewDelegationTokenReq deepCopy() { + return new TRenewDelegationTokenReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.delegationToken = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getDelegationToken() { + return this.delegationToken; + } + + public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { + this.delegationToken = delegationToken; + } + + public void unsetDelegationToken() { + this.delegationToken = null; + } + + /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ + public boolean isSetDelegationToken() { + return this.delegationToken != null; + } + + public void setDelegationTokenIsSet(boolean value) { + if (!value) { + this.delegationToken = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case DELEGATION_TOKEN: + if (value == null) { + unsetDelegationToken(); + } else { + setDelegationToken((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case DELEGATION_TOKEN: + return getDelegationToken(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case DELEGATION_TOKEN: + return isSetDelegationToken(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TRenewDelegationTokenReq) + return this.equals((TRenewDelegationTokenReq)that); + return false; + } + + public boolean equals(TRenewDelegationTokenReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_delegationToken = true && this.isSetDelegationToken(); + boolean that_present_delegationToken = true && that.isSetDelegationToken(); + if (this_present_delegationToken || that_present_delegationToken) { + if (!(this_present_delegationToken && that_present_delegationToken)) + return false; + if (!this.delegationToken.equals(that.delegationToken)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); + if (isSetDelegationToken()) + hashCode = hashCode * 8191 + delegationToken.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TRenewDelegationTokenReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelegationToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenReq("); + 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("delegationToken:"); + if (this.delegationToken == null) { + sb.append("null"); + } else { + sb.append(this.delegationToken); + } + 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 (!isSetDelegationToken()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TRenewDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRenewDelegationTokenReqStandardScheme getScheme() { + return new TRenewDelegationTokenReqStandardScheme(); + } + } + + private static class TRenewDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenReq 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: // DELEGATION_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(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, TRenewDelegationTokenReq 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.delegationToken != null) { + oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); + oprot.writeString(struct.delegationToken); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRenewDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRenewDelegationTokenReqTupleScheme getScheme() { + return new TRenewDelegationTokenReqTupleScheme(); + } + } + + private static class TRenewDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + oprot.writeString(struct.delegationToken); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + struct.delegationToken = iprot.readString(); + struct.setDelegationTokenIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java new file mode 100644 index 000000000000..1cca35a670fe --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { + STATUS((short)1, "status"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenResp.class, metaDataMap); + } + + public TRenewDelegationTokenResp() { + } + + public TRenewDelegationTokenResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TRenewDelegationTokenResp(TRenewDelegationTokenResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TRenewDelegationTokenResp deepCopy() { + return new TRenewDelegationTokenResp(this); + } + + @Override + public void clear() { + this.status = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TRenewDelegationTokenResp) + return this.equals((TRenewDelegationTokenResp)that); + return false; + } + + public boolean equals(TRenewDelegationTokenResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TRenewDelegationTokenResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TRenewDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRenewDelegationTokenRespStandardScheme getScheme() { + return new TRenewDelegationTokenRespStandardScheme(); + } + } + + private static class TRenewDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenResp 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; + 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, TRenewDelegationTokenResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRenewDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRenewDelegationTokenRespTupleScheme getScheme() { + return new TRenewDelegationTokenRespTupleScheme(); + } + } + + private static class TRenewDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java new file mode 100644 index 000000000000..6fe6cbfc10fe --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java @@ -0,0 +1,423 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); + + private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List colVals; // 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 { + COL_VALS((short)1, "colVals"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // COL_VALS + return COL_VALS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); + } + + public TRow() { + } + + public TRow( + java.util.List colVals) + { + this(); + this.colVals = colVals; + } + + /** + * Performs a deep copy on other. + */ + public TRow(TRow other) { + if (other.isSetColVals()) { + java.util.List __this__colVals = new java.util.ArrayList(other.colVals.size()); + for (TColumnValue other_element : other.colVals) { + __this__colVals.add(new TColumnValue(other_element)); + } + this.colVals = __this__colVals; + } + } + + public TRow deepCopy() { + return new TRow(this); + } + + @Override + public void clear() { + this.colVals = null; + } + + public int getColValsSize() { + return (this.colVals == null) ? 0 : this.colVals.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getColValsIterator() { + return (this.colVals == null) ? null : this.colVals.iterator(); + } + + public void addToColVals(TColumnValue elem) { + if (this.colVals == null) { + this.colVals = new java.util.ArrayList(); + } + this.colVals.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getColVals() { + return this.colVals; + } + + public void setColVals(@org.apache.thrift.annotation.Nullable java.util.List colVals) { + this.colVals = colVals; + } + + public void unsetColVals() { + this.colVals = null; + } + + /** Returns true if field colVals is set (has been assigned a value) and false otherwise */ + public boolean isSetColVals() { + return this.colVals != null; + } + + public void setColValsIsSet(boolean value) { + if (!value) { + this.colVals = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case COL_VALS: + if (value == null) { + unsetColVals(); + } else { + setColVals((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case COL_VALS: + return getColVals(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case COL_VALS: + return isSetColVals(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TRow) + return this.equals((TRow)that); + return false; + } + + public boolean equals(TRow that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_colVals = true && this.isSetColVals(); + boolean that_present_colVals = true && that.isSetColVals(); + if (this_present_colVals || that_present_colVals) { + if (!(this_present_colVals && that_present_colVals)) + return false; + if (!this.colVals.equals(that.colVals)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetColVals()) ? 131071 : 524287); + if (isSetColVals()) + hashCode = hashCode * 8191 + colVals.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TRow other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColVals()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVals, other.colVals); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRow("); + boolean first = true; + + sb.append("colVals:"); + if (this.colVals == null) { + sb.append("null"); + } else { + sb.append(this.colVals); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetColVals()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'colVals' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TRowStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRowStandardScheme getScheme() { + return new TRowStandardScheme(); + } + } + + private static class TRowStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRow 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: // COL_VALS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); + struct.colVals = new java.util.ArrayList(_list46.size); + @org.apache.thrift.annotation.Nullable TColumnValue _elem47; + for (int _i48 = 0; _i48 < _list46.size; ++_i48) + { + _elem47 = new TColumnValue(); + _elem47.read(iprot); + struct.colVals.add(_elem47); + } + iprot.readListEnd(); + } + struct.setColValsIsSet(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, TRow struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.colVals != null) { + oprot.writeFieldBegin(COL_VALS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.colVals.size())); + for (TColumnValue _iter49 : struct.colVals) + { + _iter49.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRowTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRowTupleScheme getScheme() { + return new TRowTupleScheme(); + } + } + + private static class TRowTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.colVals.size()); + for (TColumnValue _iter50 : struct.colVals) + { + _iter50.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.colVals = new java.util.ArrayList(_list51.size); + @org.apache.thrift.annotation.Nullable TColumnValue _elem52; + for (int _i53 = 0; _i53 < _list51.size; ++_i53) + { + _elem52 = new TColumnValue(); + _elem52.read(iprot); + struct.colVals.add(_elem52); + } + } + struct.setColValsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java new file mode 100644 index 000000000000..84360a4bc172 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java @@ -0,0 +1,900 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); + + private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField BINARY_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumns", org.apache.thrift.protocol.TType.STRING, (short)4); + private static final org.apache.thrift.protocol.TField COLUMN_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("columnCount", org.apache.thrift.protocol.TType.I32, (short)5); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowSetStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowSetTupleSchemeFactory(); + + private long startRowOffset; // required + private @org.apache.thrift.annotation.Nullable java.util.List rows; // required + private @org.apache.thrift.annotation.Nullable java.util.List columns; // optional + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns; // optional + private int columnCount; // 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 { + START_ROW_OFFSET((short)1, "startRowOffset"), + ROWS((short)2, "rows"), + COLUMNS((short)3, "columns"), + BINARY_COLUMNS((short)4, "binaryColumns"), + COLUMN_COUNT((short)5, "columnCount"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // START_ROW_OFFSET + return START_ROW_OFFSET; + case 2: // ROWS + return ROWS; + case 3: // COLUMNS + return COLUMNS; + case 4: // BINARY_COLUMNS + return BINARY_COLUMNS; + case 5: // COLUMN_COUNT + return COLUMN_COUNT; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __STARTROWOFFSET_ISSET_ID = 0; + private static final int __COLUMNCOUNT_ISSET_ID = 1; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.BINARY_COLUMNS,_Fields.COLUMN_COUNT}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRow.class)))); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class)))); + tmpMap.put(_Fields.BINARY_COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("binaryColumns", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + tmpMap.put(_Fields.COLUMN_COUNT, new org.apache.thrift.meta_data.FieldMetaData("columnCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); + } + + public TRowSet() { + } + + public TRowSet( + long startRowOffset, + java.util.List rows) + { + this(); + this.startRowOffset = startRowOffset; + setStartRowOffsetIsSet(true); + this.rows = rows; + } + + /** + * Performs a deep copy on other. + */ + public TRowSet(TRowSet other) { + __isset_bitfield = other.__isset_bitfield; + this.startRowOffset = other.startRowOffset; + if (other.isSetRows()) { + java.util.List __this__rows = new java.util.ArrayList(other.rows.size()); + for (TRow other_element : other.rows) { + __this__rows.add(new TRow(other_element)); + } + this.rows = __this__rows; + } + if (other.isSetColumns()) { + java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); + for (TColumn other_element : other.columns) { + __this__columns.add(new TColumn(other_element)); + } + this.columns = __this__columns; + } + if (other.isSetBinaryColumns()) { + this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(other.binaryColumns); + } + this.columnCount = other.columnCount; + } + + public TRowSet deepCopy() { + return new TRowSet(this); + } + + @Override + public void clear() { + setStartRowOffsetIsSet(false); + this.startRowOffset = 0; + this.rows = null; + this.columns = null; + this.binaryColumns = null; + setColumnCountIsSet(false); + this.columnCount = 0; + } + + public long getStartRowOffset() { + return this.startRowOffset; + } + + public void setStartRowOffset(long startRowOffset) { + this.startRowOffset = startRowOffset; + setStartRowOffsetIsSet(true); + } + + public void unsetStartRowOffset() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + } + + /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */ + public boolean isSetStartRowOffset() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + } + + public void setStartRowOffsetIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); + } + + public int getRowsSize() { + return (this.rows == null) ? 0 : this.rows.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getRowsIterator() { + return (this.rows == null) ? null : this.rows.iterator(); + } + + public void addToRows(TRow elem) { + if (this.rows == null) { + this.rows = new java.util.ArrayList(); + } + this.rows.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getRows() { + return this.rows; + } + + public void setRows(@org.apache.thrift.annotation.Nullable java.util.List rows) { + this.rows = rows; + } + + public void unsetRows() { + this.rows = null; + } + + /** Returns true if field rows is set (has been assigned a value) and false otherwise */ + public boolean isSetRows() { + return this.rows != null; + } + + public void setRowsIsSet(boolean value) { + if (!value) { + this.rows = null; + } + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumn elem) { + if (this.columns == null) { + this.columns = new java.util.ArrayList(); + } + this.columns.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getColumns() { + return this.columns; + } + + public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { + this.columns = columns; + } + + public void unsetColumns() { + this.columns = null; + } + + /** Returns true if field columns is set (has been assigned a value) and false otherwise */ + public boolean isSetColumns() { + return this.columns != null; + } + + public void setColumnsIsSet(boolean value) { + if (!value) { + this.columns = null; + } + } + + public byte[] getBinaryColumns() { + setBinaryColumns(org.apache.thrift.TBaseHelper.rightSize(binaryColumns)); + return binaryColumns == null ? null : binaryColumns.array(); + } + + public java.nio.ByteBuffer bufferForBinaryColumns() { + return org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); + } + + public void setBinaryColumns(byte[] binaryColumns) { + this.binaryColumns = binaryColumns == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(binaryColumns.clone()); + } + + public void setBinaryColumns(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns) { + this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); + } + + public void unsetBinaryColumns() { + this.binaryColumns = null; + } + + /** Returns true if field binaryColumns is set (has been assigned a value) and false otherwise */ + public boolean isSetBinaryColumns() { + return this.binaryColumns != null; + } + + public void setBinaryColumnsIsSet(boolean value) { + if (!value) { + this.binaryColumns = null; + } + } + + public int getColumnCount() { + return this.columnCount; + } + + public void setColumnCount(int columnCount) { + this.columnCount = columnCount; + setColumnCountIsSet(true); + } + + public void unsetColumnCount() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + } + + /** Returns true if field columnCount is set (has been assigned a value) and false otherwise */ + public boolean isSetColumnCount() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + } + + public void setColumnCountIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case START_ROW_OFFSET: + if (value == null) { + unsetStartRowOffset(); + } else { + setStartRowOffset((java.lang.Long)value); + } + break; + + case ROWS: + if (value == null) { + unsetRows(); + } else { + setRows((java.util.List)value); + } + break; + + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((java.util.List)value); + } + break; + + case BINARY_COLUMNS: + if (value == null) { + unsetBinaryColumns(); + } else { + if (value instanceof byte[]) { + setBinaryColumns((byte[])value); + } else { + setBinaryColumns((java.nio.ByteBuffer)value); + } + } + break; + + case COLUMN_COUNT: + if (value == null) { + unsetColumnCount(); + } else { + setColumnCount((java.lang.Integer)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case START_ROW_OFFSET: + return getStartRowOffset(); + + case ROWS: + return getRows(); + + case COLUMNS: + return getColumns(); + + case BINARY_COLUMNS: + return getBinaryColumns(); + + case COLUMN_COUNT: + return getColumnCount(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case START_ROW_OFFSET: + return isSetStartRowOffset(); + case ROWS: + return isSetRows(); + case COLUMNS: + return isSetColumns(); + case BINARY_COLUMNS: + return isSetBinaryColumns(); + case COLUMN_COUNT: + return isSetColumnCount(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TRowSet) + return this.equals((TRowSet)that); + return false; + } + + public boolean equals(TRowSet that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_startRowOffset = true; + boolean that_present_startRowOffset = true; + if (this_present_startRowOffset || that_present_startRowOffset) { + if (!(this_present_startRowOffset && that_present_startRowOffset)) + return false; + if (this.startRowOffset != that.startRowOffset) + return false; + } + + boolean this_present_rows = true && this.isSetRows(); + boolean that_present_rows = true && that.isSetRows(); + if (this_present_rows || that_present_rows) { + if (!(this_present_rows && that_present_rows)) + return false; + if (!this.rows.equals(that.rows)) + return false; + } + + boolean this_present_columns = true && this.isSetColumns(); + boolean that_present_columns = true && that.isSetColumns(); + if (this_present_columns || that_present_columns) { + if (!(this_present_columns && that_present_columns)) + return false; + if (!this.columns.equals(that.columns)) + return false; + } + + boolean this_present_binaryColumns = true && this.isSetBinaryColumns(); + boolean that_present_binaryColumns = true && that.isSetBinaryColumns(); + if (this_present_binaryColumns || that_present_binaryColumns) { + if (!(this_present_binaryColumns && that_present_binaryColumns)) + return false; + if (!this.binaryColumns.equals(that.binaryColumns)) + return false; + } + + boolean this_present_columnCount = true && this.isSetColumnCount(); + boolean that_present_columnCount = true && that.isSetColumnCount(); + if (this_present_columnCount || that_present_columnCount) { + if (!(this_present_columnCount && that_present_columnCount)) + return false; + if (this.columnCount != that.columnCount) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startRowOffset); + + hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); + if (isSetRows()) + hashCode = hashCode * 8191 + rows.hashCode(); + + hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); + if (isSetColumns()) + hashCode = hashCode * 8191 + columns.hashCode(); + + hashCode = hashCode * 8191 + ((isSetBinaryColumns()) ? 131071 : 524287); + if (isSetBinaryColumns()) + hashCode = hashCode * 8191 + binaryColumns.hashCode(); + + hashCode = hashCode * 8191 + ((isSetColumnCount()) ? 131071 : 524287); + if (isSetColumnCount()) + hashCode = hashCode * 8191 + columnCount; + + return hashCode; + } + + @Override + public int compareTo(TRowSet other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartRowOffset()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, other.startRowOffset); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetRows()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBinaryColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryColumns, other.binaryColumns); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumnCount()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnCount, other.columnCount); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TRowSet("); + boolean first = true; + + sb.append("startRowOffset:"); + sb.append(this.startRowOffset); + first = false; + if (!first) sb.append(", "); + sb.append("rows:"); + if (this.rows == null) { + sb.append("null"); + } else { + sb.append(this.rows); + } + first = false; + if (isSetColumns()) { + if (!first) sb.append(", "); + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + sb.append(this.columns); + } + first = false; + } + if (isSetBinaryColumns()) { + if (!first) sb.append(", "); + sb.append("binaryColumns:"); + if (this.binaryColumns == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.binaryColumns, sb); + } + first = false; + } + if (isSetColumnCount()) { + if (!first) sb.append(", "); + sb.append("columnCount:"); + sb.append(this.columnCount); + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetStartRowOffset()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'startRowOffset' is unset! Struct:" + toString()); + } + + if (!isSetRows()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TRowSetStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRowSetStandardScheme getScheme() { + return new TRowSetStandardScheme(); + } + } + + private static class TRowSetStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet 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: // START_ROW_OFFSET + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.startRowOffset = iprot.readI64(); + struct.setStartRowOffsetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ROWS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); + struct.rows = new java.util.ArrayList(_list118.size); + @org.apache.thrift.annotation.Nullable TRow _elem119; + for (int _i120 = 0; _i120 < _list118.size; ++_i120) + { + _elem119 = new TRow(); + _elem119.read(iprot); + struct.rows.add(_elem119); + } + iprot.readListEnd(); + } + struct.setRowsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); + struct.columns = new java.util.ArrayList(_list121.size); + @org.apache.thrift.annotation.Nullable TColumn _elem122; + for (int _i123 = 0; _i123 < _list121.size; ++_i123) + { + _elem122 = new TColumn(); + _elem122.read(iprot); + struct.columns.add(_elem122); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // BINARY_COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.binaryColumns = iprot.readBinary(); + struct.setBinaryColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COLUMN_COUNT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.columnCount = iprot.readI32(); + struct.setColumnCountIsSet(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, TRowSet struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC); + oprot.writeI64(struct.startRowOffset); + oprot.writeFieldEnd(); + if (struct.rows != null) { + oprot.writeFieldBegin(ROWS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); + for (TRow _iter124 : struct.rows) + { + _iter124.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.columns != null) { + if (struct.isSetColumns()) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (TColumn _iter125 : struct.columns) + { + _iter125.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.binaryColumns != null) { + if (struct.isSetBinaryColumns()) { + oprot.writeFieldBegin(BINARY_COLUMNS_FIELD_DESC); + oprot.writeBinary(struct.binaryColumns); + oprot.writeFieldEnd(); + } + } + if (struct.isSetColumnCount()) { + oprot.writeFieldBegin(COLUMN_COUNT_FIELD_DESC); + oprot.writeI32(struct.columnCount); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TRowSetTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TRowSetTupleScheme getScheme() { + return new TRowSetTupleScheme(); + } + } + + private static class TRowSetTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI64(struct.startRowOffset); + { + oprot.writeI32(struct.rows.size()); + for (TRow _iter126 : struct.rows) + { + _iter126.write(oprot); + } + } + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetColumns()) { + optionals.set(0); + } + if (struct.isSetBinaryColumns()) { + optionals.set(1); + } + if (struct.isSetColumnCount()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetColumns()) { + { + oprot.writeI32(struct.columns.size()); + for (TColumn _iter127 : struct.columns) + { + _iter127.write(oprot); + } + } + } + if (struct.isSetBinaryColumns()) { + oprot.writeBinary(struct.binaryColumns); + } + if (struct.isSetColumnCount()) { + oprot.writeI32(struct.columnCount); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.startRowOffset = iprot.readI64(); + struct.setStartRowOffsetIsSet(true); + { + org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.rows = new java.util.ArrayList(_list128.size); + @org.apache.thrift.annotation.Nullable TRow _elem129; + for (int _i130 = 0; _i130 < _list128.size; ++_i130) + { + _elem129 = new TRow(); + _elem129.read(iprot); + struct.rows.add(_elem129); + } + } + struct.setRowsIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new java.util.ArrayList(_list131.size); + @org.apache.thrift.annotation.Nullable TColumn _elem132; + for (int _i133 = 0; _i133 < _list131.size; ++_i133) + { + _elem132 = new TColumn(); + _elem132.read(iprot); + struct.columns.add(_elem132); + } + } + struct.setColumnsIsSet(true); + } + if (incoming.get(1)) { + struct.binaryColumns = iprot.readBinary(); + struct.setBinaryColumnsIsSet(true); + } + if (incoming.get(2)) { + struct.columnCount = iprot.readI32(); + struct.setColumnCountIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java new file mode 100644 index 000000000000..cca69894b016 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionHandle"); + + private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSessionHandleStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSessionHandleTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable THandleIdentifier sessionId; // 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_ID((short)1, "sessionId"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_ID + return SESSION_ID; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionHandle.class, metaDataMap); + } + + public TSessionHandle() { + } + + public TSessionHandle( + THandleIdentifier sessionId) + { + this(); + this.sessionId = sessionId; + } + + /** + * Performs a deep copy on other. + */ + public TSessionHandle(TSessionHandle other) { + if (other.isSetSessionId()) { + this.sessionId = new THandleIdentifier(other.sessionId); + } + } + + public TSessionHandle deepCopy() { + return new TSessionHandle(this); + } + + @Override + public void clear() { + this.sessionId = null; + } + + @org.apache.thrift.annotation.Nullable + public THandleIdentifier getSessionId() { + return this.sessionId; + } + + public void setSessionId(@org.apache.thrift.annotation.Nullable THandleIdentifier sessionId) { + this.sessionId = sessionId; + } + + public void unsetSessionId() { + this.sessionId = null; + } + + /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ + public boolean isSetSessionId() { + return this.sessionId != null; + } + + public void setSessionIdIsSet(boolean value) { + if (!value) { + this.sessionId = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_ID: + if (value == null) { + unsetSessionId(); + } else { + setSessionId((THandleIdentifier)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_ID: + return getSessionId(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_ID: + return isSetSessionId(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TSessionHandle) + return this.equals((TSessionHandle)that); + return false; + } + + public boolean equals(TSessionHandle that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_sessionId = true && this.isSetSessionId(); + boolean that_present_sessionId = true && that.isSetSessionId(); + if (this_present_sessionId || that_present_sessionId) { + if (!(this_present_sessionId && that_present_sessionId)) + return false; + if (!this.sessionId.equals(that.sessionId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionId()) ? 131071 : 524287); + if (isSetSessionId()) + hashCode = hashCode * 8191 + sessionId.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TSessionHandle other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TSessionHandle("); + boolean first = true; + + sb.append("sessionId:"); + if (this.sessionId == null) { + sb.append("null"); + } else { + sb.append(this.sessionId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetSessionId()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionId' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + if (sessionId != null) { + sessionId.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, java.lang.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 TSessionHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TSessionHandleStandardScheme getScheme() { + return new TSessionHandleStandardScheme(); + } + } + + private static class TSessionHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionHandle 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_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.sessionId = new THandleIdentifier(); + struct.sessionId.read(iprot); + struct.setSessionIdIsSet(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, TSessionHandle struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.sessionId != null) { + oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); + struct.sessionId.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TSessionHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TSessionHandleTupleScheme getScheme() { + return new TSessionHandleTupleScheme(); + } + } + + private static class TSessionHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionId.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionId = new THandleIdentifier(); + struct.sessionId.read(iprot); + struct.setSessionIdIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java new file mode 100644 index 000000000000..2969f1618160 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java @@ -0,0 +1,535 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TSetClientInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoReq"); + + 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 CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoReqStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoReqTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // 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 { + SESSION_HANDLE((short)1, "sessionHandle"), + CONFIGURATION((short)2, "configuration"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // SESSION_HANDLE + return SESSION_HANDLE; + case 2: // CONFIGURATION + return CONFIGURATION; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.CONFIGURATION}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoReq.class, metaDataMap); + } + + public TSetClientInfoReq() { + } + + public TSetClientInfoReq( + TSessionHandle sessionHandle) + { + this(); + this.sessionHandle = sessionHandle; + } + + /** + * Performs a deep copy on other. + */ + public TSetClientInfoReq(TSetClientInfoReq other) { + if (other.isSetSessionHandle()) { + this.sessionHandle = new TSessionHandle(other.sessionHandle); + } + if (other.isSetConfiguration()) { + java.util.Map __this__configuration = new java.util.HashMap(other.configuration); + this.configuration = __this__configuration; + } + } + + public TSetClientInfoReq deepCopy() { + return new TSetClientInfoReq(this); + } + + @Override + public void clear() { + this.sessionHandle = null; + this.configuration = null; + } + + @org.apache.thrift.annotation.Nullable + public TSessionHandle getSessionHandle() { + return this.sessionHandle; + } + + public void setSessionHandle(@org.apache.thrift.annotation.Nullable 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 int getConfigurationSize() { + return (this.configuration == null) ? 0 : this.configuration.size(); + } + + public void putToConfiguration(java.lang.String key, java.lang.String val) { + if (this.configuration == null) { + this.configuration = new java.util.HashMap(); + } + this.configuration.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getConfiguration() { + return this.configuration; + } + + public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { + this.configuration = configuration; + } + + public void unsetConfiguration() { + this.configuration = null; + } + + /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ + public boolean isSetConfiguration() { + return this.configuration != null; + } + + public void setConfigurationIsSet(boolean value) { + if (!value) { + this.configuration = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case SESSION_HANDLE: + if (value == null) { + unsetSessionHandle(); + } else { + setSessionHandle((TSessionHandle)value); + } + break; + + case CONFIGURATION: + if (value == null) { + unsetConfiguration(); + } else { + setConfiguration((java.util.Map)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case SESSION_HANDLE: + return getSessionHandle(); + + case CONFIGURATION: + return getConfiguration(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case SESSION_HANDLE: + return isSetSessionHandle(); + case CONFIGURATION: + return isSetConfiguration(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TSetClientInfoReq) + return this.equals((TSetClientInfoReq)that); + return false; + } + + public boolean equals(TSetClientInfoReq that) { + if (that == null) + return false; + if (this == that) + return true; + + 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_configuration = true && this.isSetConfiguration(); + boolean that_present_configuration = true && that.isSetConfiguration(); + if (this_present_configuration || that_present_configuration) { + if (!(this_present_configuration && that_present_configuration)) + return false; + if (!this.configuration.equals(that.configuration)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); + if (isSetSessionHandle()) + hashCode = hashCode * 8191 + sessionHandle.hashCode(); + + hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); + if (isSetConfiguration()) + hashCode = hashCode * 8191 + configuration.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TSetClientInfoReq other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSessionHandle()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetConfiguration()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoReq("); + boolean first = true; + + sb.append("sessionHandle:"); + if (this.sessionHandle == null) { + sb.append("null"); + } else { + sb.append(this.sessionHandle); + } + first = false; + if (isSetConfiguration()) { + if (!first) sb.append(", "); + sb.append("configuration:"); + if (this.configuration == null) { + sb.append("null"); + } else { + sb.append(this.configuration); + } + 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()); + } + + // check for sub-struct validity + if (sessionHandle != null) { + sessionHandle.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, java.lang.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 TSetClientInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TSetClientInfoReqStandardScheme getScheme() { + return new TSetClientInfoReqStandardScheme(); + } + } + + private static class TSetClientInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoReq 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: // CONFIGURATION + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); + struct.configuration = new java.util.HashMap(2*_map162.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key163; + @org.apache.thrift.annotation.Nullable java.lang.String _val164; + for (int _i165 = 0; _i165 < _map162.size; ++_i165) + { + _key163 = iprot.readString(); + _val164 = iprot.readString(); + struct.configuration.put(_key163, _val164); + } + iprot.readMapEnd(); + } + struct.setConfigurationIsSet(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, TSetClientInfoReq 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.configuration != null) { + if (struct.isSetConfiguration()) { + oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); + for (java.util.Map.Entry _iter166 : struct.configuration.entrySet()) + { + oprot.writeString(_iter166.getKey()); + oprot.writeString(_iter166.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TSetClientInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TSetClientInfoReqTupleScheme getScheme() { + return new TSetClientInfoReqTupleScheme(); + } + } + + private static class TSetClientInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle.write(oprot); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetConfiguration()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetConfiguration()) { + { + oprot.writeI32(struct.configuration.size()); + for (java.util.Map.Entry _iter167 : struct.configuration.entrySet()) + { + oprot.writeString(_iter167.getKey()); + oprot.writeString(_iter167.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.sessionHandle = new TSessionHandle(); + struct.sessionHandle.read(iprot); + struct.setSessionHandleIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.configuration = new java.util.HashMap(2*_map168.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key169; + @org.apache.thrift.annotation.Nullable java.lang.String _val170; + for (int _i171 = 0; _i171 < _map168.size; ++_i171) + { + _key169 = iprot.readString(); + _val170 = iprot.readString(); + struct.configuration.put(_key169, _val170); + } + } + struct.setConfigurationIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java new file mode 100644 index 000000000000..c6d5b5fefb88 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java @@ -0,0 +1,373 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TSetClientInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoResp"); + + 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoRespStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoRespTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatus status; // 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 { + STATUS((short)1, "status"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS + return STATUS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoResp.class, metaDataMap); + } + + public TSetClientInfoResp() { + } + + public TSetClientInfoResp( + TStatus status) + { + this(); + this.status = status; + } + + /** + * Performs a deep copy on other. + */ + public TSetClientInfoResp(TSetClientInfoResp other) { + if (other.isSetStatus()) { + this.status = new TStatus(other.status); + } + } + + public TSetClientInfoResp deepCopy() { + return new TSetClientInfoResp(this); + } + + @Override + public void clear() { + this.status = null; + } + + @org.apache.thrift.annotation.Nullable + public TStatus getStatus() { + return this.status; + } + + public void setStatus(@org.apache.thrift.annotation.Nullable 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 void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS: + if (value == null) { + unsetStatus(); + } else { + setStatus((TStatus)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS: + return getStatus(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS: + return isSetStatus(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TSetClientInfoResp) + return this.equals((TSetClientInfoResp)that); + return false; + } + + public boolean equals(TSetClientInfoResp that) { + if (that == null) + return false; + if (this == that) + return true; + + 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; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); + if (isSetStatus()) + hashCode = hashCode * 8191 + status.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TSetClientInfoResp other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatus()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoResp("); + boolean first = true; + + sb.append("status:"); + if (this.status == null) { + sb.append("null"); + } else { + sb.append(this.status); + } + 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()); + } + + // check for sub-struct validity + if (status != null) { + status.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, java.lang.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 TSetClientInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TSetClientInfoRespStandardScheme getScheme() { + return new TSetClientInfoRespStandardScheme(); + } + } + + private static class TSetClientInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoResp 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; + 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, TSetClientInfoResp 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(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TSetClientInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TSetClientInfoRespTupleScheme getScheme() { + return new TSetClientInfoRespTupleScheme(); + } + } + + private static class TSetClientInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status.write(oprot); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.status = new TStatus(); + struct.status.read(iprot); + struct.setStatusIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java new file mode 100644 index 000000000000..6faa97ca5a52 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java @@ -0,0 +1,854 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus"); + + private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField INFO_MESSAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("infoMessages", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); + private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStatusStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStatusTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable TStatusCode statusCode; // required + private @org.apache.thrift.annotation.Nullable java.util.List infoMessages; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional + private int errorCode; // optional + private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // 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 { + /** + * + * @see TStatusCode + */ + STATUS_CODE((short)1, "statusCode"), + INFO_MESSAGES((short)2, "infoMessages"), + SQL_STATE((short)3, "sqlState"), + ERROR_CODE((short)4, "errorCode"), + ERROR_MESSAGE((short)5, "errorMessage"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // STATUS_CODE + return STATUS_CODE; + case 2: // INFO_MESSAGES + return INFO_MESSAGES; + case 3: // SQL_STATE + return SQL_STATE; + case 4: // ERROR_CODE + return ERROR_CODE; + case 5: // ERROR_MESSAGE + return ERROR_MESSAGE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __ERRORCODE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class))); + tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap); + } + + public TStatus() { + } + + public TStatus( + TStatusCode statusCode) + { + this(); + this.statusCode = statusCode; + } + + /** + * Performs a deep copy on other. + */ + public TStatus(TStatus other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetStatusCode()) { + this.statusCode = other.statusCode; + } + if (other.isSetInfoMessages()) { + java.util.List __this__infoMessages = new java.util.ArrayList(other.infoMessages); + this.infoMessages = __this__infoMessages; + } + if (other.isSetSqlState()) { + this.sqlState = other.sqlState; + } + this.errorCode = other.errorCode; + if (other.isSetErrorMessage()) { + this.errorMessage = other.errorMessage; + } + } + + public TStatus deepCopy() { + return new TStatus(this); + } + + @Override + public void clear() { + this.statusCode = null; + this.infoMessages = null; + this.sqlState = null; + setErrorCodeIsSet(false); + this.errorCode = 0; + this.errorMessage = null; + } + + /** + * + * @see TStatusCode + */ + @org.apache.thrift.annotation.Nullable + public TStatusCode getStatusCode() { + return this.statusCode; + } + + /** + * + * @see TStatusCode + */ + public void setStatusCode(@org.apache.thrift.annotation.Nullable TStatusCode statusCode) { + this.statusCode = statusCode; + } + + public void unsetStatusCode() { + this.statusCode = null; + } + + /** Returns true if field statusCode is set (has been assigned a value) and false otherwise */ + public boolean isSetStatusCode() { + return this.statusCode != null; + } + + public void setStatusCodeIsSet(boolean value) { + if (!value) { + this.statusCode = null; + } + } + + public int getInfoMessagesSize() { + return (this.infoMessages == null) ? 0 : this.infoMessages.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getInfoMessagesIterator() { + return (this.infoMessages == null) ? null : this.infoMessages.iterator(); + } + + public void addToInfoMessages(java.lang.String elem) { + if (this.infoMessages == null) { + this.infoMessages = new java.util.ArrayList(); + } + this.infoMessages.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getInfoMessages() { + return this.infoMessages; + } + + public void setInfoMessages(@org.apache.thrift.annotation.Nullable java.util.List infoMessages) { + this.infoMessages = infoMessages; + } + + public void unsetInfoMessages() { + this.infoMessages = null; + } + + /** Returns true if field infoMessages is set (has been assigned a value) and false otherwise */ + public boolean isSetInfoMessages() { + return this.infoMessages != null; + } + + public void setInfoMessagesIsSet(boolean value) { + if (!value) { + this.infoMessages = null; + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getSqlState() { + return this.sqlState; + } + + public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { + this.sqlState = sqlState; + } + + public void unsetSqlState() { + this.sqlState = null; + } + + /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ + public boolean isSetSqlState() { + return this.sqlState != null; + } + + public void setSqlStateIsSet(boolean value) { + if (!value) { + this.sqlState = null; + } + } + + public int getErrorCode() { + return this.errorCode; + } + + public void setErrorCode(int errorCode) { + this.errorCode = errorCode; + setErrorCodeIsSet(true); + } + + public void unsetErrorCode() { + __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorCode() { + return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + } + + public void setErrorCodeIsSet(boolean value) { + __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getErrorMessage() { + return this.errorMessage; + } + + public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { + this.errorMessage = errorMessage; + } + + public void unsetErrorMessage() { + this.errorMessage = null; + } + + /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ + public boolean isSetErrorMessage() { + return this.errorMessage != null; + } + + public void setErrorMessageIsSet(boolean value) { + if (!value) { + this.errorMessage = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case STATUS_CODE: + if (value == null) { + unsetStatusCode(); + } else { + setStatusCode((TStatusCode)value); + } + break; + + case INFO_MESSAGES: + if (value == null) { + unsetInfoMessages(); + } else { + setInfoMessages((java.util.List)value); + } + break; + + case SQL_STATE: + if (value == null) { + unsetSqlState(); + } else { + setSqlState((java.lang.String)value); + } + break; + + case ERROR_CODE: + if (value == null) { + unsetErrorCode(); + } else { + setErrorCode((java.lang.Integer)value); + } + break; + + case ERROR_MESSAGE: + if (value == null) { + unsetErrorMessage(); + } else { + setErrorMessage((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case STATUS_CODE: + return getStatusCode(); + + case INFO_MESSAGES: + return getInfoMessages(); + + case SQL_STATE: + return getSqlState(); + + case ERROR_CODE: + return getErrorCode(); + + case ERROR_MESSAGE: + return getErrorMessage(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case STATUS_CODE: + return isSetStatusCode(); + case INFO_MESSAGES: + return isSetInfoMessages(); + case SQL_STATE: + return isSetSqlState(); + case ERROR_CODE: + return isSetErrorCode(); + case ERROR_MESSAGE: + return isSetErrorMessage(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TStatus) + return this.equals((TStatus)that); + return false; + } + + public boolean equals(TStatus that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_statusCode = true && this.isSetStatusCode(); + boolean that_present_statusCode = true && that.isSetStatusCode(); + if (this_present_statusCode || that_present_statusCode) { + if (!(this_present_statusCode && that_present_statusCode)) + return false; + if (!this.statusCode.equals(that.statusCode)) + return false; + } + + boolean this_present_infoMessages = true && this.isSetInfoMessages(); + boolean that_present_infoMessages = true && that.isSetInfoMessages(); + if (this_present_infoMessages || that_present_infoMessages) { + if (!(this_present_infoMessages && that_present_infoMessages)) + return false; + if (!this.infoMessages.equals(that.infoMessages)) + return false; + } + + boolean this_present_sqlState = true && this.isSetSqlState(); + boolean that_present_sqlState = true && that.isSetSqlState(); + if (this_present_sqlState || that_present_sqlState) { + if (!(this_present_sqlState && that_present_sqlState)) + return false; + if (!this.sqlState.equals(that.sqlState)) + return false; + } + + boolean this_present_errorCode = true && this.isSetErrorCode(); + boolean that_present_errorCode = true && that.isSetErrorCode(); + if (this_present_errorCode || that_present_errorCode) { + if (!(this_present_errorCode && that_present_errorCode)) + return false; + if (this.errorCode != that.errorCode) + return false; + } + + boolean this_present_errorMessage = true && this.isSetErrorMessage(); + boolean that_present_errorMessage = true && that.isSetErrorMessage(); + if (this_present_errorMessage || that_present_errorMessage) { + if (!(this_present_errorMessage && that_present_errorMessage)) + return false; + if (!this.errorMessage.equals(that.errorMessage)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetStatusCode()) ? 131071 : 524287); + if (isSetStatusCode()) + hashCode = hashCode * 8191 + statusCode.getValue(); + + hashCode = hashCode * 8191 + ((isSetInfoMessages()) ? 131071 : 524287); + if (isSetInfoMessages()) + hashCode = hashCode * 8191 + infoMessages.hashCode(); + + hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); + if (isSetSqlState()) + hashCode = hashCode * 8191 + sqlState.hashCode(); + + hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); + if (isSetErrorCode()) + hashCode = hashCode * 8191 + errorCode; + + hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); + if (isSetErrorMessage()) + hashCode = hashCode * 8191 + errorMessage.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TStatus other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStatusCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusCode, other.statusCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInfoMessages()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoMessages, other.infoMessages); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSqlState()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorCode()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetErrorMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStatus("); + boolean first = true; + + sb.append("statusCode:"); + if (this.statusCode == null) { + sb.append("null"); + } else { + sb.append(this.statusCode); + } + first = false; + if (isSetInfoMessages()) { + if (!first) sb.append(", "); + sb.append("infoMessages:"); + if (this.infoMessages == null) { + sb.append("null"); + } else { + sb.append(this.infoMessages); + } + first = false; + } + if (isSetSqlState()) { + if (!first) sb.append(", "); + sb.append("sqlState:"); + if (this.sqlState == null) { + sb.append("null"); + } else { + sb.append(this.sqlState); + } + first = false; + } + if (isSetErrorCode()) { + if (!first) sb.append(", "); + sb.append("errorCode:"); + sb.append(this.errorCode); + first = false; + } + if (isSetErrorMessage()) { + if (!first) sb.append(", "); + sb.append("errorMessage:"); + if (this.errorMessage == null) { + sb.append("null"); + } else { + sb.append(this.errorMessage); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetStatusCode()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + 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 TStatusStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStatusStandardScheme getScheme() { + return new TStatusStandardScheme(); + } + } + + private static class TStatusStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus 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_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.statusCode = org.apache.spark.sql.thriftserver.cli.thrift.TStatusCode.findByValue(iprot.readI32()); + struct.setStatusCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // INFO_MESSAGES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); + struct.infoMessages = new java.util.ArrayList(_list134.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem135; + for (int _i136 = 0; _i136 < _list134.size; ++_i136) + { + _elem135 = iprot.readString(); + struct.infoMessages.add(_elem135); + } + iprot.readListEnd(); + } + struct.setInfoMessagesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SQL_STATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // ERROR_CODE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // ERROR_MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(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, TStatus struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.statusCode != null) { + oprot.writeFieldBegin(STATUS_CODE_FIELD_DESC); + oprot.writeI32(struct.statusCode.getValue()); + oprot.writeFieldEnd(); + } + if (struct.infoMessages != null) { + if (struct.isSetInfoMessages()) { + oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); + for (java.lang.String _iter137 : struct.infoMessages) + { + oprot.writeString(_iter137); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.sqlState != null) { + if (struct.isSetSqlState()) { + oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); + oprot.writeString(struct.sqlState); + oprot.writeFieldEnd(); + } + } + if (struct.isSetErrorCode()) { + oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); + oprot.writeI32(struct.errorCode); + oprot.writeFieldEnd(); + } + if (struct.errorMessage != null) { + if (struct.isSetErrorMessage()) { + oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); + oprot.writeString(struct.errorMessage); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStatusTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStatusTupleScheme getScheme() { + return new TStatusTupleScheme(); + } + } + + private static class TStatusTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeI32(struct.statusCode.getValue()); + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetInfoMessages()) { + optionals.set(0); + } + if (struct.isSetSqlState()) { + optionals.set(1); + } + if (struct.isSetErrorCode()) { + optionals.set(2); + } + if (struct.isSetErrorMessage()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetInfoMessages()) { + { + oprot.writeI32(struct.infoMessages.size()); + for (java.lang.String _iter138 : struct.infoMessages) + { + oprot.writeString(_iter138); + } + } + } + if (struct.isSetSqlState()) { + oprot.writeString(struct.sqlState); + } + if (struct.isSetErrorCode()) { + oprot.writeI32(struct.errorCode); + } + if (struct.isSetErrorMessage()) { + oprot.writeString(struct.errorMessage); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.statusCode = org.apache.spark.sql.thriftserver.cli.thrift.TStatusCode.findByValue(iprot.readI32()); + struct.setStatusCodeIsSet(true); + java.util.BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.infoMessages = new java.util.ArrayList(_list139.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem140; + for (int _i141 = 0; _i141 < _list139.size; ++_i141) + { + _elem140 = iprot.readString(); + struct.infoMessages.add(_elem140); + } + } + struct.setInfoMessagesIsSet(true); + } + if (incoming.get(1)) { + struct.sqlState = iprot.readString(); + struct.setSqlStateIsSet(true); + } + if (incoming.get(2)) { + struct.errorCode = iprot.readI32(); + struct.setErrorCodeIsSet(true); + } + if (incoming.get(3)) { + struct.errorMessage = iprot.readString(); + struct.setErrorMessageIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java new file mode 100644 index 000000000000..665985167d19 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java @@ -0,0 +1,52 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TStatusCode implements org.apache.thrift.TEnum { + SUCCESS_STATUS(0), + SUCCESS_WITH_INFO_STATUS(1), + STILL_EXECUTING_STATUS(2), + ERROR_STATUS(3), + INVALID_HANDLE_STATUS(4); + + private final int value; + + private TStatusCode(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TStatusCode findByValue(int value) { + switch (value) { + case 0: + return SUCCESS_STATUS; + case 1: + return SUCCESS_WITH_INFO_STATUS; + case 2: + return STILL_EXECUTING_STATUS; + case 3: + return ERROR_STATUS; + case 4: + return INVALID_HANDLE_STATUS; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java new file mode 100644 index 000000000000..46b0ef88db34 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java @@ -0,0 +1,531 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn"); + + private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringColumnStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringColumnTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List values; // required + private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // 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 { + VALUES((short)1, "values"), + NULLS((short)2, "nulls"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUES + return VALUES; + case 2: // NULLS + return NULLS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap); + } + + public TStringColumn() { + } + + public TStringColumn( + java.util.List values, + java.nio.ByteBuffer nulls) + { + this(); + this.values = values; + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + /** + * Performs a deep copy on other. + */ + public TStringColumn(TStringColumn other) { + if (other.isSetValues()) { + java.util.List __this__values = new java.util.ArrayList(other.values); + this.values = __this__values; + } + if (other.isSetNulls()) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); + } + } + + public TStringColumn deepCopy() { + return new TStringColumn(this); + } + + @Override + public void clear() { + this.values = null; + this.nulls = null; + } + + public int getValuesSize() { + return (this.values == null) ? 0 : this.values.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getValuesIterator() { + return (this.values == null) ? null : this.values.iterator(); + } + + public void addToValues(java.lang.String elem) { + if (this.values == null) { + this.values = new java.util.ArrayList(); + } + this.values.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getValues() { + return this.values; + } + + public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + this.values = values; + } + + public void unsetValues() { + this.values = null; + } + + /** Returns true if field values is set (has been assigned a value) and false otherwise */ + public boolean isSetValues() { + return this.values != null; + } + + public void setValuesIsSet(boolean value) { + if (!value) { + this.values = null; + } + } + + public byte[] getNulls() { + setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); + return nulls == null ? null : nulls.array(); + } + + public java.nio.ByteBuffer bufferForNulls() { + return org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void setNulls(byte[] nulls) { + this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + } + + public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); + } + + public void unsetNulls() { + this.nulls = null; + } + + /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ + public boolean isSetNulls() { + return this.nulls != null; + } + + public void setNullsIsSet(boolean value) { + if (!value) { + this.nulls = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUES: + if (value == null) { + unsetValues(); + } else { + setValues((java.util.List)value); + } + break; + + case NULLS: + if (value == null) { + unsetNulls(); + } else { + if (value instanceof byte[]) { + setNulls((byte[])value); + } else { + setNulls((java.nio.ByteBuffer)value); + } + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUES: + return getValues(); + + case NULLS: + return getNulls(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUES: + return isSetValues(); + case NULLS: + return isSetNulls(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TStringColumn) + return this.equals((TStringColumn)that); + return false; + } + + public boolean equals(TStringColumn that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_values = true && this.isSetValues(); + boolean that_present_values = true && that.isSetValues(); + if (this_present_values || that_present_values) { + if (!(this_present_values && that_present_values)) + return false; + if (!this.values.equals(that.values)) + return false; + } + + boolean this_present_nulls = true && this.isSetNulls(); + boolean that_present_nulls = true && that.isSetNulls(); + if (this_present_nulls || that_present_nulls) { + if (!(this_present_nulls && that_present_nulls)) + return false; + if (!this.nulls.equals(that.nulls)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); + if (isSetValues()) + hashCode = hashCode * 8191 + values.hashCode(); + + hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); + if (isSetNulls()) + hashCode = hashCode * 8191 + nulls.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TStringColumn other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValues()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNulls()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringColumn("); + boolean first = true; + + sb.append("values:"); + if (this.values == null) { + sb.append("null"); + } else { + sb.append(this.values); + } + first = false; + if (!first) sb.append(", "); + sb.append("nulls:"); + if (this.nulls == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.nulls, sb); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetValues()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); + } + + if (!isSetNulls()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TStringColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStringColumnStandardScheme getScheme() { + return new TStringColumnStandardScheme(); + } + } + + private static class TStringColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn 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: // VALUES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); + struct.values = new java.util.ArrayList(_list102.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem103; + for (int _i104 = 0; _i104 < _list102.size; ++_i104) + { + _elem103 = iprot.readString(); + struct.values.add(_elem103); + } + iprot.readListEnd(); + } + struct.setValuesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NULLS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(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, TStringColumn struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.values != null) { + oprot.writeFieldBegin(VALUES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); + for (java.lang.String _iter105 : struct.values) + { + oprot.writeString(_iter105); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.nulls != null) { + oprot.writeFieldBegin(NULLS_FIELD_DESC); + oprot.writeBinary(struct.nulls); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStringColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStringColumnTupleScheme getScheme() { + return new TStringColumnTupleScheme(); + } + } + + private static class TStringColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.values.size()); + for (java.lang.String _iter106 : struct.values) + { + oprot.writeString(_iter106); + } + } + oprot.writeBinary(struct.nulls); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.values = new java.util.ArrayList(_list107.size); + @org.apache.thrift.annotation.Nullable java.lang.String _elem108; + for (int _i109 = 0; _i109 < _list107.size; ++_i109) + { + _elem108 = iprot.readString(); + struct.values.add(_elem108); + } + } + struct.setValuesIsSet(true); + struct.nulls = iprot.readBinary(); + struct.setNullsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java new file mode 100644 index 000000000000..ba6d187ac01a --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java @@ -0,0 +1,372 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); + + private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringValueStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringValueTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.lang.String value; // 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 { + VALUE((short)1, "value"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // VALUE + return VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final _Fields optionals[] = {_Fields.VALUE}; + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); + } + + public TStringValue() { + } + + /** + * Performs a deep copy on other. + */ + public TStringValue(TStringValue other) { + if (other.isSetValue()) { + this.value = other.value; + } + } + + public TStringValue deepCopy() { + return new TStringValue(this); + } + + @Override + public void clear() { + this.value = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getValue() { + return this.value; + } + + public void setValue(@org.apache.thrift.annotation.Nullable java.lang.String value) { + this.value = value; + } + + public void unsetValue() { + this.value = null; + } + + /** Returns true if field value is set (has been assigned a value) and false otherwise */ + public boolean isSetValue() { + return this.value != null; + } + + public void setValueIsSet(boolean value) { + if (!value) { + this.value = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case VALUE: + if (value == null) { + unsetValue(); + } else { + setValue((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case VALUE: + return getValue(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case VALUE: + return isSetValue(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TStringValue) + return this.equals((TStringValue)that); + return false; + } + + public boolean equals(TStringValue that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_value = true && this.isSetValue(); + boolean that_present_value = true && that.isSetValue(); + if (this_present_value || that_present_value) { + if (!(this_present_value && that_present_value)) + return false; + if (!this.value.equals(that.value)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); + if (isSetValue()) + hashCode = hashCode * 8191 + value.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TStringValue other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetValue()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringValue("); + boolean first = true; + + if (isSetValue()) { + sb.append("value:"); + if (this.value == null) { + sb.append("null"); + } else { + sb.append(this.value); + } + first = false; + } + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + 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, java.lang.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 TStringValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStringValueStandardScheme getScheme() { + return new TStringValueStandardScheme(); + } + } + + private static class TStringValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue 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: // VALUE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.value = iprot.readString(); + struct.setValueIsSet(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, TStringValue struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.value != null) { + if (struct.isSetValue()) { + oprot.writeFieldBegin(VALUE_FIELD_DESC); + oprot.writeString(struct.value); + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStringValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStringValueTupleScheme getScheme() { + return new TStringValueTupleScheme(); + } + } + + private static class TStringValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet optionals = new java.util.BitSet(); + if (struct.isSetValue()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetValue()) { + oprot.writeString(struct.value); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + java.util.BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.value = iprot.readString(); + struct.setValueIsSet(true); + } + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java new file mode 100644 index 000000000000..c1bc3c7b61c1 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java @@ -0,0 +1,431 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStructTypeEntry"); + + private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStructTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStructTypeEntryTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // 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 { + NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME_TO_TYPE_PTR + return NAME_TO_TYPE_PTR; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStructTypeEntry.class, metaDataMap); + } + + public TStructTypeEntry() { + } + + public TStructTypeEntry( + java.util.Map nameToTypePtr) + { + this(); + this.nameToTypePtr = nameToTypePtr; + } + + /** + * Performs a deep copy on other. + */ + public TStructTypeEntry(TStructTypeEntry other) { + if (other.isSetNameToTypePtr()) { + java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); + for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { + + java.lang.String other_element_key = other_element.getKey(); + java.lang.Integer other_element_value = other_element.getValue(); + + java.lang.String __this__nameToTypePtr_copy_key = other_element_key; + + java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; + + __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); + } + this.nameToTypePtr = __this__nameToTypePtr; + } + } + + public TStructTypeEntry deepCopy() { + return new TStructTypeEntry(this); + } + + @Override + public void clear() { + this.nameToTypePtr = null; + } + + public int getNameToTypePtrSize() { + return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); + } + + public void putToNameToTypePtr(java.lang.String key, int val) { + if (this.nameToTypePtr == null) { + this.nameToTypePtr = new java.util.HashMap(); + } + this.nameToTypePtr.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getNameToTypePtr() { + return this.nameToTypePtr; + } + + public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { + this.nameToTypePtr = nameToTypePtr; + } + + public void unsetNameToTypePtr() { + this.nameToTypePtr = null; + } + + /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetNameToTypePtr() { + return this.nameToTypePtr != null; + } + + public void setNameToTypePtrIsSet(boolean value) { + if (!value) { + this.nameToTypePtr = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case NAME_TO_TYPE_PTR: + if (value == null) { + unsetNameToTypePtr(); + } else { + setNameToTypePtr((java.util.Map)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case NAME_TO_TYPE_PTR: + return getNameToTypePtr(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case NAME_TO_TYPE_PTR: + return isSetNameToTypePtr(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TStructTypeEntry) + return this.equals((TStructTypeEntry)that); + return false; + } + + public boolean equals(TStructTypeEntry that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); + boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); + if (this_present_nameToTypePtr || that_present_nameToTypePtr) { + if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) + return false; + if (!this.nameToTypePtr.equals(that.nameToTypePtr)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); + if (isSetNameToTypePtr()) + hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TStructTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNameToTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TStructTypeEntry("); + boolean first = true; + + sb.append("nameToTypePtr:"); + if (this.nameToTypePtr == null) { + sb.append("null"); + } else { + sb.append(this.nameToTypePtr); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetNameToTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TStructTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStructTypeEntryStandardScheme getScheme() { + return new TStructTypeEntryStandardScheme(); + } + } + + private static class TStructTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry 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: // NAME_TO_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin(); + struct.nameToTypePtr = new java.util.HashMap(2*_map10.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key11; + int _val12; + for (int _i13 = 0; _i13 < _map10.size; ++_i13) + { + _key11 = iprot.readString(); + _val12 = iprot.readI32(); + struct.nameToTypePtr.put(_key11, _val12); + } + iprot.readMapEnd(); + } + struct.setNameToTypePtrIsSet(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, TStructTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.nameToTypePtr != null) { + oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); + for (java.util.Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter14.getKey()); + oprot.writeI32(_iter14.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TStructTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TStructTypeEntryTupleScheme getScheme() { + return new TStructTypeEntryTupleScheme(); + } + } + + private static class TStructTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.nameToTypePtr.size()); + for (java.util.Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter15.getKey()); + oprot.writeI32(_iter15.getValue()); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.nameToTypePtr = new java.util.HashMap(2*_map16.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key17; + int _val18; + for (int _i19 = 0; _i19 < _map16.size; ++_i19) + { + _key17 = iprot.readString(); + _val18 = iprot.readI32(); + struct.nameToTypePtr.put(_key17, _val18); + } + } + struct.setNameToTypePtrIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java new file mode 100644 index 000000000000..9815e9cca6fe --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java @@ -0,0 +1,423 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableSchema"); + + private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableSchemaStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableSchemaTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List columns; // 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 { + COLUMNS((short)1, "columns"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // COLUMNS + return COLUMNS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnDesc.class)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableSchema.class, metaDataMap); + } + + public TTableSchema() { + } + + public TTableSchema( + java.util.List columns) + { + this(); + this.columns = columns; + } + + /** + * Performs a deep copy on other. + */ + public TTableSchema(TTableSchema other) { + if (other.isSetColumns()) { + java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); + for (TColumnDesc other_element : other.columns) { + __this__columns.add(new TColumnDesc(other_element)); + } + this.columns = __this__columns; + } + } + + public TTableSchema deepCopy() { + return new TTableSchema(this); + } + + @Override + public void clear() { + this.columns = null; + } + + public int getColumnsSize() { + return (this.columns == null) ? 0 : this.columns.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getColumnsIterator() { + return (this.columns == null) ? null : this.columns.iterator(); + } + + public void addToColumns(TColumnDesc elem) { + if (this.columns == null) { + this.columns = new java.util.ArrayList(); + } + this.columns.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getColumns() { + return this.columns; + } + + public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { + this.columns = columns; + } + + public void unsetColumns() { + this.columns = null; + } + + /** Returns true if field columns is set (has been assigned a value) and false otherwise */ + public boolean isSetColumns() { + return this.columns != null; + } + + public void setColumnsIsSet(boolean value) { + if (!value) { + this.columns = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case COLUMNS: + if (value == null) { + unsetColumns(); + } else { + setColumns((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case COLUMNS: + return getColumns(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case COLUMNS: + return isSetColumns(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TTableSchema) + return this.equals((TTableSchema)that); + return false; + } + + public boolean equals(TTableSchema that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_columns = true && this.isSetColumns(); + boolean that_present_columns = true && that.isSetColumns(); + if (this_present_columns || that_present_columns) { + if (!(this_present_columns && that_present_columns)) + return false; + if (!this.columns.equals(that.columns)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); + if (isSetColumns()) + hashCode = hashCode * 8191 + columns.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TTableSchema other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetColumns()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TTableSchema("); + boolean first = true; + + sb.append("columns:"); + if (this.columns == null) { + sb.append("null"); + } else { + sb.append(this.columns); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetColumns()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TTableSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TTableSchemaStandardScheme getScheme() { + return new TTableSchemaStandardScheme(); + } + } + + private static class TTableSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema 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: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); + struct.columns = new java.util.ArrayList(_list38.size); + @org.apache.thrift.annotation.Nullable TColumnDesc _elem39; + for (int _i40 = 0; _i40 < _list38.size; ++_i40) + { + _elem39 = new TColumnDesc(); + _elem39.read(iprot); + struct.columns.add(_elem39); + } + iprot.readListEnd(); + } + struct.setColumnsIsSet(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, TTableSchema struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.columns != null) { + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); + for (TColumnDesc _iter41 : struct.columns) + { + _iter41.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TTableSchemaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TTableSchemaTupleScheme getScheme() { + return new TTableSchemaTupleScheme(); + } + } + + private static class TTableSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.columns.size()); + for (TColumnDesc _iter42 : struct.columns) + { + _iter42.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.columns = new java.util.ArrayList(_list43.size); + @org.apache.thrift.annotation.Nullable TColumnDesc _elem44; + for (int _i45 = 0; _i45 < _list43.size; ++_i45) + { + _elem44 = new TColumnDesc(); + _elem44.read(iprot); + struct.columns.add(_elem44); + } + } + struct.setColumnsIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java new file mode 100644 index 000000000000..2ba65bd0bb50 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java @@ -0,0 +1,423 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeDesc"); + + private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeDescStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeDescTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.List types; // 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 { + TYPES((short)1, "types"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TYPES + return TYPES; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeEntry.class)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeDesc.class, metaDataMap); + } + + public TTypeDesc() { + } + + public TTypeDesc( + java.util.List types) + { + this(); + this.types = types; + } + + /** + * Performs a deep copy on other. + */ + public TTypeDesc(TTypeDesc other) { + if (other.isSetTypes()) { + java.util.List __this__types = new java.util.ArrayList(other.types.size()); + for (TTypeEntry other_element : other.types) { + __this__types.add(new TTypeEntry(other_element)); + } + this.types = __this__types; + } + } + + public TTypeDesc deepCopy() { + return new TTypeDesc(this); + } + + @Override + public void clear() { + this.types = null; + } + + public int getTypesSize() { + return (this.types == null) ? 0 : this.types.size(); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Iterator getTypesIterator() { + return (this.types == null) ? null : this.types.iterator(); + } + + public void addToTypes(TTypeEntry elem) { + if (this.types == null) { + this.types = new java.util.ArrayList(); + } + this.types.add(elem); + } + + @org.apache.thrift.annotation.Nullable + public java.util.List getTypes() { + return this.types; + } + + public void setTypes(@org.apache.thrift.annotation.Nullable java.util.List types) { + this.types = types; + } + + public void unsetTypes() { + this.types = null; + } + + /** Returns true if field types is set (has been assigned a value) and false otherwise */ + public boolean isSetTypes() { + return this.types != null; + } + + public void setTypesIsSet(boolean value) { + if (!value) { + this.types = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TYPES: + if (value == null) { + unsetTypes(); + } else { + setTypes((java.util.List)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TYPES: + return getTypes(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case TYPES: + return isSetTypes(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TTypeDesc) + return this.equals((TTypeDesc)that); + return false; + } + + public boolean equals(TTypeDesc that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_types = true && this.isSetTypes(); + boolean that_present_types = true && that.isSetTypes(); + if (this_present_types || that_present_types) { + if (!(this_present_types && that_present_types)) + return false; + if (!this.types.equals(that.types)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetTypes()) ? 131071 : 524287); + if (isSetTypes()) + hashCode = hashCode * 8191 + types.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TTypeDesc other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypes()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.types, other.types); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeDesc("); + boolean first = true; + + sb.append("types:"); + if (this.types == null) { + sb.append("null"); + } else { + sb.append(this.types); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetTypes()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'types' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TTypeDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TTypeDescStandardScheme getScheme() { + return new TTypeDescStandardScheme(); + } + } + + private static class TTypeDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc 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: // TYPES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); + struct.types = new java.util.ArrayList(_list30.size); + @org.apache.thrift.annotation.Nullable TTypeEntry _elem31; + for (int _i32 = 0; _i32 < _list30.size; ++_i32) + { + _elem31 = new TTypeEntry(); + _elem31.read(iprot); + struct.types.add(_elem31); + } + iprot.readListEnd(); + } + struct.setTypesIsSet(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, TTypeDesc struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.types != null) { + oprot.writeFieldBegin(TYPES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.types.size())); + for (TTypeEntry _iter33 : struct.types) + { + _iter33.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TTypeDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TTypeDescTupleScheme getScheme() { + return new TTypeDescTupleScheme(); + } + } + + private static class TTypeDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.types.size()); + for (TTypeEntry _iter34 : struct.types) + { + _iter34.write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.types = new java.util.ArrayList(_list35.size); + @org.apache.thrift.annotation.Nullable TTypeEntry _elem36; + for (int _i37 = 0; _i37 < _list35.size; ++_i37) + { + _elem36 = new TTypeEntry(); + _elem36.read(iprot); + struct.types.add(_elem36); + } + } + struct.setTypesIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java new file mode 100644 index 000000000000..9367055e4c7d --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java @@ -0,0 +1,591 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TTypeEntry extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry"); + private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField ARRAY_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("arrayEntry", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField MAP_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("mapEntry", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField STRUCT_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("structEntry", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField UNION_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("unionEntry", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final org.apache.thrift.protocol.TField USER_DEFINED_TYPE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("userDefinedTypeEntry", org.apache.thrift.protocol.TType.STRUCT, (short)6); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + PRIMITIVE_ENTRY((short)1, "primitiveEntry"), + ARRAY_ENTRY((short)2, "arrayEntry"), + MAP_ENTRY((short)3, "mapEntry"), + STRUCT_ENTRY((short)4, "structEntry"), + UNION_ENTRY((short)5, "unionEntry"), + USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // PRIMITIVE_ENTRY + return PRIMITIVE_ENTRY; + case 2: // ARRAY_ENTRY + return ARRAY_ENTRY; + case 3: // MAP_ENTRY + return MAP_ENTRY; + case 4: // STRUCT_ENTRY + return STRUCT_ENTRY; + case 5: // UNION_ENTRY + return UNION_ENTRY; + case 6: // USER_DEFINED_TYPE_ENTRY + return USER_DEFINED_TYPE_ENTRY; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class))); + tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class))); + tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class))); + tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class))); + tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class))); + tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap); + } + + public TTypeEntry() { + super(); + } + + public TTypeEntry(_Fields setField, java.lang.Object value) { + super(setField, value); + } + + public TTypeEntry(TTypeEntry other) { + super(other); + } + public TTypeEntry deepCopy() { + return new TTypeEntry(this); + } + + public static TTypeEntry primitiveEntry(TPrimitiveTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setPrimitiveEntry(value); + return x; + } + + public static TTypeEntry arrayEntry(TArrayTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setArrayEntry(value); + return x; + } + + public static TTypeEntry mapEntry(TMapTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setMapEntry(value); + return x; + } + + public static TTypeEntry structEntry(TStructTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setStructEntry(value); + return x; + } + + public static TTypeEntry unionEntry(TUnionTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setUnionEntry(value); + return x; + } + + public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) { + TTypeEntry x = new TTypeEntry(); + x.setUserDefinedTypeEntry(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + switch (setField) { + case PRIMITIVE_ENTRY: + if (value instanceof TPrimitiveTypeEntry) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); + case ARRAY_ENTRY: + if (value instanceof TArrayTypeEntry) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); + case MAP_ENTRY: + if (value instanceof TMapTypeEntry) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); + case STRUCT_ENTRY: + if (value instanceof TStructTypeEntry) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); + case UNION_ENTRY: + if (value instanceof TUnionTypeEntry) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); + case USER_DEFINED_TYPE_ENTRY: + if (value instanceof TUserDefinedTypeEntry) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case PRIMITIVE_ENTRY: + if (field.type == PRIMITIVE_ENTRY_FIELD_DESC.type) { + TPrimitiveTypeEntry primitiveEntry; + primitiveEntry = new TPrimitiveTypeEntry(); + primitiveEntry.read(iprot); + return primitiveEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case ARRAY_ENTRY: + if (field.type == ARRAY_ENTRY_FIELD_DESC.type) { + TArrayTypeEntry arrayEntry; + arrayEntry = new TArrayTypeEntry(); + arrayEntry.read(iprot); + return arrayEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case MAP_ENTRY: + if (field.type == MAP_ENTRY_FIELD_DESC.type) { + TMapTypeEntry mapEntry; + mapEntry = new TMapTypeEntry(); + mapEntry.read(iprot); + return mapEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRUCT_ENTRY: + if (field.type == STRUCT_ENTRY_FIELD_DESC.type) { + TStructTypeEntry structEntry; + structEntry = new TStructTypeEntry(); + structEntry.read(iprot); + return structEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case UNION_ENTRY: + if (field.type == UNION_ENTRY_FIELD_DESC.type) { + TUnionTypeEntry unionEntry; + unionEntry = new TUnionTypeEntry(); + unionEntry.read(iprot); + return unionEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case USER_DEFINED_TYPE_ENTRY: + if (field.type == USER_DEFINED_TYPE_ENTRY_FIELD_DESC.type) { + TUserDefinedTypeEntry userDefinedTypeEntry; + userDefinedTypeEntry = new TUserDefinedTypeEntry(); + userDefinedTypeEntry.read(iprot); + return userDefinedTypeEntry; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case PRIMITIVE_ENTRY: + TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; + primitiveEntry.write(oprot); + return; + case ARRAY_ENTRY: + TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; + arrayEntry.write(oprot); + return; + case MAP_ENTRY: + TMapTypeEntry mapEntry = (TMapTypeEntry)value_; + mapEntry.write(oprot); + return; + case STRUCT_ENTRY: + TStructTypeEntry structEntry = (TStructTypeEntry)value_; + structEntry.write(oprot); + return; + case UNION_ENTRY: + TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; + unionEntry.write(oprot); + return; + case USER_DEFINED_TYPE_ENTRY: + TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; + userDefinedTypeEntry.write(oprot); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case PRIMITIVE_ENTRY: + TPrimitiveTypeEntry primitiveEntry; + primitiveEntry = new TPrimitiveTypeEntry(); + primitiveEntry.read(iprot); + return primitiveEntry; + case ARRAY_ENTRY: + TArrayTypeEntry arrayEntry; + arrayEntry = new TArrayTypeEntry(); + arrayEntry.read(iprot); + return arrayEntry; + case MAP_ENTRY: + TMapTypeEntry mapEntry; + mapEntry = new TMapTypeEntry(); + mapEntry.read(iprot); + return mapEntry; + case STRUCT_ENTRY: + TStructTypeEntry structEntry; + structEntry = new TStructTypeEntry(); + structEntry.read(iprot); + return structEntry; + case UNION_ENTRY: + TUnionTypeEntry unionEntry; + unionEntry = new TUnionTypeEntry(); + unionEntry.read(iprot); + return unionEntry; + case USER_DEFINED_TYPE_ENTRY: + TUserDefinedTypeEntry userDefinedTypeEntry; + userDefinedTypeEntry = new TUserDefinedTypeEntry(); + userDefinedTypeEntry.read(iprot); + return userDefinedTypeEntry; + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case PRIMITIVE_ENTRY: + TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; + primitiveEntry.write(oprot); + return; + case ARRAY_ENTRY: + TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; + arrayEntry.write(oprot); + return; + case MAP_ENTRY: + TMapTypeEntry mapEntry = (TMapTypeEntry)value_; + mapEntry.write(oprot); + return; + case STRUCT_ENTRY: + TStructTypeEntry structEntry = (TStructTypeEntry)value_; + structEntry.write(oprot); + return; + case UNION_ENTRY: + TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; + unionEntry.write(oprot); + return; + case USER_DEFINED_TYPE_ENTRY: + TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; + userDefinedTypeEntry.write(oprot); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case PRIMITIVE_ENTRY: + return PRIMITIVE_ENTRY_FIELD_DESC; + case ARRAY_ENTRY: + return ARRAY_ENTRY_FIELD_DESC; + case MAP_ENTRY: + return MAP_ENTRY_FIELD_DESC; + case STRUCT_ENTRY: + return STRUCT_ENTRY_FIELD_DESC; + case UNION_ENTRY: + return UNION_ENTRY_FIELD_DESC; + case USER_DEFINED_TYPE_ENTRY: + return USER_DEFINED_TYPE_ENTRY_FIELD_DESC; + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public TPrimitiveTypeEntry getPrimitiveEntry() { + if (getSetField() == _Fields.PRIMITIVE_ENTRY) { + return (TPrimitiveTypeEntry)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setPrimitiveEntry(TPrimitiveTypeEntry value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.PRIMITIVE_ENTRY; + value_ = value; + } + + public TArrayTypeEntry getArrayEntry() { + if (getSetField() == _Fields.ARRAY_ENTRY) { + return (TArrayTypeEntry)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setArrayEntry(TArrayTypeEntry value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.ARRAY_ENTRY; + value_ = value; + } + + public TMapTypeEntry getMapEntry() { + if (getSetField() == _Fields.MAP_ENTRY) { + return (TMapTypeEntry)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setMapEntry(TMapTypeEntry value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.MAP_ENTRY; + value_ = value; + } + + public TStructTypeEntry getStructEntry() { + if (getSetField() == _Fields.STRUCT_ENTRY) { + return (TStructTypeEntry)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStructEntry(TStructTypeEntry value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.STRUCT_ENTRY; + value_ = value; + } + + public TUnionTypeEntry getUnionEntry() { + if (getSetField() == _Fields.UNION_ENTRY) { + return (TUnionTypeEntry)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setUnionEntry(TUnionTypeEntry value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.UNION_ENTRY; + value_ = value; + } + + public TUserDefinedTypeEntry getUserDefinedTypeEntry() { + if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) { + return (TUserDefinedTypeEntry)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.USER_DEFINED_TYPE_ENTRY; + value_ = value; + } + + public boolean isSetPrimitiveEntry() { + return setField_ == _Fields.PRIMITIVE_ENTRY; + } + + + public boolean isSetArrayEntry() { + return setField_ == _Fields.ARRAY_ENTRY; + } + + + public boolean isSetMapEntry() { + return setField_ == _Fields.MAP_ENTRY; + } + + + public boolean isSetStructEntry() { + return setField_ == _Fields.STRUCT_ENTRY; + } + + + public boolean isSetUnionEntry() { + return setField_ == _Fields.UNION_ENTRY; + } + + + public boolean isSetUserDefinedTypeEntry() { + return setField_ == _Fields.USER_DEFINED_TYPE_ENTRY; + } + + + public boolean equals(java.lang.Object other) { + if (other instanceof TTypeEntry) { + return equals((TTypeEntry)other); + } else { + return false; + } + } + + public boolean equals(TTypeEntry other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TTypeEntry other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + java.util.List list = new java.util.ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + java.lang.Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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, java.lang.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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java new file mode 100644 index 000000000000..09d276a0cec3 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java @@ -0,0 +1,106 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + + +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public enum TTypeId implements org.apache.thrift.TEnum { + BOOLEAN_TYPE(0), + TINYINT_TYPE(1), + SMALLINT_TYPE(2), + INT_TYPE(3), + BIGINT_TYPE(4), + FLOAT_TYPE(5), + DOUBLE_TYPE(6), + STRING_TYPE(7), + TIMESTAMP_TYPE(8), + BINARY_TYPE(9), + ARRAY_TYPE(10), + MAP_TYPE(11), + STRUCT_TYPE(12), + UNION_TYPE(13), + USER_DEFINED_TYPE(14), + DECIMAL_TYPE(15), + NULL_TYPE(16), + DATE_TYPE(17), + VARCHAR_TYPE(18), + CHAR_TYPE(19), + INTERVAL_YEAR_MONTH_TYPE(20), + INTERVAL_DAY_TIME_TYPE(21), + TIMESTAMPLOCALTZ_TYPE(22); + + private final int value; + + private TTypeId(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + @org.apache.thrift.annotation.Nullable + public static TTypeId findByValue(int value) { + switch (value) { + case 0: + return BOOLEAN_TYPE; + case 1: + return TINYINT_TYPE; + case 2: + return SMALLINT_TYPE; + case 3: + return INT_TYPE; + case 4: + return BIGINT_TYPE; + case 5: + return FLOAT_TYPE; + case 6: + return DOUBLE_TYPE; + case 7: + return STRING_TYPE; + case 8: + return TIMESTAMP_TYPE; + case 9: + return BINARY_TYPE; + case 10: + return ARRAY_TYPE; + case 11: + return MAP_TYPE; + case 12: + return STRUCT_TYPE; + case 13: + return UNION_TYPE; + case 14: + return USER_DEFINED_TYPE; + case 15: + return DECIMAL_TYPE; + case 16: + return NULL_TYPE; + case 17: + return DATE_TYPE; + case 18: + return VARCHAR_TYPE; + case 19: + return CHAR_TYPE; + case 20: + return INTERVAL_YEAR_MONTH_TYPE; + case 21: + return INTERVAL_DAY_TIME_TYPE; + case 22: + return TIMESTAMPLOCALTZ_TYPE; + default: + return null; + } + } +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java new file mode 100644 index 000000000000..f8598f65e4dd --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java @@ -0,0 +1,342 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TTypeQualifierValue extends org.apache.thrift.TUnion { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifierValue"); + private static final org.apache.thrift.protocol.TField I32_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Value", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)2); + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + I32_VALUE((short)1, "i32Value"), + STRING_VALUE((short)2, "stringValue"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // I32_VALUE + return I32_VALUE; + case 2: // STRING_VALUE + return STRING_VALUE; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.I32_VALUE, new org.apache.thrift.meta_data.FieldMetaData("i32Value", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifierValue.class, metaDataMap); + } + + public TTypeQualifierValue() { + super(); + } + + public TTypeQualifierValue(_Fields setField, java.lang.Object value) { + super(setField, value); + } + + public TTypeQualifierValue(TTypeQualifierValue other) { + super(other); + } + public TTypeQualifierValue deepCopy() { + return new TTypeQualifierValue(this); + } + + public static TTypeQualifierValue i32Value(int value) { + TTypeQualifierValue x = new TTypeQualifierValue(); + x.setI32Value(value); + return x; + } + + public static TTypeQualifierValue stringValue(java.lang.String value) { + TTypeQualifierValue x = new TTypeQualifierValue(); + x.setStringValue(value); + return x; + } + + + @Override + protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + switch (setField) { + case I32_VALUE: + if (value instanceof java.lang.Integer) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); + case STRING_VALUE: + if (value instanceof java.lang.String) { + break; + } + throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(field.id); + if (setField != null) { + switch (setField) { + case I32_VALUE: + if (field.type == I32_VALUE_FIELD_DESC.type) { + java.lang.Integer i32Value; + i32Value = iprot.readI32(); + return i32Value; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + case STRING_VALUE: + if (field.type == STRING_VALUE_FIELD_DESC.type) { + java.lang.String stringValue; + stringValue = iprot.readString(); + return stringValue; + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + return null; + } + } + + @Override + protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case I32_VALUE: + java.lang.Integer i32Value = (java.lang.Integer)value_; + oprot.writeI32(i32Value); + return; + case STRING_VALUE: + java.lang.String stringValue = (java.lang.String)value_; + oprot.writeString(stringValue); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + _Fields setField = _Fields.findByThriftId(fieldID); + if (setField != null) { + switch (setField) { + case I32_VALUE: + java.lang.Integer i32Value; + i32Value = iprot.readI32(); + return i32Value; + case STRING_VALUE: + java.lang.String stringValue; + stringValue = iprot.readString(); + return stringValue; + default: + throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + } + } else { + throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + } + } + + @Override + protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + switch (setField_) { + case I32_VALUE: + java.lang.Integer i32Value = (java.lang.Integer)value_; + oprot.writeI32(i32Value); + return; + case STRING_VALUE: + java.lang.String stringValue = (java.lang.String)value_; + oprot.writeString(stringValue); + return; + default: + throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + } + } + + @Override + protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { + switch (setField) { + case I32_VALUE: + return I32_VALUE_FIELD_DESC; + case STRING_VALUE: + return STRING_VALUE_FIELD_DESC; + default: + throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + } + } + + @Override + protected org.apache.thrift.protocol.TStruct getStructDesc() { + return STRUCT_DESC; + } + + @Override + protected _Fields enumForId(short id) { + return _Fields.findByThriftIdOrThrow(id); + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + + public int getI32Value() { + if (getSetField() == _Fields.I32_VALUE) { + return (java.lang.Integer)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setI32Value(int value) { + setField_ = _Fields.I32_VALUE; + value_ = value; + } + + public java.lang.String getStringValue() { + if (getSetField() == _Fields.STRING_VALUE) { + return (java.lang.String)getFieldValue(); + } else { + throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + } + } + + public void setStringValue(java.lang.String value) { + if (value == null) throw new java.lang.NullPointerException(); + setField_ = _Fields.STRING_VALUE; + value_ = value; + } + + public boolean isSetI32Value() { + return setField_ == _Fields.I32_VALUE; + } + + + public boolean isSetStringValue() { + return setField_ == _Fields.STRING_VALUE; + } + + + public boolean equals(java.lang.Object other) { + if (other instanceof TTypeQualifierValue) { + return equals((TTypeQualifierValue)other); + } else { + return false; + } + } + + public boolean equals(TTypeQualifierValue other) { + return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); + } + + @Override + public int compareTo(TTypeQualifierValue other) { + int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); + if (lastComparison == 0) { + return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); + } + return lastComparison; + } + + + @Override + public int hashCode() { + java.util.List list = new java.util.ArrayList(); + list.add(this.getClass().getName()); + org.apache.thrift.TFieldIdEnum setField = getSetField(); + if (setField != null) { + list.add(setField.getThriftFieldId()); + java.lang.Object value = getFieldValue(); + if (value instanceof org.apache.thrift.TEnum) { + list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); + } else { + list.add(value); + } + } + return list.hashCode(); + } + 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, java.lang.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); + } + } + + +} diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java new file mode 100644 index 000000000000..7c3872e2af62 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java @@ -0,0 +1,433 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifiers"); + + private static final org.apache.thrift.protocol.TField QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifiers", org.apache.thrift.protocol.TType.MAP, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeQualifiersStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeQualifiersTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.Map qualifiers; // 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 { + QUALIFIERS((short)1, "qualifiers"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // QUALIFIERS + return QUALIFIERS; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("qualifiers", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifierValue.class)))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifiers.class, metaDataMap); + } + + public TTypeQualifiers() { + } + + public TTypeQualifiers( + java.util.Map qualifiers) + { + this(); + this.qualifiers = qualifiers; + } + + /** + * Performs a deep copy on other. + */ + public TTypeQualifiers(TTypeQualifiers other) { + if (other.isSetQualifiers()) { + java.util.Map __this__qualifiers = new java.util.HashMap(other.qualifiers.size()); + for (java.util.Map.Entry other_element : other.qualifiers.entrySet()) { + + java.lang.String other_element_key = other_element.getKey(); + TTypeQualifierValue other_element_value = other_element.getValue(); + + java.lang.String __this__qualifiers_copy_key = other_element_key; + + TTypeQualifierValue __this__qualifiers_copy_value = new TTypeQualifierValue(other_element_value); + + __this__qualifiers.put(__this__qualifiers_copy_key, __this__qualifiers_copy_value); + } + this.qualifiers = __this__qualifiers; + } + } + + public TTypeQualifiers deepCopy() { + return new TTypeQualifiers(this); + } + + @Override + public void clear() { + this.qualifiers = null; + } + + public int getQualifiersSize() { + return (this.qualifiers == null) ? 0 : this.qualifiers.size(); + } + + public void putToQualifiers(java.lang.String key, TTypeQualifierValue val) { + if (this.qualifiers == null) { + this.qualifiers = new java.util.HashMap(); + } + this.qualifiers.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getQualifiers() { + return this.qualifiers; + } + + public void setQualifiers(@org.apache.thrift.annotation.Nullable java.util.Map qualifiers) { + this.qualifiers = qualifiers; + } + + public void unsetQualifiers() { + this.qualifiers = null; + } + + /** Returns true if field qualifiers is set (has been assigned a value) and false otherwise */ + public boolean isSetQualifiers() { + return this.qualifiers != null; + } + + public void setQualifiersIsSet(boolean value) { + if (!value) { + this.qualifiers = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case QUALIFIERS: + if (value == null) { + unsetQualifiers(); + } else { + setQualifiers((java.util.Map)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case QUALIFIERS: + return getQualifiers(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case QUALIFIERS: + return isSetQualifiers(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TTypeQualifiers) + return this.equals((TTypeQualifiers)that); + return false; + } + + public boolean equals(TTypeQualifiers that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_qualifiers = true && this.isSetQualifiers(); + boolean that_present_qualifiers = true && that.isSetQualifiers(); + if (this_present_qualifiers || that_present_qualifiers) { + if (!(this_present_qualifiers && that_present_qualifiers)) + return false; + if (!this.qualifiers.equals(that.qualifiers)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetQualifiers()) ? 131071 : 524287); + if (isSetQualifiers()) + hashCode = hashCode * 8191 + qualifiers.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TTypeQualifiers other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetQualifiers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifiers, other.qualifiers); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeQualifiers("); + boolean first = true; + + sb.append("qualifiers:"); + if (this.qualifiers == null) { + sb.append("null"); + } else { + sb.append(this.qualifiers); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetQualifiers()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifiers' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TTypeQualifiersStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TTypeQualifiersStandardScheme getScheme() { + return new TTypeQualifiersStandardScheme(); + } + } + + private static class TTypeQualifiersStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers 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: // QUALIFIERS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); + struct.qualifiers = new java.util.HashMap(2*_map0.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key1; + @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val2; + for (int _i3 = 0; _i3 < _map0.size; ++_i3) + { + _key1 = iprot.readString(); + _val2 = new TTypeQualifierValue(); + _val2.read(iprot); + struct.qualifiers.put(_key1, _val2); + } + iprot.readMapEnd(); + } + struct.setQualifiersIsSet(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, TTypeQualifiers struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.qualifiers != null) { + oprot.writeFieldBegin(QUALIFIERS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.qualifiers.size())); + for (java.util.Map.Entry _iter4 : struct.qualifiers.entrySet()) + { + oprot.writeString(_iter4.getKey()); + _iter4.getValue().write(oprot); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TTypeQualifiersTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TTypeQualifiersTupleScheme getScheme() { + return new TTypeQualifiersTupleScheme(); + } + } + + private static class TTypeQualifiersTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.qualifiers.size()); + for (java.util.Map.Entry _iter5 : struct.qualifiers.entrySet()) + { + oprot.writeString(_iter5.getKey()); + _iter5.getValue().write(oprot); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.qualifiers = new java.util.HashMap(2*_map6.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key7; + @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val8; + for (int _i9 = 0; _i9 < _map6.size; ++_i9) + { + _key7 = iprot.readString(); + _val8 = new TTypeQualifierValue(); + _val8.read(iprot); + struct.qualifiers.put(_key7, _val8); + } + } + struct.setQualifiersIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java new file mode 100644 index 000000000000..9b24c4bcc167 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java @@ -0,0 +1,431 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTypeEntry"); + + private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUnionTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUnionTypeEntryTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // 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 { + NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // NAME_TO_TYPE_PTR + return NAME_TO_TYPE_PTR; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTypeEntry.class, metaDataMap); + } + + public TUnionTypeEntry() { + } + + public TUnionTypeEntry( + java.util.Map nameToTypePtr) + { + this(); + this.nameToTypePtr = nameToTypePtr; + } + + /** + * Performs a deep copy on other. + */ + public TUnionTypeEntry(TUnionTypeEntry other) { + if (other.isSetNameToTypePtr()) { + java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); + for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { + + java.lang.String other_element_key = other_element.getKey(); + java.lang.Integer other_element_value = other_element.getValue(); + + java.lang.String __this__nameToTypePtr_copy_key = other_element_key; + + java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; + + __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); + } + this.nameToTypePtr = __this__nameToTypePtr; + } + } + + public TUnionTypeEntry deepCopy() { + return new TUnionTypeEntry(this); + } + + @Override + public void clear() { + this.nameToTypePtr = null; + } + + public int getNameToTypePtrSize() { + return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); + } + + public void putToNameToTypePtr(java.lang.String key, int val) { + if (this.nameToTypePtr == null) { + this.nameToTypePtr = new java.util.HashMap(); + } + this.nameToTypePtr.put(key, val); + } + + @org.apache.thrift.annotation.Nullable + public java.util.Map getNameToTypePtr() { + return this.nameToTypePtr; + } + + public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { + this.nameToTypePtr = nameToTypePtr; + } + + public void unsetNameToTypePtr() { + this.nameToTypePtr = null; + } + + /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ + public boolean isSetNameToTypePtr() { + return this.nameToTypePtr != null; + } + + public void setNameToTypePtrIsSet(boolean value) { + if (!value) { + this.nameToTypePtr = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case NAME_TO_TYPE_PTR: + if (value == null) { + unsetNameToTypePtr(); + } else { + setNameToTypePtr((java.util.Map)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case NAME_TO_TYPE_PTR: + return getNameToTypePtr(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case NAME_TO_TYPE_PTR: + return isSetNameToTypePtr(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TUnionTypeEntry) + return this.equals((TUnionTypeEntry)that); + return false; + } + + public boolean equals(TUnionTypeEntry that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); + boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); + if (this_present_nameToTypePtr || that_present_nameToTypePtr) { + if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) + return false; + if (!this.nameToTypePtr.equals(that.nameToTypePtr)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); + if (isSetNameToTypePtr()) + hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TUnionTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNameToTypePtr()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TUnionTypeEntry("); + boolean first = true; + + sb.append("nameToTypePtr:"); + if (this.nameToTypePtr == null) { + sb.append("null"); + } else { + sb.append(this.nameToTypePtr); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetNameToTypePtr()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TUnionTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TUnionTypeEntryStandardScheme getScheme() { + return new TUnionTypeEntryStandardScheme(); + } + } + + private static class TUnionTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry 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: // NAME_TO_TYPE_PTR + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin(); + struct.nameToTypePtr = new java.util.HashMap(2*_map20.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key21; + int _val22; + for (int _i23 = 0; _i23 < _map20.size; ++_i23) + { + _key21 = iprot.readString(); + _val22 = iprot.readI32(); + struct.nameToTypePtr.put(_key21, _val22); + } + iprot.readMapEnd(); + } + struct.setNameToTypePtrIsSet(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, TUnionTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.nameToTypePtr != null) { + oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); + for (java.util.Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter24.getKey()); + oprot.writeI32(_iter24.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TUnionTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TUnionTypeEntryTupleScheme getScheme() { + return new TUnionTypeEntryTupleScheme(); + } + } + + private static class TUnionTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + oprot.writeI32(struct.nameToTypePtr.size()); + for (java.util.Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) + { + oprot.writeString(_iter25.getKey()); + oprot.writeI32(_iter25.getValue()); + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + { + org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.nameToTypePtr = new java.util.HashMap(2*_map26.size); + @org.apache.thrift.annotation.Nullable java.lang.String _key27; + int _val28; + for (int _i29 = 0; _i29 < _map26.size; ++_i29) + { + _key27 = iprot.readString(); + _val28 = iprot.readI32(); + struct.nameToTypePtr.put(_key27, _val28); + } + } + struct.setNameToTypePtrIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java new file mode 100644 index 000000000000..32833f692384 --- /dev/null +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java @@ -0,0 +1,368 @@ +/** + * Autogenerated by Thrift Compiler (0.12.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.spark.sql.thriftserver.cli.thrift; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry"); + + private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUserDefinedTypeEntryStandardSchemeFactory(); + private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUserDefinedTypeEntryTupleSchemeFactory(); + + private @org.apache.thrift.annotation.Nullable java.lang.String typeClassName; // 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 { + TYPE_CLASS_NAME((short)1, "typeClassName"); + + private static final java.util.Map byName = new java.util.HashMap(); + + static { + for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TYPE_CLASS_NAME + return TYPE_CLASS_NAME; + 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 java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + @org.apache.thrift.annotation.Nullable + public static _Fields findByName(java.lang.String name) { + return byName.get(name); + } + + private final short _thriftId; + private final java.lang.String _fieldName; + + _Fields(short thriftId, java.lang.String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public java.lang.String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap); + } + + public TUserDefinedTypeEntry() { + } + + public TUserDefinedTypeEntry( + java.lang.String typeClassName) + { + this(); + this.typeClassName = typeClassName; + } + + /** + * Performs a deep copy on other. + */ + public TUserDefinedTypeEntry(TUserDefinedTypeEntry other) { + if (other.isSetTypeClassName()) { + this.typeClassName = other.typeClassName; + } + } + + public TUserDefinedTypeEntry deepCopy() { + return new TUserDefinedTypeEntry(this); + } + + @Override + public void clear() { + this.typeClassName = null; + } + + @org.apache.thrift.annotation.Nullable + public java.lang.String getTypeClassName() { + return this.typeClassName; + } + + public void setTypeClassName(@org.apache.thrift.annotation.Nullable java.lang.String typeClassName) { + this.typeClassName = typeClassName; + } + + public void unsetTypeClassName() { + this.typeClassName = null; + } + + /** Returns true if field typeClassName is set (has been assigned a value) and false otherwise */ + public boolean isSetTypeClassName() { + return this.typeClassName != null; + } + + public void setTypeClassNameIsSet(boolean value) { + if (!value) { + this.typeClassName = null; + } + } + + public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + switch (field) { + case TYPE_CLASS_NAME: + if (value == null) { + unsetTypeClassName(); + } else { + setTypeClassName((java.lang.String)value); + } + break; + + } + } + + @org.apache.thrift.annotation.Nullable + public java.lang.Object getFieldValue(_Fields field) { + switch (field) { + case TYPE_CLASS_NAME: + return getTypeClassName(); + + } + throw new java.lang.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 java.lang.IllegalArgumentException(); + } + + switch (field) { + case TYPE_CLASS_NAME: + return isSetTypeClassName(); + } + throw new java.lang.IllegalStateException(); + } + + @Override + public boolean equals(java.lang.Object that) { + if (that == null) + return false; + if (that instanceof TUserDefinedTypeEntry) + return this.equals((TUserDefinedTypeEntry)that); + return false; + } + + public boolean equals(TUserDefinedTypeEntry that) { + if (that == null) + return false; + if (this == that) + return true; + + boolean this_present_typeClassName = true && this.isSetTypeClassName(); + boolean that_present_typeClassName = true && that.isSetTypeClassName(); + if (this_present_typeClassName || that_present_typeClassName) { + if (!(this_present_typeClassName && that_present_typeClassName)) + return false; + if (!this.typeClassName.equals(that.typeClassName)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + int hashCode = 1; + + hashCode = hashCode * 8191 + ((isSetTypeClassName()) ? 131071 : 524287); + if (isSetTypeClassName()) + hashCode = hashCode * 8191 + typeClassName.hashCode(); + + return hashCode; + } + + @Override + public int compareTo(TUserDefinedTypeEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = java.lang.Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTypeClassName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeClassName, other.typeClassName); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + @org.apache.thrift.annotation.Nullable + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + scheme(iprot).read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + scheme(oprot).write(oprot, this); + } + + @Override + public java.lang.String toString() { + java.lang.StringBuilder sb = new java.lang.StringBuilder("TUserDefinedTypeEntry("); + boolean first = true; + + sb.append("typeClassName:"); + if (this.typeClassName == null) { + sb.append("null"); + } else { + sb.append(this.typeClassName); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetTypeClassName()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeClassName' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + 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, java.lang.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 TUserDefinedTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TUserDefinedTypeEntryStandardScheme getScheme() { + return new TUserDefinedTypeEntryStandardScheme(); + } + } + + private static class TUserDefinedTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry 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: // TYPE_CLASS_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.typeClassName = iprot.readString(); + struct.setTypeClassNameIsSet(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, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.typeClassName != null) { + oprot.writeFieldBegin(TYPE_CLASS_NAME_FIELD_DESC); + oprot.writeString(struct.typeClassName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TUserDefinedTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + public TUserDefinedTypeEntryTupleScheme getScheme() { + return new TUserDefinedTypeEntryTupleScheme(); + } + } + + private static class TUserDefinedTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + oprot.writeString(struct.typeClassName); + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + struct.typeClassName = iprot.readString(); + struct.setTypeClassNameIsSet(true); + } + } + + private static S scheme(org.apache.thrift.protocol.TProtocol proto) { + return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); + } +} + From 272ba3c140b9972537877496081f201abcf4d63d Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 6 Nov 2019 14:49:53 +0800 Subject: [PATCH 51/55] not check current java code now --- sql/thriftserver/pom.xml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index bb03333c16a5..46e51c15657e 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -202,6 +202,39 @@ + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.0 + + false + true + + ${basedir}/src/main/scala + + + ${basedir}/src/test/java + + dev/checkstyle.xml + ${basedir}/target/checkstyle-output.xml + ${project.build.sourceEncoding} + ${project.reporting.outputEncoding} + + + + com.puppycrawl.tools + checkstyle + 8.25 + + + + + + check + + + + From 0de31916e6369f77f0badb96f9fd10fb988c75c8 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 6 Nov 2019 16:39:02 +0800 Subject: [PATCH 52/55] remove import jdk.tools dependency --- sql/thriftserver/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sql/thriftserver/pom.xml b/sql/thriftserver/pom.xml index 46e51c15657e..0955c1c0009a 100644 --- a/sql/thriftserver/pom.xml +++ b/sql/thriftserver/pom.xml @@ -127,6 +127,10 @@ org.apache.curator curator-recipes + + jdk.tools + jdk.tools + From 6374f423396b5dbf390c130a48e29ffc4544e64e Mon Sep 17 00:00:00 2001 From: angerszhu Date: Wed, 6 Nov 2019 19:23:05 +0800 Subject: [PATCH 53/55] follow comment --- sql/thriftserver/README.md | 6 +- .../cli/thrift/TArrayTypeEntry.java | 122 +- .../cli/thrift/TBinaryColumn.java | 173 +- .../thriftserver/cli/thrift/TBoolColumn.java | 163 +- .../thriftserver/cli/thrift/TBoolValue.java | 128 +- .../thriftserver/cli/thrift/TByteColumn.java | 163 +- .../thriftserver/cli/thrift/TByteValue.java | 128 +- .../thriftserver/cli/thrift/TCLIService.java | 5592 ++++++++--------- .../cli/thrift/TCLIServiceConstants.java | 77 +- .../cli/thrift/TCancelDelegationTokenReq.java | 141 +- .../thrift/TCancelDelegationTokenResp.java | 121 +- .../cli/thrift/TCancelOperationReq.java | 121 +- .../cli/thrift/TCancelOperationResp.java | 121 +- .../cli/thrift/TCloseOperationReq.java | 121 +- .../cli/thrift/TCloseOperationResp.java | 121 +- .../cli/thrift/TCloseSessionReq.java | 121 +- .../cli/thrift/TCloseSessionResp.java | 121 +- .../sql/thriftserver/cli/thrift/TColumn.java | 149 +- .../thriftserver/cli/thrift/TColumnDesc.java | 178 +- .../thriftserver/cli/thrift/TColumnValue.java | 141 +- .../cli/thrift/TDoubleColumn.java | 163 +- .../thriftserver/cli/thrift/TDoubleValue.java | 128 +- .../cli/thrift/TExecuteStatementReq.java | 219 +- .../cli/thrift/TExecuteStatementResp.java | 139 +- .../cli/thrift/TFetchOrientation.java | 8 +- .../cli/thrift/TFetchResultsReq.java | 171 +- .../cli/thrift/TFetchResultsResp.java | 156 +- .../cli/thrift/TGetCatalogsReq.java | 121 +- .../cli/thrift/TGetCatalogsResp.java | 139 +- .../cli/thrift/TGetColumnsReq.java | 197 +- .../cli/thrift/TGetColumnsResp.java | 139 +- .../cli/thrift/TGetCrossReferenceReq.java | 249 +- .../cli/thrift/TGetCrossReferenceResp.java | 139 +- .../cli/thrift/TGetDelegationTokenReq.java | 161 +- .../cli/thrift/TGetDelegationTokenResp.java | 143 +- .../cli/thrift/TGetFunctionsReq.java | 181 +- .../cli/thrift/TGetFunctionsResp.java | 139 +- .../thriftserver/cli/thrift/TGetInfoReq.java | 135 +- .../thriftserver/cli/thrift/TGetInfoResp.java | 135 +- .../thriftserver/cli/thrift/TGetInfoType.java | 8 +- .../cli/thrift/TGetInfoValue.java | 201 +- .../cli/thrift/TGetOperationStatusReq.java | 142 +- .../cli/thrift/TGetOperationStatusResp.java | 277 +- .../cli/thrift/TGetPrimaryKeysReq.java | 179 +- .../cli/thrift/TGetPrimaryKeysResp.java | 139 +- .../cli/thrift/TGetQueryIdReq.java | 121 +- .../cli/thrift/TGetQueryIdResp.java | 127 +- .../cli/thrift/TGetResultSetMetadataReq.java | 121 +- .../cli/thrift/TGetResultSetMetadataResp.java | 139 +- .../cli/thrift/TGetSchemasReq.java | 161 +- .../cli/thrift/TGetSchemasResp.java | 139 +- .../cli/thrift/TGetTableTypesReq.java | 121 +- .../cli/thrift/TGetTableTypesResp.java | 139 +- .../cli/thrift/TGetTablesReq.java | 218 +- .../cli/thrift/TGetTablesResp.java | 139 +- .../cli/thrift/TGetTypeInfoReq.java | 121 +- .../cli/thrift/TGetTypeInfoResp.java | 139 +- .../cli/thrift/THandleIdentifier.java | 157 +- .../thriftserver/cli/thrift/TI16Column.java | 163 +- .../thriftserver/cli/thrift/TI16Value.java | 128 +- .../thriftserver/cli/thrift/TI32Column.java | 163 +- .../thriftserver/cli/thrift/TI32Value.java | 128 +- .../thriftserver/cli/thrift/TI64Column.java | 163 +- .../thriftserver/cli/thrift/TI64Value.java | 128 +- .../cli/thrift/TJobExecutionStatus.java | 8 +- .../cli/thrift/TMapTypeEntry.java | 137 +- .../cli/thrift/TOpenSessionReq.java | 201 +- .../cli/thrift/TOpenSessionResp.java | 193 +- .../cli/thrift/TOperationHandle.java | 171 +- .../cli/thrift/TOperationState.java | 8 +- .../cli/thrift/TOperationType.java | 8 +- .../cli/thrift/TPrimitiveTypeEntry.java | 139 +- .../cli/thrift/TProgressUpdateResp.java | 283 +- .../cli/thrift/TProtocolVersion.java | 8 +- .../cli/thrift/TRenewDelegationTokenReq.java | 141 +- .../cli/thrift/TRenewDelegationTokenResp.java | 121 +- .../sql/thriftserver/cli/thrift/TRow.java | 140 +- .../sql/thriftserver/cli/thrift/TRowSet.java | 230 +- .../cli/thrift/TSessionHandle.java | 121 +- .../cli/thrift/TSetClientInfoReq.java | 165 +- .../cli/thrift/TSetClientInfoResp.java | 121 +- .../sql/thriftserver/cli/thrift/TStatus.java | 217 +- .../thriftserver/cli/thrift/TStatusCode.java | 8 +- .../cli/thrift/TStringColumn.java | 173 +- .../thriftserver/cli/thrift/TStringValue.java | 129 +- .../cli/thrift/TStructTypeEntry.java | 155 +- .../thriftserver/cli/thrift/TTableSchema.java | 140 +- .../thriftserver/cli/thrift/TTypeDesc.java | 140 +- .../thriftserver/cli/thrift/TTypeEntry.java | 133 +- .../sql/thriftserver/cli/thrift/TTypeId.java | 8 +- .../cli/thrift/TTypeQualifierValue.java | 125 +- .../cli/thrift/TTypeQualifiers.java | 155 +- .../cli/thrift/TUnionTypeEntry.java | 155 +- .../cli/thrift/TUserDefinedTypeEntry.java | 127 +- 94 files changed, 9795 insertions(+), 8596 deletions(-) diff --git a/sql/thriftserver/README.md b/sql/thriftserver/README.md index aac10166b4aa..91a3487d23dc 100644 --- a/sql/thriftserver/README.md +++ b/sql/thriftserver/README.md @@ -1,3 +1,5 @@ -Thrift commands to generate files from TCLIService.thrift: +Thrift commands to generate files from TCLIService.thrift : -------------------- -thrift --gen java:beans,hashcode -o src/gen/thrift if/TCLIService.thrift +Please use Thrift 0.9.3 available from https://www.apache.org/dist/thrift/0.9.3 + +`thrift --gen java:beans,hashcode,generated_annotations=undated -o src/gen/thrift if/TCLIService.thrift` diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java index d001861b35da..7e552b633da5 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java @@ -1,20 +1,50 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry"); private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TArrayTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TArrayTypeEntryTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TArrayTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TArrayTypeEntryTupleSchemeFactory()); + } private int objectTypePtr; // required @@ -22,10 +52,10 @@ public class TArrayTypeEntry implements org.apache.thrift.TBase byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OBJECT_TYPE_PTR @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,7 +101,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -81,12 +109,12 @@ public java.lang.String getFieldName() { // isset id assignments private static final int __OBJECTTYPEPTR_ISSET_ID = 0; private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap); } @@ -129,56 +157,55 @@ public void setObjectTypePtr(int objectTypePtr) { } public void unsetObjectTypePtr() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); } /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */ public boolean isSetObjectTypePtr() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); } public void setObjectTypePtrIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OBJECT_TYPE_PTR: if (value == null) { unsetObjectTypePtr(); } else { - setObjectTypePtr((java.lang.Integer)value); + setObjectTypePtr((Integer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OBJECT_TYPE_PTR: return getObjectTypePtr(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case OBJECT_TYPE_PTR: return isSetObjectTypePtr(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TArrayTypeEntry) @@ -189,8 +216,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TArrayTypeEntry that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_objectTypePtr = true; boolean that_present_objectTypePtr = true; @@ -206,11 +231,14 @@ public boolean equals(TArrayTypeEntry that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + objectTypePtr; + boolean present_objectTypePtr = true; + list.add(present_objectTypePtr); + if (present_objectTypePtr) + list.add(objectTypePtr); - return hashCode; + return list.hashCode(); } @Override @@ -221,7 +249,7 @@ public int compareTo(TArrayTypeEntry other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); + lastComparison = Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -234,22 +262,21 @@ public int compareTo(TArrayTypeEntry other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TArrayTypeEntry("); + public String toString() { + StringBuilder sb = new StringBuilder("TArrayTypeEntry("); boolean first = true; sb.append("objectTypePtr:"); @@ -276,7 +303,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -286,13 +313,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TArrayTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TArrayTypeEntryStandardSchemeFactory implements SchemeFactory { public TArrayTypeEntryStandardScheme getScheme() { return new TArrayTypeEntryStandardScheme(); } } - private static class TArrayTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TArrayTypeEntryStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -334,30 +361,27 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TArrayTypeEntry st } - private static class TArrayTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TArrayTypeEntryTupleSchemeFactory implements SchemeFactory { public TArrayTypeEntryTupleScheme getScheme() { return new TArrayTypeEntryTupleScheme(); } } - private static class TArrayTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TArrayTypeEntryTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.objectTypePtr); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.objectTypePtr = iprot.readI32(); struct.setObjectTypePtrIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java index b53748d37265..308e1a5d94aa 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBinaryColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBinaryColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBinaryColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBinaryColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryColumn.class, metaDataMap); } @@ -100,8 +128,8 @@ public TBinaryColumn() { } public TBinaryColumn( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TBinaryColumn( */ public TBinaryColumn(TBinaryColumn other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } - public void addToValues(java.nio.ByteBuffer elem) { + public void addToValues(ByteBuffer elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TBinaryColumn) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TBinaryColumn that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TBinaryColumn that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TBinaryColumn other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TBinaryColumn other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TBinaryColumn other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TBinaryColumn("); + public String toString() { + StringBuilder sb = new StringBuilder("TBinaryColumn("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TBinaryColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TBinaryColumnStandardSchemeFactory implements SchemeFactory { public TBinaryColumnStandardScheme getScheme() { return new TBinaryColumnStandardScheme(); } } - private static class TBinaryColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TBinaryColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,8 +446,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list110.size); - @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem111; + struct.values = new ArrayList(_list110.size); + ByteBuffer _elem111; for (int _i112 = 0; _i112 < _list110.size; ++_i112) { _elem111 = iprot.readBinary(); @@ -465,7 +485,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBinaryColumn stru oprot.writeFieldBegin(VALUES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (java.nio.ByteBuffer _iter113 : struct.values) + for (ByteBuffer _iter113 : struct.values) { oprot.writeBinary(_iter113); } @@ -484,20 +504,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBinaryColumn stru } - private static class TBinaryColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TBinaryColumnTupleSchemeFactory implements SchemeFactory { public TBinaryColumnTupleScheme getScheme() { return new TBinaryColumnTupleScheme(); } } - private static class TBinaryColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TBinaryColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); - for (java.nio.ByteBuffer _iter114 : struct.values) + for (ByteBuffer _iter114 : struct.values) { oprot.writeBinary(_iter114); } @@ -507,11 +527,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new java.util.ArrayList(_list115.size); - @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer _elem116; + struct.values = new ArrayList(_list115.size); + ByteBuffer _elem116; for (int _i117 = 0; _i117 < _list115.size; ++_i117) { _elem116 = iprot.readBinary(); @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java index b5b8060ee295..8ef33bac8547 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBoolColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBoolColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolColumn.class, metaDataMap); } @@ -100,8 +128,8 @@ public TBoolColumn() { } public TBoolColumn( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TBoolColumn( */ public TBoolColumn(TBoolColumn other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(boolean elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TBoolColumn) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TBoolColumn that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TBoolColumn that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TBoolColumn other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TBoolColumn other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TBoolColumn other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolColumn("); + public String toString() { + StringBuilder sb = new StringBuilder("TBoolColumn("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TBoolColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TBoolColumnStandardSchemeFactory implements SchemeFactory { public TBoolColumnStandardScheme getScheme() { return new TBoolColumnStandardScheme(); } } - private static class TBoolColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TBoolColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,7 +446,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list54.size); + struct.values = new ArrayList(_list54.size); boolean _elem55; for (int _i56 = 0; _i56 < _list54.size; ++_i56) { @@ -484,17 +504,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolColumn struct } - private static class TBoolColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TBoolColumnTupleSchemeFactory implements SchemeFactory { public TBoolColumnTupleScheme getScheme() { return new TBoolColumnTupleScheme(); } } - private static class TBoolColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TBoolColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (boolean _iter58 : struct.values) @@ -507,10 +527,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); - struct.values = new java.util.ArrayList(_list59.size); + struct.values = new ArrayList(_list59.size); boolean _elem60; for (int _i61 = 0; _i61 < _list59.size; ++_i61) { @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java index 01245aa110e7..0ec6c5cdc853 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java @@ -1,20 +1,50 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TBoolValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TBoolValueTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TBoolValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TBoolValueTupleSchemeFactory()); + } private boolean value; // optional @@ -22,10 +52,10 @@ public class TBoolValue implements org.apache.thrift.TBase byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,7 +101,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -82,12 +110,12 @@ public java.lang.String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolValue.class, metaDataMap); } @@ -122,56 +150,55 @@ public void setValue(boolean value) { } public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((java.lang.Boolean)value); + setValue((Boolean)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return isValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TBoolValue) @@ -182,8 +209,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TBoolValue that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -199,13 +224,14 @@ public boolean equals(TBoolValue that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + ((value) ? 131071 : 524287); + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); - return hashCode; + return list.hashCode(); } @Override @@ -216,7 +242,7 @@ public int compareTo(TBoolValue other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -229,22 +255,21 @@ public int compareTo(TBoolValue other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TBoolValue("); + public String toString() { + StringBuilder sb = new StringBuilder("TBoolValue("); boolean first = true; if (isSetValue()) { @@ -269,7 +294,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -279,13 +304,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TBoolValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TBoolValueStandardSchemeFactory implements SchemeFactory { public TBoolValueStandardScheme getScheme() { return new TBoolValueStandardScheme(); } } - private static class TBoolValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TBoolValueStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -329,18 +354,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolValue struct) } - private static class TBoolValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TBoolValueTupleSchemeFactory implements SchemeFactory { public TBoolValueTupleScheme getScheme() { return new TBoolValueTupleScheme(); } } - private static class TBoolValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TBoolValueTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -352,8 +377,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readBool(); struct.setValueIsSet(true); @@ -361,8 +386,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) t } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java index 432c498ac884..5041ad433994 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TByteColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TByteColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteColumn.class, metaDataMap); } @@ -100,8 +128,8 @@ public TByteColumn() { } public TByteColumn( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TByteColumn( */ public TByteColumn(TByteColumn other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(byte elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TByteColumn) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TByteColumn that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TByteColumn that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TByteColumn other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TByteColumn other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TByteColumn other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteColumn("); + public String toString() { + StringBuilder sb = new StringBuilder("TByteColumn("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TByteColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TByteColumnStandardSchemeFactory implements SchemeFactory { public TByteColumnStandardScheme getScheme() { return new TByteColumnStandardScheme(); } } - private static class TByteColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TByteColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,7 +446,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list62.size); + struct.values = new ArrayList(_list62.size); byte _elem63; for (int _i64 = 0; _i64 < _list62.size; ++_i64) { @@ -484,17 +504,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TByteColumn struct } - private static class TByteColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TByteColumnTupleSchemeFactory implements SchemeFactory { public TByteColumnTupleScheme getScheme() { return new TByteColumnTupleScheme(); } } - private static class TByteColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TByteColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (byte _iter66 : struct.values) @@ -507,10 +527,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); - struct.values = new java.util.ArrayList(_list67.size); + struct.values = new ArrayList(_list67.size); byte _elem68; for (int _i69 = 0; _i69 < _list67.size; ++_i69) { @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java index a78f429c6ecd..2d6ef998f9eb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java @@ -1,20 +1,50 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TByteValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TByteValueTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TByteValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TByteValueTupleSchemeFactory()); + } private byte value; // optional @@ -22,10 +52,10 @@ public class TByteValue implements org.apache.thrift.TBase byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,7 +101,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -82,12 +110,12 @@ public java.lang.String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteValue.class, metaDataMap); } @@ -122,56 +150,55 @@ public void setValue(byte value) { } public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((java.lang.Byte)value); + setValue((Byte)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TByteValue) @@ -182,8 +209,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TByteValue that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -199,13 +224,14 @@ public boolean equals(TByteValue that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + (int) (value); + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); - return hashCode; + return list.hashCode(); } @Override @@ -216,7 +242,7 @@ public int compareTo(TByteValue other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -229,22 +255,21 @@ public int compareTo(TByteValue other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TByteValue("); + public String toString() { + StringBuilder sb = new StringBuilder("TByteValue("); boolean first = true; if (isSetValue()) { @@ -269,7 +294,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -279,13 +304,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TByteValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TByteValueStandardSchemeFactory implements SchemeFactory { public TByteValueStandardScheme getScheme() { return new TByteValueStandardScheme(); } } - private static class TByteValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TByteValueStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -329,18 +354,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TByteValue struct) } - private static class TByteValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TByteValueTupleSchemeFactory implements SchemeFactory { public TByteValueTupleScheme getScheme() { return new TByteValueTupleScheme(); } } - private static class TByteValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TByteValueTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -352,8 +377,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readByte(); struct.setValueIsSet(true); @@ -361,8 +386,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) t } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java index f82e22878573..a0fdad020853 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCLIService { public interface Iface { @@ -62,51 +89,51 @@ public interface Iface { public interface AsyncIface { - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void ExecuteStatement(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 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; + public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; } @@ -677,16 +704,16 @@ public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, super(protocolFactory, clientManager, transport); } - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); OpenSession_call method_call = new OpenSession_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { private TOpenSessionReq req; - public OpenSession_call(TOpenSessionReq 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 { + public OpenSession_call(TOpenSessionReq 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; } @@ -701,7 +728,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TOpenSessionResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -709,16 +736,16 @@ public TOpenSessionResp getResult() throws org.apache.thrift.TException { } } - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { private TCloseSessionReq req; - public CloseSession_call(TCloseSessionReq 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 { + public CloseSession_call(TCloseSessionReq 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; } @@ -733,7 +760,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCloseSessionResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -741,16 +768,16 @@ public TCloseSessionResp getResult() throws org.apache.thrift.TException { } } - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetInfo_call method_call = new GetInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetInfoReq req; - public GetInfo_call(TGetInfoReq 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 { + public GetInfo_call(TGetInfoReq 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; } @@ -765,7 +792,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetInfoResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -773,16 +800,16 @@ public TGetInfoResp getResult() throws org.apache.thrift.TException { } } - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); ExecuteStatement_call method_call = new ExecuteStatement_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { private TExecuteStatementReq req; - public ExecuteStatement_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 { + public ExecuteStatement_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; } @@ -797,7 +824,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TExecuteStatementResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -805,16 +832,16 @@ public TExecuteStatementResp getResult() throws org.apache.thrift.TException { } } - public void GetTypeInfo(TGetTypeInfoReq 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 { checkReady(); GetTypeInfo_call method_call = new GetTypeInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetTypeInfoReq req; - public GetTypeInfo_call(TGetTypeInfoReq 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 { + public GetTypeInfo_call(TGetTypeInfoReq 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; } @@ -829,7 +856,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -837,16 +864,16 @@ public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { } } - public void GetCatalogs(TGetCatalogsReq 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 { checkReady(); GetCatalogs_call method_call = new GetCatalogs_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetCatalogsReq req; - public GetCatalogs_call(TGetCatalogsReq 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 { + public GetCatalogs_call(TGetCatalogsReq 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; } @@ -861,7 +888,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetCatalogsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -869,16 +896,16 @@ public TGetCatalogsResp getResult() throws org.apache.thrift.TException { } } - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetSchemas_call method_call = new GetSchemas_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetSchemasReq req; - public GetSchemas_call(TGetSchemasReq 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 { + public GetSchemas_call(TGetSchemasReq 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; } @@ -893,7 +920,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetSchemasResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -901,16 +928,16 @@ public TGetSchemasResp getResult() throws org.apache.thrift.TException { } } - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetTables_call method_call = new GetTables_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetTablesReq req; - public GetTables_call(TGetTablesReq 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 { + public GetTables_call(TGetTablesReq 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; } @@ -925,7 +952,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetTablesResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -933,16 +960,16 @@ public TGetTablesResp getResult() throws org.apache.thrift.TException { } } - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetTableTypes_call method_call = new GetTableTypes_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetTableTypesReq req; - public GetTableTypes_call(TGetTableTypesReq 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 { + public GetTableTypes_call(TGetTableTypesReq 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; } @@ -957,7 +984,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetTableTypesResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -965,16 +992,16 @@ public TGetTableTypesResp getResult() throws org.apache.thrift.TException { } } - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetColumns_call method_call = new GetColumns_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetColumnsReq req; - public GetColumns_call(TGetColumnsReq 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 { + public GetColumns_call(TGetColumnsReq 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; } @@ -989,7 +1016,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetColumnsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -997,16 +1024,16 @@ public TGetColumnsResp getResult() throws org.apache.thrift.TException { } } - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetFunctions_call method_call = new GetFunctions_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetFunctionsReq req; - public GetFunctions_call(TGetFunctionsReq 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 { + public GetFunctions_call(TGetFunctionsReq 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; } @@ -1021,7 +1048,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetFunctionsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1029,16 +1056,16 @@ public TGetFunctionsResp getResult() throws org.apache.thrift.TException { } } - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetPrimaryKeys_call method_call = new GetPrimaryKeys_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetPrimaryKeysReq req; - public GetPrimaryKeys_call(TGetPrimaryKeysReq 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 { + public GetPrimaryKeys_call(TGetPrimaryKeysReq 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; } @@ -1053,7 +1080,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetPrimaryKeysResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1061,16 +1088,16 @@ public TGetPrimaryKeysResp getResult() throws org.apache.thrift.TException { } } - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetCrossReference_call method_call = new GetCrossReference_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetCrossReferenceReq req; - public GetCrossReference_call(TGetCrossReferenceReq 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 { + public GetCrossReference_call(TGetCrossReferenceReq 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; } @@ -1085,7 +1112,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetCrossReferenceResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1093,16 +1120,16 @@ public TGetCrossReferenceResp getResult() throws org.apache.thrift.TException { } } - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetOperationStatus_call method_call = new GetOperationStatus_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetOperationStatusReq req; - public GetOperationStatus_call(TGetOperationStatusReq 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 { + public GetOperationStatus_call(TGetOperationStatusReq 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; } @@ -1117,7 +1144,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1125,16 +1152,16 @@ public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { } } - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CancelOperation_call method_call = new CancelOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { private TCancelOperationReq req; - public CancelOperation_call(TCancelOperationReq 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 { + public CancelOperation_call(TCancelOperationReq 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; } @@ -1149,7 +1176,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCancelOperationResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1157,16 +1184,16 @@ public TCancelOperationResp getResult() throws org.apache.thrift.TException { } } - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CloseOperation_call method_call = new CloseOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { private TCloseOperationReq req; - public CloseOperation_call(TCloseOperationReq 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 { + public CloseOperation_call(TCloseOperationReq 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; } @@ -1181,7 +1208,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCloseOperationResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1189,16 +1216,16 @@ public TCloseOperationResp getResult() throws org.apache.thrift.TException { } } - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetResultSetMetadata_call method_call = new GetResultSetMetadata_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetResultSetMetadataReq req; - public GetResultSetMetadata_call(TGetResultSetMetadataReq 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 { + public GetResultSetMetadata_call(TGetResultSetMetadataReq 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; } @@ -1213,7 +1240,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1221,16 +1248,16 @@ public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException } } - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); FetchResults_call method_call = new FetchResults_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { private TFetchResultsReq req; - public FetchResults_call(TFetchResultsReq 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 { + public FetchResults_call(TFetchResultsReq 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; } @@ -1245,7 +1272,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TFetchResultsResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1253,16 +1280,16 @@ public TFetchResultsResp getResult() throws org.apache.thrift.TException { } } - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetDelegationToken_call method_call = new GetDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetDelegationTokenReq req; - public GetDelegationToken_call(TGetDelegationTokenReq 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 { + public GetDelegationToken_call(TGetDelegationTokenReq 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; } @@ -1277,7 +1304,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1285,16 +1312,16 @@ public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { } } - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); CancelDelegationToken_call method_call = new CancelDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { private TCancelDelegationTokenReq req; - public CancelDelegationToken_call(TCancelDelegationTokenReq 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 { + public CancelDelegationToken_call(TCancelDelegationTokenReq 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; } @@ -1309,7 +1336,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1317,16 +1344,16 @@ public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TExceptio } } - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); RenewDelegationToken_call method_call = new RenewDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { private TRenewDelegationTokenReq req; - public RenewDelegationToken_call(TRenewDelegationTokenReq 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 { + public RenewDelegationToken_call(TRenewDelegationTokenReq 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; } @@ -1341,7 +1368,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1349,16 +1376,16 @@ public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException } } - public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void GetQueryId(TGetQueryIdReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); GetQueryId_call method_call = new GetQueryId_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class GetQueryId_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class GetQueryId_call extends org.apache.thrift.async.TAsyncMethodCall { private TGetQueryIdReq req; - public GetQueryId_call(TGetQueryIdReq 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 { + public GetQueryId_call(TGetQueryIdReq 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; } @@ -1373,7 +1400,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TGetQueryIdResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1381,16 +1408,16 @@ public TGetQueryIdResp getResult() throws org.apache.thrift.TException { } } - public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void SetClientInfo(TSetClientInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); SetClientInfo_call method_call = new SetClientInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class SetClientInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class SetClientInfo_call extends org.apache.thrift.async.TAsyncMethodCall { private TSetClientInfoReq req; - public SetClientInfo_call(TSetClientInfoReq 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 { + public SetClientInfo_call(TSetClientInfoReq 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; } @@ -1405,7 +1432,7 @@ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apa public TSetClientInfoResp getResult() throws org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new java.lang.IllegalStateException("Method call not finished!"); + 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); @@ -1416,16 +1443,16 @@ public TSetClientInfoResp getResult() throws org.apache.thrift.TException { } public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName()); + private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { - super(iface, getProcessMap(new java.util.HashMap>())); + super(iface, getProcessMap(new HashMap>())); } - protected Processor(I iface, java.util.Map> processMap) { + protected Processor(I iface, Map> processMap) { super(iface, getProcessMap(processMap)); } - private static java.util.Map> getProcessMap(java.util.Map> processMap) { + private static Map> getProcessMap(Map> processMap) { processMap.put("OpenSession", new OpenSession()); processMap.put("CloseSession", new CloseSession()); processMap.put("GetInfo", new GetInfo()); @@ -1465,11 +1492,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public OpenSession_result getResult(I iface, OpenSession_args args) throws org.apache.thrift.TException { OpenSession_result result = new OpenSession_result(); result.success = iface.OpenSession(args.req); @@ -1490,11 +1512,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { CloseSession_result result = new CloseSession_result(); result.success = iface.CloseSession(args.req); @@ -1515,11 +1532,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.thrift.TException { GetInfo_result result = new GetInfo_result(); result.success = iface.GetInfo(args.req); @@ -1540,11 +1552,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) throws org.apache.thrift.TException { ExecuteStatement_result result = new ExecuteStatement_result(); result.success = iface.ExecuteStatement(args.req); @@ -1565,11 +1572,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.apache.thrift.TException { GetTypeInfo_result result = new GetTypeInfo_result(); result.success = iface.GetTypeInfo(args.req); @@ -1590,11 +1592,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.apache.thrift.TException { GetCatalogs_result result = new GetCatalogs_result(); result.success = iface.GetCatalogs(args.req); @@ -1615,11 +1612,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apache.thrift.TException { GetSchemas_result result = new GetSchemas_result(); result.success = iface.GetSchemas(args.req); @@ -1640,11 +1632,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetTables_result getResult(I iface, GetTables_args args) throws org.apache.thrift.TException { GetTables_result result = new GetTables_result(); result.success = iface.GetTables(args.req); @@ -1665,11 +1652,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws org.apache.thrift.TException { GetTableTypes_result result = new GetTableTypes_result(); result.success = iface.GetTableTypes(args.req); @@ -1690,11 +1672,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apache.thrift.TException { GetColumns_result result = new GetColumns_result(); result.success = iface.GetColumns(args.req); @@ -1715,11 +1692,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org.apache.thrift.TException { GetFunctions_result result = new GetFunctions_result(); result.success = iface.GetFunctions(args.req); @@ -1740,11 +1712,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetPrimaryKeys_result getResult(I iface, GetPrimaryKeys_args args) throws org.apache.thrift.TException { GetPrimaryKeys_result result = new GetPrimaryKeys_result(); result.success = iface.GetPrimaryKeys(args.req); @@ -1765,11 +1732,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetCrossReference_result getResult(I iface, GetCrossReference_args args) throws org.apache.thrift.TException { GetCrossReference_result result = new GetCrossReference_result(); result.success = iface.GetCrossReference(args.req); @@ -1790,11 +1752,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args) throws org.apache.thrift.TException { GetOperationStatus_result result = new GetOperationStatus_result(); result.success = iface.GetOperationStatus(args.req); @@ -1815,11 +1772,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public CancelOperation_result getResult(I iface, CancelOperation_args args) throws org.apache.thrift.TException { CancelOperation_result result = new CancelOperation_result(); result.success = iface.CancelOperation(args.req); @@ -1840,11 +1792,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public CloseOperation_result getResult(I iface, CloseOperation_args args) throws org.apache.thrift.TException { CloseOperation_result result = new CloseOperation_result(); result.success = iface.CloseOperation(args.req); @@ -1865,11 +1812,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args args) throws org.apache.thrift.TException { GetResultSetMetadata_result result = new GetResultSetMetadata_result(); result.success = iface.GetResultSetMetadata(args.req); @@ -1890,11 +1832,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public FetchResults_result getResult(I iface, FetchResults_args args) throws org.apache.thrift.TException { FetchResults_result result = new FetchResults_result(); result.success = iface.FetchResults(args.req); @@ -1915,11 +1852,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args) throws org.apache.thrift.TException { GetDelegationToken_result result = new GetDelegationToken_result(); result.success = iface.GetDelegationToken(args.req); @@ -1940,11 +1872,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_args args) throws org.apache.thrift.TException { CancelDelegationToken_result result = new CancelDelegationToken_result(); result.success = iface.CancelDelegationToken(args.req); @@ -1965,11 +1892,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args args) throws org.apache.thrift.TException { RenewDelegationToken_result result = new RenewDelegationToken_result(); result.success = iface.RenewDelegationToken(args.req); @@ -1990,11 +1912,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public GetQueryId_result getResult(I iface, GetQueryId_args args) throws org.apache.thrift.TException { GetQueryId_result result = new GetQueryId_result(); result.success = iface.GetQueryId(args.req); @@ -2015,11 +1932,6 @@ protected boolean isOneway() { return false; } - @Override - protected boolean rethrowUnhandledExceptions() { - return false; - } - public SetClientInfo_result getResult(I iface, SetClientInfo_args args) throws org.apache.thrift.TException { SetClientInfo_result result = new SetClientInfo_result(); result.success = iface.SetClientInfo(args.req); @@ -2030,16 +1942,16 @@ public SetClientInfo_result getResult(I iface, SetClientInfo_args args) throws o } public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { - private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName()); + private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); public AsyncProcessor(I iface) { - super(iface, getProcessMap(new java.util.HashMap>())); + super(iface, getProcessMap(new HashMap>())); } - protected AsyncProcessor(I iface, java.util.Map> processMap) { + protected AsyncProcessor(I iface, Map> processMap) { super(iface, getProcessMap(processMap)); } - private static java.util.Map> getProcessMap(java.util.Map> processMap) { + private static Map> getProcessMap(Map> processMap) { processMap.put("OpenSession", new OpenSession()); processMap.put("CloseSession", new CloseSession()); processMap.put("GetInfo", new GetInfo()); @@ -2075,45 +1987,35 @@ public OpenSession_args getEmptyArgsInstance() { return new OpenSession_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TOpenSessionResp o) { OpenSession_result result = new OpenSession_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; OpenSession_result result = new OpenSession_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2122,7 +2024,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.OpenSession(args.req,resultHandler); } } @@ -2136,45 +2038,35 @@ public CloseSession_args getEmptyArgsInstance() { return new CloseSession_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TCloseSessionResp o) { CloseSession_result result = new CloseSession_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; CloseSession_result result = new CloseSession_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2183,7 +2075,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.CloseSession(args.req,resultHandler); } } @@ -2197,45 +2089,35 @@ public GetInfo_args getEmptyArgsInstance() { return new GetInfo_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetInfoResp o) { GetInfo_result result = new GetInfo_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetInfo_result result = new GetInfo_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2244,7 +2126,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetInfo(args.req,resultHandler); } } @@ -2258,45 +2140,35 @@ public ExecuteStatement_args getEmptyArgsInstance() { return new ExecuteStatement_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TExecuteStatementResp o) { ExecuteStatement_result result = new ExecuteStatement_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; ExecuteStatement_result result = new ExecuteStatement_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2305,7 +2177,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.ExecuteStatement(args.req,resultHandler); } } @@ -2319,45 +2191,35 @@ public GetTypeInfo_args getEmptyArgsInstance() { return new GetTypeInfo_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetTypeInfoResp o) { GetTypeInfo_result result = new GetTypeInfo_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetTypeInfo_result result = new GetTypeInfo_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2366,7 +2228,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetTypeInfo(args.req,resultHandler); } } @@ -2380,45 +2242,35 @@ public GetCatalogs_args getEmptyArgsInstance() { return new GetCatalogs_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetCatalogsResp o) { GetCatalogs_result result = new GetCatalogs_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetCatalogs_result result = new GetCatalogs_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2427,7 +2279,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetCatalogs(args.req,resultHandler); } } @@ -2441,45 +2293,35 @@ public GetSchemas_args getEmptyArgsInstance() { return new GetSchemas_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetSchemasResp o) { GetSchemas_result result = new GetSchemas_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetSchemas_result result = new GetSchemas_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2488,7 +2330,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetSchemas(args.req,resultHandler); } } @@ -2502,45 +2344,35 @@ public GetTables_args getEmptyArgsInstance() { return new GetTables_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetTablesResp o) { GetTables_result result = new GetTables_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetTables_result result = new GetTables_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2549,7 +2381,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetTables(args.req,resultHandler); } } @@ -2563,45 +2395,35 @@ public GetTableTypes_args getEmptyArgsInstance() { return new GetTableTypes_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetTableTypesResp o) { GetTableTypes_result result = new GetTableTypes_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetTableTypes_result result = new GetTableTypes_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2610,7 +2432,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetTableTypes(args.req,resultHandler); } } @@ -2624,45 +2446,35 @@ public GetColumns_args getEmptyArgsInstance() { return new GetColumns_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetColumnsResp o) { GetColumns_result result = new GetColumns_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetColumns_result result = new GetColumns_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2671,7 +2483,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetColumns(args.req,resultHandler); } } @@ -2685,45 +2497,35 @@ public GetFunctions_args getEmptyArgsInstance() { return new GetFunctions_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetFunctionsResp o) { GetFunctions_result result = new GetFunctions_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetFunctions_result result = new GetFunctions_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2732,7 +2534,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetFunctions(args.req,resultHandler); } } @@ -2746,45 +2548,35 @@ public GetPrimaryKeys_args getEmptyArgsInstance() { return new GetPrimaryKeys_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetPrimaryKeysResp o) { GetPrimaryKeys_result result = new GetPrimaryKeys_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2793,7 +2585,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetPrimaryKeys(args.req,resultHandler); } } @@ -2807,45 +2599,35 @@ public GetCrossReference_args getEmptyArgsInstance() { return new GetCrossReference_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetCrossReferenceResp o) { GetCrossReference_result result = new GetCrossReference_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetCrossReference_result result = new GetCrossReference_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2854,7 +2636,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetCrossReference(args.req,resultHandler); } } @@ -2868,45 +2650,35 @@ public GetOperationStatus_args getEmptyArgsInstance() { return new GetOperationStatus_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetOperationStatusResp o) { GetOperationStatus_result result = new GetOperationStatus_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetOperationStatus_result result = new GetOperationStatus_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2915,7 +2687,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetOperationStatus(args.req,resultHandler); } } @@ -2929,45 +2701,35 @@ public CancelOperation_args getEmptyArgsInstance() { return new CancelOperation_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TCancelOperationResp o) { CancelOperation_result result = new CancelOperation_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; CancelOperation_result result = new CancelOperation_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -2976,7 +2738,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.CancelOperation(args.req,resultHandler); } } @@ -2990,45 +2752,35 @@ public CloseOperation_args getEmptyArgsInstance() { return new CloseOperation_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TCloseOperationResp o) { CloseOperation_result result = new CloseOperation_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; CloseOperation_result result = new CloseOperation_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3037,7 +2789,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.CloseOperation(args.req,resultHandler); } } @@ -3051,45 +2803,35 @@ public GetResultSetMetadata_args getEmptyArgsInstance() { return new GetResultSetMetadata_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetResultSetMetadataResp o) { GetResultSetMetadata_result result = new GetResultSetMetadata_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3098,7 +2840,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetResultSetMetadata(args.req,resultHandler); } } @@ -3112,45 +2854,35 @@ public FetchResults_args getEmptyArgsInstance() { return new FetchResults_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TFetchResultsResp o) { FetchResults_result result = new FetchResults_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; FetchResults_result result = new FetchResults_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3159,7 +2891,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.FetchResults(args.req,resultHandler); } } @@ -3173,45 +2905,35 @@ public GetDelegationToken_args getEmptyArgsInstance() { return new GetDelegationToken_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetDelegationTokenResp o) { GetDelegationToken_result result = new GetDelegationToken_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetDelegationToken_result result = new GetDelegationToken_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3220,7 +2942,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetDelegationToken(args.req,resultHandler); } } @@ -3234,45 +2956,35 @@ public CancelDelegationToken_args getEmptyArgsInstance() { return new CancelDelegationToken_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TCancelDelegationTokenResp o) { CancelDelegationToken_result result = new CancelDelegationToken_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; CancelDelegationToken_result result = new CancelDelegationToken_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3281,7 +2993,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.CancelDelegationToken(args.req,resultHandler); } } @@ -3295,45 +3007,35 @@ public RenewDelegationToken_args getEmptyArgsInstance() { return new RenewDelegationToken_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TRenewDelegationTokenResp o) { RenewDelegationToken_result result = new RenewDelegationToken_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; RenewDelegationToken_result result = new RenewDelegationToken_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3342,7 +3044,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.RenewDelegationToken(args.req,resultHandler); } } @@ -3356,45 +3058,35 @@ public GetQueryId_args getEmptyArgsInstance() { return new GetQueryId_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TGetQueryIdResp o) { GetQueryId_result result = new GetQueryId_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; GetQueryId_result result = new GetQueryId_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3403,7 +3095,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, GetQueryId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, GetQueryId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.GetQueryId(args.req,resultHandler); } } @@ -3417,45 +3109,35 @@ public SetClientInfo_args getEmptyArgsInstance() { return new SetClientInfo_args(); } - public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new org.apache.thrift.async.AsyncMethodCallback() { + return new AsyncMethodCallback() { public void onComplete(TSetClientInfoResp o) { SetClientInfo_result result = new SetClientInfo_result(); result.success = o; try { - fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - } catch (org.apache.thrift.transport.TTransportException e) { - _LOGGER.error("TTransportException writing to internal frame buffer", e); - fb.close(); - } catch (java.lang.Exception e) { - _LOGGER.error("Exception writing to internal frame buffer", e); - onError(e); + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); } + fb.close(); } - public void onError(java.lang.Exception e) { + public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TSerializable msg; + org.apache.thrift.TBase msg; SetClientInfo_result result = new SetClientInfo_result(); - if (e instanceof org.apache.thrift.transport.TTransportException) { - _LOGGER.error("TTransportException inside handler", e); - fb.close(); - return; - } else if (e instanceof org.apache.thrift.TApplicationException) { - _LOGGER.error("TApplicationException inside handler", e); + { msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TApplicationException)e; - } else { - _LOGGER.error("Exception inside handler", e); - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); } try { fcall.sendResponse(fb,msg,msgType,seqid); - } catch (java.lang.Exception ex) { - _LOGGER.error("Exception writing to internal frame buffer", ex); - fb.close(); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); } + fb.close(); } }; } @@ -3464,7 +3146,7 @@ protected boolean isOneway() { return false; } - public void start(I iface, SetClientInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void start(I iface, SetClientInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { iface.SetClientInfo(args.req,resultHandler); } } @@ -3476,19 +3158,22 @@ public static class OpenSession_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new OpenSession_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new OpenSession_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOpenSessionReq req; // required + private TOpenSessionReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -3496,7 +3181,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -3512,22 +3196,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -3536,18 +3219,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TOpenSessionReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_args.class, metaDataMap); } @@ -3579,12 +3262,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TOpenSessionReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TOpenSessionReq req) { + public void setReq(TOpenSessionReq req) { this.req = req; } @@ -3603,7 +3285,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -3616,31 +3298,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof OpenSession_args) @@ -3651,8 +3332,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(OpenSession_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -3668,13 +3347,14 @@ public boolean equals(OpenSession_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -3685,7 +3365,7 @@ public int compareTo(OpenSession_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -3698,22 +3378,21 @@ public int compareTo(OpenSession_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_args("); + public String toString() { + StringBuilder sb = new StringBuilder("OpenSession_args("); boolean first = true; sb.append("req:"); @@ -3743,7 +3422,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -3751,13 +3430,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class OpenSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class OpenSession_argsStandardSchemeFactory implements SchemeFactory { public OpenSession_argsStandardScheme getScheme() { return new OpenSession_argsStandardScheme(); } } - private static class OpenSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class OpenSession_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -3802,18 +3481,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_args s } - private static class OpenSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class OpenSession_argsTupleSchemeFactory implements SchemeFactory { public OpenSession_argsTupleScheme getScheme() { return new OpenSession_argsTupleScheme(); } } - private static class OpenSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class OpenSession_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -3825,8 +3504,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args st @Override public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TOpenSessionReq(); struct.req.read(iprot); @@ -3835,9 +3514,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_args str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -3845,19 +3521,22 @@ public static class OpenSession_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new OpenSession_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new OpenSession_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOpenSessionResp success; // required + private TOpenSessionResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -3865,7 +3544,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -3881,22 +3559,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -3905,18 +3582,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TOpenSessionResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_result.class, metaDataMap); } @@ -3948,12 +3625,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TOpenSessionResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TOpenSessionResp success) { + public void setSuccess(TOpenSessionResp success) { this.success = success; } @@ -3972,7 +3648,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -3985,31 +3661,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof OpenSession_result) @@ -4020,8 +3695,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(OpenSession_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -4037,13 +3710,14 @@ public boolean equals(OpenSession_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -4054,7 +3728,7 @@ public int compareTo(OpenSession_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -4067,22 +3741,21 @@ public int compareTo(OpenSession_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("OpenSession_result("); + public String toString() { + StringBuilder sb = new StringBuilder("OpenSession_result("); boolean first = true; sb.append("success:"); @@ -4112,7 +3785,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -4120,13 +3793,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class OpenSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class OpenSession_resultStandardSchemeFactory implements SchemeFactory { public OpenSession_resultStandardScheme getScheme() { return new OpenSession_resultStandardScheme(); } } - private static class OpenSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class OpenSession_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -4171,18 +3844,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_result } - private static class OpenSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class OpenSession_resultTupleSchemeFactory implements SchemeFactory { public OpenSession_resultTupleScheme getScheme() { return new OpenSession_resultTupleScheme(); } } - private static class OpenSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class OpenSession_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -4194,8 +3867,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TOpenSessionResp(); struct.success.read(iprot); @@ -4204,9 +3877,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_result s } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -4214,19 +3884,22 @@ public static class CloseSession_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CloseSession_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseSession_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCloseSessionReq req; // required + private TCloseSessionReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -4234,7 +3907,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -4250,22 +3922,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -4274,18 +3945,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCloseSessionReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_args.class, metaDataMap); } @@ -4317,12 +3988,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TCloseSessionReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TCloseSessionReq req) { + public void setReq(TCloseSessionReq req) { this.req = req; } @@ -4341,7 +4011,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -4354,31 +4024,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CloseSession_args) @@ -4389,8 +4058,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CloseSession_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -4406,13 +4073,14 @@ public boolean equals(CloseSession_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -4423,7 +4091,7 @@ public int compareTo(CloseSession_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -4436,22 +4104,21 @@ public int compareTo(CloseSession_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_args("); + public String toString() { + StringBuilder sb = new StringBuilder("CloseSession_args("); boolean first = true; sb.append("req:"); @@ -4481,7 +4148,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -4489,13 +4156,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseSession_argsStandardSchemeFactory implements SchemeFactory { public CloseSession_argsStandardScheme getScheme() { return new CloseSession_argsStandardScheme(); } } - private static class CloseSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CloseSession_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -4540,18 +4207,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_args } - private static class CloseSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseSession_argsTupleSchemeFactory implements SchemeFactory { public CloseSession_argsTupleScheme getScheme() { return new CloseSession_argsTupleScheme(); } } - private static class CloseSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CloseSession_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -4563,8 +4230,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args s @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCloseSessionReq(); struct.req.read(iprot); @@ -4573,9 +4240,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_args st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -4583,19 +4247,22 @@ public static class CloseSession_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CloseSession_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseSession_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCloseSessionResp success; // required + private TCloseSessionResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -4603,7 +4270,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -4619,22 +4285,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -4643,18 +4308,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCloseSessionResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_result.class, metaDataMap); } @@ -4686,12 +4351,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TCloseSessionResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseSessionResp success) { + public void setSuccess(TCloseSessionResp success) { this.success = success; } @@ -4710,7 +4374,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -4723,31 +4387,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CloseSession_result) @@ -4758,8 +4421,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CloseSession_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -4775,13 +4436,14 @@ public boolean equals(CloseSession_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -4792,7 +4454,7 @@ public int compareTo(CloseSession_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -4805,22 +4467,21 @@ public int compareTo(CloseSession_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseSession_result("); + public String toString() { + StringBuilder sb = new StringBuilder("CloseSession_result("); boolean first = true; sb.append("success:"); @@ -4850,7 +4511,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -4858,13 +4519,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseSession_resultStandardSchemeFactory implements SchemeFactory { public CloseSession_resultStandardScheme getScheme() { return new CloseSession_resultStandardScheme(); } } - private static class CloseSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CloseSession_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -4909,18 +4570,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_resul } - private static class CloseSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseSession_resultTupleSchemeFactory implements SchemeFactory { public CloseSession_resultTupleScheme getScheme() { return new CloseSession_resultTupleScheme(); } } - private static class CloseSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CloseSession_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -4932,8 +4593,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCloseSessionResp(); struct.success.read(iprot); @@ -4942,9 +4603,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_result } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -4952,19 +4610,22 @@ public static class GetInfo_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetInfo_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetInfoReq req; // required + private TGetInfoReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -4972,7 +4633,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -4988,22 +4648,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -5012,18 +4671,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetInfoReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_args.class, metaDataMap); } @@ -5055,12 +4714,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetInfoReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetInfoReq req) { + public void setReq(TGetInfoReq req) { this.req = req; } @@ -5079,7 +4737,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -5092,31 +4750,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetInfo_args) @@ -5127,8 +4784,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetInfo_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -5144,13 +4799,14 @@ public boolean equals(GetInfo_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -5161,7 +4817,7 @@ public int compareTo(GetInfo_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -5174,22 +4830,21 @@ public int compareTo(GetInfo_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetInfo_args("); boolean first = true; sb.append("req:"); @@ -5219,7 +4874,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -5227,13 +4882,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetInfo_argsStandardSchemeFactory implements SchemeFactory { public GetInfo_argsStandardScheme getScheme() { return new GetInfo_argsStandardScheme(); } } - private static class GetInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetInfo_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -5278,18 +4933,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_args struc } - private static class GetInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetInfo_argsTupleSchemeFactory implements SchemeFactory { public GetInfo_argsTupleScheme getScheme() { return new GetInfo_argsTupleScheme(); } } - private static class GetInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetInfo_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -5301,8 +4956,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetInfoReq(); struct.req.read(iprot); @@ -5311,9 +4966,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -5321,19 +4973,22 @@ public static class GetInfo_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetInfo_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetInfoResp success; // required + private TGetInfoResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -5341,7 +4996,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -5357,22 +5011,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -5381,18 +5034,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetInfoResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_result.class, metaDataMap); } @@ -5424,12 +5077,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetInfoResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetInfoResp success) { + public void setSuccess(TGetInfoResp success) { this.success = success; } @@ -5448,7 +5100,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -5461,31 +5113,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetInfo_result) @@ -5496,8 +5147,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetInfo_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -5513,13 +5162,14 @@ public boolean equals(GetInfo_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -5530,7 +5180,7 @@ public int compareTo(GetInfo_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -5543,22 +5193,21 @@ public int compareTo(GetInfo_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetInfo_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetInfo_result("); boolean first = true; sb.append("success:"); @@ -5588,7 +5237,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -5596,13 +5245,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetInfo_resultStandardSchemeFactory implements SchemeFactory { public GetInfo_resultStandardScheme getScheme() { return new GetInfo_resultStandardScheme(); } } - private static class GetInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetInfo_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -5647,18 +5296,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_result str } - private static class GetInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetInfo_resultTupleSchemeFactory implements SchemeFactory { public GetInfo_resultTupleScheme getScheme() { return new GetInfo_resultTupleScheme(); } } - private static class GetInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetInfo_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -5670,8 +5319,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetInfoResp(); struct.success.read(iprot); @@ -5680,9 +5329,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struc } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -5690,19 +5336,22 @@ public static class ExecuteStatement_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ExecuteStatement_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ExecuteStatement_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TExecuteStatementReq req; // required + 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -5710,7 +5359,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -5726,22 +5374,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -5750,18 +5397,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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 = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_args.class, metaDataMap); } @@ -5793,12 +5440,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TExecuteStatementReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TExecuteStatementReq req) { + public void setReq(TExecuteStatementReq req) { this.req = req; } @@ -5817,7 +5463,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -5830,31 +5476,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof ExecuteStatement_args) @@ -5865,8 +5510,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(ExecuteStatement_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -5882,13 +5525,14 @@ public boolean equals(ExecuteStatement_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -5899,7 +5543,7 @@ public int compareTo(ExecuteStatement_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -5912,22 +5556,21 @@ public int compareTo(ExecuteStatement_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_args("); + public String toString() { + StringBuilder sb = new StringBuilder("ExecuteStatement_args("); boolean first = true; sb.append("req:"); @@ -5957,7 +5600,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -5965,13 +5608,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class ExecuteStatement_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ExecuteStatement_argsStandardSchemeFactory implements SchemeFactory { public ExecuteStatement_argsStandardScheme getScheme() { return new ExecuteStatement_argsStandardScheme(); } } - private static class ExecuteStatement_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class ExecuteStatement_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -6016,18 +5659,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_a } - private static class ExecuteStatement_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ExecuteStatement_argsTupleSchemeFactory implements SchemeFactory { public ExecuteStatement_argsTupleScheme getScheme() { return new ExecuteStatement_argsTupleScheme(); } } - private static class ExecuteStatement_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class ExecuteStatement_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -6039,8 +5682,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_ar @Override public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TExecuteStatementReq(); struct.req.read(iprot); @@ -6049,9 +5692,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_arg } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -6059,19 +5699,22 @@ public static class ExecuteStatement_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ExecuteStatement_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ExecuteStatement_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TExecuteStatementResp success; // required + private TExecuteStatementResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -6079,7 +5722,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -6095,22 +5737,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -6119,18 +5760,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TExecuteStatementResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_result.class, metaDataMap); } @@ -6162,12 +5803,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TExecuteStatementResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TExecuteStatementResp success) { + public void setSuccess(TExecuteStatementResp success) { this.success = success; } @@ -6186,7 +5826,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -6199,31 +5839,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof ExecuteStatement_result) @@ -6234,8 +5873,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(ExecuteStatement_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -6251,13 +5888,14 @@ public boolean equals(ExecuteStatement_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -6268,7 +5906,7 @@ public int compareTo(ExecuteStatement_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -6281,22 +5919,21 @@ public int compareTo(ExecuteStatement_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("ExecuteStatement_result("); + public String toString() { + StringBuilder sb = new StringBuilder("ExecuteStatement_result("); boolean first = true; sb.append("success:"); @@ -6326,7 +5963,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -6334,13 +5971,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class ExecuteStatement_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ExecuteStatement_resultStandardSchemeFactory implements SchemeFactory { public ExecuteStatement_resultStandardScheme getScheme() { return new ExecuteStatement_resultStandardScheme(); } } - private static class ExecuteStatement_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class ExecuteStatement_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -6385,18 +6022,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_r } - private static class ExecuteStatement_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class ExecuteStatement_resultTupleSchemeFactory implements SchemeFactory { public ExecuteStatement_resultTupleScheme getScheme() { return new ExecuteStatement_resultTupleScheme(); } } - private static class ExecuteStatement_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class ExecuteStatement_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -6408,8 +6045,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_re @Override public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TExecuteStatementResp(); struct.success.read(iprot); @@ -6418,9 +6055,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_res } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -6428,19 +6062,22 @@ public static class GetTypeInfo_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetTypeInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTypeInfo_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetTypeInfoReq req; // required + private TGetTypeInfoReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -6448,7 +6085,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -6464,22 +6100,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -6488,18 +6123,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetTypeInfoReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_args.class, metaDataMap); } @@ -6531,12 +6166,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetTypeInfoReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetTypeInfoReq req) { + public void setReq(TGetTypeInfoReq req) { this.req = req; } @@ -6555,7 +6189,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -6568,31 +6202,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetTypeInfo_args) @@ -6603,8 +6236,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetTypeInfo_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -6620,13 +6251,14 @@ public boolean equals(GetTypeInfo_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -6637,7 +6269,7 @@ public int compareTo(GetTypeInfo_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -6650,22 +6282,21 @@ public int compareTo(GetTypeInfo_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetTypeInfo_args("); boolean first = true; sb.append("req:"); @@ -6695,7 +6326,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -6703,13 +6334,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTypeInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTypeInfo_argsStandardSchemeFactory implements SchemeFactory { public GetTypeInfo_argsStandardScheme getScheme() { return new GetTypeInfo_argsStandardScheme(); } } - private static class GetTypeInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetTypeInfo_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -6754,18 +6385,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_args s } - private static class GetTypeInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTypeInfo_argsTupleSchemeFactory implements SchemeFactory { public GetTypeInfo_argsTupleScheme getScheme() { return new GetTypeInfo_argsTupleScheme(); } } - private static class GetTypeInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetTypeInfo_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -6777,8 +6408,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args st @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetTypeInfoReq(); struct.req.read(iprot); @@ -6787,9 +6418,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -6797,19 +6425,22 @@ public static class GetTypeInfo_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetTypeInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTypeInfo_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetTypeInfoResp success; // required + private TGetTypeInfoResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -6817,7 +6448,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -6833,22 +6463,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -6857,18 +6486,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetTypeInfoResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_result.class, metaDataMap); } @@ -6900,12 +6529,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetTypeInfoResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTypeInfoResp success) { + public void setSuccess(TGetTypeInfoResp success) { this.success = success; } @@ -6924,7 +6552,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -6937,31 +6565,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetTypeInfo_result) @@ -6972,8 +6599,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetTypeInfo_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -6989,13 +6614,14 @@ public boolean equals(GetTypeInfo_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -7006,7 +6632,7 @@ public int compareTo(GetTypeInfo_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -7019,22 +6645,21 @@ public int compareTo(GetTypeInfo_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTypeInfo_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetTypeInfo_result("); boolean first = true; sb.append("success:"); @@ -7064,7 +6689,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -7072,13 +6697,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTypeInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTypeInfo_resultStandardSchemeFactory implements SchemeFactory { public GetTypeInfo_resultStandardScheme getScheme() { return new GetTypeInfo_resultStandardScheme(); } } - private static class GetTypeInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetTypeInfo_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -7123,18 +6748,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_result } - private static class GetTypeInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTypeInfo_resultTupleSchemeFactory implements SchemeFactory { public GetTypeInfo_resultTupleScheme getScheme() { return new GetTypeInfo_resultTupleScheme(); } } - private static class GetTypeInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetTypeInfo_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -7146,8 +6771,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetTypeInfoResp(); struct.success.read(iprot); @@ -7156,9 +6781,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result s } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -7166,19 +6788,22 @@ public static class GetCatalogs_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetCatalogs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCatalogs_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetCatalogsReq req; // required + private TGetCatalogsReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -7186,7 +6811,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -7202,22 +6826,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -7226,18 +6849,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetCatalogsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_args.class, metaDataMap); } @@ -7269,12 +6892,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetCatalogsReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetCatalogsReq req) { + public void setReq(TGetCatalogsReq req) { this.req = req; } @@ -7293,7 +6915,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -7306,31 +6928,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetCatalogs_args) @@ -7341,8 +6962,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetCatalogs_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -7358,13 +6977,14 @@ public boolean equals(GetCatalogs_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -7375,7 +6995,7 @@ public int compareTo(GetCatalogs_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -7388,22 +7008,21 @@ public int compareTo(GetCatalogs_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetCatalogs_args("); boolean first = true; sb.append("req:"); @@ -7433,7 +7052,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -7441,13 +7060,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCatalogs_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCatalogs_argsStandardSchemeFactory implements SchemeFactory { public GetCatalogs_argsStandardScheme getScheme() { return new GetCatalogs_argsStandardScheme(); } } - private static class GetCatalogs_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetCatalogs_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -7492,18 +7111,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_args s } - private static class GetCatalogs_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCatalogs_argsTupleSchemeFactory implements SchemeFactory { public GetCatalogs_argsTupleScheme getScheme() { return new GetCatalogs_argsTupleScheme(); } } - private static class GetCatalogs_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetCatalogs_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -7515,8 +7134,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args st @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetCatalogsReq(); struct.req.read(iprot); @@ -7525,9 +7144,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -7535,19 +7151,22 @@ public static class GetCatalogs_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetCatalogs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCatalogs_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetCatalogsResp success; // required + private TGetCatalogsResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -7555,7 +7174,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -7571,22 +7189,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -7595,18 +7212,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetCatalogsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_result.class, metaDataMap); } @@ -7638,12 +7255,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetCatalogsResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCatalogsResp success) { + public void setSuccess(TGetCatalogsResp success) { this.success = success; } @@ -7662,7 +7278,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -7675,31 +7291,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetCatalogs_result) @@ -7710,8 +7325,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetCatalogs_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -7727,13 +7340,14 @@ public boolean equals(GetCatalogs_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -7744,7 +7358,7 @@ public int compareTo(GetCatalogs_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -7757,22 +7371,21 @@ public int compareTo(GetCatalogs_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCatalogs_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetCatalogs_result("); boolean first = true; sb.append("success:"); @@ -7802,7 +7415,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -7810,13 +7423,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCatalogs_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCatalogs_resultStandardSchemeFactory implements SchemeFactory { public GetCatalogs_resultStandardScheme getScheme() { return new GetCatalogs_resultStandardScheme(); } } - private static class GetCatalogs_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetCatalogs_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -7861,18 +7474,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_result } - private static class GetCatalogs_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCatalogs_resultTupleSchemeFactory implements SchemeFactory { public GetCatalogs_resultTupleScheme getScheme() { return new GetCatalogs_resultTupleScheme(); } } - private static class GetCatalogs_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetCatalogs_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -7884,8 +7497,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetCatalogsResp(); struct.success.read(iprot); @@ -7894,9 +7507,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result s } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -7904,19 +7514,22 @@ public static class GetSchemas_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetSchemas_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetSchemas_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetSchemasReq req; // required + private TGetSchemasReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -7924,7 +7537,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -7940,22 +7552,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -7964,18 +7575,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetSchemasReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_args.class, metaDataMap); } @@ -8007,12 +7618,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetSchemasReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetSchemasReq req) { + public void setReq(TGetSchemasReq req) { this.req = req; } @@ -8031,7 +7641,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -8044,31 +7654,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetSchemas_args) @@ -8079,8 +7688,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetSchemas_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -8096,13 +7703,14 @@ public boolean equals(GetSchemas_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -8113,7 +7721,7 @@ public int compareTo(GetSchemas_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -8126,22 +7734,21 @@ public int compareTo(GetSchemas_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetSchemas_args("); boolean first = true; sb.append("req:"); @@ -8171,7 +7778,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -8179,13 +7786,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetSchemas_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetSchemas_argsStandardSchemeFactory implements SchemeFactory { public GetSchemas_argsStandardScheme getScheme() { return new GetSchemas_argsStandardScheme(); } } - private static class GetSchemas_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetSchemas_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -8230,18 +7837,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_args st } - private static class GetSchemas_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetSchemas_argsTupleSchemeFactory implements SchemeFactory { public GetSchemas_argsTupleScheme getScheme() { return new GetSchemas_argsTupleScheme(); } } - private static class GetSchemas_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetSchemas_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -8253,8 +7860,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args str @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetSchemasReq(); struct.req.read(iprot); @@ -8263,9 +7870,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -8273,19 +7877,22 @@ public static class GetSchemas_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetSchemas_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetSchemas_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetSchemasResp success; // required + private TGetSchemasResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -8293,7 +7900,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -8309,22 +7915,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -8333,18 +7938,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetSchemasResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_result.class, metaDataMap); } @@ -8376,12 +7981,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetSchemasResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetSchemasResp success) { + public void setSuccess(TGetSchemasResp success) { this.success = success; } @@ -8400,7 +8004,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -8413,31 +8017,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetSchemas_result) @@ -8448,8 +8051,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetSchemas_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -8465,13 +8066,14 @@ public boolean equals(GetSchemas_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -8482,7 +8084,7 @@ public int compareTo(GetSchemas_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -8495,22 +8097,21 @@ public int compareTo(GetSchemas_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetSchemas_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetSchemas_result("); boolean first = true; sb.append("success:"); @@ -8540,7 +8141,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -8548,13 +8149,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetSchemas_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetSchemas_resultStandardSchemeFactory implements SchemeFactory { public GetSchemas_resultStandardScheme getScheme() { return new GetSchemas_resultStandardScheme(); } } - private static class GetSchemas_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetSchemas_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -8599,18 +8200,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_result } - private static class GetSchemas_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetSchemas_resultTupleSchemeFactory implements SchemeFactory { public GetSchemas_resultTupleScheme getScheme() { return new GetSchemas_resultTupleScheme(); } } - private static class GetSchemas_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetSchemas_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -8622,8 +8223,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetSchemasResp(); struct.success.read(iprot); @@ -8632,9 +8233,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -8642,19 +8240,22 @@ public static class GetTables_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetTables_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTables_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetTablesReq req; // required + private TGetTablesReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -8662,7 +8263,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -8678,22 +8278,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -8702,18 +8301,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetTablesReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_args.class, metaDataMap); } @@ -8745,12 +8344,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetTablesReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetTablesReq req) { + public void setReq(TGetTablesReq req) { this.req = req; } @@ -8769,7 +8367,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -8782,31 +8380,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetTables_args) @@ -8817,8 +8414,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetTables_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -8834,13 +8429,14 @@ public boolean equals(GetTables_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -8851,7 +8447,7 @@ public int compareTo(GetTables_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -8864,22 +8460,21 @@ public int compareTo(GetTables_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetTables_args("); boolean first = true; sb.append("req:"); @@ -8909,7 +8504,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -8917,13 +8512,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTables_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTables_argsStandardSchemeFactory implements SchemeFactory { public GetTables_argsStandardScheme getScheme() { return new GetTables_argsStandardScheme(); } } - private static class GetTables_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetTables_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -8968,18 +8563,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_args str } - private static class GetTables_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTables_argsTupleSchemeFactory implements SchemeFactory { public GetTables_argsTupleScheme getScheme() { return new GetTables_argsTupleScheme(); } } - private static class GetTables_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetTables_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -8991,8 +8586,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetTablesReq(); struct.req.read(iprot); @@ -9001,9 +8596,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_args struc } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -9011,19 +8603,22 @@ public static class GetTables_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetTables_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTables_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetTablesResp success; // required + private TGetTablesResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -9031,7 +8626,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -9047,22 +8641,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -9071,18 +8664,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetTablesResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_result.class, metaDataMap); } @@ -9114,12 +8707,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetTablesResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTablesResp success) { + public void setSuccess(TGetTablesResp success) { this.success = success; } @@ -9138,7 +8730,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -9151,31 +8743,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetTables_result) @@ -9186,8 +8777,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetTables_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -9203,13 +8792,14 @@ public boolean equals(GetTables_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -9220,7 +8810,7 @@ public int compareTo(GetTables_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -9233,22 +8823,21 @@ public int compareTo(GetTables_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTables_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetTables_result("); boolean first = true; sb.append("success:"); @@ -9278,7 +8867,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -9286,13 +8875,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTables_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTables_resultStandardSchemeFactory implements SchemeFactory { public GetTables_resultStandardScheme getScheme() { return new GetTables_resultStandardScheme(); } } - private static class GetTables_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetTables_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -9337,18 +8926,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_result s } - private static class GetTables_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTables_resultTupleSchemeFactory implements SchemeFactory { public GetTables_resultTupleScheme getScheme() { return new GetTables_resultTupleScheme(); } } - private static class GetTables_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetTables_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -9360,8 +8949,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result st @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetTablesResp(); struct.success.read(iprot); @@ -9370,9 +8959,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_result str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -9380,19 +8966,22 @@ public static class GetTableTypes_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetTableTypes_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTableTypes_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetTableTypesReq req; // required + private TGetTableTypesReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -9400,7 +8989,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -9416,22 +9004,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -9440,18 +9027,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetTableTypesReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_args.class, metaDataMap); } @@ -9483,12 +9070,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetTableTypesReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetTableTypesReq req) { + public void setReq(TGetTableTypesReq req) { this.req = req; } @@ -9507,7 +9093,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -9520,31 +9106,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetTableTypes_args) @@ -9555,8 +9140,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetTableTypes_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -9572,13 +9155,14 @@ public boolean equals(GetTableTypes_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -9589,7 +9173,7 @@ public int compareTo(GetTableTypes_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -9602,22 +9186,21 @@ public int compareTo(GetTableTypes_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetTableTypes_args("); boolean first = true; sb.append("req:"); @@ -9647,7 +9230,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -9655,13 +9238,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTableTypes_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTableTypes_argsStandardSchemeFactory implements SchemeFactory { public GetTableTypes_argsStandardScheme getScheme() { return new GetTableTypes_argsStandardScheme(); } } - private static class GetTableTypes_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetTableTypes_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -9706,18 +9289,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_args } - private static class GetTableTypes_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTableTypes_argsTupleSchemeFactory implements SchemeFactory { public GetTableTypes_argsTupleScheme getScheme() { return new GetTableTypes_argsTupleScheme(); } } - private static class GetTableTypes_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetTableTypes_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -9729,8 +9312,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetTableTypesReq(); struct.req.read(iprot); @@ -9739,9 +9322,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args s } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -9749,19 +9329,22 @@ public static class GetTableTypes_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetTableTypes_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetTableTypes_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetTableTypesResp success; // required + private TGetTableTypesResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -9769,7 +9352,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -9785,22 +9367,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -9809,18 +9390,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetTableTypesResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_result.class, metaDataMap); } @@ -9852,12 +9433,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetTableTypesResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetTableTypesResp success) { + public void setSuccess(TGetTableTypesResp success) { this.success = success; } @@ -9876,7 +9456,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -9889,31 +9469,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetTableTypes_result) @@ -9924,8 +9503,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetTableTypes_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -9941,13 +9518,14 @@ public boolean equals(GetTableTypes_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -9958,7 +9536,7 @@ public int compareTo(GetTableTypes_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -9971,22 +9549,21 @@ public int compareTo(GetTableTypes_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetTableTypes_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetTableTypes_result("); boolean first = true; sb.append("success:"); @@ -10016,7 +9593,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -10024,13 +9601,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetTableTypes_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTableTypes_resultStandardSchemeFactory implements SchemeFactory { public GetTableTypes_resultStandardScheme getScheme() { return new GetTableTypes_resultStandardScheme(); } } - private static class GetTableTypes_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetTableTypes_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -10075,18 +9652,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_resu } - private static class GetTableTypes_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetTableTypes_resultTupleSchemeFactory implements SchemeFactory { public GetTableTypes_resultTupleScheme getScheme() { return new GetTableTypes_resultTupleScheme(); } } - private static class GetTableTypes_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetTableTypes_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -10098,8 +9675,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_resul @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetTableTypesResp(); struct.success.read(iprot); @@ -10108,9 +9685,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -10118,19 +9692,22 @@ public static class GetColumns_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetColumns_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetColumns_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetColumnsReq req; // required + private TGetColumnsReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -10138,7 +9715,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -10154,22 +9730,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -10178,18 +9753,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetColumnsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_args.class, metaDataMap); } @@ -10221,12 +9796,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetColumnsReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetColumnsReq req) { + public void setReq(TGetColumnsReq req) { this.req = req; } @@ -10245,7 +9819,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -10258,31 +9832,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetColumns_args) @@ -10293,8 +9866,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetColumns_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -10310,13 +9881,14 @@ public boolean equals(GetColumns_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -10327,7 +9899,7 @@ public int compareTo(GetColumns_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -10340,22 +9912,21 @@ public int compareTo(GetColumns_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetColumns_args("); boolean first = true; sb.append("req:"); @@ -10385,7 +9956,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -10393,13 +9964,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetColumns_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetColumns_argsStandardSchemeFactory implements SchemeFactory { public GetColumns_argsStandardScheme getScheme() { return new GetColumns_argsStandardScheme(); } } - private static class GetColumns_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetColumns_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -10444,18 +10015,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_args st } - private static class GetColumns_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetColumns_argsTupleSchemeFactory implements SchemeFactory { public GetColumns_argsTupleScheme getScheme() { return new GetColumns_argsTupleScheme(); } } - private static class GetColumns_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetColumns_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -10467,8 +10038,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args str @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetColumnsReq(); struct.req.read(iprot); @@ -10477,9 +10048,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_args stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -10487,19 +10055,22 @@ public static class GetColumns_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetColumns_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetColumns_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetColumnsResp success; // required + private TGetColumnsResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -10507,7 +10078,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -10523,22 +10093,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -10547,18 +10116,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetColumnsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_result.class, metaDataMap); } @@ -10590,12 +10159,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetColumnsResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetColumnsResp success) { + public void setSuccess(TGetColumnsResp success) { this.success = success; } @@ -10614,7 +10182,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -10627,31 +10195,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetColumns_result) @@ -10662,8 +10229,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetColumns_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -10679,13 +10244,14 @@ public boolean equals(GetColumns_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -10696,7 +10262,7 @@ public int compareTo(GetColumns_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -10709,22 +10275,21 @@ public int compareTo(GetColumns_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetColumns_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetColumns_result("); boolean first = true; sb.append("success:"); @@ -10754,7 +10319,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -10762,13 +10327,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetColumns_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetColumns_resultStandardSchemeFactory implements SchemeFactory { public GetColumns_resultStandardScheme getScheme() { return new GetColumns_resultStandardScheme(); } } - private static class GetColumns_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetColumns_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -10813,18 +10378,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_result } - private static class GetColumns_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetColumns_resultTupleSchemeFactory implements SchemeFactory { public GetColumns_resultTupleScheme getScheme() { return new GetColumns_resultTupleScheme(); } } - private static class GetColumns_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetColumns_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -10836,8 +10401,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetColumnsResp(); struct.success.read(iprot); @@ -10846,9 +10411,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_result st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -10856,19 +10418,22 @@ public static class GetFunctions_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetFunctions_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetFunctions_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetFunctionsReq req; // required + private TGetFunctionsReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -10876,7 +10441,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -10892,22 +10456,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -10916,18 +10479,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetFunctionsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_args.class, metaDataMap); } @@ -10959,12 +10522,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetFunctionsReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetFunctionsReq req) { + public void setReq(TGetFunctionsReq req) { this.req = req; } @@ -10983,7 +10545,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -10996,31 +10558,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetFunctions_args) @@ -11031,8 +10592,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetFunctions_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -11048,13 +10607,14 @@ public boolean equals(GetFunctions_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -11065,7 +10625,7 @@ public int compareTo(GetFunctions_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -11078,22 +10638,21 @@ public int compareTo(GetFunctions_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetFunctions_args("); boolean first = true; sb.append("req:"); @@ -11123,7 +10682,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -11131,13 +10690,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetFunctions_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetFunctions_argsStandardSchemeFactory implements SchemeFactory { public GetFunctions_argsStandardScheme getScheme() { return new GetFunctions_argsStandardScheme(); } } - private static class GetFunctions_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetFunctions_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -11182,18 +10741,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_args } - private static class GetFunctions_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetFunctions_argsTupleSchemeFactory implements SchemeFactory { public GetFunctions_argsTupleScheme getScheme() { return new GetFunctions_argsTupleScheme(); } } - private static class GetFunctions_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetFunctions_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -11205,8 +10764,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetFunctionsReq(); struct.req.read(iprot); @@ -11215,9 +10774,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -11225,19 +10781,22 @@ public static class GetFunctions_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetFunctions_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetFunctions_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetFunctionsResp success; // required + private TGetFunctionsResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -11245,7 +10804,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -11261,22 +10819,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -11285,18 +10842,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetFunctionsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_result.class, metaDataMap); } @@ -11328,12 +10885,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetFunctionsResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetFunctionsResp success) { + public void setSuccess(TGetFunctionsResp success) { this.success = success; } @@ -11352,7 +10908,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -11365,31 +10921,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetFunctions_result) @@ -11400,8 +10955,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetFunctions_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -11417,13 +10970,14 @@ public boolean equals(GetFunctions_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -11434,7 +10988,7 @@ public int compareTo(GetFunctions_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -11447,22 +11001,21 @@ public int compareTo(GetFunctions_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetFunctions_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetFunctions_result("); boolean first = true; sb.append("success:"); @@ -11492,7 +11045,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -11500,13 +11053,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetFunctions_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetFunctions_resultStandardSchemeFactory implements SchemeFactory { public GetFunctions_resultStandardScheme getScheme() { return new GetFunctions_resultStandardScheme(); } } - private static class GetFunctions_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetFunctions_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -11551,18 +11104,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_resul } - private static class GetFunctions_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetFunctions_resultTupleSchemeFactory implements SchemeFactory { public GetFunctions_resultTupleScheme getScheme() { return new GetFunctions_resultTupleScheme(); } } - private static class GetFunctions_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetFunctions_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -11574,8 +11127,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetFunctionsResp(); struct.success.read(iprot); @@ -11584,9 +11137,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -11594,19 +11144,22 @@ public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetPrimaryKeys_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetPrimaryKeys_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq req; // required + private TGetPrimaryKeysReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -11614,7 +11167,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -11630,22 +11182,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -11654,18 +11205,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetPrimaryKeysReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_args.class, metaDataMap); } @@ -11697,12 +11248,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetPrimaryKeysReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysReq req) { + public void setReq(TGetPrimaryKeysReq req) { this.req = req; } @@ -11721,7 +11271,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -11734,31 +11284,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetPrimaryKeys_args) @@ -11769,8 +11318,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetPrimaryKeys_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -11786,13 +11333,14 @@ public boolean equals(GetPrimaryKeys_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -11803,7 +11351,7 @@ public int compareTo(GetPrimaryKeys_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -11816,22 +11364,21 @@ public int compareTo(GetPrimaryKeys_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetPrimaryKeys_args("); boolean first = true; sb.append("req:"); @@ -11861,7 +11408,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -11869,13 +11416,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetPrimaryKeys_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetPrimaryKeys_argsStandardSchemeFactory implements SchemeFactory { public GetPrimaryKeys_argsStandardScheme getScheme() { return new GetPrimaryKeys_argsStandardScheme(); } } - private static class GetPrimaryKeys_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetPrimaryKeys_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -11920,18 +11467,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetPrimaryKeys_arg } - private static class GetPrimaryKeys_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetPrimaryKeys_argsTupleSchemeFactory implements SchemeFactory { public GetPrimaryKeys_argsTupleScheme getScheme() { return new GetPrimaryKeys_argsTupleScheme(); } } - private static class GetPrimaryKeys_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetPrimaryKeys_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -11943,8 +11490,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetPrimaryKeysReq(); struct.req.read(iprot); @@ -11953,9 +11500,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -11963,19 +11507,22 @@ public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetPrimaryKeys_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetPrimaryKeys_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp success; // required + private TGetPrimaryKeysResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -11983,7 +11530,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -11999,22 +11545,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -12023,18 +11568,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetPrimaryKeysResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_result.class, metaDataMap); } @@ -12066,12 +11611,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetPrimaryKeysResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetPrimaryKeysResp success) { + public void setSuccess(TGetPrimaryKeysResp success) { this.success = success; } @@ -12090,7 +11634,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -12103,31 +11647,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetPrimaryKeys_result) @@ -12138,8 +11681,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetPrimaryKeys_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -12155,13 +11696,14 @@ public boolean equals(GetPrimaryKeys_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -12172,7 +11714,7 @@ public int compareTo(GetPrimaryKeys_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -12185,22 +11727,21 @@ public int compareTo(GetPrimaryKeys_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetPrimaryKeys_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetPrimaryKeys_result("); boolean first = true; sb.append("success:"); @@ -12230,7 +11771,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -12238,13 +11779,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetPrimaryKeys_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetPrimaryKeys_resultStandardSchemeFactory implements SchemeFactory { public GetPrimaryKeys_resultStandardScheme getScheme() { return new GetPrimaryKeys_resultStandardScheme(); } } - private static class GetPrimaryKeys_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetPrimaryKeys_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -12289,18 +11830,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetPrimaryKeys_res } - private static class GetPrimaryKeys_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetPrimaryKeys_resultTupleSchemeFactory implements SchemeFactory { public GetPrimaryKeys_resultTupleScheme getScheme() { return new GetPrimaryKeys_resultTupleScheme(); } } - private static class GetPrimaryKeys_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetPrimaryKeys_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -12312,8 +11853,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_resu @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetPrimaryKeysResp(); struct.success.read(iprot); @@ -12322,9 +11863,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_resul } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetCrossReference_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -12332,19 +11870,22 @@ public static class GetCrossReference_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetCrossReference_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCrossReference_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetCrossReferenceReq req; // required + private TGetCrossReferenceReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -12352,7 +11893,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -12368,22 +11908,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -12392,18 +11931,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetCrossReferenceReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_args.class, metaDataMap); } @@ -12435,12 +11974,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetCrossReferenceReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetCrossReferenceReq req) { + public void setReq(TGetCrossReferenceReq req) { this.req = req; } @@ -12459,7 +11997,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -12472,31 +12010,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetCrossReference_args) @@ -12507,8 +12044,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetCrossReference_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -12524,13 +12059,14 @@ public boolean equals(GetCrossReference_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -12541,7 +12077,7 @@ public int compareTo(GetCrossReference_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -12554,22 +12090,21 @@ public int compareTo(GetCrossReference_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetCrossReference_args("); boolean first = true; sb.append("req:"); @@ -12599,7 +12134,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -12607,13 +12142,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCrossReference_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCrossReference_argsStandardSchemeFactory implements SchemeFactory { public GetCrossReference_argsStandardScheme getScheme() { return new GetCrossReference_argsStandardScheme(); } } - private static class GetCrossReference_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetCrossReference_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -12658,18 +12193,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCrossReference_ } - private static class GetCrossReference_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCrossReference_argsTupleSchemeFactory implements SchemeFactory { public GetCrossReference_argsTupleScheme getScheme() { return new GetCrossReference_argsTupleScheme(); } } - private static class GetCrossReference_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetCrossReference_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -12681,8 +12216,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_a @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetCrossReferenceReq(); struct.req.read(iprot); @@ -12691,9 +12226,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_ar } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetCrossReference_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -12701,19 +12233,22 @@ public static class GetCrossReference_result implements org.apache.thrift.TBase< 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetCrossReference_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetCrossReference_resultTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetCrossReference_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetCrossReference_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetCrossReferenceResp success; // required + private TGetCrossReferenceResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -12721,7 +12256,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -12737,22 +12271,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -12761,18 +12294,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetCrossReferenceResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_result.class, metaDataMap); } @@ -12804,12 +12337,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetCrossReferenceResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetCrossReferenceResp success) { + public void setSuccess(TGetCrossReferenceResp success) { this.success = success; } @@ -12828,7 +12360,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -12841,31 +12373,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetCrossReference_result) @@ -12876,8 +12407,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetCrossReference_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -12893,13 +12422,14 @@ public boolean equals(GetCrossReference_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -12910,7 +12440,7 @@ public int compareTo(GetCrossReference_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -12923,22 +12453,21 @@ public int compareTo(GetCrossReference_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetCrossReference_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetCrossReference_result("); boolean first = true; sb.append("success:"); @@ -12968,7 +12497,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -12976,13 +12505,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetCrossReference_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCrossReference_resultStandardSchemeFactory implements SchemeFactory { public GetCrossReference_resultStandardScheme getScheme() { return new GetCrossReference_resultStandardScheme(); } } - private static class GetCrossReference_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetCrossReference_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -13027,18 +12556,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetCrossReference_ } - private static class GetCrossReference_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetCrossReference_resultTupleSchemeFactory implements SchemeFactory { public GetCrossReference_resultTupleScheme getScheme() { return new GetCrossReference_resultTupleScheme(); } } - private static class GetCrossReference_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetCrossReference_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -13050,8 +12579,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_r @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetCrossReferenceResp(); struct.success.read(iprot); @@ -13060,9 +12589,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_re } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -13070,19 +12596,22 @@ public static class GetOperationStatus_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetOperationStatus_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetOperationStatus_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetOperationStatusReq req; // required + private TGetOperationStatusReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -13090,7 +12619,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -13106,22 +12634,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -13130,18 +12657,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetOperationStatusReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_args.class, metaDataMap); } @@ -13173,12 +12700,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetOperationStatusReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetOperationStatusReq req) { + public void setReq(TGetOperationStatusReq req) { this.req = req; } @@ -13197,7 +12723,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -13210,31 +12736,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetOperationStatus_args) @@ -13245,8 +12770,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetOperationStatus_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -13262,13 +12785,14 @@ public boolean equals(GetOperationStatus_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -13279,7 +12803,7 @@ public int compareTo(GetOperationStatus_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -13292,22 +12816,21 @@ public int compareTo(GetOperationStatus_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetOperationStatus_args("); boolean first = true; sb.append("req:"); @@ -13337,7 +12860,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -13345,13 +12868,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetOperationStatus_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetOperationStatus_argsStandardSchemeFactory implements SchemeFactory { public GetOperationStatus_argsStandardScheme getScheme() { return new GetOperationStatus_argsStandardScheme(); } } - private static class GetOperationStatus_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetOperationStatus_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -13396,18 +12919,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus } - private static class GetOperationStatus_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetOperationStatus_argsTupleSchemeFactory implements SchemeFactory { public GetOperationStatus_argsTupleScheme getScheme() { return new GetOperationStatus_argsTupleScheme(); } } - private static class GetOperationStatus_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetOperationStatus_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -13419,8 +12942,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetOperationStatusReq(); struct.req.read(iprot); @@ -13429,9 +12952,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_a } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -13439,19 +12959,22 @@ public static class GetOperationStatus_result implements org.apache.thrift.TBase 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetOperationStatus_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetOperationStatus_resultTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetOperationStatus_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetOperationStatus_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetOperationStatusResp success; // required + private TGetOperationStatusResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -13459,7 +12982,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -13475,22 +12997,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -13499,18 +13020,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetOperationStatusResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_result.class, metaDataMap); } @@ -13542,12 +13063,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetOperationStatusResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetOperationStatusResp success) { + public void setSuccess(TGetOperationStatusResp success) { this.success = success; } @@ -13566,7 +13086,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -13579,31 +13099,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetOperationStatus_result) @@ -13614,8 +13133,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetOperationStatus_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -13631,13 +13148,14 @@ public boolean equals(GetOperationStatus_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -13648,7 +13166,7 @@ public int compareTo(GetOperationStatus_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -13661,22 +13179,21 @@ public int compareTo(GetOperationStatus_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetOperationStatus_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetOperationStatus_result("); boolean first = true; sb.append("success:"); @@ -13706,7 +13223,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -13714,13 +13231,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetOperationStatus_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetOperationStatus_resultStandardSchemeFactory implements SchemeFactory { public GetOperationStatus_resultStandardScheme getScheme() { return new GetOperationStatus_resultStandardScheme(); } } - private static class GetOperationStatus_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetOperationStatus_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -13765,18 +13282,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus } - private static class GetOperationStatus_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetOperationStatus_resultTupleSchemeFactory implements SchemeFactory { public GetOperationStatus_resultTupleScheme getScheme() { return new GetOperationStatus_resultTupleScheme(); } } - private static class GetOperationStatus_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetOperationStatus_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -13788,8 +13305,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetOperationStatusResp(); struct.success.read(iprot); @@ -13798,9 +13315,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_r } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -13808,19 +13322,22 @@ public static class CancelOperation_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CancelOperation_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelOperation_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCancelOperationReq req; // required + private TCancelOperationReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -13828,7 +13345,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -13844,22 +13360,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -13868,18 +13383,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCancelOperationReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_args.class, metaDataMap); } @@ -13911,12 +13426,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TCancelOperationReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TCancelOperationReq req) { + public void setReq(TCancelOperationReq req) { this.req = req; } @@ -13935,7 +13449,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -13948,31 +13462,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CancelOperation_args) @@ -13983,8 +13496,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CancelOperation_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -14000,13 +13511,14 @@ public boolean equals(CancelOperation_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -14017,7 +13529,7 @@ public int compareTo(CancelOperation_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -14030,22 +13542,21 @@ public int compareTo(CancelOperation_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_args("); + public String toString() { + StringBuilder sb = new StringBuilder("CancelOperation_args("); boolean first = true; sb.append("req:"); @@ -14075,7 +13586,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -14083,13 +13594,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelOperation_argsStandardSchemeFactory implements SchemeFactory { public CancelOperation_argsStandardScheme getScheme() { return new CancelOperation_argsStandardScheme(); } } - private static class CancelOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CancelOperation_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -14134,18 +13645,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_ar } - private static class CancelOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelOperation_argsTupleSchemeFactory implements SchemeFactory { public CancelOperation_argsTupleScheme getScheme() { return new CancelOperation_argsTupleScheme(); } } - private static class CancelOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CancelOperation_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -14157,8 +13668,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_arg @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCancelOperationReq(); struct.req.read(iprot); @@ -14167,9 +13678,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -14177,19 +13685,22 @@ public static class CancelOperation_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CancelOperation_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelOperation_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCancelOperationResp success; // required + private TCancelOperationResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -14197,7 +13708,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -14213,22 +13723,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -14237,18 +13746,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCancelOperationResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_result.class, metaDataMap); } @@ -14280,12 +13789,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TCancelOperationResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelOperationResp success) { + public void setSuccess(TCancelOperationResp success) { this.success = success; } @@ -14304,7 +13812,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -14317,31 +13825,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CancelOperation_result) @@ -14352,8 +13859,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CancelOperation_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -14369,13 +13874,14 @@ public boolean equals(CancelOperation_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -14386,7 +13892,7 @@ public int compareTo(CancelOperation_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -14399,22 +13905,21 @@ public int compareTo(CancelOperation_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelOperation_result("); + public String toString() { + StringBuilder sb = new StringBuilder("CancelOperation_result("); boolean first = true; sb.append("success:"); @@ -14444,7 +13949,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -14452,13 +13957,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelOperation_resultStandardSchemeFactory implements SchemeFactory { public CancelOperation_resultStandardScheme getScheme() { return new CancelOperation_resultStandardScheme(); } } - private static class CancelOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CancelOperation_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -14503,18 +14008,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_re } - private static class CancelOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelOperation_resultTupleSchemeFactory implements SchemeFactory { public CancelOperation_resultTupleScheme getScheme() { return new CancelOperation_resultTupleScheme(); } } - private static class CancelOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CancelOperation_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -14526,8 +14031,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_res @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCancelOperationResp(); struct.success.read(iprot); @@ -14536,9 +14041,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_resu } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -14546,19 +14048,22 @@ public static class CloseOperation_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CloseOperation_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseOperation_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCloseOperationReq req; // required + private TCloseOperationReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -14566,7 +14071,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -14582,22 +14086,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -14606,18 +14109,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCloseOperationReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_args.class, metaDataMap); } @@ -14649,12 +14152,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TCloseOperationReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TCloseOperationReq req) { + public void setReq(TCloseOperationReq req) { this.req = req; } @@ -14673,7 +14175,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -14686,31 +14188,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CloseOperation_args) @@ -14721,8 +14222,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CloseOperation_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -14738,13 +14237,14 @@ public boolean equals(CloseOperation_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -14755,7 +14255,7 @@ public int compareTo(CloseOperation_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -14768,22 +14268,21 @@ public int compareTo(CloseOperation_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_args("); + public String toString() { + StringBuilder sb = new StringBuilder("CloseOperation_args("); boolean first = true; sb.append("req:"); @@ -14813,7 +14312,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -14821,13 +14320,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseOperation_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseOperation_argsStandardSchemeFactory implements SchemeFactory { public CloseOperation_argsStandardScheme getScheme() { return new CloseOperation_argsStandardScheme(); } } - private static class CloseOperation_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CloseOperation_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -14872,18 +14371,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_arg } - private static class CloseOperation_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseOperation_argsTupleSchemeFactory implements SchemeFactory { public CloseOperation_argsTupleScheme getScheme() { return new CloseOperation_argsTupleScheme(); } } - private static class CloseOperation_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CloseOperation_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -14895,8 +14394,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCloseOperationReq(); struct.req.read(iprot); @@ -14905,9 +14404,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -14915,19 +14411,22 @@ public static class CloseOperation_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CloseOperation_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CloseOperation_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCloseOperationResp success; // required + private TCloseOperationResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -14935,7 +14434,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -14951,22 +14449,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -14975,18 +14472,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCloseOperationResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_result.class, metaDataMap); } @@ -15018,12 +14515,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TCloseOperationResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TCloseOperationResp success) { + public void setSuccess(TCloseOperationResp success) { this.success = success; } @@ -15042,7 +14538,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -15055,31 +14551,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CloseOperation_result) @@ -15090,8 +14585,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CloseOperation_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -15107,13 +14600,14 @@ public boolean equals(CloseOperation_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -15124,7 +14618,7 @@ public int compareTo(CloseOperation_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -15137,22 +14631,21 @@ public int compareTo(CloseOperation_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CloseOperation_result("); + public String toString() { + StringBuilder sb = new StringBuilder("CloseOperation_result("); boolean first = true; sb.append("success:"); @@ -15182,7 +14675,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -15190,13 +14683,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CloseOperation_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseOperation_resultStandardSchemeFactory implements SchemeFactory { public CloseOperation_resultStandardScheme getScheme() { return new CloseOperation_resultStandardScheme(); } } - private static class CloseOperation_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CloseOperation_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -15241,18 +14734,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_res } - private static class CloseOperation_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CloseOperation_resultTupleSchemeFactory implements SchemeFactory { public CloseOperation_resultTupleScheme getScheme() { return new CloseOperation_resultTupleScheme(); } } - private static class CloseOperation_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CloseOperation_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -15264,8 +14757,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_resu @Override public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCloseOperationResp(); struct.success.read(iprot); @@ -15274,9 +14767,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_resul } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -15284,19 +14774,22 @@ public static class GetResultSetMetadata_args implements org.apache.thrift.TBase 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_argsTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetResultSetMetadata_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetResultSetMetadata_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq req; // required + private TGetResultSetMetadataReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -15304,7 +14797,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -15320,22 +14812,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -15344,18 +14835,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetResultSetMetadataReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_args.class, metaDataMap); } @@ -15387,12 +14878,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetResultSetMetadataReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataReq req) { + public void setReq(TGetResultSetMetadataReq req) { this.req = req; } @@ -15411,7 +14901,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -15424,31 +14914,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetResultSetMetadata_args) @@ -15459,8 +14948,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetResultSetMetadata_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -15476,13 +14963,14 @@ public boolean equals(GetResultSetMetadata_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -15493,7 +14981,7 @@ public int compareTo(GetResultSetMetadata_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -15506,22 +14994,21 @@ public int compareTo(GetResultSetMetadata_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetResultSetMetadata_args("); boolean first = true; sb.append("req:"); @@ -15551,7 +15038,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -15559,13 +15046,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetResultSetMetadata_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetResultSetMetadata_argsStandardSchemeFactory implements SchemeFactory { public GetResultSetMetadata_argsStandardScheme getScheme() { return new GetResultSetMetadata_argsStandardScheme(); } } - private static class GetResultSetMetadata_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetResultSetMetadata_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -15610,18 +15097,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetada } - private static class GetResultSetMetadata_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetResultSetMetadata_argsTupleSchemeFactory implements SchemeFactory { public GetResultSetMetadata_argsTupleScheme getScheme() { return new GetResultSetMetadata_argsTupleScheme(); } } - private static class GetResultSetMetadata_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetResultSetMetadata_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -15633,8 +15120,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadat @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetResultSetMetadataReq(); struct.req.read(iprot); @@ -15643,9 +15130,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -15653,19 +15137,22 @@ public static class GetResultSetMetadata_result implements org.apache.thrift.TBa 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetResultSetMetadata_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetResultSetMetadata_resultTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetResultSetMetadata_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetResultSetMetadata_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp success; // required + private TGetResultSetMetadataResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -15673,7 +15160,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -15689,22 +15175,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -15713,18 +15198,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetResultSetMetadataResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_result.class, metaDataMap); } @@ -15756,12 +15241,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetResultSetMetadataResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetResultSetMetadataResp success) { + public void setSuccess(TGetResultSetMetadataResp success) { this.success = success; } @@ -15780,7 +15264,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -15793,31 +15277,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetResultSetMetadata_result) @@ -15828,8 +15311,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetResultSetMetadata_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -15845,13 +15326,14 @@ public boolean equals(GetResultSetMetadata_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -15862,7 +15344,7 @@ public int compareTo(GetResultSetMetadata_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -15875,22 +15357,21 @@ public int compareTo(GetResultSetMetadata_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetResultSetMetadata_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetResultSetMetadata_result("); boolean first = true; sb.append("success:"); @@ -15920,7 +15401,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -15928,13 +15409,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetResultSetMetadata_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetResultSetMetadata_resultStandardSchemeFactory implements SchemeFactory { public GetResultSetMetadata_resultStandardScheme getScheme() { return new GetResultSetMetadata_resultStandardScheme(); } } - private static class GetResultSetMetadata_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetResultSetMetadata_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -15979,18 +15460,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetada } - private static class GetResultSetMetadata_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetResultSetMetadata_resultTupleSchemeFactory implements SchemeFactory { public GetResultSetMetadata_resultTupleScheme getScheme() { return new GetResultSetMetadata_resultTupleScheme(); } } - private static class GetResultSetMetadata_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetResultSetMetadata_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -16002,8 +15483,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadat @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetResultSetMetadataResp(); struct.success.read(iprot); @@ -16012,9 +15493,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -16022,19 +15500,22 @@ public static class FetchResults_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new FetchResults_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new FetchResults_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TFetchResultsReq req; // required + private TFetchResultsReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -16042,7 +15523,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -16058,22 +15538,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -16082,18 +15561,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TFetchResultsReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_args.class, metaDataMap); } @@ -16125,12 +15604,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TFetchResultsReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TFetchResultsReq req) { + public void setReq(TFetchResultsReq req) { this.req = req; } @@ -16149,7 +15627,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -16162,31 +15640,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof FetchResults_args) @@ -16197,8 +15674,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(FetchResults_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -16214,13 +15689,14 @@ public boolean equals(FetchResults_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -16231,7 +15707,7 @@ public int compareTo(FetchResults_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -16244,22 +15720,21 @@ public int compareTo(FetchResults_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_args("); + public String toString() { + StringBuilder sb = new StringBuilder("FetchResults_args("); boolean first = true; sb.append("req:"); @@ -16289,7 +15764,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -16297,13 +15772,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class FetchResults_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class FetchResults_argsStandardSchemeFactory implements SchemeFactory { public FetchResults_argsStandardScheme getScheme() { return new FetchResults_argsStandardScheme(); } } - private static class FetchResults_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class FetchResults_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -16348,18 +15823,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_args } - private static class FetchResults_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class FetchResults_argsTupleSchemeFactory implements SchemeFactory { public FetchResults_argsTupleScheme getScheme() { return new FetchResults_argsTupleScheme(); } } - private static class FetchResults_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class FetchResults_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -16371,8 +15846,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args s @Override public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TFetchResultsReq(); struct.req.read(iprot); @@ -16381,9 +15856,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_args st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -16391,19 +15863,22 @@ public static class FetchResults_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new FetchResults_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new FetchResults_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TFetchResultsResp success; // required + private TFetchResultsResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -16411,7 +15886,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -16427,22 +15901,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -16451,18 +15924,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TFetchResultsResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_result.class, metaDataMap); } @@ -16494,12 +15967,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TFetchResultsResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TFetchResultsResp success) { + public void setSuccess(TFetchResultsResp success) { this.success = success; } @@ -16518,7 +15990,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -16531,31 +16003,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof FetchResults_result) @@ -16566,8 +16037,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(FetchResults_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -16583,13 +16052,14 @@ public boolean equals(FetchResults_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -16600,7 +16070,7 @@ public int compareTo(FetchResults_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -16613,22 +16083,21 @@ public int compareTo(FetchResults_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("FetchResults_result("); + public String toString() { + StringBuilder sb = new StringBuilder("FetchResults_result("); boolean first = true; sb.append("success:"); @@ -16658,7 +16127,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -16666,13 +16135,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class FetchResults_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class FetchResults_resultStandardSchemeFactory implements SchemeFactory { public FetchResults_resultStandardScheme getScheme() { return new FetchResults_resultStandardScheme(); } } - private static class FetchResults_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class FetchResults_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -16717,18 +16186,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_resul } - private static class FetchResults_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class FetchResults_resultTupleSchemeFactory implements SchemeFactory { public FetchResults_resultTupleScheme getScheme() { return new FetchResults_resultTupleScheme(); } } - private static class FetchResults_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class FetchResults_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -16740,8 +16209,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result @Override public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TFetchResultsResp(); struct.success.read(iprot); @@ -16750,9 +16219,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -16760,19 +16226,22 @@ public static class GetDelegationToken_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetDelegationToken_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetDelegationToken_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetDelegationTokenReq req; // required + private TGetDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -16780,7 +16249,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -16796,22 +16264,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -16820,18 +16287,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetDelegationTokenReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_args.class, metaDataMap); } @@ -16863,12 +16330,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetDelegationTokenReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetDelegationTokenReq req) { + public void setReq(TGetDelegationTokenReq req) { this.req = req; } @@ -16887,7 +16353,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -16900,31 +16366,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetDelegationToken_args) @@ -16935,8 +16400,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetDelegationToken_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -16952,13 +16415,14 @@ public boolean equals(GetDelegationToken_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -16969,7 +16433,7 @@ public int compareTo(GetDelegationToken_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -16982,22 +16446,21 @@ public int compareTo(GetDelegationToken_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetDelegationToken_args("); boolean first = true; sb.append("req:"); @@ -17027,7 +16490,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -17035,13 +16498,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetDelegationToken_argsStandardSchemeFactory implements SchemeFactory { public GetDelegationToken_argsStandardScheme getScheme() { return new GetDelegationToken_argsStandardScheme(); } } - private static class GetDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetDelegationToken_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -17086,18 +16549,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken } - private static class GetDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetDelegationToken_argsTupleSchemeFactory implements SchemeFactory { public GetDelegationToken_argsTupleScheme getScheme() { return new GetDelegationToken_argsTupleScheme(); } } - private static class GetDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetDelegationToken_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -17109,8 +16572,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetDelegationTokenReq(); struct.req.read(iprot); @@ -17119,9 +16582,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_a } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -17129,19 +16589,22 @@ public static class GetDelegationToken_result implements org.apache.thrift.TBase 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetDelegationToken_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetDelegationToken_resultTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetDelegationToken_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetDelegationToken_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetDelegationTokenResp success; // required + private TGetDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -17149,7 +16612,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -17165,22 +16627,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -17189,18 +16650,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetDelegationTokenResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_result.class, metaDataMap); } @@ -17232,12 +16693,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetDelegationTokenResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetDelegationTokenResp success) { + public void setSuccess(TGetDelegationTokenResp success) { this.success = success; } @@ -17256,7 +16716,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -17269,31 +16729,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetDelegationToken_result) @@ -17304,8 +16763,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetDelegationToken_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -17321,13 +16778,14 @@ public boolean equals(GetDelegationToken_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -17338,7 +16796,7 @@ public int compareTo(GetDelegationToken_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -17351,22 +16809,21 @@ public int compareTo(GetDelegationToken_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetDelegationToken_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetDelegationToken_result("); boolean first = true; sb.append("success:"); @@ -17396,7 +16853,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -17404,13 +16861,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetDelegationToken_resultStandardSchemeFactory implements SchemeFactory { public GetDelegationToken_resultStandardScheme getScheme() { return new GetDelegationToken_resultStandardScheme(); } } - private static class GetDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetDelegationToken_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -17455,18 +16912,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken } - private static class GetDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetDelegationToken_resultTupleSchemeFactory implements SchemeFactory { public GetDelegationToken_resultTupleScheme getScheme() { return new GetDelegationToken_resultTupleScheme(); } } - private static class GetDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetDelegationToken_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -17478,8 +16935,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_ @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetDelegationTokenResp(); struct.success.read(iprot); @@ -17488,9 +16945,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_r } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -17498,19 +16952,22 @@ public static class CancelDelegationToken_args implements org.apache.thrift.TBas 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_argsTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CancelDelegationToken_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelDelegationToken_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq req; // required + private TCancelDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -17518,7 +16975,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -17534,22 +16990,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -17558,18 +17013,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCancelDelegationTokenReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_args.class, metaDataMap); } @@ -17601,12 +17056,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TCancelDelegationTokenReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenReq req) { + public void setReq(TCancelDelegationTokenReq req) { this.req = req; } @@ -17625,7 +17079,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -17638,31 +17092,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CancelDelegationToken_args) @@ -17673,8 +17126,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CancelDelegationToken_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -17690,13 +17141,14 @@ public boolean equals(CancelDelegationToken_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -17707,7 +17159,7 @@ public int compareTo(CancelDelegationToken_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -17720,22 +17172,21 @@ public int compareTo(CancelDelegationToken_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_args("); + public String toString() { + StringBuilder sb = new StringBuilder("CancelDelegationToken_args("); boolean first = true; sb.append("req:"); @@ -17765,7 +17216,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -17773,13 +17224,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelDelegationToken_argsStandardSchemeFactory implements SchemeFactory { public CancelDelegationToken_argsStandardScheme getScheme() { return new CancelDelegationToken_argsStandardScheme(); } } - private static class CancelDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CancelDelegationToken_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -17824,18 +17275,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationTo } - private static class CancelDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelDelegationToken_argsTupleSchemeFactory implements SchemeFactory { public CancelDelegationToken_argsTupleScheme getScheme() { return new CancelDelegationToken_argsTupleScheme(); } } - private static class CancelDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CancelDelegationToken_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -17847,8 +17298,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationTok @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TCancelDelegationTokenReq(); struct.req.read(iprot); @@ -17857,9 +17308,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToke } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -17867,19 +17315,22 @@ public static class CancelDelegationToken_result implements org.apache.thrift.TB 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CancelDelegationToken_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CancelDelegationToken_resultTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CancelDelegationToken_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CancelDelegationToken_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp success; // required + private TCancelDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -17887,7 +17338,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -17903,22 +17353,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -17927,18 +17376,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TCancelDelegationTokenResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_result.class, metaDataMap); } @@ -17970,12 +17419,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TCancelDelegationTokenResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TCancelDelegationTokenResp success) { + public void setSuccess(TCancelDelegationTokenResp success) { this.success = success; } @@ -17994,7 +17442,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -18007,31 +17455,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof CancelDelegationToken_result) @@ -18042,8 +17489,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(CancelDelegationToken_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -18059,13 +17504,14 @@ public boolean equals(CancelDelegationToken_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -18076,7 +17522,7 @@ public int compareTo(CancelDelegationToken_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -18089,22 +17535,21 @@ public int compareTo(CancelDelegationToken_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("CancelDelegationToken_result("); + public String toString() { + StringBuilder sb = new StringBuilder("CancelDelegationToken_result("); boolean first = true; sb.append("success:"); @@ -18134,7 +17579,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -18142,13 +17587,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class CancelDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelDelegationToken_resultStandardSchemeFactory implements SchemeFactory { public CancelDelegationToken_resultStandardScheme getScheme() { return new CancelDelegationToken_resultStandardScheme(); } } - private static class CancelDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class CancelDelegationToken_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -18193,18 +17638,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationTo } - private static class CancelDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class CancelDelegationToken_resultTupleSchemeFactory implements SchemeFactory { public CancelDelegationToken_resultTupleScheme getScheme() { return new CancelDelegationToken_resultTupleScheme(); } } - private static class CancelDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class CancelDelegationToken_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -18216,8 +17661,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationTok @Override public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TCancelDelegationTokenResp(); struct.success.read(iprot); @@ -18226,9 +17671,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToke } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -18236,19 +17678,22 @@ public static class RenewDelegationToken_args implements org.apache.thrift.TBase 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_argsStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_argsTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RenewDelegationToken_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RenewDelegationToken_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq req; // required + private TRenewDelegationTokenReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -18256,7 +17701,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -18272,22 +17716,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -18296,18 +17739,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TRenewDelegationTokenReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_args.class, metaDataMap); } @@ -18339,12 +17782,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TRenewDelegationTokenReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenReq req) { + public void setReq(TRenewDelegationTokenReq req) { this.req = req; } @@ -18363,7 +17805,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -18376,31 +17818,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof RenewDelegationToken_args) @@ -18411,8 +17852,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(RenewDelegationToken_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -18428,13 +17867,14 @@ public boolean equals(RenewDelegationToken_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -18445,7 +17885,7 @@ public int compareTo(RenewDelegationToken_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -18458,22 +17898,21 @@ public int compareTo(RenewDelegationToken_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_args("); + public String toString() { + StringBuilder sb = new StringBuilder("RenewDelegationToken_args("); boolean first = true; sb.append("req:"); @@ -18503,7 +17942,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -18511,13 +17950,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class RenewDelegationToken_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class RenewDelegationToken_argsStandardSchemeFactory implements SchemeFactory { public RenewDelegationToken_argsStandardScheme getScheme() { return new RenewDelegationToken_argsStandardScheme(); } } - private static class RenewDelegationToken_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class RenewDelegationToken_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -18562,18 +18001,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationTok } - private static class RenewDelegationToken_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class RenewDelegationToken_argsTupleSchemeFactory implements SchemeFactory { public RenewDelegationToken_argsTupleScheme getScheme() { return new RenewDelegationToken_argsTupleScheme(); } } - private static class RenewDelegationToken_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class RenewDelegationToken_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -18585,8 +18024,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToke @Override public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TRenewDelegationTokenReq(); struct.req.read(iprot); @@ -18595,9 +18034,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -18605,19 +18041,22 @@ public static class RenewDelegationToken_result implements org.apache.thrift.TBa 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 org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RenewDelegationToken_resultStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RenewDelegationToken_resultTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new RenewDelegationToken_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new RenewDelegationToken_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp success; // required + private TRenewDelegationTokenResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -18625,7 +18064,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -18641,22 +18079,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -18665,18 +18102,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TRenewDelegationTokenResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_result.class, metaDataMap); } @@ -18708,12 +18145,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TRenewDelegationTokenResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TRenewDelegationTokenResp success) { + public void setSuccess(TRenewDelegationTokenResp success) { this.success = success; } @@ -18732,7 +18168,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -18745,31 +18181,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof RenewDelegationToken_result) @@ -18780,8 +18215,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(RenewDelegationToken_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -18797,13 +18230,14 @@ public boolean equals(RenewDelegationToken_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -18814,7 +18248,7 @@ public int compareTo(RenewDelegationToken_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -18827,22 +18261,21 @@ public int compareTo(RenewDelegationToken_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("RenewDelegationToken_result("); + public String toString() { + StringBuilder sb = new StringBuilder("RenewDelegationToken_result("); boolean first = true; sb.append("success:"); @@ -18872,7 +18305,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -18880,13 +18313,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class RenewDelegationToken_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class RenewDelegationToken_resultStandardSchemeFactory implements SchemeFactory { public RenewDelegationToken_resultStandardScheme getScheme() { return new RenewDelegationToken_resultStandardScheme(); } } - private static class RenewDelegationToken_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class RenewDelegationToken_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -18931,18 +18364,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationTok } - private static class RenewDelegationToken_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class RenewDelegationToken_resultTupleSchemeFactory implements SchemeFactory { public RenewDelegationToken_resultTupleScheme getScheme() { return new RenewDelegationToken_resultTupleScheme(); } } - private static class RenewDelegationToken_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class RenewDelegationToken_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -18954,8 +18387,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToke @Override public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TRenewDelegationTokenResp(); struct.success.read(iprot); @@ -18964,9 +18397,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetQueryId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -18974,19 +18404,22 @@ public static class GetQueryId_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetQueryId_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetQueryId_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetQueryIdReq req; // required + private TGetQueryIdReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -18994,7 +18427,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -19010,22 +18442,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -19034,18 +18465,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetQueryIdReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_args.class, metaDataMap); } @@ -19077,12 +18508,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TGetQueryIdReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TGetQueryIdReq req) { + public void setReq(TGetQueryIdReq req) { this.req = req; } @@ -19101,7 +18531,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -19114,31 +18544,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetQueryId_args) @@ -19149,8 +18578,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetQueryId_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -19166,13 +18593,14 @@ public boolean equals(GetQueryId_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -19183,7 +18611,7 @@ public int compareTo(GetQueryId_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -19196,22 +18624,21 @@ public int compareTo(GetQueryId_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_args("); + public String toString() { + StringBuilder sb = new StringBuilder("GetQueryId_args("); boolean first = true; sb.append("req:"); @@ -19241,7 +18668,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -19249,13 +18676,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetQueryId_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetQueryId_argsStandardSchemeFactory implements SchemeFactory { public GetQueryId_argsStandardScheme getScheme() { return new GetQueryId_argsStandardScheme(); } } - private static class GetQueryId_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetQueryId_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -19300,18 +18727,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetQueryId_args st } - private static class GetQueryId_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetQueryId_argsTupleSchemeFactory implements SchemeFactory { public GetQueryId_argsTupleScheme getScheme() { return new GetQueryId_argsTupleScheme(); } } - private static class GetQueryId_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetQueryId_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -19323,8 +18750,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args str @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TGetQueryIdReq(); struct.req.read(iprot); @@ -19333,9 +18760,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_args stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class GetQueryId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -19343,19 +18767,22 @@ public static class GetQueryId_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new GetQueryId_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new GetQueryId_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TGetQueryIdResp success; // required + private TGetQueryIdResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -19363,7 +18790,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -19379,22 +18805,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -19403,18 +18828,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TGetQueryIdResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetQueryId_result.class, metaDataMap); } @@ -19446,12 +18871,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TGetQueryIdResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TGetQueryIdResp success) { + public void setSuccess(TGetQueryIdResp success) { this.success = success; } @@ -19470,7 +18894,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -19483,31 +18907,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof GetQueryId_result) @@ -19518,8 +18941,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(GetQueryId_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -19535,13 +18956,14 @@ public boolean equals(GetQueryId_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -19552,7 +18974,7 @@ public int compareTo(GetQueryId_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -19565,22 +18987,21 @@ public int compareTo(GetQueryId_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("GetQueryId_result("); + public String toString() { + StringBuilder sb = new StringBuilder("GetQueryId_result("); boolean first = true; sb.append("success:"); @@ -19610,7 +19031,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -19618,13 +19039,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class GetQueryId_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetQueryId_resultStandardSchemeFactory implements SchemeFactory { public GetQueryId_resultStandardScheme getScheme() { return new GetQueryId_resultStandardScheme(); } } - private static class GetQueryId_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class GetQueryId_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, GetQueryId_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -19669,18 +19090,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, GetQueryId_result } - private static class GetQueryId_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class GetQueryId_resultTupleSchemeFactory implements SchemeFactory { public GetQueryId_resultTupleScheme getScheme() { return new GetQueryId_resultTupleScheme(); } } - private static class GetQueryId_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class GetQueryId_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -19692,8 +19113,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result s @Override public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TGetQueryIdResp(); struct.success.read(iprot); @@ -19702,9 +19123,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, GetQueryId_result st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class SetClientInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -19712,19 +19130,22 @@ public static class SetClientInfo_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SetClientInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SetClientInfo_argsTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSetClientInfoReq req; // required + private TSetClientInfoReq 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -19732,7 +19153,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // REQ @@ -19748,22 +19168,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -19772,18 +19191,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TSetClientInfoReq.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_args.class, metaDataMap); } @@ -19815,12 +19234,11 @@ public void clear() { this.req = null; } - @org.apache.thrift.annotation.Nullable public TSetClientInfoReq getReq() { return this.req; } - public void setReq(@org.apache.thrift.annotation.Nullable TSetClientInfoReq req) { + public void setReq(TSetClientInfoReq req) { this.req = req; } @@ -19839,7 +19257,7 @@ public void setReqIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case REQ: if (value == null) { @@ -19852,31 +19270,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case REQ: return getReq(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case REQ: return isSetReq(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof SetClientInfo_args) @@ -19887,8 +19304,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(SetClientInfo_args that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_req = true && this.isSetReq(); boolean that_present_req = true && that.isSetReq(); @@ -19904,13 +19319,14 @@ public boolean equals(SetClientInfo_args that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetReq()) ? 131071 : 524287); - if (isSetReq()) - hashCode = hashCode * 8191 + req.hashCode(); + boolean present_req = true && (isSetReq()); + list.add(present_req); + if (present_req) + list.add(req); - return hashCode; + return list.hashCode(); } @Override @@ -19921,7 +19337,7 @@ public int compareTo(SetClientInfo_args other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); + lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); if (lastComparison != 0) { return lastComparison; } @@ -19934,22 +19350,21 @@ public int compareTo(SetClientInfo_args other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_args("); + public String toString() { + StringBuilder sb = new StringBuilder("SetClientInfo_args("); boolean first = true; sb.append("req:"); @@ -19979,7 +19394,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -19987,13 +19402,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class SetClientInfo_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class SetClientInfo_argsStandardSchemeFactory implements SchemeFactory { public SetClientInfo_argsStandardScheme getScheme() { return new SetClientInfo_argsStandardScheme(); } } - private static class SetClientInfo_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class SetClientInfo_argsStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -20038,18 +19453,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, SetClientInfo_args } - private static class SetClientInfo_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class SetClientInfo_argsTupleSchemeFactory implements SchemeFactory { public SetClientInfo_argsTupleScheme getScheme() { return new SetClientInfo_argsTupleScheme(); } } - private static class SetClientInfo_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class SetClientInfo_argsTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetReq()) { optionals.set(0); } @@ -20061,8 +19476,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args @Override public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.req = new TSetClientInfoReq(); struct.req.read(iprot); @@ -20071,9 +19486,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_args s } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } public static class SetClientInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { @@ -20081,19 +19493,22 @@ public static class SetClientInfo_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SetClientInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SetClientInfo_resultTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSetClientInfoResp success; // required + private TSetClientInfoResp 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 java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -20101,7 +19516,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 0: // SUCCESS @@ -20117,22 +19531,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -20141,18 +19554,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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, TSetClientInfoResp.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SetClientInfo_result.class, metaDataMap); } @@ -20184,12 +19597,11 @@ public void clear() { this.success = null; } - @org.apache.thrift.annotation.Nullable public TSetClientInfoResp getSuccess() { return this.success; } - public void setSuccess(@org.apache.thrift.annotation.Nullable TSetClientInfoResp success) { + public void setSuccess(TSetClientInfoResp success) { this.success = success; } @@ -20208,7 +19620,7 @@ public void setSuccessIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: if (value == null) { @@ -20221,31 +19633,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SUCCESS: return getSuccess(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SUCCESS: return isSetSuccess(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof SetClientInfo_result) @@ -20256,8 +19667,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(SetClientInfo_result that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); @@ -20273,13 +19682,14 @@ public boolean equals(SetClientInfo_result that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287); - if (isSetSuccess()) - hashCode = hashCode * 8191 + success.hashCode(); + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); - return hashCode; + return list.hashCode(); } @Override @@ -20290,7 +19700,7 @@ public int compareTo(SetClientInfo_result other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } @@ -20303,22 +19713,21 @@ public int compareTo(SetClientInfo_result other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("SetClientInfo_result("); + public String toString() { + StringBuilder sb = new StringBuilder("SetClientInfo_result("); boolean first = true; sb.append("success:"); @@ -20348,7 +19757,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -20356,13 +19765,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class SetClientInfo_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class SetClientInfo_resultStandardSchemeFactory implements SchemeFactory { public SetClientInfo_resultStandardScheme getScheme() { return new SetClientInfo_resultStandardScheme(); } } - private static class SetClientInfo_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class SetClientInfo_resultStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, SetClientInfo_result struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -20407,18 +19816,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, SetClientInfo_resu } - private static class SetClientInfo_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class SetClientInfo_resultTupleSchemeFactory implements SchemeFactory { public SetClientInfo_resultTupleScheme getScheme() { return new SetClientInfo_resultTupleScheme(); } } - private static class SetClientInfo_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class SetClientInfo_resultTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetSuccess()) { optionals.set(0); } @@ -20430,8 +19839,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_resul @Override public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TSetClientInfoResp(); struct.success.read(iprot); @@ -20440,9 +19849,6 @@ public void read(org.apache.thrift.protocol.TProtocol prot, SetClientInfo_result } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java index c526118f908c..3a817c3c864b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java @@ -1,15 +1,42 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) public class TCLIServiceConstants { - public static final java.util.Set PRIMITIVE_TYPES = java.util.EnumSet.noneOf(TTypeId.class); + public static final Set PRIMITIVE_TYPES = new HashSet(); static { PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BOOLEAN_TYPE); PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TINYINT_TYPE); @@ -31,7 +58,7 @@ public class TCLIServiceConstants { PRIMITIVE_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE); } - public static final java.util.Set COMPLEX_TYPES = java.util.EnumSet.noneOf(TTypeId.class); + public static final Set COMPLEX_TYPES = new HashSet(); static { COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.ARRAY_TYPE); COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.MAP_TYPE); @@ -40,42 +67,42 @@ public class TCLIServiceConstants { COMPLEX_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.USER_DEFINED_TYPE); } - public static final java.util.Set COLLECTION_TYPES = java.util.EnumSet.noneOf(TTypeId.class); + public static final Set COLLECTION_TYPES = new HashSet(); static { COLLECTION_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.ARRAY_TYPE); COLLECTION_TYPES.add(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.MAP_TYPE); } - public static final java.util.Map TYPE_NAMES = new java.util.EnumMap(TTypeId.class); + public static final Map TYPE_NAMES = new HashMap(); static { - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.ARRAY_TYPE, "ARRAY"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BIGINT_TYPE, "BIGINT"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BINARY_TYPE, "BINARY"); TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BOOLEAN_TYPE, "BOOLEAN"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.CHAR_TYPE, "CHAR"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DATE_TYPE, "DATE"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DECIMAL_TYPE, "DECIMAL"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DOUBLE_TYPE, "DOUBLE"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.FLOAT_TYPE, "FLOAT"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INT_TYPE, "INT"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.MAP_TYPE, "MAP"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.NULL_TYPE, "NULL"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TINYINT_TYPE, "TINYINT"); TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.SMALLINT_TYPE, "SMALLINT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INT_TYPE, "INT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BIGINT_TYPE, "BIGINT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.FLOAT_TYPE, "FLOAT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DOUBLE_TYPE, "DOUBLE"); TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.STRING_TYPE, "STRING"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.STRUCT_TYPE, "STRUCT"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE, "TIMESTAMP WITH LOCAL TIME ZONE"); TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); - TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TINYINT_TYPE, "TINYINT"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.BINARY_TYPE, "BINARY"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.ARRAY_TYPE, "ARRAY"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.MAP_TYPE, "MAP"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.STRUCT_TYPE, "STRUCT"); TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.UNION_TYPE, "UNIONTYPE"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DECIMAL_TYPE, "DECIMAL"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.NULL_TYPE, "NULL"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.DATE_TYPE, "DATE"); TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.VARCHAR_TYPE, "VARCHAR"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.CHAR_TYPE, "CHAR"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); + TYPE_NAMES.put(org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.TIMESTAMPLOCALTZ_TYPE, "TIMESTAMP WITH LOCAL TIME ZONE"); } - public static final java.lang.String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; + public static final String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; - public static final java.lang.String PRECISION = "precision"; + public static final String PRECISION = "precision"; - public static final java.lang.String SCALE = "scale"; + public static final String SCALE = "scale"; } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java index 5873d2a95316..b9bd1d187347 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenReq"); 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelDelegationTokenReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelDelegationTokenReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // required + private TSessionHandle sessionHandle; // required + private String delegationToken; // 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"), DELEGATION_TOKEN((short)2, "delegationToken"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,20 +106,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenReq.class, metaDataMap); } @@ -100,7 +128,7 @@ public TCancelDelegationTokenReq() { public TCancelDelegationTokenReq( TSessionHandle sessionHandle, - java.lang.String delegationToken) + String delegationToken) { this(); this.sessionHandle = sessionHandle; @@ -129,12 +157,11 @@ public void clear() { this.delegationToken = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -153,12 +180,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getDelegationToken() { + public String getDelegationToken() { return this.delegationToken; } - public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { + public void setDelegationToken(String delegationToken) { this.delegationToken = delegationToken; } @@ -177,7 +203,7 @@ public void setDelegationTokenIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -191,15 +217,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetDelegationToken(); } else { - setDelegationToken((java.lang.String)value); + setDelegationToken((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -208,13 +233,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getDelegationToken(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -223,11 +248,11 @@ public boolean isSet(_Fields field) { case DELEGATION_TOKEN: return isSetDelegationToken(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCancelDelegationTokenReq) @@ -238,8 +263,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCancelDelegationTokenReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -264,17 +287,19 @@ public boolean equals(TCancelDelegationTokenReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); - if (isSetDelegationToken()) - hashCode = hashCode * 8191 + delegationToken.hashCode(); + boolean present_delegationToken = true && (isSetDelegationToken()); + list.add(present_delegationToken); + if (present_delegationToken) + list.add(delegationToken); - return hashCode; + return list.hashCode(); } @Override @@ -285,7 +310,7 @@ public int compareTo(TCancelDelegationTokenReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -295,7 +320,7 @@ public int compareTo(TCancelDelegationTokenReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); if (lastComparison != 0) { return lastComparison; } @@ -308,22 +333,21 @@ public int compareTo(TCancelDelegationTokenReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TCancelDelegationTokenReq("); boolean first = true; sb.append("sessionHandle:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelDelegationTokenReqStandardSchemeFactory implements SchemeFactory { public TCancelDelegationTokenReqStandardScheme getScheme() { return new TCancelDelegationTokenReqStandardScheme(); } } - private static class TCancelDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCancelDelegationTokenReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -441,24 +465,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationT } - private static class TCancelDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelDelegationTokenReqTupleSchemeFactory implements SchemeFactory { public TCancelDelegationTokenReqTupleScheme getScheme() { return new TCancelDelegationTokenReqTupleScheme(); } } - private static class TCancelDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCancelDelegationTokenReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.delegationToken); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); @@ -467,8 +491,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTok } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java index 70900ee26a33..2ad02e3b2a54 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelDelegationTokenRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelDelegationTokenRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelDelegationTokenRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelDelegationTokenRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required + private TStatus status; // 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 { STATUS((short)1, "status"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.status = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -140,7 +167,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCancelDelegationTokenResp) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCancelDelegationTokenResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -205,13 +229,14 @@ public boolean equals(TCancelDelegationTokenResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TCancelDelegationTokenResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TCancelDelegationTokenResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelDelegationTokenResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TCancelDelegationTokenResp("); boolean first = true; sb.append("status:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelDelegationTokenRespStandardSchemeFactory implements SchemeFactory { public TCancelDelegationTokenRespStandardScheme getScheme() { return new TCancelDelegationTokenRespStandardScheme(); } } - private static class TCancelDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCancelDelegationTokenRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationT } - private static class TCancelDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelDelegationTokenRespTupleSchemeFactory implements SchemeFactory { public TCancelDelegationTokenRespTupleScheme getScheme() { return new TCancelDelegationTokenRespTupleScheme(); } } - private static class TCancelDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCancelDelegationTokenRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java index 02b0c07df0f2..e797e8fb6433 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq"); 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)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelOperationReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelOperationReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -140,7 +167,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCancelOperationReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCancelOperationReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -205,13 +229,14 @@ public boolean equals(TCancelOperationReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TCancelOperationReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TCancelOperationReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TCancelOperationReq("); boolean first = true; sb.append("operationHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelOperationReqStandardSchemeFactory implements SchemeFactory { public TCancelOperationReqStandardScheme getScheme() { return new TCancelOperationReqStandardScheme(); } } - private static class TCancelOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCancelOperationReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationRe } - private static class TCancelOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelOperationReqTupleSchemeFactory implements SchemeFactory { public TCancelOperationReqTupleScheme getScheme() { return new TCancelOperationReqTupleScheme(); } } - private static class TCancelOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCancelOperationReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java index 359a8cb7758b..0ea2de271f15 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCancelOperationRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCancelOperationRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCancelOperationRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCancelOperationRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required + private TStatus status; // 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 { STATUS((short)1, "status"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationResp.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.status = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -140,7 +167,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCancelOperationResp) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCancelOperationResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -205,13 +229,14 @@ public boolean equals(TCancelOperationResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TCancelOperationResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TCancelOperationResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCancelOperationResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TCancelOperationResp("); boolean first = true; sb.append("status:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCancelOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelOperationRespStandardSchemeFactory implements SchemeFactory { public TCancelOperationRespStandardScheme getScheme() { return new TCancelOperationRespStandardScheme(); } } - private static class TCancelOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCancelOperationRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationRe } - private static class TCancelOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCancelOperationRespTupleSchemeFactory implements SchemeFactory { public TCancelOperationRespTupleScheme getScheme() { return new TCancelOperationRespTupleScheme(); } } - private static class TCancelOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCancelOperationRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java index c2fd8ec30cdc..f363b117b099 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationReq"); 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)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseOperationReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseOperationReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -140,7 +167,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCloseOperationReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCloseOperationReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -205,13 +229,14 @@ public boolean equals(TCloseOperationReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TCloseOperationReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TCloseOperationReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TCloseOperationReq("); boolean first = true; sb.append("operationHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseOperationReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseOperationReqStandardSchemeFactory implements SchemeFactory { public TCloseOperationReqStandardScheme getScheme() { return new TCloseOperationReqStandardScheme(); } } - private static class TCloseOperationReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCloseOperationReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationReq } - private static class TCloseOperationReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseOperationReqTupleSchemeFactory implements SchemeFactory { public TCloseOperationReqTupleScheme getScheme() { return new TCloseOperationReqTupleScheme(); } } - private static class TCloseOperationReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCloseOperationReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java index 5415cd340277..33efd302cdfe 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseOperationRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseOperationRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseOperationRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseOperationRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required + private TStatus status; // 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 { STATUS((short)1, "status"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationResp.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.status = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -140,7 +167,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCloseOperationResp) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCloseOperationResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -205,13 +229,14 @@ public boolean equals(TCloseOperationResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TCloseOperationResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TCloseOperationResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseOperationResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TCloseOperationResp("); boolean first = true; sb.append("status:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseOperationRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseOperationRespStandardSchemeFactory implements SchemeFactory { public TCloseOperationRespStandardScheme getScheme() { return new TCloseOperationRespStandardScheme(); } } - private static class TCloseOperationRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCloseOperationRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationRes } - private static class TCloseOperationRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseOperationRespTupleSchemeFactory implements SchemeFactory { public TCloseOperationRespTupleScheme getScheme() { return new TCloseOperationRespTupleScheme(); } } - private static class TCloseOperationRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCloseOperationRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java index 43d65a7871ed..c7e02eb1bb33 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionReq"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseSessionReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseSessionReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private TSessionHandle sessionHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.sessionHandle = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -140,7 +167,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCloseSessionReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCloseSessionReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -205,13 +229,14 @@ public boolean equals(TCloseSessionReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TCloseSessionReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TCloseSessionReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TCloseSessionReq("); boolean first = true; sb.append("sessionHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseSessionReqStandardSchemeFactory implements SchemeFactory { public TCloseSessionReqStandardScheme getScheme() { return new TCloseSessionReqStandardScheme(); } } - private static class TCloseSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCloseSessionReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionReq s } - private static class TCloseSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseSessionReqTupleSchemeFactory implements SchemeFactory { public TCloseSessionReqTupleScheme getScheme() { return new TCloseSessionReqTupleScheme(); } } - private static class TCloseSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCloseSessionReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java index 85d9f4094155..947dcb273bfc 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TCloseSessionRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TCloseSessionRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TCloseSessionRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TCloseSessionRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required + private TStatus status; // 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 { STATUS((short)1, "status"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionResp.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.status = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -140,7 +167,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TCloseSessionResp) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TCloseSessionResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -205,13 +229,14 @@ public boolean equals(TCloseSessionResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TCloseSessionResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TCloseSessionResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TCloseSessionResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TCloseSessionResp("); boolean first = true; sb.append("status:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TCloseSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseSessionRespStandardSchemeFactory implements SchemeFactory { public TCloseSessionRespStandardScheme getScheme() { return new TCloseSessionRespStandardScheme(); } } - private static class TCloseSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TCloseSessionRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionResp } - private static class TCloseSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TCloseSessionRespTupleSchemeFactory implements SchemeFactory { public TCloseSessionRespTupleScheme getScheme() { return new TCloseSessionRespTupleScheme(); } } - private static class TCloseSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TCloseSessionRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java index b7ad6d67dfec..760cd2c40cc4 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java @@ -1,13 +1,39 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) public class TColumn extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -30,10 +56,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { STRING_VAL((short)7, "stringVal"), BINARY_VAL((short)8, "binaryVal"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -41,7 +67,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // BOOL_VAL @@ -71,22 +96,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -95,31 +119,31 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolColumn.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteColumn.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Column.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Column.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Column.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleColumn.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringColumn.class))); - tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryColumn.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); } @@ -127,7 +151,7 @@ public TColumn() { super(); } - public TColumn(_Fields setField, java.lang.Object value) { + public TColumn(_Fields setField, Object value) { super(setField, value); } @@ -188,55 +212,55 @@ public static TColumn binaryVal(TBinaryColumn value) { @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + protected void checkType(_Fields setField, Object value) throws ClassCastException { switch (setField) { case BOOL_VAL: if (value instanceof TBoolColumn) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); case BYTE_VAL: if (value instanceof TByteColumn) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); case I16_VAL: if (value instanceof TI16Column) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); case I32_VAL: if (value instanceof TI32Column) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); case I64_VAL: if (value instanceof TI64Column) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); case DOUBLE_VAL: if (value instanceof TDoubleColumn) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); case STRING_VAL: if (value instanceof TStringColumn) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); case BINARY_VAL: if (value instanceof TBinaryColumn) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { @@ -321,7 +345,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP return null; } default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -365,12 +389,12 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr binaryVal.write(oprot); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { @@ -415,10 +439,10 @@ protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProt binaryVal.read(iprot); return binaryVal; default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + throw new TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -458,7 +482,7 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) binaryVal.write(oprot); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -482,7 +506,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case BINARY_VAL: return BINARY_VAL_FIELD_DESC; default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @@ -496,7 +520,6 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -506,12 +529,12 @@ public TBoolColumn getBoolVal() { if (getSetField() == _Fields.BOOL_VAL) { return (TBoolColumn)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setBoolVal(TBoolColumn value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.BOOL_VAL; value_ = value; } @@ -520,12 +543,12 @@ public TByteColumn getByteVal() { if (getSetField() == _Fields.BYTE_VAL) { return (TByteColumn)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setByteVal(TByteColumn value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.BYTE_VAL; value_ = value; } @@ -534,12 +557,12 @@ public TI16Column getI16Val() { if (getSetField() == _Fields.I16_VAL) { return (TI16Column)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI16Val(TI16Column value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.I16_VAL; value_ = value; } @@ -548,12 +571,12 @@ public TI32Column getI32Val() { if (getSetField() == _Fields.I32_VAL) { return (TI32Column)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI32Val(TI32Column value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.I32_VAL; value_ = value; } @@ -562,12 +585,12 @@ public TI64Column getI64Val() { if (getSetField() == _Fields.I64_VAL) { return (TI64Column)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI64Val(TI64Column value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.I64_VAL; value_ = value; } @@ -576,12 +599,12 @@ public TDoubleColumn getDoubleVal() { if (getSetField() == _Fields.DOUBLE_VAL) { return (TDoubleColumn)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setDoubleVal(TDoubleColumn value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.DOUBLE_VAL; value_ = value; } @@ -590,12 +613,12 @@ public TStringColumn getStringVal() { if (getSetField() == _Fields.STRING_VAL) { return (TStringColumn)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setStringVal(TStringColumn value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.STRING_VAL; value_ = value; } @@ -604,12 +627,12 @@ public TBinaryColumn getBinaryVal() { if (getSetField() == _Fields.BINARY_VAL) { return (TBinaryColumn)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setBinaryVal(TBinaryColumn value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.BINARY_VAL; value_ = value; } @@ -654,7 +677,7 @@ public boolean isSetBinaryVal() { } - public boolean equals(java.lang.Object other) { + public boolean equals(Object other) { if (other instanceof TColumn) { return equals((TColumn)other); } else { @@ -678,12 +701,12 @@ public int compareTo(TColumn other) { @Override public int hashCode() { - java.util.List list = new java.util.ArrayList(); + List list = new ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); + Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -701,7 +724,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java index 979298180798..7f40a4930c8c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnDesc"); @@ -16,13 +43,16 @@ public class TColumnDesc implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TColumnDescStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TColumnDescTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // required - private @org.apache.thrift.annotation.Nullable TTypeDesc typeDesc; // required + private String columnName; // required + private TTypeDesc typeDesc; // required private int position; // required - private @org.apache.thrift.annotation.Nullable java.lang.String comment; // optional + private String comment; // 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 { @@ -31,10 +61,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { POSITION((short)3, "position"), COMMENT((short)4, "comment"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -42,7 +72,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // COLUMN_NAME @@ -64,22 +93,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -88,7 +116,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -97,9 +125,9 @@ public java.lang.String getFieldName() { private static final int __POSITION_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.COMMENT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.TYPE_DESC, new org.apache.thrift.meta_data.FieldMetaData("typeDesc", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -108,7 +136,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); } @@ -116,7 +144,7 @@ public TColumnDesc() { } public TColumnDesc( - java.lang.String columnName, + String columnName, TTypeDesc typeDesc, int position) { @@ -157,12 +185,11 @@ public void clear() { this.comment = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getColumnName() { + public String getColumnName() { return this.columnName; } - public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { + public void setColumnName(String columnName) { this.columnName = columnName; } @@ -181,12 +208,11 @@ public void setColumnNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TTypeDesc getTypeDesc() { return this.typeDesc; } - public void setTypeDesc(@org.apache.thrift.annotation.Nullable TTypeDesc typeDesc) { + public void setTypeDesc(TTypeDesc typeDesc) { this.typeDesc = typeDesc; } @@ -215,24 +241,23 @@ public void setPosition(int position) { } public void unsetPosition() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); } /** Returns true if field position is set (has been assigned a value) and false otherwise */ public boolean isSetPosition() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); } public void setPositionIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); } - @org.apache.thrift.annotation.Nullable - public java.lang.String getComment() { + public String getComment() { return this.comment; } - public void setComment(@org.apache.thrift.annotation.Nullable java.lang.String comment) { + public void setComment(String comment) { this.comment = comment; } @@ -251,13 +276,13 @@ public void setCommentIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case COLUMN_NAME: if (value == null) { unsetColumnName(); } else { - setColumnName((java.lang.String)value); + setColumnName((String)value); } break; @@ -273,7 +298,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetPosition(); } else { - setPosition((java.lang.Integer)value); + setPosition((Integer)value); } break; @@ -281,15 +306,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetComment(); } else { - setComment((java.lang.String)value); + setComment((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case COLUMN_NAME: return getColumnName(); @@ -304,13 +328,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getComment(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -323,11 +347,11 @@ public boolean isSet(_Fields field) { case COMMENT: return isSetComment(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TColumnDesc) @@ -338,8 +362,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TColumnDesc that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_columnName = true && this.isSetColumnName(); boolean that_present_columnName = true && that.isSetColumnName(); @@ -382,23 +404,29 @@ public boolean equals(TColumnDesc that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); - if (isSetColumnName()) - hashCode = hashCode * 8191 + columnName.hashCode(); + boolean present_columnName = true && (isSetColumnName()); + list.add(present_columnName); + if (present_columnName) + list.add(columnName); - hashCode = hashCode * 8191 + ((isSetTypeDesc()) ? 131071 : 524287); - if (isSetTypeDesc()) - hashCode = hashCode * 8191 + typeDesc.hashCode(); + boolean present_typeDesc = true && (isSetTypeDesc()); + list.add(present_typeDesc); + if (present_typeDesc) + list.add(typeDesc); - hashCode = hashCode * 8191 + position; + boolean present_position = true; + list.add(present_position); + if (present_position) + list.add(position); - hashCode = hashCode * 8191 + ((isSetComment()) ? 131071 : 524287); - if (isSetComment()) - hashCode = hashCode * 8191 + comment.hashCode(); + boolean present_comment = true && (isSetComment()); + list.add(present_comment); + if (present_comment) + list.add(comment); - return hashCode; + return list.hashCode(); } @Override @@ -409,7 +437,7 @@ public int compareTo(TColumnDesc other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); if (lastComparison != 0) { return lastComparison; } @@ -419,7 +447,7 @@ public int compareTo(TColumnDesc other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); + lastComparison = Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); if (lastComparison != 0) { return lastComparison; } @@ -429,7 +457,7 @@ public int compareTo(TColumnDesc other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); + lastComparison = Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); if (lastComparison != 0) { return lastComparison; } @@ -439,7 +467,7 @@ public int compareTo(TColumnDesc other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); + lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); if (lastComparison != 0) { return lastComparison; } @@ -452,22 +480,21 @@ public int compareTo(TColumnDesc other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TColumnDesc("); + public String toString() { + StringBuilder sb = new StringBuilder("TColumnDesc("); boolean first = true; sb.append("columnName:"); @@ -531,7 +558,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -541,13 +568,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TColumnDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TColumnDescStandardSchemeFactory implements SchemeFactory { public TColumnDescStandardScheme getScheme() { return new TColumnDescStandardScheme(); } } - private static class TColumnDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TColumnDescStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -631,21 +658,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TColumnDesc struct } - private static class TColumnDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TColumnDescTupleSchemeFactory implements SchemeFactory { public TColumnDescTupleScheme getScheme() { return new TColumnDescTupleScheme(); } } - private static class TColumnDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TColumnDescTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.columnName); struct.typeDesc.write(oprot); oprot.writeI32(struct.position); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetComment()) { optionals.set(0); } @@ -657,7 +684,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.columnName = iprot.readString(); struct.setColumnNameIsSet(true); struct.typeDesc = new TTypeDesc(); @@ -665,7 +692,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) struct.setTypeDescIsSet(true); struct.position = iprot.readI32(); struct.setPositionIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.comment = iprot.readString(); struct.setCommentIsSet(true); @@ -673,8 +700,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java index c2f9a6f0a0d6..a2c758dfa98a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java @@ -1,13 +1,39 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) public class TColumnValue extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -28,10 +54,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { DOUBLE_VAL((short)6, "doubleVal"), STRING_VAL((short)7, "stringVal"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -39,7 +65,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // BOOL_VAL @@ -67,22 +92,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -91,29 +115,29 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolValue.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteValue.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Value.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Value.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Value.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); } @@ -121,7 +145,7 @@ public TColumnValue() { super(); } - public TColumnValue(_Fields setField, java.lang.Object value) { + public TColumnValue(_Fields setField, Object value) { super(setField, value); } @@ -176,50 +200,50 @@ public static TColumnValue stringVal(TStringValue value) { @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + protected void checkType(_Fields setField, Object value) throws ClassCastException { switch (setField) { case BOOL_VAL: if (value instanceof TBoolValue) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); case BYTE_VAL: if (value instanceof TByteValue) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); case I16_VAL: if (value instanceof TI16Value) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); case I32_VAL: if (value instanceof TI32Value) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); case I64_VAL: if (value instanceof TI64Value) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); case DOUBLE_VAL: if (value instanceof TDoubleValue) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); case STRING_VAL: if (value instanceof TStringValue) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { @@ -294,7 +318,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP return null; } default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -334,12 +358,12 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr stringVal.write(oprot); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { @@ -379,10 +403,10 @@ protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProt stringVal.read(iprot); return stringVal; default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + throw new TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -418,7 +442,7 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) stringVal.write(oprot); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -440,7 +464,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case STRING_VAL: return STRING_VAL_FIELD_DESC; default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @@ -454,7 +478,6 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -464,12 +487,12 @@ public TBoolValue getBoolVal() { if (getSetField() == _Fields.BOOL_VAL) { return (TBoolValue)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setBoolVal(TBoolValue value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.BOOL_VAL; value_ = value; } @@ -478,12 +501,12 @@ public TByteValue getByteVal() { if (getSetField() == _Fields.BYTE_VAL) { return (TByteValue)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setByteVal(TByteValue value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.BYTE_VAL; value_ = value; } @@ -492,12 +515,12 @@ public TI16Value getI16Val() { if (getSetField() == _Fields.I16_VAL) { return (TI16Value)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI16Val(TI16Value value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.I16_VAL; value_ = value; } @@ -506,12 +529,12 @@ public TI32Value getI32Val() { if (getSetField() == _Fields.I32_VAL) { return (TI32Value)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI32Val(TI32Value value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.I32_VAL; value_ = value; } @@ -520,12 +543,12 @@ public TI64Value getI64Val() { if (getSetField() == _Fields.I64_VAL) { return (TI64Value)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setI64Val(TI64Value value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.I64_VAL; value_ = value; } @@ -534,12 +557,12 @@ public TDoubleValue getDoubleVal() { if (getSetField() == _Fields.DOUBLE_VAL) { return (TDoubleValue)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setDoubleVal(TDoubleValue value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.DOUBLE_VAL; value_ = value; } @@ -548,12 +571,12 @@ public TStringValue getStringVal() { if (getSetField() == _Fields.STRING_VAL) { return (TStringValue)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setStringVal(TStringValue value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.STRING_VAL; value_ = value; } @@ -593,7 +616,7 @@ public boolean isSetStringVal() { } - public boolean equals(java.lang.Object other) { + public boolean equals(Object other) { if (other instanceof TColumnValue) { return equals((TColumnValue)other); } else { @@ -617,12 +640,12 @@ public int compareTo(TColumnValue other) { @Override public int hashCode() { - java.util.List list = new java.util.ArrayList(); + List list = new ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); + Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -640,7 +663,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java index 7618e0eecfe4..ac7bc7043e87 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TDoubleColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TDoubleColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleColumn.class, metaDataMap); } @@ -100,8 +128,8 @@ public TDoubleColumn() { } public TDoubleColumn( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TDoubleColumn( */ public TDoubleColumn(TDoubleColumn other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(double elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TDoubleColumn) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TDoubleColumn that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TDoubleColumn that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TDoubleColumn other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TDoubleColumn other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TDoubleColumn other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleColumn("); + public String toString() { + StringBuilder sb = new StringBuilder("TDoubleColumn("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TDoubleColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TDoubleColumnStandardSchemeFactory implements SchemeFactory { public TDoubleColumnStandardScheme getScheme() { return new TDoubleColumnStandardScheme(); } } - private static class TDoubleColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TDoubleColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,7 +446,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list94.size); + struct.values = new ArrayList(_list94.size); double _elem95; for (int _i96 = 0; _i96 < _list94.size; ++_i96) { @@ -484,17 +504,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleColumn stru } - private static class TDoubleColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TDoubleColumnTupleSchemeFactory implements SchemeFactory { public TDoubleColumnTupleScheme getScheme() { return new TDoubleColumnTupleScheme(); } } - private static class TDoubleColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TDoubleColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (double _iter98 : struct.values) @@ -507,10 +527,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); - struct.values = new java.util.ArrayList(_list99.size); + struct.values = new ArrayList(_list99.size); double _elem100; for (int _i101 = 0; _i101 < _list99.size; ++_i101) { @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java index e7f04ea788fa..88e18a1c3851 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java @@ -1,20 +1,50 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TDoubleValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TDoubleValueTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TDoubleValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TDoubleValueTupleSchemeFactory()); + } private double value; // optional @@ -22,10 +52,10 @@ public class TDoubleValue implements org.apache.thrift.TBase byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,7 +101,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -82,12 +110,12 @@ public java.lang.String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleValue.class, metaDataMap); } @@ -122,56 +150,55 @@ public void setValue(double value) { } public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((java.lang.Double)value); + setValue((Double)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TDoubleValue) @@ -182,8 +209,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TDoubleValue that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -199,13 +224,14 @@ public boolean equals(TDoubleValue that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); - return hashCode; + return list.hashCode(); } @Override @@ -216,7 +242,7 @@ public int compareTo(TDoubleValue other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -229,22 +255,21 @@ public int compareTo(TDoubleValue other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TDoubleValue("); + public String toString() { + StringBuilder sb = new StringBuilder("TDoubleValue("); boolean first = true; if (isSetValue()) { @@ -269,7 +294,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -279,13 +304,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TDoubleValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TDoubleValueStandardSchemeFactory implements SchemeFactory { public TDoubleValueStandardScheme getScheme() { return new TDoubleValueStandardScheme(); } } - private static class TDoubleValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TDoubleValueStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -329,18 +354,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleValue struc } - private static class TDoubleValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TDoubleValueTupleSchemeFactory implements SchemeFactory { public TDoubleValueTupleScheme getScheme() { return new TDoubleValueTupleScheme(); } } - private static class TDoubleValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TDoubleValueTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -352,8 +377,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readDouble(); struct.setValueIsSet(true); @@ -361,8 +386,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java index 4a935d8378aa..363d8216d280 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq"); @@ -17,12 +44,15 @@ public class TExecuteStatementReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TExecuteStatementReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TExecuteStatementReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String statement; // required - private @org.apache.thrift.annotation.Nullable java.util.Map confOverlay; // optional + private TSessionHandle sessionHandle; // required + private String statement; // required + private Map confOverlay; // optional private boolean runAsync; // optional private long queryTimeout; // optional @@ -34,10 +64,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { RUN_ASYNC((short)4, "runAsync"), QUERY_TIMEOUT((short)5, "queryTimeout"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -45,7 +75,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -69,22 +98,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -93,7 +121,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -103,9 +131,9 @@ public java.lang.String getFieldName() { private static final int __QUERYTIMEOUT_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC,_Fields.QUERY_TIMEOUT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -118,7 +146,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.QUERY_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("queryTimeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap); } @@ -131,7 +159,7 @@ public TExecuteStatementReq() { public TExecuteStatementReq( TSessionHandle sessionHandle, - java.lang.String statement) + String statement) { this(); this.sessionHandle = sessionHandle; @@ -150,7 +178,7 @@ public TExecuteStatementReq(TExecuteStatementReq other) { this.statement = other.statement; } if (other.isSetConfOverlay()) { - java.util.Map __this__confOverlay = new java.util.HashMap(other.confOverlay); + Map __this__confOverlay = new HashMap(other.confOverlay); this.confOverlay = __this__confOverlay; } this.runAsync = other.runAsync; @@ -172,12 +200,11 @@ public void clear() { } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -196,12 +223,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getStatement() { + public String getStatement() { return this.statement; } - public void setStatement(@org.apache.thrift.annotation.Nullable java.lang.String statement) { + public void setStatement(String statement) { this.statement = statement; } @@ -224,19 +250,18 @@ public int getConfOverlaySize() { return (this.confOverlay == null) ? 0 : this.confOverlay.size(); } - public void putToConfOverlay(java.lang.String key, java.lang.String val) { + public void putToConfOverlay(String key, String val) { if (this.confOverlay == null) { - this.confOverlay = new java.util.HashMap(); + this.confOverlay = new HashMap(); } this.confOverlay.put(key, val); } - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfOverlay() { + public Map getConfOverlay() { return this.confOverlay; } - public void setConfOverlay(@org.apache.thrift.annotation.Nullable java.util.Map confOverlay) { + public void setConfOverlay(Map confOverlay) { this.confOverlay = confOverlay; } @@ -265,16 +290,16 @@ public void setRunAsync(boolean runAsync) { } public void unsetRunAsync() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); } /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */ public boolean isSetRunAsync() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); } public void setRunAsyncIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); } public long getQueryTimeout() { @@ -287,19 +312,19 @@ public void setQueryTimeout(long queryTimeout) { } public void unsetQueryTimeout() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); } /** Returns true if field queryTimeout is set (has been assigned a value) and false otherwise */ public boolean isSetQueryTimeout() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); } public void setQueryTimeoutIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -313,7 +338,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetStatement(); } else { - setStatement((java.lang.String)value); + setStatement((String)value); } break; @@ -321,7 +346,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetConfOverlay(); } else { - setConfOverlay((java.util.Map)value); + setConfOverlay((Map)value); } break; @@ -329,7 +354,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetRunAsync(); } else { - setRunAsync((java.lang.Boolean)value); + setRunAsync((Boolean)value); } break; @@ -337,15 +362,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetQueryTimeout(); } else { - setQueryTimeout((java.lang.Long)value); + setQueryTimeout((Long)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -363,13 +387,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getQueryTimeout(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -384,11 +408,11 @@ public boolean isSet(_Fields field) { case QUERY_TIMEOUT: return isSetQueryTimeout(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TExecuteStatementReq) @@ -399,8 +423,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TExecuteStatementReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -452,29 +474,34 @@ public boolean equals(TExecuteStatementReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetStatement()) ? 131071 : 524287); - if (isSetStatement()) - hashCode = hashCode * 8191 + statement.hashCode(); + boolean present_statement = true && (isSetStatement()); + list.add(present_statement); + if (present_statement) + list.add(statement); - hashCode = hashCode * 8191 + ((isSetConfOverlay()) ? 131071 : 524287); - if (isSetConfOverlay()) - hashCode = hashCode * 8191 + confOverlay.hashCode(); + boolean present_confOverlay = true && (isSetConfOverlay()); + list.add(present_confOverlay); + if (present_confOverlay) + list.add(confOverlay); - hashCode = hashCode * 8191 + ((isSetRunAsync()) ? 131071 : 524287); - if (isSetRunAsync()) - hashCode = hashCode * 8191 + ((runAsync) ? 131071 : 524287); + boolean present_runAsync = true && (isSetRunAsync()); + list.add(present_runAsync); + if (present_runAsync) + list.add(runAsync); - hashCode = hashCode * 8191 + ((isSetQueryTimeout()) ? 131071 : 524287); - if (isSetQueryTimeout()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(queryTimeout); + boolean present_queryTimeout = true && (isSetQueryTimeout()); + list.add(present_queryTimeout); + if (present_queryTimeout) + list.add(queryTimeout); - return hashCode; + return list.hashCode(); } @Override @@ -485,7 +512,7 @@ public int compareTo(TExecuteStatementReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -495,7 +522,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); + lastComparison = Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); if (lastComparison != 0) { return lastComparison; } @@ -505,7 +532,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); + lastComparison = Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); if (lastComparison != 0) { return lastComparison; } @@ -515,7 +542,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); + lastComparison = Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); if (lastComparison != 0) { return lastComparison; } @@ -525,7 +552,7 @@ public int compareTo(TExecuteStatementReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); + lastComparison = Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); if (lastComparison != 0) { return lastComparison; } @@ -538,22 +565,21 @@ public int compareTo(TExecuteStatementReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TExecuteStatementReq("); boolean first = true; sb.append("sessionHandle:"); @@ -621,7 +647,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -631,13 +657,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TExecuteStatementReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TExecuteStatementReqStandardSchemeFactory implements SchemeFactory { public TExecuteStatementReqStandardScheme getScheme() { return new TExecuteStatementReqStandardScheme(); } } - private static class TExecuteStatementReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TExecuteStatementReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -670,9 +696,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementRe if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map172 = iprot.readMapBegin(); - struct.confOverlay = new java.util.HashMap(2*_map172.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key173; - @org.apache.thrift.annotation.Nullable java.lang.String _val174; + struct.confOverlay = new HashMap(2*_map172.size); + String _key173; + String _val174; for (int _i175 = 0; _i175 < _map172.size; ++_i175) { _key173 = iprot.readString(); @@ -730,7 +756,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); - for (java.util.Map.Entry _iter176 : struct.confOverlay.entrySet()) + for (Map.Entry _iter176 : struct.confOverlay.entrySet()) { oprot.writeString(_iter176.getKey()); oprot.writeString(_iter176.getValue()); @@ -756,20 +782,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR } - private static class TExecuteStatementReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TExecuteStatementReqTupleSchemeFactory implements SchemeFactory { public TExecuteStatementReqTupleScheme getScheme() { return new TExecuteStatementReqTupleScheme(); } } - private static class TExecuteStatementReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TExecuteStatementReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.statement); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetConfOverlay()) { optionals.set(0); } @@ -783,7 +809,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe if (struct.isSetConfOverlay()) { { oprot.writeI32(struct.confOverlay.size()); - for (java.util.Map.Entry _iter177 : struct.confOverlay.entrySet()) + for (Map.Entry _iter177 : struct.confOverlay.entrySet()) { oprot.writeString(_iter177.getKey()); oprot.writeString(_iter177.getValue()); @@ -800,19 +826,19 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe @Override public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); struct.statement = iprot.readString(); struct.setStatementIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map178 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.confOverlay = new java.util.HashMap(2*_map178.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key179; - @org.apache.thrift.annotation.Nullable java.lang.String _val180; + struct.confOverlay = new HashMap(2*_map178.size); + String _key179; + String _val180; for (int _i181 = 0; _i181 < _map178.size; ++_i181) { _key179 = iprot.readString(); @@ -833,8 +859,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java index 47e1321e05b7..c13f9aa31130 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TExecuteStatementRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TExecuteStatementRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TExecuteStatementRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TExecuteStatementRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TExecuteStatementResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TExecuteStatementResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TExecuteStatementResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TExecuteStatementResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TExecuteStatementResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TExecuteStatementResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TExecuteStatementResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TExecuteStatementResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TExecuteStatementRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TExecuteStatementRespStandardSchemeFactory implements SchemeFactory { public TExecuteStatementRespStandardScheme getScheme() { return new TExecuteStatementRespStandardScheme(); } } - private static class TExecuteStatementRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TExecuteStatementRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementR } - private static class TExecuteStatementRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TExecuteStatementRespTupleSchemeFactory implements SchemeFactory { public TExecuteStatementRespTupleScheme getScheme() { return new TExecuteStatementRespTupleScheme(); } } - private static class TExecuteStatementRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TExecuteStatementRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRe @Override public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementRes } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java index 2219f27445a6..7c353f18229a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TFetchOrientation implements org.apache.thrift.TEnum { FETCH_NEXT(0), FETCH_PRIOR(1), @@ -33,7 +36,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TFetchOrientation findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java index 4de4a139b03b..f0fbc23faa0d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq"); @@ -16,11 +43,14 @@ public class TFetchResultsReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TFetchResultsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TFetchResultsReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required - private @org.apache.thrift.annotation.Nullable TFetchOrientation orientation; // required + private TOperationHandle operationHandle; // required + private TFetchOrientation orientation; // required private long maxRows; // required private short fetchType; // optional @@ -35,10 +65,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { MAX_ROWS((short)3, "maxRows"), FETCH_TYPE((short)4, "fetchType"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -46,7 +76,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -68,22 +97,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +120,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -102,9 +130,9 @@ public java.lang.String getFieldName() { private static final int __FETCHTYPE_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.FETCH_TYPE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -113,7 +141,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap); } @@ -166,12 +194,11 @@ public void clear() { } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -194,7 +221,6 @@ public void setOperationHandleIsSet(boolean value) { * * @see TFetchOrientation */ - @org.apache.thrift.annotation.Nullable public TFetchOrientation getOrientation() { return this.orientation; } @@ -203,7 +229,7 @@ public TFetchOrientation getOrientation() { * * @see TFetchOrientation */ - public void setOrientation(@org.apache.thrift.annotation.Nullable TFetchOrientation orientation) { + public void setOrientation(TFetchOrientation orientation) { this.orientation = orientation; } @@ -232,16 +258,16 @@ public void setMaxRows(long maxRows) { } public void unsetMaxRows() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); } /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */ public boolean isSetMaxRows() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); } public void setMaxRowsIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); } public short getFetchType() { @@ -254,19 +280,19 @@ public void setFetchType(short fetchType) { } public void unsetFetchType() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); } /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */ public boolean isSetFetchType() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); } public void setFetchTypeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -288,7 +314,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetMaxRows(); } else { - setMaxRows((java.lang.Long)value); + setMaxRows((Long)value); } break; @@ -296,15 +322,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetFetchType(); } else { - setFetchType((java.lang.Short)value); + setFetchType((Short)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); @@ -319,13 +344,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getFetchType(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -338,11 +363,11 @@ public boolean isSet(_Fields field) { case FETCH_TYPE: return isSetFetchType(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TFetchResultsReq) @@ -353,8 +378,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TFetchResultsReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -397,23 +420,29 @@ public boolean equals(TFetchResultsReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - hashCode = hashCode * 8191 + ((isSetOrientation()) ? 131071 : 524287); - if (isSetOrientation()) - hashCode = hashCode * 8191 + orientation.getValue(); + boolean present_orientation = true && (isSetOrientation()); + list.add(present_orientation); + if (present_orientation) + list.add(orientation.getValue()); - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(maxRows); + boolean present_maxRows = true; + list.add(present_maxRows); + if (present_maxRows) + list.add(maxRows); - hashCode = hashCode * 8191 + ((isSetFetchType()) ? 131071 : 524287); - if (isSetFetchType()) - hashCode = hashCode * 8191 + fetchType; + boolean present_fetchType = true && (isSetFetchType()); + list.add(present_fetchType); + if (present_fetchType) + list.add(fetchType); - return hashCode; + return list.hashCode(); } @Override @@ -424,7 +453,7 @@ public int compareTo(TFetchResultsReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -434,7 +463,7 @@ public int compareTo(TFetchResultsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); + lastComparison = Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); if (lastComparison != 0) { return lastComparison; } @@ -444,7 +473,7 @@ public int compareTo(TFetchResultsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); + lastComparison = Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); if (lastComparison != 0) { return lastComparison; } @@ -454,7 +483,7 @@ public int compareTo(TFetchResultsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); + lastComparison = Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); if (lastComparison != 0) { return lastComparison; } @@ -467,22 +496,21 @@ public int compareTo(TFetchResultsReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TFetchResultsReq("); boolean first = true; sb.append("operationHandle:"); @@ -542,7 +570,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -552,13 +580,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TFetchResultsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TFetchResultsReqStandardSchemeFactory implements SchemeFactory { public TFetchResultsReqStandardScheme getScheme() { return new TFetchResultsReqStandardScheme(); } } - private static class TFetchResultsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TFetchResultsReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -640,21 +668,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsReq s } - private static class TFetchResultsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TFetchResultsReqTupleSchemeFactory implements SchemeFactory { public TFetchResultsReqTupleScheme getScheme() { return new TFetchResultsReqTupleScheme(); } } - private static class TFetchResultsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TFetchResultsReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.operationHandle.write(oprot); oprot.writeI32(struct.orientation.getValue()); oprot.writeI64(struct.maxRows); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetFetchType()) { optionals.set(0); } @@ -666,7 +694,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); @@ -674,7 +702,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq str struct.setOrientationIsSet(true); struct.maxRows = iprot.readI64(); struct.setMaxRowsIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.fetchType = iprot.readI16(); struct.setFetchTypeIsSet(true); @@ -682,8 +710,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java index 449358755663..4a1f0d5a67db 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsResp"); @@ -15,12 +42,15 @@ public class TFetchResultsResp implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TFetchResultsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TFetchResultsRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required + private TStatus status; // required private boolean hasMoreRows; // optional - private @org.apache.thrift.annotation.Nullable TRowSet results; // optional + private TRowSet results; // 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 { @@ -28,10 +58,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HAS_MORE_ROWS((short)2, "hasMoreRows"), RESULTS((short)3, "results"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -39,7 +69,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -59,22 +88,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -83,7 +111,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -92,16 +120,16 @@ public java.lang.String getFieldName() { private static final int __HASMOREROWS_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.HAS_MORE_ROWS,_Fields.RESULTS}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.HAS_MORE_ROWS, new org.apache.thrift.meta_data.FieldMetaData("hasMoreRows", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsResp.class, metaDataMap); } @@ -141,12 +169,11 @@ public void clear() { this.results = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -175,24 +202,23 @@ public void setHasMoreRows(boolean hasMoreRows) { } public void unsetHasMoreRows() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); } /** Returns true if field hasMoreRows is set (has been assigned a value) and false otherwise */ public boolean isSetHasMoreRows() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); } public void setHasMoreRowsIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); } - @org.apache.thrift.annotation.Nullable public TRowSet getResults() { return this.results; } - public void setResults(@org.apache.thrift.annotation.Nullable TRowSet results) { + public void setResults(TRowSet results) { this.results = results; } @@ -211,7 +237,7 @@ public void setResultsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -225,7 +251,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetHasMoreRows(); } else { - setHasMoreRows((java.lang.Boolean)value); + setHasMoreRows((Boolean)value); } break; @@ -240,8 +266,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -253,13 +278,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getResults(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -270,11 +295,11 @@ public boolean isSet(_Fields field) { case RESULTS: return isSetResults(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TFetchResultsResp) @@ -285,8 +310,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TFetchResultsResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -320,21 +343,24 @@ public boolean equals(TFetchResultsResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetHasMoreRows()) ? 131071 : 524287); - if (isSetHasMoreRows()) - hashCode = hashCode * 8191 + ((hasMoreRows) ? 131071 : 524287); + boolean present_hasMoreRows = true && (isSetHasMoreRows()); + list.add(present_hasMoreRows); + if (present_hasMoreRows) + list.add(hasMoreRows); - hashCode = hashCode * 8191 + ((isSetResults()) ? 131071 : 524287); - if (isSetResults()) - hashCode = hashCode * 8191 + results.hashCode(); + boolean present_results = true && (isSetResults()); + list.add(present_results); + if (present_results) + list.add(results); - return hashCode; + return list.hashCode(); } @Override @@ -345,7 +371,7 @@ public int compareTo(TFetchResultsResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -355,7 +381,7 @@ public int compareTo(TFetchResultsResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); + lastComparison = Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); if (lastComparison != 0) { return lastComparison; } @@ -365,7 +391,7 @@ public int compareTo(TFetchResultsResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); + lastComparison = Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); if (lastComparison != 0) { return lastComparison; } @@ -378,22 +404,21 @@ public int compareTo(TFetchResultsResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TFetchResultsResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TFetchResultsResp("); boolean first = true; sb.append("status:"); @@ -446,7 +471,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -456,13 +481,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TFetchResultsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TFetchResultsRespStandardSchemeFactory implements SchemeFactory { public TFetchResultsRespStandardScheme getScheme() { return new TFetchResultsRespStandardScheme(); } } - private static class TFetchResultsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TFetchResultsRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -536,19 +561,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsResp } - private static class TFetchResultsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TFetchResultsRespTupleSchemeFactory implements SchemeFactory { public TFetchResultsRespTupleScheme getScheme() { return new TFetchResultsRespTupleScheme(); } } - private static class TFetchResultsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TFetchResultsRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetHasMoreRows()) { optionals.set(0); } @@ -566,11 +591,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp s @Override public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.hasMoreRows = iprot.readBool(); struct.setHasMoreRowsIsSet(true); @@ -583,8 +608,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java index 5c69d3dcc23d..0e151d5e91e6 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsReq"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCatalogsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCatalogsReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private TSessionHandle sessionHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.sessionHandle = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -140,7 +167,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetCatalogsReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetCatalogsReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -205,13 +229,14 @@ public boolean equals(TGetCatalogsReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TGetCatalogsReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TGetCatalogsReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetCatalogsReq("); boolean first = true; sb.append("sessionHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCatalogsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCatalogsReqStandardSchemeFactory implements SchemeFactory { public TGetCatalogsReqStandardScheme getScheme() { return new TGetCatalogsReqStandardScheme(); } } - private static class TGetCatalogsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetCatalogsReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsReq st } - private static class TGetCatalogsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCatalogsReqTupleSchemeFactory implements SchemeFactory { public TGetCatalogsReqTupleScheme getScheme() { return new TGetCatalogsReqTupleScheme(); } } - private static class TGetCatalogsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetCatalogsReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java index 40fa7bd0c6bd..ee113df514db 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCatalogsRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCatalogsRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCatalogsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCatalogsRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetCatalogsResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetCatalogsResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetCatalogsResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetCatalogsResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetCatalogsResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetCatalogsResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCatalogsResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetCatalogsResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCatalogsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCatalogsRespStandardSchemeFactory implements SchemeFactory { public TGetCatalogsRespStandardScheme getScheme() { return new TGetCatalogsRespStandardScheme(); } } - private static class TGetCatalogsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetCatalogsRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsResp s } - private static class TGetCatalogsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCatalogsRespTupleSchemeFactory implements SchemeFactory { public TGetCatalogsRespTupleScheme getScheme() { return new TGetCatalogsRespTupleScheme(); } } - private static class TGetCatalogsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetCatalogsRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java index b457575597f5..3ac8c4968d2f 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq"); @@ -17,14 +44,17 @@ public class TGetColumnsReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetColumnsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetColumnsReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String columnName; // optional + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String tableName; // optional + private String columnName; // 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 { @@ -34,10 +64,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TABLE_NAME((short)4, "tableName"), COLUMN_NAME((short)5, "columnName"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -45,7 +75,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -69,22 +98,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -93,16 +121,16 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -113,7 +141,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap); } @@ -161,12 +189,11 @@ public void clear() { this.columnName = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -185,12 +212,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { + public String getCatalogName() { return this.catalogName; } - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + public void setCatalogName(String catalogName) { this.catalogName = catalogName; } @@ -209,12 +235,11 @@ public void setCatalogNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { + public String getSchemaName() { return this.schemaName; } - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + public void setSchemaName(String schemaName) { this.schemaName = schemaName; } @@ -233,12 +258,11 @@ public void setSchemaNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getTableName() { + public String getTableName() { return this.tableName; } - public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { + public void setTableName(String tableName) { this.tableName = tableName; } @@ -257,12 +281,11 @@ public void setTableNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getColumnName() { + public String getColumnName() { return this.columnName; } - public void setColumnName(@org.apache.thrift.annotation.Nullable java.lang.String columnName) { + public void setColumnName(String columnName) { this.columnName = columnName; } @@ -281,7 +304,7 @@ public void setColumnNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -295,7 +318,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetCatalogName(); } else { - setCatalogName((java.lang.String)value); + setCatalogName((String)value); } break; @@ -303,7 +326,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSchemaName(); } else { - setSchemaName((java.lang.String)value); + setSchemaName((String)value); } break; @@ -311,7 +334,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetTableName(); } else { - setTableName((java.lang.String)value); + setTableName((String)value); } break; @@ -319,15 +342,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetColumnName(); } else { - setColumnName((java.lang.String)value); + setColumnName((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -345,13 +367,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getColumnName(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -366,11 +388,11 @@ public boolean isSet(_Fields field) { case COLUMN_NAME: return isSetColumnName(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetColumnsReq) @@ -381,8 +403,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetColumnsReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -434,29 +454,34 @@ public boolean equals(TGetColumnsReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); - hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); - if (isSetTableName()) - hashCode = hashCode * 8191 + tableName.hashCode(); + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); - hashCode = hashCode * 8191 + ((isSetColumnName()) ? 131071 : 524287); - if (isSetColumnName()) - hashCode = hashCode * 8191 + columnName.hashCode(); + boolean present_columnName = true && (isSetColumnName()); + list.add(present_columnName); + if (present_columnName) + list.add(columnName); - return hashCode; + return list.hashCode(); } @Override @@ -467,7 +492,7 @@ public int compareTo(TGetColumnsReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -477,7 +502,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -487,7 +512,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -497,7 +522,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; } @@ -507,7 +532,7 @@ public int compareTo(TGetColumnsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); + lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); if (lastComparison != 0) { return lastComparison; } @@ -520,22 +545,21 @@ public int compareTo(TGetColumnsReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetColumnsReq("); boolean first = true; sb.append("sessionHandle:"); @@ -609,7 +633,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -617,13 +641,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetColumnsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetColumnsReqStandardSchemeFactory implements SchemeFactory { public TGetColumnsReqStandardScheme getScheme() { return new TGetColumnsReqStandardScheme(); } } - private static class TGetColumnsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetColumnsReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -728,19 +752,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsReq str } - private static class TGetColumnsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetColumnsReqTupleSchemeFactory implements SchemeFactory { public TGetColumnsReqTupleScheme getScheme() { return new TGetColumnsReqTupleScheme(); } } - private static class TGetColumnsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetColumnsReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -770,11 +794,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -794,8 +818,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struc } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java index 01758dc977bd..2903d4975c93 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetColumnsRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetColumnsRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetColumnsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetColumnsRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetColumnsResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetColumnsResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetColumnsResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetColumnsResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetColumnsResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetColumnsResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetColumnsResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetColumnsResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetColumnsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetColumnsRespStandardSchemeFactory implements SchemeFactory { public TGetColumnsRespStandardScheme getScheme() { return new TGetColumnsRespStandardScheme(); } } - private static class TGetColumnsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetColumnsRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsResp st } - private static class TGetColumnsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetColumnsRespTupleSchemeFactory implements SchemeFactory { public TGetColumnsRespTupleScheme getScheme() { return new TGetColumnsRespTupleScheme(); } } - private static class TGetColumnsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetColumnsRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java index 685963bcc26b..281de4c748b4 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetCrossReferenceReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceReq"); @@ -19,16 +46,19 @@ public class TGetCrossReferenceReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCrossReferenceReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCrossReferenceReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String parentTableName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String foreignTableName; // optional + private TSessionHandle sessionHandle; // required + private String parentCatalogName; // optional + private String parentSchemaName; // optional + private String parentTableName; // optional + private String foreignCatalogName; // optional + private String foreignSchemaName; // optional + private String foreignTableName; // 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 { @@ -40,10 +70,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FOREIGN_SCHEMA_NAME((short)6, "foreignSchemaName"), FOREIGN_TABLE_NAME((short)7, "foreignTableName"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -51,7 +81,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -79,22 +108,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -103,16 +131,16 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.PARENT_CATALOG_NAME,_Fields.PARENT_SCHEMA_NAME,_Fields.PARENT_TABLE_NAME,_Fields.FOREIGN_CATALOG_NAME,_Fields.FOREIGN_SCHEMA_NAME,_Fields.FOREIGN_TABLE_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.PARENT_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -127,7 +155,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); tmpMap.put(_Fields.FOREIGN_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceReq.class, metaDataMap); } @@ -183,12 +211,11 @@ public void clear() { this.foreignTableName = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -207,12 +234,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getParentCatalogName() { + public String getParentCatalogName() { return this.parentCatalogName; } - public void setParentCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String parentCatalogName) { + public void setParentCatalogName(String parentCatalogName) { this.parentCatalogName = parentCatalogName; } @@ -231,12 +257,11 @@ public void setParentCatalogNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getParentSchemaName() { + public String getParentSchemaName() { return this.parentSchemaName; } - public void setParentSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String parentSchemaName) { + public void setParentSchemaName(String parentSchemaName) { this.parentSchemaName = parentSchemaName; } @@ -255,12 +280,11 @@ public void setParentSchemaNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getParentTableName() { + public String getParentTableName() { return this.parentTableName; } - public void setParentTableName(@org.apache.thrift.annotation.Nullable java.lang.String parentTableName) { + public void setParentTableName(String parentTableName) { this.parentTableName = parentTableName; } @@ -279,12 +303,11 @@ public void setParentTableNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getForeignCatalogName() { + public String getForeignCatalogName() { return this.foreignCatalogName; } - public void setForeignCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String foreignCatalogName) { + public void setForeignCatalogName(String foreignCatalogName) { this.foreignCatalogName = foreignCatalogName; } @@ -303,12 +326,11 @@ public void setForeignCatalogNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getForeignSchemaName() { + public String getForeignSchemaName() { return this.foreignSchemaName; } - public void setForeignSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String foreignSchemaName) { + public void setForeignSchemaName(String foreignSchemaName) { this.foreignSchemaName = foreignSchemaName; } @@ -327,12 +349,11 @@ public void setForeignSchemaNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getForeignTableName() { + public String getForeignTableName() { return this.foreignTableName; } - public void setForeignTableName(@org.apache.thrift.annotation.Nullable java.lang.String foreignTableName) { + public void setForeignTableName(String foreignTableName) { this.foreignTableName = foreignTableName; } @@ -351,7 +372,7 @@ public void setForeignTableNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -365,7 +386,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetParentCatalogName(); } else { - setParentCatalogName((java.lang.String)value); + setParentCatalogName((String)value); } break; @@ -373,7 +394,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetParentSchemaName(); } else { - setParentSchemaName((java.lang.String)value); + setParentSchemaName((String)value); } break; @@ -381,7 +402,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetParentTableName(); } else { - setParentTableName((java.lang.String)value); + setParentTableName((String)value); } break; @@ -389,7 +410,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetForeignCatalogName(); } else { - setForeignCatalogName((java.lang.String)value); + setForeignCatalogName((String)value); } break; @@ -397,7 +418,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetForeignSchemaName(); } else { - setForeignSchemaName((java.lang.String)value); + setForeignSchemaName((String)value); } break; @@ -405,15 +426,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetForeignTableName(); } else { - setForeignTableName((java.lang.String)value); + setForeignTableName((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -437,13 +457,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getForeignTableName(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -462,11 +482,11 @@ public boolean isSet(_Fields field) { case FOREIGN_TABLE_NAME: return isSetForeignTableName(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetCrossReferenceReq) @@ -477,8 +497,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetCrossReferenceReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -548,37 +566,44 @@ public boolean equals(TGetCrossReferenceReq that) { @Override public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); - - hashCode = hashCode * 8191 + ((isSetParentCatalogName()) ? 131071 : 524287); - if (isSetParentCatalogName()) - hashCode = hashCode * 8191 + parentCatalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetParentSchemaName()) ? 131071 : 524287); - if (isSetParentSchemaName()) - hashCode = hashCode * 8191 + parentSchemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetParentTableName()) ? 131071 : 524287); - if (isSetParentTableName()) - hashCode = hashCode * 8191 + parentTableName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetForeignCatalogName()) ? 131071 : 524287); - if (isSetForeignCatalogName()) - hashCode = hashCode * 8191 + foreignCatalogName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetForeignSchemaName()) ? 131071 : 524287); - if (isSetForeignSchemaName()) - hashCode = hashCode * 8191 + foreignSchemaName.hashCode(); - - hashCode = hashCode * 8191 + ((isSetForeignTableName()) ? 131071 : 524287); - if (isSetForeignTableName()) - hashCode = hashCode * 8191 + foreignTableName.hashCode(); - - return hashCode; + List list = new ArrayList(); + + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); + + boolean present_parentCatalogName = true && (isSetParentCatalogName()); + list.add(present_parentCatalogName); + if (present_parentCatalogName) + list.add(parentCatalogName); + + boolean present_parentSchemaName = true && (isSetParentSchemaName()); + list.add(present_parentSchemaName); + if (present_parentSchemaName) + list.add(parentSchemaName); + + boolean present_parentTableName = true && (isSetParentTableName()); + list.add(present_parentTableName); + if (present_parentTableName) + list.add(parentTableName); + + boolean present_foreignCatalogName = true && (isSetForeignCatalogName()); + list.add(present_foreignCatalogName); + if (present_foreignCatalogName) + list.add(foreignCatalogName); + + boolean present_foreignSchemaName = true && (isSetForeignSchemaName()); + list.add(present_foreignSchemaName); + if (present_foreignSchemaName) + list.add(foreignSchemaName); + + boolean present_foreignTableName = true && (isSetForeignTableName()); + list.add(present_foreignTableName); + if (present_foreignTableName) + list.add(foreignTableName); + + return list.hashCode(); } @Override @@ -589,7 +614,7 @@ public int compareTo(TGetCrossReferenceReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -599,7 +624,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); + lastComparison = Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -609,7 +634,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); + lastComparison = Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -619,7 +644,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); + lastComparison = Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); if (lastComparison != 0) { return lastComparison; } @@ -629,7 +654,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); + lastComparison = Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -639,7 +664,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); + lastComparison = Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -649,7 +674,7 @@ public int compareTo(TGetCrossReferenceReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); + lastComparison = Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); if (lastComparison != 0) { return lastComparison; } @@ -662,22 +687,21 @@ public int compareTo(TGetCrossReferenceReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetCrossReferenceReq("); boolean first = true; sb.append("sessionHandle:"); @@ -771,7 +795,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -779,13 +803,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCrossReferenceReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCrossReferenceReqStandardSchemeFactory implements SchemeFactory { public TGetCrossReferenceReqStandardScheme getScheme() { return new TGetCrossReferenceReqStandardScheme(); } } - private static class TGetCrossReferenceReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetCrossReferenceReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -920,19 +944,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCrossReference } - private static class TGetCrossReferenceReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCrossReferenceReqTupleSchemeFactory implements SchemeFactory { public TGetCrossReferenceReqTupleScheme getScheme() { return new TGetCrossReferenceReqTupleScheme(); } } - private static class TGetCrossReferenceReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetCrossReferenceReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetParentCatalogName()) { optionals.set(0); } @@ -974,11 +998,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceR @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(6); + BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.parentCatalogName = iprot.readString(); struct.setParentCatalogNameIsSet(true); @@ -1006,8 +1030,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceRe } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java index ed70edbd9e54..140becdca24d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetCrossReferenceResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetCrossReferenceRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetCrossReferenceRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetCrossReferenceRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetCrossReferenceRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetCrossReferenceResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetCrossReferenceResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetCrossReferenceResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetCrossReferenceResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetCrossReferenceResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetCrossReferenceResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetCrossReferenceResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetCrossReferenceResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetCrossReferenceRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCrossReferenceRespStandardSchemeFactory implements SchemeFactory { public TGetCrossReferenceRespStandardScheme getScheme() { return new TGetCrossReferenceRespStandardScheme(); } } - private static class TGetCrossReferenceRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetCrossReferenceRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCrossReference } - private static class TGetCrossReferenceRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetCrossReferenceRespTupleSchemeFactory implements SchemeFactory { public TGetCrossReferenceRespTupleScheme getScheme() { return new TGetCrossReferenceRespTupleScheme(); } } - private static class TGetCrossReferenceRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetCrossReferenceRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceR @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceRe } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java index 354967cde192..a4d52c4f8c02 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq"); @@ -15,12 +42,15 @@ public class TGetDelegationTokenReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetDelegationTokenReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetDelegationTokenReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String owner; // required - private @org.apache.thrift.annotation.Nullable java.lang.String renewer; // required + private TSessionHandle sessionHandle; // required + private String owner; // required + private String renewer; // 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 { @@ -28,10 +58,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { OWNER((short)2, "owner"), RENEWER((short)3, "renewer"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -39,7 +69,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -59,22 +88,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -83,22 +111,22 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap); } @@ -107,8 +135,8 @@ public TGetDelegationTokenReq() { public TGetDelegationTokenReq( TSessionHandle sessionHandle, - java.lang.String owner, - java.lang.String renewer) + String owner, + String renewer) { this(); this.sessionHandle = sessionHandle; @@ -142,12 +170,11 @@ public void clear() { this.renewer = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -166,12 +193,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getOwner() { + public String getOwner() { return this.owner; } - public void setOwner(@org.apache.thrift.annotation.Nullable java.lang.String owner) { + public void setOwner(String owner) { this.owner = owner; } @@ -190,12 +216,11 @@ public void setOwnerIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getRenewer() { + public String getRenewer() { return this.renewer; } - public void setRenewer(@org.apache.thrift.annotation.Nullable java.lang.String renewer) { + public void setRenewer(String renewer) { this.renewer = renewer; } @@ -214,7 +239,7 @@ public void setRenewerIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -228,7 +253,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetOwner(); } else { - setOwner((java.lang.String)value); + setOwner((String)value); } break; @@ -236,15 +261,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetRenewer(); } else { - setRenewer((java.lang.String)value); + setRenewer((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -256,13 +280,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getRenewer(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -273,11 +297,11 @@ public boolean isSet(_Fields field) { case RENEWER: return isSetRenewer(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetDelegationTokenReq) @@ -288,8 +312,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetDelegationTokenReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -323,21 +345,24 @@ public boolean equals(TGetDelegationTokenReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetOwner()) ? 131071 : 524287); - if (isSetOwner()) - hashCode = hashCode * 8191 + owner.hashCode(); + boolean present_owner = true && (isSetOwner()); + list.add(present_owner); + if (present_owner) + list.add(owner); - hashCode = hashCode * 8191 + ((isSetRenewer()) ? 131071 : 524287); - if (isSetRenewer()) - hashCode = hashCode * 8191 + renewer.hashCode(); + boolean present_renewer = true && (isSetRenewer()); + list.add(present_renewer); + if (present_renewer) + list.add(renewer); - return hashCode; + return list.hashCode(); } @Override @@ -348,7 +373,7 @@ public int compareTo(TGetDelegationTokenReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -358,7 +383,7 @@ public int compareTo(TGetDelegationTokenReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); + lastComparison = Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); if (lastComparison != 0) { return lastComparison; } @@ -368,7 +393,7 @@ public int compareTo(TGetDelegationTokenReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); + lastComparison = Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); if (lastComparison != 0) { return lastComparison; } @@ -381,22 +406,21 @@ public int compareTo(TGetDelegationTokenReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetDelegationTokenReq("); boolean first = true; sb.append("sessionHandle:"); @@ -454,7 +478,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -462,13 +486,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetDelegationTokenReqStandardSchemeFactory implements SchemeFactory { public TGetDelegationTokenReqStandardScheme getScheme() { return new TGetDelegationTokenReqStandardScheme(); } } - private static class TGetDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetDelegationTokenReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -539,17 +563,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationToke } - private static class TGetDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetDelegationTokenReqTupleSchemeFactory implements SchemeFactory { public TGetDelegationTokenReqTupleScheme getScheme() { return new TGetDelegationTokenReqTupleScheme(); } } - private static class TGetDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetDelegationTokenReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.owner); oprot.writeString(struct.renewer); @@ -557,7 +581,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationToken @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); @@ -568,8 +592,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenR } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java index 206c66410b44..4f517a2a2c44 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenResp"); 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetDelegationTokenRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetDelegationTokenRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetDelegationTokenRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetDelegationTokenRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // optional + private TStatus status; // required + private String delegationToken; // 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"), DELEGATION_TOKEN((short)2, "delegationToken"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.DELEGATION_TOKEN}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.delegationToken = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getDelegationToken() { + public String getDelegationToken() { return this.delegationToken; } - public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { + public void setDelegationToken(String delegationToken) { this.delegationToken = delegationToken; } @@ -176,7 +202,7 @@ public void setDelegationTokenIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -190,15 +216,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetDelegationToken(); } else { - setDelegationToken((java.lang.String)value); + setDelegationToken((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getDelegationToken(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case DELEGATION_TOKEN: return isSetDelegationToken(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetDelegationTokenResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetDelegationTokenResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetDelegationTokenResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); - if (isSetDelegationToken()) - hashCode = hashCode * 8191 + delegationToken.hashCode(); + boolean present_delegationToken = true && (isSetDelegationToken()); + list.add(present_delegationToken); + if (present_delegationToken) + list.add(delegationToken); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetDelegationTokenResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetDelegationTokenResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetDelegationTokenResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetDelegationTokenResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetDelegationTokenResp("); boolean first = true; sb.append("status:"); @@ -366,7 +390,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -374,13 +398,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetDelegationTokenRespStandardSchemeFactory implements SchemeFactory { public TGetDelegationTokenRespStandardScheme getScheme() { return new TGetDelegationTokenRespStandardScheme(); } } - private static class TGetDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetDelegationTokenRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -440,19 +464,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationToke } - private static class TGetDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetDelegationTokenRespTupleSchemeFactory implements SchemeFactory { public TGetDelegationTokenRespTupleScheme getScheme() { return new TGetDelegationTokenRespTupleScheme(); } } - private static class TGetDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetDelegationTokenRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetDelegationToken()) { optionals.set(0); } @@ -464,11 +488,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationToken @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.delegationToken = iprot.readString(); struct.setDelegationTokenIsSet(true); @@ -476,8 +500,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenR } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java index 899bc0f7aabc..2612b974b16f 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsReq"); @@ -16,13 +43,16 @@ public class TGetFunctionsReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetFunctionsReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetFunctionsReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String functionName; // required + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String functionName; // 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 { @@ -31,10 +61,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SCHEMA_NAME((short)3, "schemaName"), FUNCTION_NAME((short)4, "functionName"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -42,7 +72,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -64,22 +93,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -88,16 +116,16 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -106,7 +134,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsReq.class, metaDataMap); } @@ -115,7 +143,7 @@ public TGetFunctionsReq() { public TGetFunctionsReq( TSessionHandle sessionHandle, - java.lang.String functionName) + String functionName) { this(); this.sessionHandle = sessionHandle; @@ -152,12 +180,11 @@ public void clear() { this.functionName = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -176,12 +203,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { + public String getCatalogName() { return this.catalogName; } - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + public void setCatalogName(String catalogName) { this.catalogName = catalogName; } @@ -200,12 +226,11 @@ public void setCatalogNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { + public String getSchemaName() { return this.schemaName; } - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + public void setSchemaName(String schemaName) { this.schemaName = schemaName; } @@ -224,12 +249,11 @@ public void setSchemaNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getFunctionName() { + public String getFunctionName() { return this.functionName; } - public void setFunctionName(@org.apache.thrift.annotation.Nullable java.lang.String functionName) { + public void setFunctionName(String functionName) { this.functionName = functionName; } @@ -248,7 +272,7 @@ public void setFunctionNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -262,7 +286,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetCatalogName(); } else { - setCatalogName((java.lang.String)value); + setCatalogName((String)value); } break; @@ -270,7 +294,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSchemaName(); } else { - setSchemaName((java.lang.String)value); + setSchemaName((String)value); } break; @@ -278,15 +302,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetFunctionName(); } else { - setFunctionName((java.lang.String)value); + setFunctionName((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -301,13 +324,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getFunctionName(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -320,11 +343,11 @@ public boolean isSet(_Fields field) { case FUNCTION_NAME: return isSetFunctionName(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetFunctionsReq) @@ -335,8 +358,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetFunctionsReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -379,25 +400,29 @@ public boolean equals(TGetFunctionsReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); - hashCode = hashCode * 8191 + ((isSetFunctionName()) ? 131071 : 524287); - if (isSetFunctionName()) - hashCode = hashCode * 8191 + functionName.hashCode(); + boolean present_functionName = true && (isSetFunctionName()); + list.add(present_functionName); + if (present_functionName) + list.add(functionName); - return hashCode; + return list.hashCode(); } @Override @@ -408,7 +433,7 @@ public int compareTo(TGetFunctionsReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -418,7 +443,7 @@ public int compareTo(TGetFunctionsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -428,7 +453,7 @@ public int compareTo(TGetFunctionsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -438,7 +463,7 @@ public int compareTo(TGetFunctionsReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); + lastComparison = Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); if (lastComparison != 0) { return lastComparison; } @@ -451,22 +476,21 @@ public int compareTo(TGetFunctionsReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetFunctionsReq("); boolean first = true; sb.append("sessionHandle:"); @@ -532,7 +556,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -540,13 +564,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetFunctionsReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetFunctionsReqStandardSchemeFactory implements SchemeFactory { public TGetFunctionsReqStandardScheme getScheme() { return new TGetFunctionsReqStandardScheme(); } } - private static class TGetFunctionsReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetFunctionsReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -634,20 +658,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsReq s } - private static class TGetFunctionsReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetFunctionsReqTupleSchemeFactory implements SchemeFactory { public TGetFunctionsReqTupleScheme getScheme() { return new TGetFunctionsReqTupleScheme(); } } - private static class TGetFunctionsReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetFunctionsReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.functionName); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -665,13 +689,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); struct.functionName = iprot.readString(); struct.setFunctionNameIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -683,8 +707,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java index 74bb9cb450a2..7228e2e533b7 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetFunctionsRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetFunctionsRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetFunctionsRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetFunctionsRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetFunctionsResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetFunctionsResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetFunctionsResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetFunctionsResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetFunctionsResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetFunctionsResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetFunctionsResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetFunctionsResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetFunctionsRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetFunctionsRespStandardSchemeFactory implements SchemeFactory { public TGetFunctionsRespStandardScheme getScheme() { return new TGetFunctionsRespStandardScheme(); } } - private static class TGetFunctionsRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetFunctionsRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsResp } - private static class TGetFunctionsRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetFunctionsRespTupleSchemeFactory implements SchemeFactory { public TGetFunctionsRespTupleScheme getScheme() { return new TGetFunctionsRespTupleScheme(); } } - private static class TGetFunctionsRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetFunctionsRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp s @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java index 681aa2b4c3cb..f2bf71d9ec94 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java @@ -1,24 +1,54 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoReq"); 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 INFO_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoType", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetInfoReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetInfoReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable TGetInfoType infoType; // required + private TSessionHandle sessionHandle; // required + private TGetInfoType infoType; // 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 { @@ -29,10 +59,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { */ INFO_TYPE((short)2, "infoType"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -40,7 +70,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -58,22 +87,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -82,20 +110,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.INFO_TYPE, new org.apache.thrift.meta_data.FieldMetaData("infoType", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGetInfoType.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoReq.class, metaDataMap); } @@ -133,12 +161,11 @@ public void clear() { this.infoType = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -161,7 +188,6 @@ public void setSessionHandleIsSet(boolean value) { * * @see TGetInfoType */ - @org.apache.thrift.annotation.Nullable public TGetInfoType getInfoType() { return this.infoType; } @@ -170,7 +196,7 @@ public TGetInfoType getInfoType() { * * @see TGetInfoType */ - public void setInfoType(@org.apache.thrift.annotation.Nullable TGetInfoType infoType) { + public void setInfoType(TGetInfoType infoType) { this.infoType = infoType; } @@ -189,7 +215,7 @@ public void setInfoTypeIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -210,8 +236,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -220,13 +245,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getInfoType(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -235,11 +260,11 @@ public boolean isSet(_Fields field) { case INFO_TYPE: return isSetInfoType(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetInfoReq) @@ -250,8 +275,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetInfoReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -276,17 +299,19 @@ public boolean equals(TGetInfoReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetInfoType()) ? 131071 : 524287); - if (isSetInfoType()) - hashCode = hashCode * 8191 + infoType.getValue(); + boolean present_infoType = true && (isSetInfoType()); + list.add(present_infoType); + if (present_infoType) + list.add(infoType.getValue()); - return hashCode; + return list.hashCode(); } @Override @@ -297,7 +322,7 @@ public int compareTo(TGetInfoReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,7 +332,7 @@ public int compareTo(TGetInfoReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); + lastComparison = Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); if (lastComparison != 0) { return lastComparison; } @@ -320,22 +345,21 @@ public int compareTo(TGetInfoReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetInfoReq("); boolean first = true; sb.append("sessionHandle:"); @@ -381,7 +405,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -389,13 +413,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetInfoReqStandardSchemeFactory implements SchemeFactory { public TGetInfoReqStandardScheme getScheme() { return new TGetInfoReqStandardScheme(); } } - private static class TGetInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetInfoReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -453,24 +477,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoReq struct } - private static class TGetInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetInfoReqTupleSchemeFactory implements SchemeFactory { public TGetInfoReqTupleScheme getScheme() { return new TGetInfoReqTupleScheme(); } } - private static class TGetInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetInfoReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeI32(struct.infoType.getValue()); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); @@ -479,8 +503,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java index d2688a919c0a..da770250f95c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp"); 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 INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetInfoRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetInfoRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetInfoRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetInfoRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TGetInfoValue infoValue; // required + private TStatus status; // required + private TGetInfoValue infoValue; // 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 { STATUS((short)1, "status"), INFO_VALUE((short)2, "infoValue"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,20 +106,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap); } @@ -129,12 +157,11 @@ public void clear() { this.infoValue = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -153,12 +180,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TGetInfoValue getInfoValue() { return this.infoValue; } - public void setInfoValue(@org.apache.thrift.annotation.Nullable TGetInfoValue infoValue) { + public void setInfoValue(TGetInfoValue infoValue) { this.infoValue = infoValue; } @@ -177,7 +203,7 @@ public void setInfoValueIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -198,8 +224,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -208,13 +233,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getInfoValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -223,11 +248,11 @@ public boolean isSet(_Fields field) { case INFO_VALUE: return isSetInfoValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetInfoResp) @@ -238,8 +263,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetInfoResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -264,17 +287,19 @@ public boolean equals(TGetInfoResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetInfoValue()) ? 131071 : 524287); - if (isSetInfoValue()) - hashCode = hashCode * 8191 + infoValue.hashCode(); + boolean present_infoValue = true && (isSetInfoValue()); + list.add(present_infoValue); + if (present_infoValue) + list.add(infoValue); - return hashCode; + return list.hashCode(); } @Override @@ -285,7 +310,7 @@ public int compareTo(TGetInfoResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -295,7 +320,7 @@ public int compareTo(TGetInfoResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); + lastComparison = Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); if (lastComparison != 0) { return lastComparison; } @@ -308,22 +333,21 @@ public int compareTo(TGetInfoResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetInfoResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetInfoResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetInfoRespStandardSchemeFactory implements SchemeFactory { public TGetInfoRespStandardScheme getScheme() { return new TGetInfoRespStandardScheme(); } } - private static class TGetInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetInfoRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -442,24 +466,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoResp struc } - private static class TGetInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetInfoRespTupleSchemeFactory implements SchemeFactory { public TGetInfoRespTupleScheme getScheme() { return new TGetInfoRespTupleScheme(); } } - private static class TGetInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetInfoRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); struct.infoValue.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); @@ -469,8 +493,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java index 84729c5b779c..d18a1b5b85af 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TGetInfoType implements org.apache.thrift.TEnum { CLI_MAX_DRIVER_CONNECTIONS(0), CLI_MAX_CONCURRENT_ACTIVITIES(1), @@ -75,7 +78,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TGetInfoType findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java index 7f7dd02a87b0..4f303079eed8 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java @@ -1,13 +1,39 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) public class TGetInfoValue extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoValue"); private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)1); @@ -26,10 +52,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { BINARY_VALUE((short)5, "binaryValue"), LEN_VALUE((short)6, "lenValue"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -37,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STRING_VALUE @@ -63,22 +88,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -87,27 +111,27 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoValue.class, metaDataMap); } @@ -115,7 +139,7 @@ public TGetInfoValue() { super(); } - public TGetInfoValue(_Fields setField, java.lang.Object value) { + public TGetInfoValue(_Fields setField, Object value) { super(setField, value); } @@ -126,7 +150,7 @@ public TGetInfoValue deepCopy() { return new TGetInfoValue(this); } - public static TGetInfoValue stringValue(java.lang.String value) { + public static TGetInfoValue stringValue(String value) { TGetInfoValue x = new TGetInfoValue(); x.setStringValue(value); return x; @@ -164,51 +188,51 @@ public static TGetInfoValue lenValue(long value) { @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + protected void checkType(_Fields setField, Object value) throws ClassCastException { switch (setField) { case STRING_VALUE: - if (value instanceof java.lang.String) { + if (value instanceof String) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); case SMALL_INT_VALUE: - if (value instanceof java.lang.Short) { + if (value instanceof Short) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); case INTEGER_BITMASK: - if (value instanceof java.lang.Integer) { + if (value instanceof Integer) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); case INTEGER_FLAG: - if (value instanceof java.lang.Integer) { + if (value instanceof Integer) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); case BINARY_VALUE: - if (value instanceof java.lang.Integer) { + if (value instanceof Integer) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); case LEN_VALUE: - if (value instanceof java.lang.Long) { + if (value instanceof Long) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Long for field 'lenValue', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type Long for field 'lenValue', but got " + value.getClass().getSimpleName()); default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { case STRING_VALUE: if (field.type == STRING_VALUE_FIELD_DESC.type) { - java.lang.String stringValue; + String stringValue; stringValue = iprot.readString(); return stringValue; } else { @@ -217,7 +241,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP } case SMALL_INT_VALUE: if (field.type == SMALL_INT_VALUE_FIELD_DESC.type) { - java.lang.Short smallIntValue; + Short smallIntValue; smallIntValue = iprot.readI16(); return smallIntValue; } else { @@ -226,7 +250,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP } case INTEGER_BITMASK: if (field.type == INTEGER_BITMASK_FIELD_DESC.type) { - java.lang.Integer integerBitmask; + Integer integerBitmask; integerBitmask = iprot.readI32(); return integerBitmask; } else { @@ -235,7 +259,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP } case INTEGER_FLAG: if (field.type == INTEGER_FLAG_FIELD_DESC.type) { - java.lang.Integer integerFlag; + Integer integerFlag; integerFlag = iprot.readI32(); return integerFlag; } else { @@ -244,7 +268,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP } case BINARY_VALUE: if (field.type == BINARY_VALUE_FIELD_DESC.type) { - java.lang.Integer binaryValue; + Integer binaryValue; binaryValue = iprot.readI32(); return binaryValue; } else { @@ -253,7 +277,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP } case LEN_VALUE: if (field.type == LEN_VALUE_FIELD_DESC.type) { - java.lang.Long lenValue; + Long lenValue; lenValue = iprot.readI64(); return lenValue; } else { @@ -261,7 +285,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP return null; } default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -273,68 +297,68 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; + String stringValue = (String)value_; oprot.writeString(stringValue); return; case SMALL_INT_VALUE: - java.lang.Short smallIntValue = (java.lang.Short)value_; + Short smallIntValue = (Short)value_; oprot.writeI16(smallIntValue); return; case INTEGER_BITMASK: - java.lang.Integer integerBitmask = (java.lang.Integer)value_; + Integer integerBitmask = (Integer)value_; oprot.writeI32(integerBitmask); return; case INTEGER_FLAG: - java.lang.Integer integerFlag = (java.lang.Integer)value_; + Integer integerFlag = (Integer)value_; oprot.writeI32(integerFlag); return; case BINARY_VALUE: - java.lang.Integer binaryValue = (java.lang.Integer)value_; + Integer binaryValue = (Integer)value_; oprot.writeI32(binaryValue); return; case LEN_VALUE: - java.lang.Long lenValue = (java.lang.Long)value_; + Long lenValue = (Long)value_; oprot.writeI64(lenValue); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case STRING_VALUE: - java.lang.String stringValue; + String stringValue; stringValue = iprot.readString(); return stringValue; case SMALL_INT_VALUE: - java.lang.Short smallIntValue; + Short smallIntValue; smallIntValue = iprot.readI16(); return smallIntValue; case INTEGER_BITMASK: - java.lang.Integer integerBitmask; + Integer integerBitmask; integerBitmask = iprot.readI32(); return integerBitmask; case INTEGER_FLAG: - java.lang.Integer integerFlag; + Integer integerFlag; integerFlag = iprot.readI32(); return integerFlag; case BINARY_VALUE: - java.lang.Integer binaryValue; + Integer binaryValue; binaryValue = iprot.readI32(); return binaryValue; case LEN_VALUE: - java.lang.Long lenValue; + Long lenValue; lenValue = iprot.readI64(); return lenValue; default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + throw new TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -342,31 +366,31 @@ protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProt protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; + String stringValue = (String)value_; oprot.writeString(stringValue); return; case SMALL_INT_VALUE: - java.lang.Short smallIntValue = (java.lang.Short)value_; + Short smallIntValue = (Short)value_; oprot.writeI16(smallIntValue); return; case INTEGER_BITMASK: - java.lang.Integer integerBitmask = (java.lang.Integer)value_; + Integer integerBitmask = (Integer)value_; oprot.writeI32(integerBitmask); return; case INTEGER_FLAG: - java.lang.Integer integerFlag = (java.lang.Integer)value_; + Integer integerFlag = (Integer)value_; oprot.writeI32(integerFlag); return; case BINARY_VALUE: - java.lang.Integer binaryValue = (java.lang.Integer)value_; + Integer binaryValue = (Integer)value_; oprot.writeI32(binaryValue); return; case LEN_VALUE: - java.lang.Long lenValue = (java.lang.Long)value_; + Long lenValue = (Long)value_; oprot.writeI64(lenValue); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -386,7 +410,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case LEN_VALUE: return LEN_VALUE_FIELD_DESC; default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @@ -400,31 +424,30 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public java.lang.String getStringValue() { + public String getStringValue() { if (getSetField() == _Fields.STRING_VALUE) { - return (java.lang.String)getFieldValue(); + return (String)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } - public void setStringValue(java.lang.String value) { - if (value == null) throw new java.lang.NullPointerException(); + public void setStringValue(String value) { + if (value == null) throw new NullPointerException(); setField_ = _Fields.STRING_VALUE; value_ = value; } public short getSmallIntValue() { if (getSetField() == _Fields.SMALL_INT_VALUE) { - return (java.lang.Short)getFieldValue(); + return (Short)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -435,9 +458,9 @@ public void setSmallIntValue(short value) { public int getIntegerBitmask() { if (getSetField() == _Fields.INTEGER_BITMASK) { - return (java.lang.Integer)getFieldValue(); + return (Integer)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -448,9 +471,9 @@ public void setIntegerBitmask(int value) { public int getIntegerFlag() { if (getSetField() == _Fields.INTEGER_FLAG) { - return (java.lang.Integer)getFieldValue(); + return (Integer)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -461,9 +484,9 @@ public void setIntegerFlag(int value) { public int getBinaryValue() { if (getSetField() == _Fields.BINARY_VALUE) { - return (java.lang.Integer)getFieldValue(); + return (Integer)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -474,9 +497,9 @@ public void setBinaryValue(int value) { public long getLenValue() { if (getSetField() == _Fields.LEN_VALUE) { - return (java.lang.Long)getFieldValue(); + return (Long)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -515,7 +538,7 @@ public boolean isSetLenValue() { } - public boolean equals(java.lang.Object other) { + public boolean equals(Object other) { if (other instanceof TGetInfoValue) { return equals((TGetInfoValue)other); } else { @@ -539,12 +562,12 @@ public int compareTo(TGetInfoValue other) { @Override public int hashCode() { - java.util.List list = new java.util.ArrayList(); + List list = new ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); + Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -562,7 +585,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java index 56b74b866247..a31bf386c761 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java @@ -1,23 +1,53 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusReq"); 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)1); private static final org.apache.thrift.protocol.TField GET_PROGRESS_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("getProgressUpdate", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetOperationStatusReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetOperationStatusReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetOperationStatusReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetOperationStatusReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // required + private TOperationHandle operationHandle; // required private boolean getProgressUpdate; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -25,10 +55,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { OPERATION_HANDLE((short)1, "operationHandle"), GET_PROGRESS_UPDATE((short)2, "getProgressUpdate"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,7 +106,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -87,14 +115,14 @@ public java.lang.String getFieldName() { private static final int __GETPROGRESSUPDATE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.GET_PROGRESS_UPDATE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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.GET_PROGRESS_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("getProgressUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusReq.class, metaDataMap); } @@ -130,12 +158,11 @@ public void clear() { this.getProgressUpdate = false; } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -164,19 +191,19 @@ public void setGetProgressUpdate(boolean getProgressUpdate) { } public void unsetGetProgressUpdate() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); } /** Returns true if field getProgressUpdate is set (has been assigned a value) and false otherwise */ public boolean isSetGetProgressUpdate() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); } public void setGetProgressUpdateIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -190,15 +217,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetGetProgressUpdate(); } else { - setGetProgressUpdate((java.lang.Boolean)value); + setGetProgressUpdate((Boolean)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); @@ -207,13 +233,13 @@ public java.lang.Object getFieldValue(_Fields field) { return isGetProgressUpdate(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +248,11 @@ public boolean isSet(_Fields field) { case GET_PROGRESS_UPDATE: return isSetGetProgressUpdate(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetOperationStatusReq) @@ -237,8 +263,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetOperationStatusReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -263,17 +287,19 @@ public boolean equals(TGetOperationStatusReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - hashCode = hashCode * 8191 + ((isSetGetProgressUpdate()) ? 131071 : 524287); - if (isSetGetProgressUpdate()) - hashCode = hashCode * 8191 + ((getProgressUpdate) ? 131071 : 524287); + boolean present_getProgressUpdate = true && (isSetGetProgressUpdate()); + list.add(present_getProgressUpdate); + if (present_getProgressUpdate) + list.add(getProgressUpdate); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +310,7 @@ public int compareTo(TGetOperationStatusReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +320,7 @@ public int compareTo(TGetOperationStatusReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); + lastComparison = Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +333,21 @@ public int compareTo(TGetOperationStatusReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetOperationStatusReq("); boolean first = true; sb.append("operationHandle:"); @@ -362,7 +387,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -372,13 +397,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetOperationStatusReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetOperationStatusReqStandardSchemeFactory implements SchemeFactory { public TGetOperationStatusReqStandardScheme getScheme() { return new TGetOperationStatusReqStandardScheme(); } } - private static class TGetOperationStatusReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetOperationStatusReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -436,19 +461,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatu } - private static class TGetOperationStatusReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetOperationStatusReqTupleSchemeFactory implements SchemeFactory { public TGetOperationStatusReqTupleScheme getScheme() { return new TGetOperationStatusReqTupleScheme(); } } - private static class TGetOperationStatusReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetOperationStatusReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.operationHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetGetProgressUpdate()) { optionals.set(0); } @@ -460,11 +485,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatus @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.getProgressUpdate = iprot.readBool(); struct.setGetProgressUpdateIsSet(true); @@ -472,8 +497,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusR } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java index 9c4791d3b5f1..6022287cc23b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusResp"); @@ -22,19 +49,22 @@ public class TGetOperationStatusResp implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetOperationStatusRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetOperationStatusRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationState operationState; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional + private TStatus status; // required + private TOperationState operationState; // optional + private String sqlState; // optional private int errorCode; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String taskStatus; // optional + private String errorMessage; // optional + private String taskStatus; // optional private long operationStarted; // optional private long operationCompleted; // optional private boolean hasResultSet; // optional - private @org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse; // optional + private TProgressUpdateResp progressUpdateResponse; // 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 { @@ -53,10 +83,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HAS_RESULT_SET((short)9, "hasResultSet"), PROGRESS_UPDATE_RESPONSE((short)10, "progressUpdateResponse"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -64,7 +94,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -98,22 +127,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -122,7 +150,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -134,9 +162,9 @@ public java.lang.String getFieldName() { private static final int __HASRESULTSET_ISSET_ID = 3; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET,_Fields.PROGRESS_UPDATE_RESPONSE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -157,7 +185,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.PROGRESS_UPDATE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("progressUpdateResponse", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TProgressUpdateResp"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap); } @@ -196,7 +224,7 @@ public TGetOperationStatusResp(TGetOperationStatusResp other) { this.operationCompleted = other.operationCompleted; this.hasResultSet = other.hasResultSet; if (other.isSetProgressUpdateResponse()) { - this.progressUpdateResponse = new TProgressUpdateResp(other.progressUpdateResponse); + this.progressUpdateResponse = other.progressUpdateResponse; } } @@ -222,12 +250,11 @@ public void clear() { this.progressUpdateResponse = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -250,7 +277,6 @@ public void setStatusIsSet(boolean value) { * * @see TOperationState */ - @org.apache.thrift.annotation.Nullable public TOperationState getOperationState() { return this.operationState; } @@ -259,7 +285,7 @@ public TOperationState getOperationState() { * * @see TOperationState */ - public void setOperationState(@org.apache.thrift.annotation.Nullable TOperationState operationState) { + public void setOperationState(TOperationState operationState) { this.operationState = operationState; } @@ -278,12 +304,11 @@ public void setOperationStateIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSqlState() { + public String getSqlState() { return this.sqlState; } - public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { + public void setSqlState(String sqlState) { this.sqlState = sqlState; } @@ -312,24 +337,23 @@ public void setErrorCode(int errorCode) { } public void unsetErrorCode() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ public boolean isSetErrorCode() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); } - @org.apache.thrift.annotation.Nullable - public java.lang.String getErrorMessage() { + public String getErrorMessage() { return this.errorMessage; } - public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { + public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } @@ -348,12 +372,11 @@ public void setErrorMessageIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getTaskStatus() { + public String getTaskStatus() { return this.taskStatus; } - public void setTaskStatus(@org.apache.thrift.annotation.Nullable java.lang.String taskStatus) { + public void setTaskStatus(String taskStatus) { this.taskStatus = taskStatus; } @@ -382,16 +405,16 @@ public void setOperationStarted(long operationStarted) { } public void unsetOperationStarted() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); } /** Returns true if field operationStarted is set (has been assigned a value) and false otherwise */ public boolean isSetOperationStarted() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); } public void setOperationStartedIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); } public long getOperationCompleted() { @@ -404,16 +427,16 @@ public void setOperationCompleted(long operationCompleted) { } public void unsetOperationCompleted() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); } /** Returns true if field operationCompleted is set (has been assigned a value) and false otherwise */ public boolean isSetOperationCompleted() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); } public void setOperationCompletedIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); } public boolean isHasResultSet() { @@ -426,24 +449,23 @@ public void setHasResultSet(boolean hasResultSet) { } public void unsetHasResultSet() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ public boolean isSetHasResultSet() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); } - @org.apache.thrift.annotation.Nullable public TProgressUpdateResp getProgressUpdateResponse() { return this.progressUpdateResponse; } - public void setProgressUpdateResponse(@org.apache.thrift.annotation.Nullable TProgressUpdateResp progressUpdateResponse) { + public void setProgressUpdateResponse(TProgressUpdateResp progressUpdateResponse) { this.progressUpdateResponse = progressUpdateResponse; } @@ -462,7 +484,7 @@ public void setProgressUpdateResponseIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -484,7 +506,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSqlState(); } else { - setSqlState((java.lang.String)value); + setSqlState((String)value); } break; @@ -492,7 +514,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetErrorCode(); } else { - setErrorCode((java.lang.Integer)value); + setErrorCode((Integer)value); } break; @@ -500,7 +522,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetErrorMessage(); } else { - setErrorMessage((java.lang.String)value); + setErrorMessage((String)value); } break; @@ -508,7 +530,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetTaskStatus(); } else { - setTaskStatus((java.lang.String)value); + setTaskStatus((String)value); } break; @@ -516,7 +538,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetOperationStarted(); } else { - setOperationStarted((java.lang.Long)value); + setOperationStarted((Long)value); } break; @@ -524,7 +546,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetOperationCompleted(); } else { - setOperationCompleted((java.lang.Long)value); + setOperationCompleted((Long)value); } break; @@ -532,7 +554,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetHasResultSet(); } else { - setHasResultSet((java.lang.Boolean)value); + setHasResultSet((Boolean)value); } break; @@ -547,8 +569,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -581,13 +602,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getProgressUpdateResponse(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -612,11 +633,11 @@ public boolean isSet(_Fields field) { case PROGRESS_UPDATE_RESPONSE: return isSetProgressUpdateResponse(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetOperationStatusResp) @@ -627,8 +648,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetOperationStatusResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -725,49 +744,59 @@ public boolean equals(TGetOperationStatusResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationState()) ? 131071 : 524287); - if (isSetOperationState()) - hashCode = hashCode * 8191 + operationState.getValue(); + boolean present_operationState = true && (isSetOperationState()); + list.add(present_operationState); + if (present_operationState) + list.add(operationState.getValue()); - hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); - if (isSetSqlState()) - hashCode = hashCode * 8191 + sqlState.hashCode(); + boolean present_sqlState = true && (isSetSqlState()); + list.add(present_sqlState); + if (present_sqlState) + list.add(sqlState); - hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); - if (isSetErrorCode()) - hashCode = hashCode * 8191 + errorCode; + boolean present_errorCode = true && (isSetErrorCode()); + list.add(present_errorCode); + if (present_errorCode) + list.add(errorCode); - hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); - if (isSetErrorMessage()) - hashCode = hashCode * 8191 + errorMessage.hashCode(); + boolean present_errorMessage = true && (isSetErrorMessage()); + list.add(present_errorMessage); + if (present_errorMessage) + list.add(errorMessage); - hashCode = hashCode * 8191 + ((isSetTaskStatus()) ? 131071 : 524287); - if (isSetTaskStatus()) - hashCode = hashCode * 8191 + taskStatus.hashCode(); + boolean present_taskStatus = true && (isSetTaskStatus()); + list.add(present_taskStatus); + if (present_taskStatus) + list.add(taskStatus); - hashCode = hashCode * 8191 + ((isSetOperationStarted()) ? 131071 : 524287); - if (isSetOperationStarted()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationStarted); + boolean present_operationStarted = true && (isSetOperationStarted()); + list.add(present_operationStarted); + if (present_operationStarted) + list.add(operationStarted); - hashCode = hashCode * 8191 + ((isSetOperationCompleted()) ? 131071 : 524287); - if (isSetOperationCompleted()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(operationCompleted); + boolean present_operationCompleted = true && (isSetOperationCompleted()); + list.add(present_operationCompleted); + if (present_operationCompleted) + list.add(operationCompleted); - hashCode = hashCode * 8191 + ((isSetHasResultSet()) ? 131071 : 524287); - if (isSetHasResultSet()) - hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); + boolean present_hasResultSet = true && (isSetHasResultSet()); + list.add(present_hasResultSet); + if (present_hasResultSet) + list.add(hasResultSet); - hashCode = hashCode * 8191 + ((isSetProgressUpdateResponse()) ? 131071 : 524287); - if (isSetProgressUpdateResponse()) - hashCode = hashCode * 8191 + progressUpdateResponse.hashCode(); + boolean present_progressUpdateResponse = true && (isSetProgressUpdateResponse()); + list.add(present_progressUpdateResponse); + if (present_progressUpdateResponse) + list.add(progressUpdateResponse); - return hashCode; + return list.hashCode(); } @Override @@ -778,7 +807,7 @@ public int compareTo(TGetOperationStatusResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -788,7 +817,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); + lastComparison = Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); if (lastComparison != 0) { return lastComparison; } @@ -798,7 +827,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); if (lastComparison != 0) { return lastComparison; } @@ -808,7 +837,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); if (lastComparison != 0) { return lastComparison; } @@ -818,7 +847,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); if (lastComparison != 0) { return lastComparison; } @@ -828,7 +857,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); + lastComparison = Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); if (lastComparison != 0) { return lastComparison; } @@ -838,7 +867,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); + lastComparison = Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); if (lastComparison != 0) { return lastComparison; } @@ -848,7 +877,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); + lastComparison = Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); if (lastComparison != 0) { return lastComparison; } @@ -858,7 +887,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); if (lastComparison != 0) { return lastComparison; } @@ -868,7 +897,7 @@ public int compareTo(TGetOperationStatusResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); + lastComparison = Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); if (lastComparison != 0) { return lastComparison; } @@ -881,22 +910,21 @@ public int compareTo(TGetOperationStatusResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetOperationStatusResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetOperationStatusResp("); boolean first = true; sb.append("status:"); @@ -1004,7 +1032,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -1014,13 +1042,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetOperationStatusRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetOperationStatusRespStandardSchemeFactory implements SchemeFactory { public TGetOperationStatusRespStandardScheme getScheme() { return new TGetOperationStatusRespStandardScheme(); } } - private static class TGetOperationStatusRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetOperationStatusRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -1193,19 +1221,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatu } - private static class TGetOperationStatusRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetOperationStatusRespTupleSchemeFactory implements SchemeFactory { public TGetOperationStatusRespTupleScheme getScheme() { return new TGetOperationStatusRespTupleScheme(); } } - private static class TGetOperationStatusRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetOperationStatusRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationState()) { optionals.set(0); } @@ -1265,11 +1293,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatus @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(9); + BitSet incoming = iprot.readBitSet(9); if (incoming.get(0)) { struct.operationState = org.apache.spark.sql.thriftserver.cli.thrift.TOperationState.findByValue(iprot.readI32()); struct.setOperationStateIsSet(true); @@ -1310,8 +1338,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusR } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java index 208ad832be4f..8ad4f4591dff 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysReq"); @@ -16,13 +43,16 @@ public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetPrimaryKeysReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetPrimaryKeysReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String tableName; // 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 { @@ -31,10 +61,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SCHEMA_NAME((short)3, "schemaName"), TABLE_NAME((short)4, "tableName"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -42,7 +72,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -64,22 +93,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -88,16 +116,16 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -106,7 +134,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysReq.class, metaDataMap); } @@ -150,12 +178,11 @@ public void clear() { this.tableName = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -174,12 +201,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { + public String getCatalogName() { return this.catalogName; } - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + public void setCatalogName(String catalogName) { this.catalogName = catalogName; } @@ -198,12 +224,11 @@ public void setCatalogNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { + public String getSchemaName() { return this.schemaName; } - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + public void setSchemaName(String schemaName) { this.schemaName = schemaName; } @@ -222,12 +247,11 @@ public void setSchemaNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getTableName() { + public String getTableName() { return this.tableName; } - public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { + public void setTableName(String tableName) { this.tableName = tableName; } @@ -246,7 +270,7 @@ public void setTableNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -260,7 +284,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetCatalogName(); } else { - setCatalogName((java.lang.String)value); + setCatalogName((String)value); } break; @@ -268,7 +292,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSchemaName(); } else { - setSchemaName((java.lang.String)value); + setSchemaName((String)value); } break; @@ -276,15 +300,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetTableName(); } else { - setTableName((java.lang.String)value); + setTableName((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -299,13 +322,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getTableName(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -318,11 +341,11 @@ public boolean isSet(_Fields field) { case TABLE_NAME: return isSetTableName(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetPrimaryKeysReq) @@ -333,8 +356,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetPrimaryKeysReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -377,25 +398,29 @@ public boolean equals(TGetPrimaryKeysReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); - hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); - if (isSetTableName()) - hashCode = hashCode * 8191 + tableName.hashCode(); + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); - return hashCode; + return list.hashCode(); } @Override @@ -406,7 +431,7 @@ public int compareTo(TGetPrimaryKeysReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -416,7 +441,7 @@ public int compareTo(TGetPrimaryKeysReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -426,7 +451,7 @@ public int compareTo(TGetPrimaryKeysReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -436,7 +461,7 @@ public int compareTo(TGetPrimaryKeysReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; } @@ -449,22 +474,21 @@ public int compareTo(TGetPrimaryKeysReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetPrimaryKeysReq("); boolean first = true; sb.append("sessionHandle:"); @@ -528,7 +552,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -536,13 +560,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetPrimaryKeysReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetPrimaryKeysReqStandardSchemeFactory implements SchemeFactory { public TGetPrimaryKeysReqStandardScheme getScheme() { return new TGetPrimaryKeysReqStandardScheme(); } } - private static class TGetPrimaryKeysReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetPrimaryKeysReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -632,19 +656,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetPrimaryKeysReq } - private static class TGetPrimaryKeysReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetPrimaryKeysReqTupleSchemeFactory implements SchemeFactory { public TGetPrimaryKeysReqTupleScheme getScheme() { return new TGetPrimaryKeysReqTupleScheme(); } } - private static class TGetPrimaryKeysReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetPrimaryKeysReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -668,11 +692,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -688,8 +712,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq s } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java index b6d01fb6c3ef..e67a9fcfdaea 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetPrimaryKeysResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetPrimaryKeysRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetPrimaryKeysRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetPrimaryKeysRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetPrimaryKeysRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetPrimaryKeysResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetPrimaryKeysResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetPrimaryKeysResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetPrimaryKeysResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetPrimaryKeysResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetPrimaryKeysResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetPrimaryKeysResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetPrimaryKeysResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetPrimaryKeysRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetPrimaryKeysRespStandardSchemeFactory implements SchemeFactory { public TGetPrimaryKeysRespStandardScheme getScheme() { return new TGetPrimaryKeysRespStandardScheme(); } } - private static class TGetPrimaryKeysRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetPrimaryKeysRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetPrimaryKeysRes } - private static class TGetPrimaryKeysRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetPrimaryKeysRespTupleSchemeFactory implements SchemeFactory { public TGetPrimaryKeysRespTupleScheme getScheme() { return new TGetPrimaryKeysRespTupleScheme(); } } - private static class TGetPrimaryKeysRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetPrimaryKeysRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java index 088b514d2f30..29b10679f412 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetQueryIdReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdReq"); 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)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetQueryIdReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetQueryIdReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -140,7 +167,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetQueryIdReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetQueryIdReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -205,13 +229,14 @@ public boolean equals(TGetQueryIdReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TGetQueryIdReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TGetQueryIdReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetQueryIdReq("); boolean first = true; sb.append("operationHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetQueryIdReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetQueryIdReqStandardSchemeFactory implements SchemeFactory { public TGetQueryIdReqStandardScheme getScheme() { return new TGetQueryIdReqStandardScheme(); } } - private static class TGetQueryIdReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetQueryIdReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetQueryIdReq str } - private static class TGetQueryIdReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetQueryIdReqTupleSchemeFactory implements SchemeFactory { public TGetQueryIdReqTupleScheme getScheme() { return new TGetQueryIdReqTupleScheme(); } } - private static class TGetQueryIdReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetQueryIdReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java index bd425f987f30..9f1ab8f19157 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetQueryIdResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetQueryIdResp"); private static final org.apache.thrift.protocol.TField QUERY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("queryId", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetQueryIdRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetQueryIdRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetQueryIdRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetQueryIdRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.lang.String queryId; // required + private String queryId; // 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 { QUERY_ID((short)1, "queryId"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // QUERY_ID @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.QUERY_ID, new org.apache.thrift.meta_data.FieldMetaData("queryId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetQueryIdResp.class, metaDataMap); } @@ -92,7 +120,7 @@ public TGetQueryIdResp() { } public TGetQueryIdResp( - java.lang.String queryId) + String queryId) { this(); this.queryId = queryId; @@ -116,12 +144,11 @@ public void clear() { this.queryId = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getQueryId() { + public String getQueryId() { return this.queryId; } - public void setQueryId(@org.apache.thrift.annotation.Nullable java.lang.String queryId) { + public void setQueryId(String queryId) { this.queryId = queryId; } @@ -140,44 +167,43 @@ public void setQueryIdIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case QUERY_ID: if (value == null) { unsetQueryId(); } else { - setQueryId((java.lang.String)value); + setQueryId((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case QUERY_ID: return getQueryId(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case QUERY_ID: return isSetQueryId(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetQueryIdResp) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetQueryIdResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_queryId = true && this.isSetQueryId(); boolean that_present_queryId = true && that.isSetQueryId(); @@ -205,13 +229,14 @@ public boolean equals(TGetQueryIdResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetQueryId()) ? 131071 : 524287); - if (isSetQueryId()) - hashCode = hashCode * 8191 + queryId.hashCode(); + boolean present_queryId = true && (isSetQueryId()); + list.add(present_queryId); + if (present_queryId) + list.add(queryId); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TGetQueryIdResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetQueryId()).compareTo(other.isSetQueryId()); + lastComparison = Boolean.valueOf(isSetQueryId()).compareTo(other.isSetQueryId()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TGetQueryIdResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetQueryIdResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetQueryIdResp("); boolean first = true; sb.append("queryId:"); @@ -281,7 +305,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -289,13 +313,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetQueryIdRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetQueryIdRespStandardSchemeFactory implements SchemeFactory { public TGetQueryIdRespStandardScheme getScheme() { return new TGetQueryIdRespStandardScheme(); } } - private static class TGetQueryIdRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetQueryIdRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetQueryIdResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -339,30 +363,27 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetQueryIdResp st } - private static class TGetQueryIdRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetQueryIdRespTupleSchemeFactory implements SchemeFactory { public TGetQueryIdRespTupleScheme getScheme() { return new TGetQueryIdRespTupleScheme(); } } - private static class TGetQueryIdRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetQueryIdRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.queryId); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetQueryIdResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.queryId = iprot.readString(); struct.setQueryIdIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java index 0923214e9146..5124adc8c5d9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataReq"); 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)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetResultSetMetadataReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetResultSetMetadataReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // 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 { OPERATION_HANDLE((short)1, "operationHandle"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.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 = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -140,7 +167,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_HANDLE: return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetResultSetMetadataReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetResultSetMetadataReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_operationHandle = true && this.isSetOperationHandle(); boolean that_present_operationHandle = true && that.isSetOperationHandle(); @@ -205,13 +229,14 @@ public boolean equals(TGetResultSetMetadataReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TGetResultSetMetadataReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TGetResultSetMetadataReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetResultSetMetadataReq("); boolean first = true; sb.append("operationHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetResultSetMetadataReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetResultSetMetadataReqStandardSchemeFactory implements SchemeFactory { public TGetResultSetMetadataReqStandardScheme getScheme() { return new TGetResultSetMetadataReqStandardScheme(); } } - private static class TGetResultSetMetadataReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetResultSetMetadataReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetad } - private static class TGetResultSetMetadataReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetResultSetMetadataReqTupleSchemeFactory implements SchemeFactory { public TGetResultSetMetadataReqTupleScheme getScheme() { return new TGetResultSetMetadataReqTupleScheme(); } } - private static class TGetResultSetMetadataReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetResultSetMetadataReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.operationHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); struct.setOperationHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java index a647091ebcc8..6906bff5214f 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataResp"); 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 SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetResultSetMetadataRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetResultSetMetadataRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetResultSetMetadataRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetResultSetMetadataRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TTableSchema schema; // optional + private TStatus status; // required + private TTableSchema schema; // 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"), SCHEMA((short)2, "schema"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.SCHEMA}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableSchema.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.schema = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TTableSchema getSchema() { return this.schema; } - public void setSchema(@org.apache.thrift.annotation.Nullable TTableSchema schema) { + public void setSchema(TTableSchema schema) { this.schema = schema; } @@ -176,7 +202,7 @@ public void setSchemaIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getSchema(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case SCHEMA: return isSetSchema(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetResultSetMetadataResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetResultSetMetadataResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetResultSetMetadataResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetSchema()) ? 131071 : 524287); - if (isSetSchema()) - hashCode = hashCode * 8191 + schema.hashCode(); + boolean present_schema = true && (isSetSchema()); + list.add(present_schema); + if (present_schema) + list.add(schema); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetResultSetMetadataResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetResultSetMetadataResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); + lastComparison = Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetResultSetMetadataResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetResultSetMetadataResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetResultSetMetadataResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetResultSetMetadataRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetResultSetMetadataRespStandardSchemeFactory implements SchemeFactory { public TGetResultSetMetadataRespStandardScheme getScheme() { return new TGetResultSetMetadataRespStandardScheme(); } } - private static class TGetResultSetMetadataRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetResultSetMetadataRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetad } - private static class TGetResultSetMetadataRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetResultSetMetadataRespTupleSchemeFactory implements SchemeFactory { public TGetResultSetMetadataRespTupleScheme getScheme() { return new TGetResultSetMetadataRespTupleScheme(); } } - private static class TGetResultSetMetadataRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetResultSetMetadataRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetSchema()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetada @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.schema = new TTableSchema(); struct.schema.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadat } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java index ba1fdc2f3f81..276dc8fc434e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasReq"); @@ -15,12 +42,15 @@ public class TGetSchemasReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetSchemasReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetSchemasReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // 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 { @@ -28,10 +58,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { CATALOG_NAME((short)2, "catalogName"), SCHEMA_NAME((short)3, "schemaName"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -39,7 +69,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -59,22 +88,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -83,23 +111,23 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasReq.class, metaDataMap); } @@ -139,12 +167,11 @@ public void clear() { this.schemaName = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -163,12 +190,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { + public String getCatalogName() { return this.catalogName; } - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + public void setCatalogName(String catalogName) { this.catalogName = catalogName; } @@ -187,12 +213,11 @@ public void setCatalogNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { + public String getSchemaName() { return this.schemaName; } - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + public void setSchemaName(String schemaName) { this.schemaName = schemaName; } @@ -211,7 +236,7 @@ public void setSchemaNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -225,7 +250,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetCatalogName(); } else { - setCatalogName((java.lang.String)value); + setCatalogName((String)value); } break; @@ -233,15 +258,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSchemaName(); } else { - setSchemaName((java.lang.String)value); + setSchemaName((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -253,13 +277,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getSchemaName(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -270,11 +294,11 @@ public boolean isSet(_Fields field) { case SCHEMA_NAME: return isSetSchemaName(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetSchemasReq) @@ -285,8 +309,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetSchemasReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -320,21 +342,24 @@ public boolean equals(TGetSchemasReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); - return hashCode; + return list.hashCode(); } @Override @@ -345,7 +370,7 @@ public int compareTo(TGetSchemasReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -355,7 +380,7 @@ public int compareTo(TGetSchemasReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -365,7 +390,7 @@ public int compareTo(TGetSchemasReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -378,22 +403,21 @@ public int compareTo(TGetSchemasReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetSchemasReq("); boolean first = true; sb.append("sessionHandle:"); @@ -447,7 +471,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -455,13 +479,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetSchemasReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetSchemasReqStandardSchemeFactory implements SchemeFactory { public TGetSchemasReqStandardScheme getScheme() { return new TGetSchemasReqStandardScheme(); } } - private static class TGetSchemasReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetSchemasReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -536,19 +560,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasReq str } - private static class TGetSchemasReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetSchemasReqTupleSchemeFactory implements SchemeFactory { public TGetSchemasReqTupleScheme getScheme() { return new TGetSchemasReqTupleScheme(); } } - private static class TGetSchemasReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetSchemasReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -566,11 +590,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -582,8 +606,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struc } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java index 93df8cec34ed..ed284a00af33 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetSchemasRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetSchemasRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetSchemasRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetSchemasRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetSchemasResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetSchemasResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetSchemasResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetSchemasResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetSchemasResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetSchemasResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetSchemasResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetSchemasResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetSchemasRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetSchemasRespStandardSchemeFactory implements SchemeFactory { public TGetSchemasRespStandardScheme getScheme() { return new TGetSchemasRespStandardScheme(); } } - private static class TGetSchemasRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetSchemasRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasResp st } - private static class TGetSchemasRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetSchemasRespTupleSchemeFactory implements SchemeFactory { public TGetSchemasRespTupleScheme getScheme() { return new TGetSchemasRespTupleScheme(); } } - private static class TGetSchemasRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetSchemasRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java index 2b846815eedc..e38b6ae93afb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesReq"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTableTypesReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTableTypesReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private TSessionHandle sessionHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.sessionHandle = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -140,7 +167,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetTableTypesReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetTableTypesReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -205,13 +229,14 @@ public boolean equals(TGetTableTypesReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TGetTableTypesReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TGetTableTypesReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetTableTypesReq("); boolean first = true; sb.append("sessionHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTableTypesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTableTypesReqStandardSchemeFactory implements SchemeFactory { public TGetTableTypesReqStandardScheme getScheme() { return new TGetTableTypesReqStandardScheme(); } } - private static class TGetTableTypesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetTableTypesReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesReq } - private static class TGetTableTypesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTableTypesReqTupleSchemeFactory implements SchemeFactory { public TGetTableTypesReqTupleScheme getScheme() { return new TGetTableTypesReqTupleScheme(); } } - private static class TGetTableTypesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetTableTypesReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java index 9c4df7158dfa..7724884d91ac 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTableTypesRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTableTypesRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTableTypesRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTableTypesRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetTableTypesResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetTableTypesResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetTableTypesResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetTableTypesResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetTableTypesResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetTableTypesResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTableTypesResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetTableTypesResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTableTypesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTableTypesRespStandardSchemeFactory implements SchemeFactory { public TGetTableTypesRespStandardScheme getScheme() { return new TGetTableTypesRespStandardScheme(); } } - private static class TGetTableTypesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetTableTypesRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesResp } - private static class TGetTableTypesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTableTypesRespTupleSchemeFactory implements SchemeFactory { public TGetTableTypesRespTupleScheme getScheme() { return new TGetTableTypesRespTupleScheme(); } } - private static class TGetTableTypesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetTableTypesRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp s } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java index 0c3d79e3d64a..dba6672baf9f 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq"); @@ -17,14 +44,17 @@ public class TGetTablesReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTablesReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTablesReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String catalogName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String schemaName; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String tableName; // optional - private @org.apache.thrift.annotation.Nullable java.util.List tableTypes; // optional + private TSessionHandle sessionHandle; // required + private String catalogName; // optional + private String schemaName; // optional + private String tableName; // optional + private List tableTypes; // 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 { @@ -34,10 +64,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TABLE_NAME((short)4, "tableName"), TABLE_TYPES((short)5, "tableTypes"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -45,7 +75,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -69,22 +98,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -93,16 +121,16 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.TABLE_TYPES}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -114,7 +142,7 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap); } @@ -145,7 +173,7 @@ public TGetTablesReq(TGetTablesReq other) { this.tableName = other.tableName; } if (other.isSetTableTypes()) { - java.util.List __this__tableTypes = new java.util.ArrayList(other.tableTypes); + List __this__tableTypes = new ArrayList(other.tableTypes); this.tableTypes = __this__tableTypes; } } @@ -163,12 +191,11 @@ public void clear() { this.tableTypes = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -187,12 +214,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getCatalogName() { + public String getCatalogName() { return this.catalogName; } - public void setCatalogName(@org.apache.thrift.annotation.Nullable java.lang.String catalogName) { + public void setCatalogName(String catalogName) { this.catalogName = catalogName; } @@ -211,12 +237,11 @@ public void setCatalogNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSchemaName() { + public String getSchemaName() { return this.schemaName; } - public void setSchemaName(@org.apache.thrift.annotation.Nullable java.lang.String schemaName) { + public void setSchemaName(String schemaName) { this.schemaName = schemaName; } @@ -235,12 +260,11 @@ public void setSchemaNameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getTableName() { + public String getTableName() { return this.tableName; } - public void setTableName(@org.apache.thrift.annotation.Nullable java.lang.String tableName) { + public void setTableName(String tableName) { this.tableName = tableName; } @@ -263,24 +287,22 @@ public int getTableTypesSize() { return (this.tableTypes == null) ? 0 : this.tableTypes.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getTableTypesIterator() { + public java.util.Iterator getTableTypesIterator() { return (this.tableTypes == null) ? null : this.tableTypes.iterator(); } - public void addToTableTypes(java.lang.String elem) { + public void addToTableTypes(String elem) { if (this.tableTypes == null) { - this.tableTypes = new java.util.ArrayList(); + this.tableTypes = new ArrayList(); } this.tableTypes.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getTableTypes() { + public List getTableTypes() { return this.tableTypes; } - public void setTableTypes(@org.apache.thrift.annotation.Nullable java.util.List tableTypes) { + public void setTableTypes(List tableTypes) { this.tableTypes = tableTypes; } @@ -299,7 +321,7 @@ public void setTableTypesIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -313,7 +335,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetCatalogName(); } else { - setCatalogName((java.lang.String)value); + setCatalogName((String)value); } break; @@ -321,7 +343,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSchemaName(); } else { - setSchemaName((java.lang.String)value); + setSchemaName((String)value); } break; @@ -329,7 +351,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetTableName(); } else { - setTableName((java.lang.String)value); + setTableName((String)value); } break; @@ -337,15 +359,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetTableTypes(); } else { - setTableTypes((java.util.List)value); + setTableTypes((List)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -363,13 +384,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getTableTypes(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -384,11 +405,11 @@ public boolean isSet(_Fields field) { case TABLE_TYPES: return isSetTableTypes(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetTablesReq) @@ -399,8 +420,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetTablesReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -452,29 +471,34 @@ public boolean equals(TGetTablesReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetCatalogName()) ? 131071 : 524287); - if (isSetCatalogName()) - hashCode = hashCode * 8191 + catalogName.hashCode(); + boolean present_catalogName = true && (isSetCatalogName()); + list.add(present_catalogName); + if (present_catalogName) + list.add(catalogName); - hashCode = hashCode * 8191 + ((isSetSchemaName()) ? 131071 : 524287); - if (isSetSchemaName()) - hashCode = hashCode * 8191 + schemaName.hashCode(); + boolean present_schemaName = true && (isSetSchemaName()); + list.add(present_schemaName); + if (present_schemaName) + list.add(schemaName); - hashCode = hashCode * 8191 + ((isSetTableName()) ? 131071 : 524287); - if (isSetTableName()) - hashCode = hashCode * 8191 + tableName.hashCode(); + boolean present_tableName = true && (isSetTableName()); + list.add(present_tableName); + if (present_tableName) + list.add(tableName); - hashCode = hashCode * 8191 + ((isSetTableTypes()) ? 131071 : 524287); - if (isSetTableTypes()) - hashCode = hashCode * 8191 + tableTypes.hashCode(); + boolean present_tableTypes = true && (isSetTableTypes()); + list.add(present_tableTypes); + if (present_tableTypes) + list.add(tableTypes); - return hashCode; + return list.hashCode(); } @Override @@ -485,7 +509,7 @@ public int compareTo(TGetTablesReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -495,7 +519,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); + lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); if (lastComparison != 0) { return lastComparison; } @@ -505,7 +529,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); + lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); if (lastComparison != 0) { return lastComparison; } @@ -515,7 +539,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); + lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); if (lastComparison != 0) { return lastComparison; } @@ -525,7 +549,7 @@ public int compareTo(TGetTablesReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); + lastComparison = Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); if (lastComparison != 0) { return lastComparison; } @@ -538,22 +562,21 @@ public int compareTo(TGetTablesReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetTablesReq("); boolean first = true; sb.append("sessionHandle:"); @@ -627,7 +650,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -635,13 +658,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTablesReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTablesReqStandardSchemeFactory implements SchemeFactory { public TGetTablesReqStandardScheme getScheme() { return new TGetTablesReqStandardScheme(); } } - private static class TGetTablesReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetTablesReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -690,8 +713,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list182 = iprot.readListBegin(); - struct.tableTypes = new java.util.ArrayList(_list182.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem183; + struct.tableTypes = new ArrayList(_list182.size); + String _elem183; for (int _i184 = 0; _i184 < _list182.size; ++_i184) { _elem183 = iprot.readString(); @@ -748,7 +771,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq stru oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (java.lang.String _iter185 : struct.tableTypes) + for (String _iter185 : struct.tableTypes) { oprot.writeString(_iter185); } @@ -763,19 +786,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq stru } - private static class TGetTablesReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTablesReqTupleSchemeFactory implements SchemeFactory { public TGetTablesReqTupleScheme getScheme() { return new TGetTablesReqTupleScheme(); } } - private static class TGetTablesReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetTablesReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetCatalogName()) { optionals.set(0); } @@ -801,7 +824,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struc if (struct.isSetTableTypes()) { { oprot.writeI32(struct.tableTypes.size()); - for (java.lang.String _iter186 : struct.tableTypes) + for (String _iter186 : struct.tableTypes) { oprot.writeString(_iter186); } @@ -811,11 +834,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.catalogName = iprot.readString(); struct.setCatalogNameIsSet(true); @@ -831,8 +854,8 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct if (incoming.get(3)) { { org.apache.thrift.protocol.TList _list187 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new java.util.ArrayList(_list187.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem188; + struct.tableTypes = new ArrayList(_list187.size); + String _elem188; for (int _i189 = 0; _i189 < _list187.size; ++_i189) { _elem188 = iprot.readString(); @@ -844,8 +867,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java index d1f1837e903c..5b0a712a1b1a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTablesRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTablesRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTablesRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTablesRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetTablesResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetTablesResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetTablesResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetTablesResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetTablesResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetTablesResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTablesResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetTablesResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTablesRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTablesRespStandardSchemeFactory implements SchemeFactory { public TGetTablesRespStandardScheme getScheme() { return new TGetTablesRespStandardScheme(); } } - private static class TGetTablesRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetTablesRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesResp str } - private static class TGetTablesRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTablesRespTupleSchemeFactory implements SchemeFactory { public TGetTablesRespTupleScheme getScheme() { return new TGetTablesRespTupleScheme(); } } - private static class TGetTablesRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetTablesRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp stru @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struc } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java index 4e4a0d89aba8..aeadb4666a3b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoReq"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTypeInfoReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTypeInfoReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required + private TSessionHandle sessionHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoReq.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.sessionHandle = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -140,7 +167,7 @@ public void setSessionHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SESSION_HANDLE: return isSetSessionHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetTypeInfoReq) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetTypeInfoReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -205,13 +229,14 @@ public boolean equals(TGetTypeInfoReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TGetTypeInfoReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TGetTypeInfoReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetTypeInfoReq("); boolean first = true; sb.append("sessionHandle:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTypeInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTypeInfoReqStandardSchemeFactory implements SchemeFactory { public TGetTypeInfoReqStandardScheme getScheme() { return new TGetTypeInfoReqStandardScheme(); } } - private static class TGetTypeInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetTypeInfoReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoReq st } - private static class TGetTypeInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTypeInfoReqTupleSchemeFactory implements SchemeFactory { public TGetTypeInfoReqTupleScheme getScheme() { return new TGetTypeInfoReqTupleScheme(); } } - private static class TGetTypeInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetTypeInfoReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java index eaa8b0a99349..0331adb8b11c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TGetTypeInfoRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TGetTypeInfoRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TGetTypeInfoRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TGetTypeInfoRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TOperationHandle operationHandle; // optional + private TStatus status; // required + private TOperationHandle operationHandle; // 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"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoResp.class, metaDataMap); } @@ -128,12 +156,11 @@ public void clear() { this.operationHandle = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -152,12 +179,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TOperationHandle getOperationHandle() { return this.operationHandle; } - public void setOperationHandle(@org.apache.thrift.annotation.Nullable TOperationHandle operationHandle) { + public void setOperationHandle(TOperationHandle operationHandle) { this.operationHandle = operationHandle; } @@ -176,7 +202,7 @@ public void setOperationHandleIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -197,8 +223,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -207,13 +232,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getOperationHandle(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -222,11 +247,11 @@ public boolean isSet(_Fields field) { case OPERATION_HANDLE: return isSetOperationHandle(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TGetTypeInfoResp) @@ -237,8 +262,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TGetTypeInfoResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -263,17 +286,19 @@ public boolean equals(TGetTypeInfoResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetOperationHandle()) ? 131071 : 524287); - if (isSetOperationHandle()) - hashCode = hashCode * 8191 + operationHandle.hashCode(); + boolean present_operationHandle = true && (isSetOperationHandle()); + list.add(present_operationHandle); + if (present_operationHandle) + list.add(operationHandle); - return hashCode; + return list.hashCode(); } @Override @@ -284,7 +309,7 @@ public int compareTo(TGetTypeInfoResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -294,7 +319,7 @@ public int compareTo(TGetTypeInfoResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); + lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); if (lastComparison != 0) { return lastComparison; } @@ -307,22 +332,21 @@ public int compareTo(TGetTypeInfoResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TGetTypeInfoResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TGetTypeInfoResp("); boolean first = true; sb.append("status:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TGetTypeInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTypeInfoRespStandardSchemeFactory implements SchemeFactory { public TGetTypeInfoRespStandardScheme getScheme() { return new TGetTypeInfoRespStandardScheme(); } } - private static class TGetTypeInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TGetTypeInfoRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -444,19 +468,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoResp s } - private static class TGetTypeInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TGetTypeInfoRespTupleSchemeFactory implements SchemeFactory { public TGetTypeInfoRespTupleScheme getScheme() { return new TGetTypeInfoRespTupleScheme(); } } - private static class TGetTypeInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TGetTypeInfoRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetOperationHandle()) { optionals.set(0); } @@ -468,11 +492,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.operationHandle = new TOperationHandle(); struct.operationHandle.read(iprot); @@ -481,8 +505,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java index 418dc0bdce08..4bb156ac1958 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THandleIdentifier"); private static final org.apache.thrift.protocol.TField GUID_FIELD_DESC = new org.apache.thrift.protocol.TField("guid", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("secret", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new THandleIdentifierStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new THandleIdentifierTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new THandleIdentifierStandardSchemeFactory()); + schemes.put(TupleScheme.class, new THandleIdentifierTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret; // required + private ByteBuffer guid; // required + private ByteBuffer secret; // 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 { GUID((short)1, "guid"), SECRET((short)2, "secret"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // GUID @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,20 +106,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.GUID, new org.apache.thrift.meta_data.FieldMetaData("guid", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THandleIdentifier.class, metaDataMap); } @@ -99,8 +127,8 @@ public THandleIdentifier() { } public THandleIdentifier( - java.nio.ByteBuffer guid, - java.nio.ByteBuffer secret) + ByteBuffer guid, + ByteBuffer secret) { this(); this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); @@ -134,15 +162,15 @@ public byte[] getGuid() { return guid == null ? null : guid.array(); } - public java.nio.ByteBuffer bufferForGuid() { + public ByteBuffer bufferForGuid() { return org.apache.thrift.TBaseHelper.copyBinary(guid); } public void setGuid(byte[] guid) { - this.guid = guid == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(guid.clone()); + this.guid = guid == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(guid, guid.length)); } - public void setGuid(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer guid) { + public void setGuid(ByteBuffer guid) { this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); } @@ -166,15 +194,15 @@ public byte[] getSecret() { return secret == null ? null : secret.array(); } - public java.nio.ByteBuffer bufferForSecret() { + public ByteBuffer bufferForSecret() { return org.apache.thrift.TBaseHelper.copyBinary(secret); } public void setSecret(byte[] secret) { - this.secret = secret == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(secret.clone()); + this.secret = secret == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(secret, secret.length)); } - public void setSecret(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer secret) { + public void setSecret(ByteBuffer secret) { this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); } @@ -193,17 +221,13 @@ public void setSecretIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case GUID: if (value == null) { unsetGuid(); } else { - if (value instanceof byte[]) { - setGuid((byte[])value); - } else { - setGuid((java.nio.ByteBuffer)value); - } + setGuid((ByteBuffer)value); } break; @@ -211,19 +235,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSecret(); } else { - if (value instanceof byte[]) { - setSecret((byte[])value); - } else { - setSecret((java.nio.ByteBuffer)value); - } + setSecret((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case GUID: return getGuid(); @@ -232,13 +251,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getSecret(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -247,11 +266,11 @@ public boolean isSet(_Fields field) { case SECRET: return isSetSecret(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof THandleIdentifier) @@ -262,8 +281,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(THandleIdentifier that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_guid = true && this.isSetGuid(); boolean that_present_guid = true && that.isSetGuid(); @@ -288,17 +305,19 @@ public boolean equals(THandleIdentifier that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetGuid()) ? 131071 : 524287); - if (isSetGuid()) - hashCode = hashCode * 8191 + guid.hashCode(); + boolean present_guid = true && (isSetGuid()); + list.add(present_guid); + if (present_guid) + list.add(guid); - hashCode = hashCode * 8191 + ((isSetSecret()) ? 131071 : 524287); - if (isSetSecret()) - hashCode = hashCode * 8191 + secret.hashCode(); + boolean present_secret = true && (isSetSecret()); + list.add(present_secret); + if (present_secret) + list.add(secret); - return hashCode; + return list.hashCode(); } @Override @@ -309,7 +328,7 @@ public int compareTo(THandleIdentifier other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); + lastComparison = Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); if (lastComparison != 0) { return lastComparison; } @@ -319,7 +338,7 @@ public int compareTo(THandleIdentifier other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); + lastComparison = Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); if (lastComparison != 0) { return lastComparison; } @@ -332,22 +351,21 @@ public int compareTo(THandleIdentifier other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("THandleIdentifier("); + public String toString() { + StringBuilder sb = new StringBuilder("THandleIdentifier("); boolean first = true; sb.append("guid:"); @@ -390,7 +408,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -398,13 +416,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class THandleIdentifierStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class THandleIdentifierStandardSchemeFactory implements SchemeFactory { public THandleIdentifierStandardScheme getScheme() { return new THandleIdentifierStandardScheme(); } } - private static class THandleIdentifierStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class THandleIdentifierStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, THandleIdentifier struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -461,24 +479,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, THandleIdentifier } - private static class THandleIdentifierTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class THandleIdentifierTupleSchemeFactory implements SchemeFactory { public THandleIdentifierTupleScheme getScheme() { return new THandleIdentifierTupleScheme(); } } - private static class THandleIdentifierTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class THandleIdentifierTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeBinary(struct.guid); oprot.writeBinary(struct.secret); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.guid = iprot.readBinary(); struct.setGuidIsSet(true); struct.secret = iprot.readBinary(); @@ -486,8 +504,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java index 31bb8fdd9b92..963451a34989 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Column"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI16ColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI16ColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Column.class, metaDataMap); } @@ -100,8 +128,8 @@ public TI16Column() { } public TI16Column( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TI16Column( */ public TI16Column(TI16Column other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(short elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TI16Column) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TI16Column that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TI16Column that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TI16Column other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TI16Column other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TI16Column other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Column("); + public String toString() { + StringBuilder sb = new StringBuilder("TI16Column("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI16ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI16ColumnStandardSchemeFactory implements SchemeFactory { public TI16ColumnStandardScheme getScheme() { return new TI16ColumnStandardScheme(); } } - private static class TI16ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TI16ColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,7 +446,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list70.size); + struct.values = new ArrayList(_list70.size); short _elem71; for (int _i72 = 0; _i72 < _list70.size; ++_i72) { @@ -484,17 +504,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Column struct) } - private static class TI16ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI16ColumnTupleSchemeFactory implements SchemeFactory { public TI16ColumnTupleScheme getScheme() { return new TI16ColumnTupleScheme(); } } - private static class TI16ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TI16ColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (short _iter74 : struct.values) @@ -507,10 +527,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); - struct.values = new java.util.ArrayList(_list75.size); + struct.values = new ArrayList(_list75.size); short _elem76; for (int _i77 = 0; _i77 < _list75.size; ++_i77) { @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) t } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java index 174c7b09f56c..1aa4e6f7a9eb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java @@ -1,20 +1,50 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Value"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI16ValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI16ValueTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI16ValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI16ValueTupleSchemeFactory()); + } private short value; // optional @@ -22,10 +52,10 @@ public class TI16Value implements org.apache.thrift.TBase byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,7 +101,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -82,12 +110,12 @@ public java.lang.String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Value.class, metaDataMap); } @@ -122,56 +150,55 @@ public void setValue(short value) { } public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((java.lang.Short)value); + setValue((Short)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TI16Value) @@ -182,8 +209,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TI16Value that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -199,13 +224,14 @@ public boolean equals(TI16Value that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + value; + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); - return hashCode; + return list.hashCode(); } @Override @@ -216,7 +242,7 @@ public int compareTo(TI16Value other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -229,22 +255,21 @@ public int compareTo(TI16Value other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI16Value("); + public String toString() { + StringBuilder sb = new StringBuilder("TI16Value("); boolean first = true; if (isSetValue()) { @@ -269,7 +294,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -279,13 +304,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI16ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI16ValueStandardSchemeFactory implements SchemeFactory { public TI16ValueStandardScheme getScheme() { return new TI16ValueStandardScheme(); } } - private static class TI16ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TI16ValueStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -329,18 +354,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Value struct) } - private static class TI16ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI16ValueTupleSchemeFactory implements SchemeFactory { public TI16ValueTupleScheme getScheme() { return new TI16ValueTupleScheme(); } } - private static class TI16ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TI16ValueTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -352,8 +377,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readI16(); struct.setValueIsSet(true); @@ -361,8 +386,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) th } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java index f3226dd6f5f2..8b557e47027c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Column"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI32ColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI32ColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Column.class, metaDataMap); } @@ -100,8 +128,8 @@ public TI32Column() { } public TI32Column( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TI32Column( */ public TI32Column(TI32Column other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(int elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TI32Column) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TI32Column that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TI32Column that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TI32Column other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TI32Column other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TI32Column other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Column("); + public String toString() { + StringBuilder sb = new StringBuilder("TI32Column("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI32ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI32ColumnStandardSchemeFactory implements SchemeFactory { public TI32ColumnStandardScheme getScheme() { return new TI32ColumnStandardScheme(); } } - private static class TI32ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TI32ColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,7 +446,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list78.size); + struct.values = new ArrayList(_list78.size); int _elem79; for (int _i80 = 0; _i80 < _list78.size; ++_i80) { @@ -484,17 +504,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Column struct) } - private static class TI32ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI32ColumnTupleSchemeFactory implements SchemeFactory { public TI32ColumnTupleScheme getScheme() { return new TI32ColumnTupleScheme(); } } - private static class TI32ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TI32ColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (int _iter82 : struct.values) @@ -507,10 +527,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.values = new java.util.ArrayList(_list83.size); + struct.values = new ArrayList(_list83.size); int _elem84; for (int _i85 = 0; _i85 < _list83.size; ++_i85) { @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) t } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java index 91e936613542..40ec647f375c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java @@ -1,20 +1,50 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Value"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI32ValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI32ValueTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI32ValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI32ValueTupleSchemeFactory()); + } private int value; // optional @@ -22,10 +52,10 @@ public class TI32Value implements org.apache.thrift.TBase byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,7 +101,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -82,12 +110,12 @@ public java.lang.String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Value.class, metaDataMap); } @@ -122,56 +150,55 @@ public void setValue(int value) { } public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((java.lang.Integer)value); + setValue((Integer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TI32Value) @@ -182,8 +209,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TI32Value that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -199,13 +224,14 @@ public boolean equals(TI32Value that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + value; + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); - return hashCode; + return list.hashCode(); } @Override @@ -216,7 +242,7 @@ public int compareTo(TI32Value other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -229,22 +255,21 @@ public int compareTo(TI32Value other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI32Value("); + public String toString() { + StringBuilder sb = new StringBuilder("TI32Value("); boolean first = true; if (isSetValue()) { @@ -269,7 +294,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -279,13 +304,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI32ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI32ValueStandardSchemeFactory implements SchemeFactory { public TI32ValueStandardScheme getScheme() { return new TI32ValueStandardScheme(); } } - private static class TI32ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TI32ValueStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -329,18 +354,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Value struct) } - private static class TI32ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI32ValueTupleSchemeFactory implements SchemeFactory { public TI32ValueTupleScheme getScheme() { return new TI32ValueTupleScheme(); } } - private static class TI32ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TI32ValueTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -352,8 +377,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readI32(); struct.setValueIsSet(true); @@ -361,8 +386,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) th } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java index 25ca62a1298c..17ee8f81159f 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Column"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI64ColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI64ColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Column.class, metaDataMap); } @@ -100,8 +128,8 @@ public TI64Column() { } public TI64Column( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TI64Column( */ public TI64Column(TI64Column other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } public void addToValues(long elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TI64Column) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TI64Column that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TI64Column that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TI64Column other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TI64Column other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TI64Column other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Column("); + public String toString() { + StringBuilder sb = new StringBuilder("TI64Column("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI64ColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI64ColumnStandardSchemeFactory implements SchemeFactory { public TI64ColumnStandardScheme getScheme() { return new TI64ColumnStandardScheme(); } } - private static class TI64ColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TI64ColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,7 +446,7 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column struct) if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list86.size); + struct.values = new ArrayList(_list86.size); long _elem87; for (int _i88 = 0; _i88 < _list86.size; ++_i88) { @@ -484,17 +504,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Column struct) } - private static class TI64ColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI64ColumnTupleSchemeFactory implements SchemeFactory { public TI64ColumnTupleScheme getScheme() { return new TI64ColumnTupleScheme(); } } - private static class TI64ColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TI64ColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); for (long _iter90 : struct.values) @@ -507,10 +527,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - struct.values = new java.util.ArrayList(_list91.size); + struct.values = new ArrayList(_list91.size); long _elem92; for (int _i93 = 0; _i93 < _list91.size; ++_i93) { @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) t } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java index e7a68f26b4b7..1d0330ec3f61 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java @@ -1,20 +1,50 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Value"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TI64ValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TI64ValueTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TI64ValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TI64ValueTupleSchemeFactory()); + } private long value; // optional @@ -22,10 +52,10 @@ public class TI64Value implements org.apache.thrift.TBase byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,7 +101,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -82,12 +110,12 @@ public java.lang.String getFieldName() { private static final int __VALUE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Value.class, metaDataMap); } @@ -122,56 +150,55 @@ public void setValue(long value) { } public void unsetValue() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); } /** Returns true if field value is set (has been assigned a value) and false otherwise */ public boolean isSetValue() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); } public void setValueIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((java.lang.Long)value); + setValue((Long)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TI64Value) @@ -182,8 +209,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TI64Value that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -199,13 +224,14 @@ public boolean equals(TI64Value that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(value); + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); - return hashCode; + return list.hashCode(); } @Override @@ -216,7 +242,7 @@ public int compareTo(TI64Value other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -229,22 +255,21 @@ public int compareTo(TI64Value other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TI64Value("); + public String toString() { + StringBuilder sb = new StringBuilder("TI64Value("); boolean first = true; if (isSetValue()) { @@ -269,7 +294,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -279,13 +304,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TI64ValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI64ValueStandardSchemeFactory implements SchemeFactory { public TI64ValueStandardScheme getScheme() { return new TI64ValueStandardScheme(); } } - private static class TI64ValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TI64ValueStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -329,18 +354,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Value struct) } - private static class TI64ValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TI64ValueTupleSchemeFactory implements SchemeFactory { public TI64ValueTupleScheme getScheme() { return new TI64ValueTupleScheme(); } } - private static class TI64ValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TI64ValueTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -352,8 +377,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readI64(); struct.setValueIsSet(true); @@ -361,8 +386,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) th } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java index 809ac46134ac..9c89111cb8a2 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TJobExecutionStatus implements org.apache.thrift.TEnum { IN_PROGRESS(0), COMPLETE(1), @@ -30,7 +33,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TJobExecutionStatus findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java index 54ccf26e8cd3..6b6306eca172 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java @@ -1,21 +1,51 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapTypeEntry"); private static final org.apache.thrift.protocol.TField KEY_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("keyTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField VALUE_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypePtr", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TMapTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TMapTypeEntryTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TMapTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TMapTypeEntryTupleSchemeFactory()); + } private int keyTypePtr; // required private int valueTypePtr; // required @@ -25,10 +55,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { KEY_TYPE_PTR((short)1, "keyTypePtr"), VALUE_TYPE_PTR((short)2, "valueTypePtr"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // KEY_TYPE_PTR @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,7 +106,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -87,14 +115,14 @@ public java.lang.String getFieldName() { private static final int __KEYTYPEPTR_ISSET_ID = 0; private static final int __VALUETYPEPTR_ISSET_ID = 1; private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.KEY_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("keyTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); tmpMap.put(_Fields.VALUE_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("valueTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapTypeEntry.class, metaDataMap); } @@ -143,16 +171,16 @@ public void setKeyTypePtr(int keyTypePtr) { } public void unsetKeyTypePtr() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); } /** Returns true if field keyTypePtr is set (has been assigned a value) and false otherwise */ public boolean isSetKeyTypePtr() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); } public void setKeyTypePtrIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); } public int getValueTypePtr() { @@ -165,25 +193,25 @@ public void setValueTypePtr(int valueTypePtr) { } public void unsetValueTypePtr() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); } /** Returns true if field valueTypePtr is set (has been assigned a value) and false otherwise */ public boolean isSetValueTypePtr() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); } public void setValueTypePtrIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case KEY_TYPE_PTR: if (value == null) { unsetKeyTypePtr(); } else { - setKeyTypePtr((java.lang.Integer)value); + setKeyTypePtr((Integer)value); } break; @@ -191,15 +219,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetValueTypePtr(); } else { - setValueTypePtr((java.lang.Integer)value); + setValueTypePtr((Integer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case KEY_TYPE_PTR: return getKeyTypePtr(); @@ -208,13 +235,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getValueTypePtr(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -223,11 +250,11 @@ public boolean isSet(_Fields field) { case VALUE_TYPE_PTR: return isSetValueTypePtr(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TMapTypeEntry) @@ -238,8 +265,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TMapTypeEntry that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_keyTypePtr = true; boolean that_present_keyTypePtr = true; @@ -264,13 +289,19 @@ public boolean equals(TMapTypeEntry that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + keyTypePtr; + boolean present_keyTypePtr = true; + list.add(present_keyTypePtr); + if (present_keyTypePtr) + list.add(keyTypePtr); - hashCode = hashCode * 8191 + valueTypePtr; + boolean present_valueTypePtr = true; + list.add(present_valueTypePtr); + if (present_valueTypePtr) + list.add(valueTypePtr); - return hashCode; + return list.hashCode(); } @Override @@ -281,7 +312,7 @@ public int compareTo(TMapTypeEntry other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); + lastComparison = Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -291,7 +322,7 @@ public int compareTo(TMapTypeEntry other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); + lastComparison = Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -304,22 +335,21 @@ public int compareTo(TMapTypeEntry other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TMapTypeEntry("); + public String toString() { + StringBuilder sb = new StringBuilder("TMapTypeEntry("); boolean first = true; sb.append("keyTypePtr:"); @@ -354,7 +384,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -364,13 +394,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TMapTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TMapTypeEntryStandardSchemeFactory implements SchemeFactory { public TMapTypeEntryStandardScheme getScheme() { return new TMapTypeEntryStandardScheme(); } } - private static class TMapTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TMapTypeEntryStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TMapTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -423,24 +453,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TMapTypeEntry stru } - private static class TMapTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TMapTypeEntryTupleSchemeFactory implements SchemeFactory { public TMapTypeEntryTupleScheme getScheme() { return new TMapTypeEntryTupleScheme(); } } - private static class TMapTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TMapTypeEntryTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.keyTypePtr); oprot.writeI32(struct.valueTypePtr); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.keyTypePtr = iprot.readI32(); struct.setKeyTypePtrIsSet(true); struct.valueTypePtr = iprot.readI32(); @@ -448,8 +478,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java index b33834a1bb72..47c8d949a58d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq"); @@ -16,13 +43,16 @@ public class TOpenSessionReq implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TOpenSessionReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TOpenSessionReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol; // required - private @org.apache.thrift.annotation.Nullable java.lang.String username; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String password; // optional - private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // optional + private TProtocolVersion client_protocol; // required + private String username; // optional + private String password; // optional + private Map configuration; // 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 { @@ -35,10 +65,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { PASSWORD((short)3, "password"), CONFIGURATION((short)4, "configuration"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -46,7 +76,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // CLIENT_PROTOCOL @@ -68,22 +97,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,16 +120,16 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -112,7 +140,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap); } @@ -142,7 +170,7 @@ public TOpenSessionReq(TOpenSessionReq other) { this.password = other.password; } if (other.isSetConfiguration()) { - java.util.Map __this__configuration = new java.util.HashMap(other.configuration); + Map __this__configuration = new HashMap(other.configuration); this.configuration = __this__configuration; } } @@ -164,7 +192,6 @@ public void clear() { * * @see TProtocolVersion */ - @org.apache.thrift.annotation.Nullable public TProtocolVersion getClient_protocol() { return this.client_protocol; } @@ -173,7 +200,7 @@ public TProtocolVersion getClient_protocol() { * * @see TProtocolVersion */ - public void setClient_protocol(@org.apache.thrift.annotation.Nullable TProtocolVersion client_protocol) { + public void setClient_protocol(TProtocolVersion client_protocol) { this.client_protocol = client_protocol; } @@ -192,12 +219,11 @@ public void setClient_protocolIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getUsername() { + public String getUsername() { return this.username; } - public void setUsername(@org.apache.thrift.annotation.Nullable java.lang.String username) { + public void setUsername(String username) { this.username = username; } @@ -216,12 +242,11 @@ public void setUsernameIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getPassword() { + public String getPassword() { return this.password; } - public void setPassword(@org.apache.thrift.annotation.Nullable java.lang.String password) { + public void setPassword(String password) { this.password = password; } @@ -244,19 +269,18 @@ public int getConfigurationSize() { return (this.configuration == null) ? 0 : this.configuration.size(); } - public void putToConfiguration(java.lang.String key, java.lang.String val) { + public void putToConfiguration(String key, String val) { if (this.configuration == null) { - this.configuration = new java.util.HashMap(); + this.configuration = new HashMap(); } this.configuration.put(key, val); } - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfiguration() { + public Map getConfiguration() { return this.configuration; } - public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { + public void setConfiguration(Map configuration) { this.configuration = configuration; } @@ -275,7 +299,7 @@ public void setConfigurationIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case CLIENT_PROTOCOL: if (value == null) { @@ -289,7 +313,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetUsername(); } else { - setUsername((java.lang.String)value); + setUsername((String)value); } break; @@ -297,7 +321,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetPassword(); } else { - setPassword((java.lang.String)value); + setPassword((String)value); } break; @@ -305,15 +329,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetConfiguration(); } else { - setConfiguration((java.util.Map)value); + setConfiguration((Map)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case CLIENT_PROTOCOL: return getClient_protocol(); @@ -328,13 +351,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getConfiguration(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -347,11 +370,11 @@ public boolean isSet(_Fields field) { case CONFIGURATION: return isSetConfiguration(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TOpenSessionReq) @@ -362,8 +385,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TOpenSessionReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_client_protocol = true && this.isSetClient_protocol(); boolean that_present_client_protocol = true && that.isSetClient_protocol(); @@ -406,25 +427,29 @@ public boolean equals(TOpenSessionReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetClient_protocol()) ? 131071 : 524287); - if (isSetClient_protocol()) - hashCode = hashCode * 8191 + client_protocol.getValue(); + boolean present_client_protocol = true && (isSetClient_protocol()); + list.add(present_client_protocol); + if (present_client_protocol) + list.add(client_protocol.getValue()); - hashCode = hashCode * 8191 + ((isSetUsername()) ? 131071 : 524287); - if (isSetUsername()) - hashCode = hashCode * 8191 + username.hashCode(); + boolean present_username = true && (isSetUsername()); + list.add(present_username); + if (present_username) + list.add(username); - hashCode = hashCode * 8191 + ((isSetPassword()) ? 131071 : 524287); - if (isSetPassword()) - hashCode = hashCode * 8191 + password.hashCode(); + boolean present_password = true && (isSetPassword()); + list.add(present_password); + if (present_password) + list.add(password); - hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); - if (isSetConfiguration()) - hashCode = hashCode * 8191 + configuration.hashCode(); + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); - return hashCode; + return list.hashCode(); } @Override @@ -435,7 +460,7 @@ public int compareTo(TOpenSessionReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); + lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); if (lastComparison != 0) { return lastComparison; } @@ -445,7 +470,7 @@ public int compareTo(TOpenSessionReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); + lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); if (lastComparison != 0) { return lastComparison; } @@ -455,7 +480,7 @@ public int compareTo(TOpenSessionReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); if (lastComparison != 0) { return lastComparison; } @@ -465,7 +490,7 @@ public int compareTo(TOpenSessionReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); if (lastComparison != 0) { return lastComparison; } @@ -478,22 +503,21 @@ public int compareTo(TOpenSessionReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TOpenSessionReq("); boolean first = true; sb.append("client_protocol:"); @@ -554,7 +578,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -562,13 +586,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TOpenSessionReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TOpenSessionReqStandardSchemeFactory implements SchemeFactory { public TOpenSessionReqStandardScheme getScheme() { return new TOpenSessionReqStandardScheme(); } } - private static class TOpenSessionReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TOpenSessionReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -608,9 +632,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq str if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); - struct.configuration = new java.util.HashMap(2*_map142.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key143; - @org.apache.thrift.annotation.Nullable java.lang.String _val144; + struct.configuration = new HashMap(2*_map142.size); + String _key143; + String _val144; for (int _i145 = 0; _i145 < _map142.size; ++_i145) { _key143 = iprot.readString(); @@ -661,7 +685,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq st oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (java.util.Map.Entry _iter146 : struct.configuration.entrySet()) + for (Map.Entry _iter146 : struct.configuration.entrySet()) { oprot.writeString(_iter146.getKey()); oprot.writeString(_iter146.getValue()); @@ -677,19 +701,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq st } - private static class TOpenSessionReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TOpenSessionReqTupleSchemeFactory implements SchemeFactory { public TOpenSessionReqTupleScheme getScheme() { return new TOpenSessionReqTupleScheme(); } } - private static class TOpenSessionReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TOpenSessionReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.client_protocol.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetUsername()) { optionals.set(0); } @@ -709,7 +733,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq str if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (java.util.Map.Entry _iter147 : struct.configuration.entrySet()) + for (Map.Entry _iter147 : struct.configuration.entrySet()) { oprot.writeString(_iter147.getKey()); oprot.writeString(_iter147.getValue()); @@ -720,10 +744,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.client_protocol = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.findByValue(iprot.readI32()); struct.setClient_protocolIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.username = iprot.readString(); struct.setUsernameIsSet(true); @@ -735,9 +759,9 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq stru if (incoming.get(2)) { { org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new java.util.HashMap(2*_map148.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key149; - @org.apache.thrift.annotation.Nullable java.lang.String _val150; + struct.configuration = new HashMap(2*_map148.size); + String _key149; + String _val150; for (int _i151 = 0; _i151 < _map148.size; ++_i151) { _key149 = iprot.readString(); @@ -750,8 +774,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java index 9b66f188058a..2892e4d8388b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp"); @@ -16,13 +43,16 @@ public class TOpenSessionResp implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TOpenSessionRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TOpenSessionRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required - private @org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion; // required - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // optional - private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // optional + private TStatus status; // required + private TProtocolVersion serverProtocolVersion; // required + private TSessionHandle sessionHandle; // optional + private Map configuration; // 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 { @@ -35,10 +65,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { SESSION_HANDLE((short)3, "sessionHandle"), CONFIGURATION((short)4, "configuration"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -46,7 +76,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -68,22 +97,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,16 +120,16 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -112,7 +140,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap); } @@ -144,7 +172,7 @@ public TOpenSessionResp(TOpenSessionResp other) { this.sessionHandle = new TSessionHandle(other.sessionHandle); } if (other.isSetConfiguration()) { - java.util.Map __this__configuration = new java.util.HashMap(other.configuration); + Map __this__configuration = new HashMap(other.configuration); this.configuration = __this__configuration; } } @@ -162,12 +190,11 @@ public void clear() { this.configuration = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -190,7 +217,6 @@ public void setStatusIsSet(boolean value) { * * @see TProtocolVersion */ - @org.apache.thrift.annotation.Nullable public TProtocolVersion getServerProtocolVersion() { return this.serverProtocolVersion; } @@ -199,7 +225,7 @@ public TProtocolVersion getServerProtocolVersion() { * * @see TProtocolVersion */ - public void setServerProtocolVersion(@org.apache.thrift.annotation.Nullable TProtocolVersion serverProtocolVersion) { + public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) { this.serverProtocolVersion = serverProtocolVersion; } @@ -218,12 +244,11 @@ public void setServerProtocolVersionIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -246,19 +271,18 @@ public int getConfigurationSize() { return (this.configuration == null) ? 0 : this.configuration.size(); } - public void putToConfiguration(java.lang.String key, java.lang.String val) { + public void putToConfiguration(String key, String val) { if (this.configuration == null) { - this.configuration = new java.util.HashMap(); + this.configuration = new HashMap(); } this.configuration.put(key, val); } - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfiguration() { + public Map getConfiguration() { return this.configuration; } - public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { + public void setConfiguration(Map configuration) { this.configuration = configuration; } @@ -277,7 +301,7 @@ public void setConfigurationIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -307,15 +331,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetConfiguration(); } else { - setConfiguration((java.util.Map)value); + setConfiguration((Map)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); @@ -330,13 +353,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getConfiguration(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -349,11 +372,11 @@ public boolean isSet(_Fields field) { case CONFIGURATION: return isSetConfiguration(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TOpenSessionResp) @@ -364,8 +387,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TOpenSessionResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -408,25 +429,29 @@ public boolean equals(TOpenSessionResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - hashCode = hashCode * 8191 + ((isSetServerProtocolVersion()) ? 131071 : 524287); - if (isSetServerProtocolVersion()) - hashCode = hashCode * 8191 + serverProtocolVersion.getValue(); + boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion()); + list.add(present_serverProtocolVersion); + if (present_serverProtocolVersion) + list.add(serverProtocolVersion.getValue()); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); - if (isSetConfiguration()) - hashCode = hashCode * 8191 + configuration.hashCode(); + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); - return hashCode; + return list.hashCode(); } @Override @@ -437,7 +462,7 @@ public int compareTo(TOpenSessionResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -447,7 +472,7 @@ public int compareTo(TOpenSessionResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); + lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); if (lastComparison != 0) { return lastComparison; } @@ -457,7 +482,7 @@ public int compareTo(TOpenSessionResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -467,7 +492,7 @@ public int compareTo(TOpenSessionResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); if (lastComparison != 0) { return lastComparison; } @@ -480,22 +505,21 @@ public int compareTo(TOpenSessionResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TOpenSessionResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TOpenSessionResp("); boolean first = true; sb.append("status:"); @@ -564,7 +588,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -572,13 +596,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TOpenSessionRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TOpenSessionRespStandardSchemeFactory implements SchemeFactory { public TOpenSessionRespStandardScheme getScheme() { return new TOpenSessionRespStandardScheme(); } } - private static class TOpenSessionRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TOpenSessionRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -620,9 +644,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp st if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); - struct.configuration = new java.util.HashMap(2*_map152.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key153; - @org.apache.thrift.annotation.Nullable java.lang.String _val154; + struct.configuration = new HashMap(2*_map152.size); + String _key153; + String _val154; for (int _i155 = 0; _i155 < _map152.size; ++_i155) { _key153 = iprot.readString(); @@ -671,7 +695,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp s oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (java.util.Map.Entry _iter156 : struct.configuration.entrySet()) + for (Map.Entry _iter156 : struct.configuration.entrySet()) { oprot.writeString(_iter156.getKey()); oprot.writeString(_iter156.getValue()); @@ -687,20 +711,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp s } - private static class TOpenSessionRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TOpenSessionRespTupleSchemeFactory implements SchemeFactory { public TOpenSessionRespTupleScheme getScheme() { return new TOpenSessionRespTupleScheme(); } } - private static class TOpenSessionRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TOpenSessionRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); oprot.writeI32(struct.serverProtocolVersion.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetSessionHandle()) { optionals.set(0); } @@ -714,7 +738,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp st if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (java.util.Map.Entry _iter157 : struct.configuration.entrySet()) + for (Map.Entry _iter157 : struct.configuration.entrySet()) { oprot.writeString(_iter157.getKey()); oprot.writeString(_iter157.getValue()); @@ -725,13 +749,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); struct.serverProtocolVersion = org.apache.spark.sql.thriftserver.cli.thrift.TProtocolVersion.findByValue(iprot.readI32()); struct.setServerProtocolVersionIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); @@ -740,9 +764,9 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp str if (incoming.get(1)) { { org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new java.util.HashMap(2*_map158.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key159; - @org.apache.thrift.annotation.Nullable java.lang.String _val160; + struct.configuration = new HashMap(2*_map158.size); + String _key159; + String _val160; for (int _i161 = 0; _i161 < _map158.size; ++_i161) { _key159 = iprot.readString(); @@ -755,8 +779,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java index 690574983393..4da33d76e984 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle"); @@ -16,11 +43,14 @@ public class TOperationHandle implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TOperationHandleStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TOperationHandleTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable THandleIdentifier operationId; // required - private @org.apache.thrift.annotation.Nullable TOperationType operationType; // required + private THandleIdentifier operationId; // required + private TOperationType operationType; // required private boolean hasResultSet; // required private double modifiedRowCount; // optional @@ -35,10 +65,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { HAS_RESULT_SET((short)3, "hasResultSet"), MODIFIED_ROW_COUNT((short)4, "modifiedRowCount"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -46,7 +76,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // OPERATION_ID @@ -68,22 +97,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -92,7 +120,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -102,9 +130,9 @@ public java.lang.String getFieldName() { private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -113,7 +141,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap); } @@ -161,12 +189,11 @@ public void clear() { this.modifiedRowCount = 0.0; } - @org.apache.thrift.annotation.Nullable public THandleIdentifier getOperationId() { return this.operationId; } - public void setOperationId(@org.apache.thrift.annotation.Nullable THandleIdentifier operationId) { + public void setOperationId(THandleIdentifier operationId) { this.operationId = operationId; } @@ -189,7 +216,6 @@ public void setOperationIdIsSet(boolean value) { * * @see TOperationType */ - @org.apache.thrift.annotation.Nullable public TOperationType getOperationType() { return this.operationType; } @@ -198,7 +224,7 @@ public TOperationType getOperationType() { * * @see TOperationType */ - public void setOperationType(@org.apache.thrift.annotation.Nullable TOperationType operationType) { + public void setOperationType(TOperationType operationType) { this.operationType = operationType; } @@ -227,16 +253,16 @@ public void setHasResultSet(boolean hasResultSet) { } public void unsetHasResultSet() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ public boolean isSetHasResultSet() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); } public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); } public double getModifiedRowCount() { @@ -249,19 +275,19 @@ public void setModifiedRowCount(double modifiedRowCount) { } public void unsetModifiedRowCount() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); } /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */ public boolean isSetModifiedRowCount() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); } public void setModifiedRowCountIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case OPERATION_ID: if (value == null) { @@ -283,7 +309,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetHasResultSet(); } else { - setHasResultSet((java.lang.Boolean)value); + setHasResultSet((Boolean)value); } break; @@ -291,15 +317,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetModifiedRowCount(); } else { - setModifiedRowCount((java.lang.Double)value); + setModifiedRowCount((Double)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case OPERATION_ID: return getOperationId(); @@ -314,13 +339,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getModifiedRowCount(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -333,11 +358,11 @@ public boolean isSet(_Fields field) { case MODIFIED_ROW_COUNT: return isSetModifiedRowCount(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TOperationHandle) @@ -348,8 +373,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TOperationHandle that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_operationId = true && this.isSetOperationId(); boolean that_present_operationId = true && that.isSetOperationId(); @@ -392,23 +415,29 @@ public boolean equals(TOperationHandle that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetOperationId()) ? 131071 : 524287); - if (isSetOperationId()) - hashCode = hashCode * 8191 + operationId.hashCode(); + boolean present_operationId = true && (isSetOperationId()); + list.add(present_operationId); + if (present_operationId) + list.add(operationId); - hashCode = hashCode * 8191 + ((isSetOperationType()) ? 131071 : 524287); - if (isSetOperationType()) - hashCode = hashCode * 8191 + operationType.getValue(); + boolean present_operationType = true && (isSetOperationType()); + list.add(present_operationType); + if (present_operationType) + list.add(operationType.getValue()); - hashCode = hashCode * 8191 + ((hasResultSet) ? 131071 : 524287); + boolean present_hasResultSet = true; + list.add(present_hasResultSet); + if (present_hasResultSet) + list.add(hasResultSet); - hashCode = hashCode * 8191 + ((isSetModifiedRowCount()) ? 131071 : 524287); - if (isSetModifiedRowCount()) - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(modifiedRowCount); + boolean present_modifiedRowCount = true && (isSetModifiedRowCount()); + list.add(present_modifiedRowCount); + if (present_modifiedRowCount) + list.add(modifiedRowCount); - return hashCode; + return list.hashCode(); } @Override @@ -419,7 +448,7 @@ public int compareTo(TOperationHandle other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); + lastComparison = Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); if (lastComparison != 0) { return lastComparison; } @@ -429,7 +458,7 @@ public int compareTo(TOperationHandle other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); + lastComparison = Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); if (lastComparison != 0) { return lastComparison; } @@ -439,7 +468,7 @@ public int compareTo(TOperationHandle other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); + lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); if (lastComparison != 0) { return lastComparison; } @@ -449,7 +478,7 @@ public int compareTo(TOperationHandle other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); + lastComparison = Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); if (lastComparison != 0) { return lastComparison; } @@ -462,22 +491,21 @@ public int compareTo(TOperationHandle other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TOperationHandle("); + public String toString() { + StringBuilder sb = new StringBuilder("TOperationHandle("); boolean first = true; sb.append("operationId:"); @@ -537,7 +565,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -547,13 +575,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TOperationHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TOperationHandleStandardSchemeFactory implements SchemeFactory { public TOperationHandleStandardScheme getScheme() { return new TOperationHandleStandardScheme(); } } - private static class TOperationHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TOperationHandleStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -635,21 +663,21 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TOperationHandle s } - private static class TOperationHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TOperationHandleTupleSchemeFactory implements SchemeFactory { public TOperationHandleTupleScheme getScheme() { return new TOperationHandleTupleScheme(); } } - private static class TOperationHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TOperationHandleTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.operationId.write(oprot); oprot.writeI32(struct.operationType.getValue()); oprot.writeBool(struct.hasResultSet); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetModifiedRowCount()) { optionals.set(0); } @@ -661,7 +689,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.operationId = new THandleIdentifier(); struct.operationId.read(iprot); struct.setOperationIdIsSet(true); @@ -669,7 +697,7 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle str struct.setOperationTypeIsSet(true); struct.hasResultSet = iprot.readBool(); struct.setHasResultSetIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.modifiedRowCount = iprot.readDouble(); struct.setModifiedRowCountIsSet(true); @@ -677,8 +705,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java index cc9967738fa4..0d68f399d7b2 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TOperationState implements org.apache.thrift.TEnum { INITIALIZED_STATE(0), RUNNING_STATE(1), @@ -36,7 +39,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TOperationState findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java index 8fed2bf263f4..e731590a4395 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TOperationType implements org.apache.thrift.TEnum { EXECUTE_STATEMENT(0), GET_TYPE_INFO(1), @@ -36,7 +39,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TOperationType findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java index 61fa650fcfd1..87218fe0a8e9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java @@ -1,24 +1,54 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry"); private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TPrimitiveTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TPrimitiveTypeEntryTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPrimitiveTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPrimitiveTypeEntryTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TTypeId type; // required - private @org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers; // optional + private TTypeId type; // required + private TTypeQualifiers typeQualifiers; // 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 { @@ -29,10 +59,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { TYPE((short)1, "type"), TYPE_QUALIFIERS((short)2, "typeQualifiers"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -40,7 +70,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TYPE @@ -58,22 +87,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -82,21 +110,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.TYPE_QUALIFIERS}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class))); tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap); } @@ -136,7 +164,6 @@ public void clear() { * * @see TTypeId */ - @org.apache.thrift.annotation.Nullable public TTypeId getType() { return this.type; } @@ -145,7 +172,7 @@ public TTypeId getType() { * * @see TTypeId */ - public void setType(@org.apache.thrift.annotation.Nullable TTypeId type) { + public void setType(TTypeId type) { this.type = type; } @@ -164,12 +191,11 @@ public void setTypeIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable public TTypeQualifiers getTypeQualifiers() { return this.typeQualifiers; } - public void setTypeQualifiers(@org.apache.thrift.annotation.Nullable TTypeQualifiers typeQualifiers) { + public void setTypeQualifiers(TTypeQualifiers typeQualifiers) { this.typeQualifiers = typeQualifiers; } @@ -188,7 +214,7 @@ public void setTypeQualifiersIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case TYPE: if (value == null) { @@ -209,8 +235,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case TYPE: return getType(); @@ -219,13 +244,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getTypeQualifiers(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -234,11 +259,11 @@ public boolean isSet(_Fields field) { case TYPE_QUALIFIERS: return isSetTypeQualifiers(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TPrimitiveTypeEntry) @@ -249,8 +274,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TPrimitiveTypeEntry that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_type = true && this.isSetType(); boolean that_present_type = true && that.isSetType(); @@ -275,17 +298,19 @@ public boolean equals(TPrimitiveTypeEntry that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetType()) ? 131071 : 524287); - if (isSetType()) - hashCode = hashCode * 8191 + type.getValue(); + boolean present_type = true && (isSetType()); + list.add(present_type); + if (present_type) + list.add(type.getValue()); - hashCode = hashCode * 8191 + ((isSetTypeQualifiers()) ? 131071 : 524287); - if (isSetTypeQualifiers()) - hashCode = hashCode * 8191 + typeQualifiers.hashCode(); + boolean present_typeQualifiers = true && (isSetTypeQualifiers()); + list.add(present_typeQualifiers); + if (present_typeQualifiers) + list.add(typeQualifiers); - return hashCode; + return list.hashCode(); } @Override @@ -296,7 +321,7 @@ public int compareTo(TPrimitiveTypeEntry other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetType()).compareTo(other.isSetType()); + lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); if (lastComparison != 0) { return lastComparison; } @@ -306,7 +331,7 @@ public int compareTo(TPrimitiveTypeEntry other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); + lastComparison = Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); if (lastComparison != 0) { return lastComparison; } @@ -319,22 +344,21 @@ public int compareTo(TPrimitiveTypeEntry other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TPrimitiveTypeEntry("); + public String toString() { + StringBuilder sb = new StringBuilder("TPrimitiveTypeEntry("); boolean first = true; sb.append("type:"); @@ -378,7 +402,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -386,13 +410,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TPrimitiveTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TPrimitiveTypeEntryStandardSchemeFactory implements SchemeFactory { public TPrimitiveTypeEntryStandardScheme getScheme() { return new TPrimitiveTypeEntryStandardScheme(); } } - private static class TPrimitiveTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TPrimitiveTypeEntryStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -452,19 +476,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TPrimitiveTypeEntr } - private static class TPrimitiveTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TPrimitiveTypeEntryTupleSchemeFactory implements SchemeFactory { public TPrimitiveTypeEntryTupleScheme getScheme() { return new TPrimitiveTypeEntryTupleScheme(); } } - private static class TPrimitiveTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TPrimitiveTypeEntryTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.type.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetTypeQualifiers()) { optionals.set(0); } @@ -476,10 +500,10 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry @Override public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.type = org.apache.spark.sql.thriftserver.cli.thrift.TTypeId.findByValue(iprot.readI32()); struct.setTypeIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.typeQualifiers = new TTypeQualifiers(); struct.typeQualifiers.read(iprot); @@ -488,8 +512,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java index 3f558b3733b6..c5bbdfd089d3 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TProgressUpdateResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TProgressUpdateResp"); @@ -18,14 +45,17 @@ public class TProgressUpdateResp implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TProgressUpdateRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TProgressUpdateRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List headerNames; // required - private @org.apache.thrift.annotation.Nullable java.util.List> rows; // required + private List headerNames; // required + private List> rows; // required private double progressedPercentage; // required - private @org.apache.thrift.annotation.Nullable TJobExecutionStatus status; // required - private @org.apache.thrift.annotation.Nullable java.lang.String footerSummary; // required + private TJobExecutionStatus status; // required + private String footerSummary; // required private long startTime; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -41,10 +71,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { FOOTER_SUMMARY((short)5, "footerSummary"), START_TIME((short)6, "startTime"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -52,7 +82,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // HEADER_NAMES @@ -78,22 +107,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -102,7 +130,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -111,9 +139,9 @@ public java.lang.String getFieldName() { private static final int __PROGRESSEDPERCENTAGE_ISSET_ID = 0; private static final int __STARTTIME_ISSET_ID = 1; private byte __isset_bitfield = 0; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.HEADER_NAMES, new org.apache.thrift.meta_data.FieldMetaData("headerNames", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); @@ -129,7 +157,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TProgressUpdateResp.class, metaDataMap); } @@ -137,11 +165,11 @@ public TProgressUpdateResp() { } public TProgressUpdateResp( - java.util.List headerNames, - java.util.List> rows, + List headerNames, + List> rows, double progressedPercentage, TJobExecutionStatus status, - java.lang.String footerSummary, + String footerSummary, long startTime) { this(); @@ -161,13 +189,13 @@ public TProgressUpdateResp( public TProgressUpdateResp(TProgressUpdateResp other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHeaderNames()) { - java.util.List __this__headerNames = new java.util.ArrayList(other.headerNames); + List __this__headerNames = new ArrayList(other.headerNames); this.headerNames = __this__headerNames; } if (other.isSetRows()) { - java.util.List> __this__rows = new java.util.ArrayList>(other.rows.size()); - for (java.util.List other_element : other.rows) { - java.util.List __this__rows_copy = new java.util.ArrayList(other_element); + List> __this__rows = new ArrayList>(other.rows.size()); + for (List other_element : other.rows) { + List __this__rows_copy = new ArrayList(other_element); __this__rows.add(__this__rows_copy); } this.rows = __this__rows; @@ -202,24 +230,22 @@ public int getHeaderNamesSize() { return (this.headerNames == null) ? 0 : this.headerNames.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getHeaderNamesIterator() { + public java.util.Iterator getHeaderNamesIterator() { return (this.headerNames == null) ? null : this.headerNames.iterator(); } - public void addToHeaderNames(java.lang.String elem) { + public void addToHeaderNames(String elem) { if (this.headerNames == null) { - this.headerNames = new java.util.ArrayList(); + this.headerNames = new ArrayList(); } this.headerNames.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getHeaderNames() { + public List getHeaderNames() { return this.headerNames; } - public void setHeaderNames(@org.apache.thrift.annotation.Nullable java.util.List headerNames) { + public void setHeaderNames(List headerNames) { this.headerNames = headerNames; } @@ -242,24 +268,22 @@ public int getRowsSize() { return (this.rows == null) ? 0 : this.rows.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator> getRowsIterator() { + public java.util.Iterator> getRowsIterator() { return (this.rows == null) ? null : this.rows.iterator(); } - public void addToRows(java.util.List elem) { + public void addToRows(List elem) { if (this.rows == null) { - this.rows = new java.util.ArrayList>(); + this.rows = new ArrayList>(); } this.rows.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List> getRows() { + public List> getRows() { return this.rows; } - public void setRows(@org.apache.thrift.annotation.Nullable java.util.List> rows) { + public void setRows(List> rows) { this.rows = rows; } @@ -288,23 +312,22 @@ public void setProgressedPercentage(double progressedPercentage) { } public void unsetProgressedPercentage() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); } /** Returns true if field progressedPercentage is set (has been assigned a value) and false otherwise */ public boolean isSetProgressedPercentage() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); } public void setProgressedPercentageIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); } /** * * @see TJobExecutionStatus */ - @org.apache.thrift.annotation.Nullable public TJobExecutionStatus getStatus() { return this.status; } @@ -313,7 +336,7 @@ public TJobExecutionStatus getStatus() { * * @see TJobExecutionStatus */ - public void setStatus(@org.apache.thrift.annotation.Nullable TJobExecutionStatus status) { + public void setStatus(TJobExecutionStatus status) { this.status = status; } @@ -332,12 +355,11 @@ public void setStatusIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getFooterSummary() { + public String getFooterSummary() { return this.footerSummary; } - public void setFooterSummary(@org.apache.thrift.annotation.Nullable java.lang.String footerSummary) { + public void setFooterSummary(String footerSummary) { this.footerSummary = footerSummary; } @@ -366,25 +388,25 @@ public void setStartTime(long startTime) { } public void unsetStartTime() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); } /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ public boolean isSetStartTime() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); } public void setStartTimeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case HEADER_NAMES: if (value == null) { unsetHeaderNames(); } else { - setHeaderNames((java.util.List)value); + setHeaderNames((List)value); } break; @@ -392,7 +414,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetRows(); } else { - setRows((java.util.List>)value); + setRows((List>)value); } break; @@ -400,7 +422,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetProgressedPercentage(); } else { - setProgressedPercentage((java.lang.Double)value); + setProgressedPercentage((Double)value); } break; @@ -416,7 +438,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetFooterSummary(); } else { - setFooterSummary((java.lang.String)value); + setFooterSummary((String)value); } break; @@ -424,15 +446,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetStartTime(); } else { - setStartTime((java.lang.Long)value); + setStartTime((Long)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case HEADER_NAMES: return getHeaderNames(); @@ -453,13 +474,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getStartTime(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -476,11 +497,11 @@ public boolean isSet(_Fields field) { case START_TIME: return isSetStartTime(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TProgressUpdateResp) @@ -491,8 +512,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TProgressUpdateResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_headerNames = true && this.isSetHeaderNames(); boolean that_present_headerNames = true && that.isSetHeaderNames(); @@ -553,29 +572,39 @@ public boolean equals(TProgressUpdateResp that) { @Override public int hashCode() { - int hashCode = 1; - - hashCode = hashCode * 8191 + ((isSetHeaderNames()) ? 131071 : 524287); - if (isSetHeaderNames()) - hashCode = hashCode * 8191 + headerNames.hashCode(); - - hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); - if (isSetRows()) - hashCode = hashCode * 8191 + rows.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(progressedPercentage); - - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.getValue(); - - hashCode = hashCode * 8191 + ((isSetFooterSummary()) ? 131071 : 524287); - if (isSetFooterSummary()) - hashCode = hashCode * 8191 + footerSummary.hashCode(); - - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startTime); - - return hashCode; + List list = new ArrayList(); + + boolean present_headerNames = true && (isSetHeaderNames()); + list.add(present_headerNames); + if (present_headerNames) + list.add(headerNames); + + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); + + boolean present_progressedPercentage = true; + list.add(present_progressedPercentage); + if (present_progressedPercentage) + list.add(progressedPercentage); + + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status.getValue()); + + boolean present_footerSummary = true && (isSetFooterSummary()); + list.add(present_footerSummary); + if (present_footerSummary) + list.add(footerSummary); + + boolean present_startTime = true; + list.add(present_startTime); + if (present_startTime) + list.add(startTime); + + return list.hashCode(); } @Override @@ -586,7 +615,7 @@ public int compareTo(TProgressUpdateResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); + lastComparison = Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); if (lastComparison != 0) { return lastComparison; } @@ -596,7 +625,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); if (lastComparison != 0) { return lastComparison; } @@ -606,7 +635,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); + lastComparison = Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); if (lastComparison != 0) { return lastComparison; } @@ -616,7 +645,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -626,7 +655,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); + lastComparison = Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); if (lastComparison != 0) { return lastComparison; } @@ -636,7 +665,7 @@ public int compareTo(TProgressUpdateResp other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); + lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); if (lastComparison != 0) { return lastComparison; } @@ -649,22 +678,21 @@ public int compareTo(TProgressUpdateResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TProgressUpdateResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TProgressUpdateResp("); boolean first = true; sb.append("headerNames:"); @@ -747,7 +775,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -757,13 +785,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TProgressUpdateRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TProgressUpdateRespStandardSchemeFactory implements SchemeFactory { public TProgressUpdateRespStandardScheme getScheme() { return new TProgressUpdateRespStandardScheme(); } } - private static class TProgressUpdateRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TProgressUpdateRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -779,8 +807,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list190 = iprot.readListBegin(); - struct.headerNames = new java.util.ArrayList(_list190.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem191; + struct.headerNames = new ArrayList(_list190.size); + String _elem191; for (int _i192 = 0; _i192 < _list190.size; ++_i192) { _elem191 = iprot.readString(); @@ -797,14 +825,14 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list193 = iprot.readListBegin(); - struct.rows = new java.util.ArrayList>(_list193.size); - @org.apache.thrift.annotation.Nullable java.util.List _elem194; + struct.rows = new ArrayList>(_list193.size); + List _elem194; for (int _i195 = 0; _i195 < _list193.size; ++_i195) { { org.apache.thrift.protocol.TList _list196 = iprot.readListBegin(); - _elem194 = new java.util.ArrayList(_list196.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem197; + _elem194 = new ArrayList(_list196.size); + String _elem197; for (int _i198 = 0; _i198 < _list196.size; ++_i198) { _elem197 = iprot.readString(); @@ -870,7 +898,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateRes oprot.writeFieldBegin(HEADER_NAMES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.headerNames.size())); - for (java.lang.String _iter199 : struct.headerNames) + for (String _iter199 : struct.headerNames) { oprot.writeString(_iter199); } @@ -882,11 +910,11 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateRes oprot.writeFieldBegin(ROWS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.rows.size())); - for (java.util.List _iter200 : struct.rows) + for (List _iter200 : struct.rows) { { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter200.size())); - for (java.lang.String _iter201 : _iter200) + for (String _iter201 : _iter200) { oprot.writeString(_iter201); } @@ -919,31 +947,31 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateRes } - private static class TProgressUpdateRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TProgressUpdateRespTupleSchemeFactory implements SchemeFactory { public TProgressUpdateRespTupleScheme getScheme() { return new TProgressUpdateRespTupleScheme(); } } - private static class TProgressUpdateRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TProgressUpdateRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.headerNames.size()); - for (java.lang.String _iter202 : struct.headerNames) + for (String _iter202 : struct.headerNames) { oprot.writeString(_iter202); } } { oprot.writeI32(struct.rows.size()); - for (java.util.List _iter203 : struct.rows) + for (List _iter203 : struct.rows) { { oprot.writeI32(_iter203.size()); - for (java.lang.String _iter204 : _iter203) + for (String _iter204 : _iter203) { oprot.writeString(_iter204); } @@ -958,11 +986,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp @Override public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list205 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.headerNames = new java.util.ArrayList(_list205.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem206; + struct.headerNames = new ArrayList(_list205.size); + String _elem206; for (int _i207 = 0; _i207 < _list205.size; ++_i207) { _elem206 = iprot.readString(); @@ -972,14 +1000,14 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct.setHeaderNamesIsSet(true); { org.apache.thrift.protocol.TList _list208 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); - struct.rows = new java.util.ArrayList>(_list208.size); - @org.apache.thrift.annotation.Nullable java.util.List _elem209; + struct.rows = new ArrayList>(_list208.size); + List _elem209; for (int _i210 = 0; _i210 < _list208.size; ++_i210) { { org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - _elem209 = new java.util.ArrayList(_list211.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem212; + _elem209 = new ArrayList(_list211.size); + String _elem212; for (int _i213 = 0; _i213 < _list211.size; ++_i213) { _elem212 = iprot.readString(); @@ -1001,8 +1029,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java index c1e1807873bf..d3fa13224a48 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TProtocolVersion implements org.apache.thrift.TEnum { HIVE_CLI_SERVICE_PROTOCOL_V1(0), HIVE_CLI_SERVICE_PROTOCOL_V2(1), @@ -38,7 +41,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TProtocolVersion findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java index 3dac24beb2e7..078331da06ea 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenReq"); 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 DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRenewDelegationTokenReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRenewDelegationTokenReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.lang.String delegationToken; // required + private TSessionHandle sessionHandle; // required + private String delegationToken; // 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"), DELEGATION_TOKEN((short)2, "delegationToken"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,20 +106,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenReq.class, metaDataMap); } @@ -100,7 +128,7 @@ public TRenewDelegationTokenReq() { public TRenewDelegationTokenReq( TSessionHandle sessionHandle, - java.lang.String delegationToken) + String delegationToken) { this(); this.sessionHandle = sessionHandle; @@ -129,12 +157,11 @@ public void clear() { this.delegationToken = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -153,12 +180,11 @@ public void setSessionHandleIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getDelegationToken() { + public String getDelegationToken() { return this.delegationToken; } - public void setDelegationToken(@org.apache.thrift.annotation.Nullable java.lang.String delegationToken) { + public void setDelegationToken(String delegationToken) { this.delegationToken = delegationToken; } @@ -177,7 +203,7 @@ public void setDelegationTokenIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -191,15 +217,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetDelegationToken(); } else { - setDelegationToken((java.lang.String)value); + setDelegationToken((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -208,13 +233,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getDelegationToken(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -223,11 +248,11 @@ public boolean isSet(_Fields field) { case DELEGATION_TOKEN: return isSetDelegationToken(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TRenewDelegationTokenReq) @@ -238,8 +263,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TRenewDelegationTokenReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -264,17 +287,19 @@ public boolean equals(TRenewDelegationTokenReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetDelegationToken()) ? 131071 : 524287); - if (isSetDelegationToken()) - hashCode = hashCode * 8191 + delegationToken.hashCode(); + boolean present_delegationToken = true && (isSetDelegationToken()); + list.add(present_delegationToken); + if (present_delegationToken) + list.add(delegationToken); - return hashCode; + return list.hashCode(); } @Override @@ -285,7 +310,7 @@ public int compareTo(TRenewDelegationTokenReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -295,7 +320,7 @@ public int compareTo(TRenewDelegationTokenReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); + lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); if (lastComparison != 0) { return lastComparison; } @@ -308,22 +333,21 @@ public int compareTo(TRenewDelegationTokenReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TRenewDelegationTokenReq("); boolean first = true; sb.append("sessionHandle:"); @@ -369,7 +393,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -377,13 +401,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRenewDelegationTokenReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRenewDelegationTokenReqStandardSchemeFactory implements SchemeFactory { public TRenewDelegationTokenReqStandardScheme getScheme() { return new TRenewDelegationTokenReqStandardScheme(); } } - private static class TRenewDelegationTokenReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TRenewDelegationTokenReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -441,24 +465,24 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTo } - private static class TRenewDelegationTokenReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRenewDelegationTokenReqTupleSchemeFactory implements SchemeFactory { public TRenewDelegationTokenReqTupleScheme getScheme() { return new TRenewDelegationTokenReqTupleScheme(); } } - private static class TRenewDelegationTokenReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TRenewDelegationTokenReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); oprot.writeString(struct.delegationToken); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); @@ -467,8 +491,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationToke } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java index 1cca35a670fe..4588d22dd35b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRenewDelegationTokenRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRenewDelegationTokenRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRenewDelegationTokenRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRenewDelegationTokenRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required + private TStatus status; // 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 { STATUS((short)1, "status"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenResp.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.status = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -140,7 +167,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TRenewDelegationTokenResp) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TRenewDelegationTokenResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -205,13 +229,14 @@ public boolean equals(TRenewDelegationTokenResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TRenewDelegationTokenResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TRenewDelegationTokenResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRenewDelegationTokenResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TRenewDelegationTokenResp("); boolean first = true; sb.append("status:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRenewDelegationTokenRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRenewDelegationTokenRespStandardSchemeFactory implements SchemeFactory { public TRenewDelegationTokenRespStandardScheme getScheme() { return new TRenewDelegationTokenRespStandardScheme(); } } - private static class TRenewDelegationTokenRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TRenewDelegationTokenRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTo } - private static class TRenewDelegationTokenRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRenewDelegationTokenRespTupleSchemeFactory implements SchemeFactory { public TRenewDelegationTokenRespTupleScheme getScheme() { return new TRenewDelegationTokenRespTupleScheme(); } } - private static class TRenewDelegationTokenRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TRenewDelegationTokenRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java index 6fe6cbfc10fe..5fd827a88630 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TRowStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TRowTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRowStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRowTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List colVals; // required + private List colVals; // 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 { COL_VALS((short)1, "colVals"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // COL_VALS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,19 +101,19 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); } @@ -93,7 +121,7 @@ public TRow() { } public TRow( - java.util.List colVals) + List colVals) { this(); this.colVals = colVals; @@ -104,7 +132,7 @@ public TRow( */ public TRow(TRow other) { if (other.isSetColVals()) { - java.util.List __this__colVals = new java.util.ArrayList(other.colVals.size()); + List __this__colVals = new ArrayList(other.colVals.size()); for (TColumnValue other_element : other.colVals) { __this__colVals.add(new TColumnValue(other_element)); } @@ -125,24 +153,22 @@ public int getColValsSize() { return (this.colVals == null) ? 0 : this.colVals.size(); } - @org.apache.thrift.annotation.Nullable public java.util.Iterator getColValsIterator() { return (this.colVals == null) ? null : this.colVals.iterator(); } public void addToColVals(TColumnValue elem) { if (this.colVals == null) { - this.colVals = new java.util.ArrayList(); + this.colVals = new ArrayList(); } this.colVals.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getColVals() { + public List getColVals() { return this.colVals; } - public void setColVals(@org.apache.thrift.annotation.Nullable java.util.List colVals) { + public void setColVals(List colVals) { this.colVals = colVals; } @@ -161,44 +187,43 @@ public void setColValsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case COL_VALS: if (value == null) { unsetColVals(); } else { - setColVals((java.util.List)value); + setColVals((List)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case COL_VALS: return getColVals(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case COL_VALS: return isSetColVals(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TRow) @@ -209,8 +234,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TRow that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_colVals = true && this.isSetColVals(); boolean that_present_colVals = true && that.isSetColVals(); @@ -226,13 +249,14 @@ public boolean equals(TRow that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetColVals()) ? 131071 : 524287); - if (isSetColVals()) - hashCode = hashCode * 8191 + colVals.hashCode(); + boolean present_colVals = true && (isSetColVals()); + list.add(present_colVals); + if (present_colVals) + list.add(colVals); - return hashCode; + return list.hashCode(); } @Override @@ -243,7 +267,7 @@ public int compareTo(TRow other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); + lastComparison = Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); if (lastComparison != 0) { return lastComparison; } @@ -256,22 +280,21 @@ public int compareTo(TRow other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRow("); + public String toString() { + StringBuilder sb = new StringBuilder("TRow("); boolean first = true; sb.append("colVals:"); @@ -302,7 +325,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -310,13 +333,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRowStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRowStandardSchemeFactory implements SchemeFactory { public TRowStandardScheme getScheme() { return new TRowStandardScheme(); } } - private static class TRowStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TRowStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRow struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -332,8 +355,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRow struct) throws if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); - struct.colVals = new java.util.ArrayList(_list46.size); - @org.apache.thrift.annotation.Nullable TColumnValue _elem47; + struct.colVals = new ArrayList(_list46.size); + TColumnValue _elem47; for (int _i48 = 0; _i48 < _list46.size; ++_i48) { _elem47 = new TColumnValue(); @@ -378,17 +401,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRow struct) throw } - private static class TRowTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRowTupleSchemeFactory implements SchemeFactory { public TRowTupleScheme getScheme() { return new TRowTupleScheme(); } } - private static class TRowTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TRowTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.colVals.size()); for (TColumnValue _iter50 : struct.colVals) @@ -400,11 +423,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.colVals = new java.util.ArrayList(_list51.size); - @org.apache.thrift.annotation.Nullable TColumnValue _elem52; + struct.colVals = new ArrayList(_list51.size); + TColumnValue _elem52; for (int _i53 = 0; _i53 < _list51.size; ++_i53) { _elem52 = new TColumnValue(); @@ -416,8 +439,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java index 84360a4bc172..15960abfd9fd 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); @@ -17,13 +44,16 @@ public class TRowSet implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TRowSetStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TRowSetTupleSchemeFactory()); + } private long startRowOffset; // required - private @org.apache.thrift.annotation.Nullable java.util.List rows; // required - private @org.apache.thrift.annotation.Nullable java.util.List columns; // optional - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns; // optional + private List rows; // required + private List columns; // optional + private ByteBuffer binaryColumns; // optional private int columnCount; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -34,10 +64,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { BINARY_COLUMNS((short)4, "binaryColumns"), COLUMN_COUNT((short)5, "columnCount"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -45,7 +75,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // START_ROW_OFFSET @@ -69,22 +98,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -93,7 +121,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -103,9 +131,9 @@ public java.lang.String getFieldName() { private static final int __COLUMNCOUNT_ISSET_ID = 1; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.BINARY_COLUMNS,_Fields.COLUMN_COUNT}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, @@ -118,7 +146,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); tmpMap.put(_Fields.COLUMN_COUNT, new org.apache.thrift.meta_data.FieldMetaData("columnCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); } @@ -127,7 +155,7 @@ public TRowSet() { public TRowSet( long startRowOffset, - java.util.List rows) + List rows) { this(); this.startRowOffset = startRowOffset; @@ -142,14 +170,14 @@ public TRowSet(TRowSet other) { __isset_bitfield = other.__isset_bitfield; this.startRowOffset = other.startRowOffset; if (other.isSetRows()) { - java.util.List __this__rows = new java.util.ArrayList(other.rows.size()); + List __this__rows = new ArrayList(other.rows.size()); for (TRow other_element : other.rows) { __this__rows.add(new TRow(other_element)); } this.rows = __this__rows; } if (other.isSetColumns()) { - java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); + List __this__columns = new ArrayList(other.columns.size()); for (TColumn other_element : other.columns) { __this__columns.add(new TColumn(other_element)); } @@ -186,40 +214,38 @@ public void setStartRowOffset(long startRowOffset) { } public void unsetStartRowOffset() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); } /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */ public boolean isSetStartRowOffset() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); } public void setStartRowOffsetIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); } public int getRowsSize() { return (this.rows == null) ? 0 : this.rows.size(); } - @org.apache.thrift.annotation.Nullable public java.util.Iterator getRowsIterator() { return (this.rows == null) ? null : this.rows.iterator(); } public void addToRows(TRow elem) { if (this.rows == null) { - this.rows = new java.util.ArrayList(); + this.rows = new ArrayList(); } this.rows.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getRows() { + public List getRows() { return this.rows; } - public void setRows(@org.apache.thrift.annotation.Nullable java.util.List rows) { + public void setRows(List rows) { this.rows = rows; } @@ -242,24 +268,22 @@ public int getColumnsSize() { return (this.columns == null) ? 0 : this.columns.size(); } - @org.apache.thrift.annotation.Nullable public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } public void addToColumns(TColumn elem) { if (this.columns == null) { - this.columns = new java.util.ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getColumns() { + public List getColumns() { return this.columns; } - public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { + public void setColumns(List columns) { this.columns = columns; } @@ -283,15 +307,15 @@ public byte[] getBinaryColumns() { return binaryColumns == null ? null : binaryColumns.array(); } - public java.nio.ByteBuffer bufferForBinaryColumns() { + public ByteBuffer bufferForBinaryColumns() { return org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); } public void setBinaryColumns(byte[] binaryColumns) { - this.binaryColumns = binaryColumns == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(binaryColumns.clone()); + this.binaryColumns = binaryColumns == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(binaryColumns, binaryColumns.length)); } - public void setBinaryColumns(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer binaryColumns) { + public void setBinaryColumns(ByteBuffer binaryColumns) { this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); } @@ -320,25 +344,25 @@ public void setColumnCount(int columnCount) { } public void unsetColumnCount() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); } /** Returns true if field columnCount is set (has been assigned a value) and false otherwise */ public boolean isSetColumnCount() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); } public void setColumnCountIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case START_ROW_OFFSET: if (value == null) { unsetStartRowOffset(); } else { - setStartRowOffset((java.lang.Long)value); + setStartRowOffset((Long)value); } break; @@ -346,7 +370,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetRows(); } else { - setRows((java.util.List)value); + setRows((List)value); } break; @@ -354,7 +378,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetColumns(); } else { - setColumns((java.util.List)value); + setColumns((List)value); } break; @@ -362,11 +386,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetBinaryColumns(); } else { - if (value instanceof byte[]) { - setBinaryColumns((byte[])value); - } else { - setBinaryColumns((java.nio.ByteBuffer)value); - } + setBinaryColumns((ByteBuffer)value); } break; @@ -374,15 +394,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetColumnCount(); } else { - setColumnCount((java.lang.Integer)value); + setColumnCount((Integer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case START_ROW_OFFSET: return getStartRowOffset(); @@ -400,13 +419,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getColumnCount(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -421,11 +440,11 @@ public boolean isSet(_Fields field) { case COLUMN_COUNT: return isSetColumnCount(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TRowSet) @@ -436,8 +455,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TRowSet that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_startRowOffset = true; boolean that_present_startRowOffset = true; @@ -489,27 +506,34 @@ public boolean equals(TRowSet that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + org.apache.thrift.TBaseHelper.hashCode(startRowOffset); + boolean present_startRowOffset = true; + list.add(present_startRowOffset); + if (present_startRowOffset) + list.add(startRowOffset); - hashCode = hashCode * 8191 + ((isSetRows()) ? 131071 : 524287); - if (isSetRows()) - hashCode = hashCode * 8191 + rows.hashCode(); + boolean present_rows = true && (isSetRows()); + list.add(present_rows); + if (present_rows) + list.add(rows); - hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); - if (isSetColumns()) - hashCode = hashCode * 8191 + columns.hashCode(); + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); - hashCode = hashCode * 8191 + ((isSetBinaryColumns()) ? 131071 : 524287); - if (isSetBinaryColumns()) - hashCode = hashCode * 8191 + binaryColumns.hashCode(); + boolean present_binaryColumns = true && (isSetBinaryColumns()); + list.add(present_binaryColumns); + if (present_binaryColumns) + list.add(binaryColumns); - hashCode = hashCode * 8191 + ((isSetColumnCount()) ? 131071 : 524287); - if (isSetColumnCount()) - hashCode = hashCode * 8191 + columnCount; + boolean present_columnCount = true && (isSetColumnCount()); + list.add(present_columnCount); + if (present_columnCount) + list.add(columnCount); - return hashCode; + return list.hashCode(); } @Override @@ -520,7 +544,7 @@ public int compareTo(TRowSet other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); + lastComparison = Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); if (lastComparison != 0) { return lastComparison; } @@ -530,7 +554,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); + lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); if (lastComparison != 0) { return lastComparison; } @@ -540,7 +564,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } @@ -550,7 +574,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); + lastComparison = Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); if (lastComparison != 0) { return lastComparison; } @@ -560,7 +584,7 @@ public int compareTo(TRowSet other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); + lastComparison = Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); if (lastComparison != 0) { return lastComparison; } @@ -573,22 +597,21 @@ public int compareTo(TRowSet other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TRowSet("); + public String toString() { + StringBuilder sb = new StringBuilder("TRowSet("); boolean first = true; sb.append("startRowOffset:"); @@ -653,7 +676,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -663,13 +686,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TRowSetStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRowSetStandardSchemeFactory implements SchemeFactory { public TRowSetStandardScheme getScheme() { return new TRowSetStandardScheme(); } } - private static class TRowSetStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TRowSetStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -693,8 +716,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); - struct.rows = new java.util.ArrayList(_list118.size); - @org.apache.thrift.annotation.Nullable TRow _elem119; + struct.rows = new ArrayList(_list118.size); + TRow _elem119; for (int _i120 = 0; _i120 < _list118.size; ++_i120) { _elem119 = new TRow(); @@ -712,8 +735,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); - struct.columns = new java.util.ArrayList(_list121.size); - @org.apache.thrift.annotation.Nullable TColumn _elem122; + struct.columns = new ArrayList(_list121.size); + TColumn _elem122; for (int _i123 = 0; _i123 < _list121.size; ++_i123) { _elem122 = new TColumn(); @@ -803,17 +826,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) th } - private static class TRowSetTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TRowSetTupleSchemeFactory implements SchemeFactory { public TRowSetTupleScheme getScheme() { return new TRowSetTupleScheme(); } } - private static class TRowSetTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TRowSetTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI64(struct.startRowOffset); { oprot.writeI32(struct.rows.size()); @@ -822,7 +845,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thr _iter126.write(oprot); } } - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetColumns()) { optionals.set(0); } @@ -852,13 +875,13 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thr @Override public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.startRowOffset = iprot.readI64(); struct.setStartRowOffsetIsSet(true); { org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.rows = new java.util.ArrayList(_list128.size); - @org.apache.thrift.annotation.Nullable TRow _elem129; + struct.rows = new ArrayList(_list128.size); + TRow _elem129; for (int _i130 = 0; _i130 < _list128.size; ++_i130) { _elem129 = new TRow(); @@ -867,12 +890,12 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thro } } struct.setRowsIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new java.util.ArrayList(_list131.size); - @org.apache.thrift.annotation.Nullable TColumn _elem132; + struct.columns = new ArrayList(_list131.size); + TColumn _elem132; for (int _i133 = 0; _i133 < _list131.size; ++_i133) { _elem132 = new TColumn(); @@ -893,8 +916,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) thro } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java index cca69894b016..d99c9c013e54 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionHandle"); private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSessionHandleStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSessionHandleTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TSessionHandleStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TSessionHandleTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable THandleIdentifier sessionId; // required + private THandleIdentifier sessionId; // 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_ID((short)1, "sessionId"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_ID @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionHandle.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.sessionId = null; } - @org.apache.thrift.annotation.Nullable public THandleIdentifier getSessionId() { return this.sessionId; } - public void setSessionId(@org.apache.thrift.annotation.Nullable THandleIdentifier sessionId) { + public void setSessionId(THandleIdentifier sessionId) { this.sessionId = sessionId; } @@ -140,7 +167,7 @@ public void setSessionIdIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_ID: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_ID: return getSessionId(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case SESSION_ID: return isSetSessionId(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TSessionHandle) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TSessionHandle that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionId = true && this.isSetSessionId(); boolean that_present_sessionId = true && that.isSetSessionId(); @@ -205,13 +229,14 @@ public boolean equals(TSessionHandle that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionId()) ? 131071 : 524287); - if (isSetSessionId()) - hashCode = hashCode * 8191 + sessionId.hashCode(); + boolean present_sessionId = true && (isSetSessionId()); + list.add(present_sessionId); + if (present_sessionId) + list.add(sessionId); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TSessionHandle other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); + lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TSessionHandle other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TSessionHandle("); + public String toString() { + StringBuilder sb = new StringBuilder("TSessionHandle("); boolean first = true; sb.append("sessionId:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TSessionHandleStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TSessionHandleStandardSchemeFactory implements SchemeFactory { public TSessionHandleStandardScheme getScheme() { return new TSessionHandleStandardScheme(); } } - private static class TSessionHandleStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TSessionHandleStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionHandle struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSessionHandle str } - private static class TSessionHandleTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TSessionHandleTupleSchemeFactory implements SchemeFactory { public TSessionHandleTupleScheme getScheme() { return new TSessionHandleTupleScheme(); } } - private static class TSessionHandleTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TSessionHandleTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionId.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionId = new THandleIdentifier(); struct.sessionId.read(iprot); struct.setSessionIdIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java index 2969f1618160..30947d03e399 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TSetClientInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoReq"); 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 CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoReqStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoReqTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TSetClientInfoReqStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TSetClientInfoReqTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle; // required - private @org.apache.thrift.annotation.Nullable java.util.Map configuration; // optional + private TSessionHandle sessionHandle; // required + private Map configuration; // 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 { SESSION_HANDLE((short)1, "sessionHandle"), CONFIGURATION((short)2, "configuration"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // SESSION_HANDLE @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,23 +106,23 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.CONFIGURATION}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoReq.class, metaDataMap); } @@ -116,7 +144,7 @@ public TSetClientInfoReq(TSetClientInfoReq other) { this.sessionHandle = new TSessionHandle(other.sessionHandle); } if (other.isSetConfiguration()) { - java.util.Map __this__configuration = new java.util.HashMap(other.configuration); + Map __this__configuration = new HashMap(other.configuration); this.configuration = __this__configuration; } } @@ -131,12 +159,11 @@ public void clear() { this.configuration = null; } - @org.apache.thrift.annotation.Nullable public TSessionHandle getSessionHandle() { return this.sessionHandle; } - public void setSessionHandle(@org.apache.thrift.annotation.Nullable TSessionHandle sessionHandle) { + public void setSessionHandle(TSessionHandle sessionHandle) { this.sessionHandle = sessionHandle; } @@ -159,19 +186,18 @@ public int getConfigurationSize() { return (this.configuration == null) ? 0 : this.configuration.size(); } - public void putToConfiguration(java.lang.String key, java.lang.String val) { + public void putToConfiguration(String key, String val) { if (this.configuration == null) { - this.configuration = new java.util.HashMap(); + this.configuration = new HashMap(); } this.configuration.put(key, val); } - @org.apache.thrift.annotation.Nullable - public java.util.Map getConfiguration() { + public Map getConfiguration() { return this.configuration; } - public void setConfiguration(@org.apache.thrift.annotation.Nullable java.util.Map configuration) { + public void setConfiguration(Map configuration) { this.configuration = configuration; } @@ -190,7 +216,7 @@ public void setConfigurationIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case SESSION_HANDLE: if (value == null) { @@ -204,15 +230,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetConfiguration(); } else { - setConfiguration((java.util.Map)value); + setConfiguration((Map)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case SESSION_HANDLE: return getSessionHandle(); @@ -221,13 +246,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getConfiguration(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -236,11 +261,11 @@ public boolean isSet(_Fields field) { case CONFIGURATION: return isSetConfiguration(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TSetClientInfoReq) @@ -251,8 +276,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TSetClientInfoReq that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_sessionHandle = true && this.isSetSessionHandle(); boolean that_present_sessionHandle = true && that.isSetSessionHandle(); @@ -277,17 +300,19 @@ public boolean equals(TSetClientInfoReq that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetSessionHandle()) ? 131071 : 524287); - if (isSetSessionHandle()) - hashCode = hashCode * 8191 + sessionHandle.hashCode(); + boolean present_sessionHandle = true && (isSetSessionHandle()); + list.add(present_sessionHandle); + if (present_sessionHandle) + list.add(sessionHandle); - hashCode = hashCode * 8191 + ((isSetConfiguration()) ? 131071 : 524287); - if (isSetConfiguration()) - hashCode = hashCode * 8191 + configuration.hashCode(); + boolean present_configuration = true && (isSetConfiguration()); + list.add(present_configuration); + if (present_configuration) + list.add(configuration); - return hashCode; + return list.hashCode(); } @Override @@ -298,7 +323,7 @@ public int compareTo(TSetClientInfoReq other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); + lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); if (lastComparison != 0) { return lastComparison; } @@ -308,7 +333,7 @@ public int compareTo(TSetClientInfoReq other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); + lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); if (lastComparison != 0) { return lastComparison; } @@ -321,22 +346,21 @@ public int compareTo(TSetClientInfoReq other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoReq("); + public String toString() { + StringBuilder sb = new StringBuilder("TSetClientInfoReq("); boolean first = true; sb.append("sessionHandle:"); @@ -380,7 +404,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -388,13 +412,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TSetClientInfoReqStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TSetClientInfoReqStandardSchemeFactory implements SchemeFactory { public TSetClientInfoReqStandardScheme getScheme() { return new TSetClientInfoReqStandardScheme(); } } - private static class TSetClientInfoReqStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TSetClientInfoReqStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoReq struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -419,9 +443,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoReq s if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); - struct.configuration = new java.util.HashMap(2*_map162.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key163; - @org.apache.thrift.annotation.Nullable java.lang.String _val164; + struct.configuration = new HashMap(2*_map162.size); + String _key163; + String _val164; for (int _i165 = 0; _i165 < _map162.size; ++_i165) { _key163 = iprot.readString(); @@ -458,7 +482,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSetClientInfoReq oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (java.util.Map.Entry _iter166 : struct.configuration.entrySet()) + for (Map.Entry _iter166 : struct.configuration.entrySet()) { oprot.writeString(_iter166.getKey()); oprot.writeString(_iter166.getValue()); @@ -474,19 +498,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSetClientInfoReq } - private static class TSetClientInfoReqTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TSetClientInfoReqTupleSchemeFactory implements SchemeFactory { public TSetClientInfoReqTupleScheme getScheme() { return new TSetClientInfoReqTupleScheme(); } } - private static class TSetClientInfoReqTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TSetClientInfoReqTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.sessionHandle.write(oprot); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetConfiguration()) { optionals.set(0); } @@ -494,7 +518,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq s if (struct.isSetConfiguration()) { { oprot.writeI32(struct.configuration.size()); - for (java.util.Map.Entry _iter167 : struct.configuration.entrySet()) + for (Map.Entry _iter167 : struct.configuration.entrySet()) { oprot.writeString(_iter167.getKey()); oprot.writeString(_iter167.getValue()); @@ -505,17 +529,17 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq s @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.sessionHandle = new TSessionHandle(); struct.sessionHandle.read(iprot); struct.setSessionHandleIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(1); + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new java.util.HashMap(2*_map168.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key169; - @org.apache.thrift.annotation.Nullable java.lang.String _val170; + struct.configuration = new HashMap(2*_map168.size); + String _key169; + String _val170; for (int _i171 = 0; _i171 < _map168.size; ++_i171) { _key169 = iprot.readString(); @@ -528,8 +552,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoReq st } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java index c6d5b5fefb88..e774339f4a07 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TSetClientInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSetClientInfoResp"); 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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TSetClientInfoRespStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TSetClientInfoRespTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TSetClientInfoRespStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TSetClientInfoRespTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatus status; // required + private TStatus status; // 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 { STATUS((short)1, "status"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + 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))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSetClientInfoResp.class, metaDataMap); } @@ -116,12 +144,11 @@ public void clear() { this.status = null; } - @org.apache.thrift.annotation.Nullable public TStatus getStatus() { return this.status; } - public void setStatus(@org.apache.thrift.annotation.Nullable TStatus status) { + public void setStatus(TStatus status) { this.status = status; } @@ -140,7 +167,7 @@ public void setStatusIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS: if (value == null) { @@ -153,31 +180,30 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS: return getStatus(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TSetClientInfoResp) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TSetClientInfoResp that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); @@ -205,13 +229,14 @@ public boolean equals(TSetClientInfoResp that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatus()) ? 131071 : 524287); - if (isSetStatus()) - hashCode = hashCode * 8191 + status.hashCode(); + boolean present_status = true && (isSetStatus()); + list.add(present_status); + if (present_status) + list.add(status); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TSetClientInfoResp other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); + lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TSetClientInfoResp other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TSetClientInfoResp("); + public String toString() { + StringBuilder sb = new StringBuilder("TSetClientInfoResp("); boolean first = true; sb.append("status:"); @@ -284,7 +308,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -292,13 +316,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TSetClientInfoRespStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TSetClientInfoRespStandardSchemeFactory implements SchemeFactory { public TSetClientInfoRespStandardScheme getScheme() { return new TSetClientInfoRespStandardScheme(); } } - private static class TSetClientInfoRespStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TSetClientInfoRespStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TSetClientInfoResp struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -343,31 +367,28 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TSetClientInfoResp } - private static class TSetClientInfoRespTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TSetClientInfoRespTupleSchemeFactory implements SchemeFactory { public TSetClientInfoRespTupleScheme getScheme() { return new TSetClientInfoRespTupleScheme(); } } - private static class TSetClientInfoRespTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TSetClientInfoRespTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TSetClientInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new TStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java index 6faa97ca5a52..7f44a7931ed5 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java @@ -1,13 +1,40 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus"); @@ -17,14 +44,17 @@ public class TStatus implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStatusStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStatusTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable TStatusCode statusCode; // required - private @org.apache.thrift.annotation.Nullable java.util.List infoMessages; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String sqlState; // optional + private TStatusCode statusCode; // required + private List infoMessages; // optional + private String sqlState; // optional private int errorCode; // optional - private @org.apache.thrift.annotation.Nullable java.lang.String errorMessage; // optional + private String errorMessage; // 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 { @@ -38,10 +68,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { ERROR_CODE((short)4, "errorCode"), ERROR_MESSAGE((short)5, "errorMessage"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -49,7 +79,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // STATUS_CODE @@ -73,22 +102,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -97,7 +125,7 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } @@ -106,9 +134,9 @@ public java.lang.String getFieldName() { private static final int __ERRORCODE_ISSET_ID = 0; private byte __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class))); tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL, @@ -120,7 +148,7 @@ public java.lang.String getFieldName() { new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap); } @@ -143,7 +171,7 @@ public TStatus(TStatus other) { this.statusCode = other.statusCode; } if (other.isSetInfoMessages()) { - java.util.List __this__infoMessages = new java.util.ArrayList(other.infoMessages); + List __this__infoMessages = new ArrayList(other.infoMessages); this.infoMessages = __this__infoMessages; } if (other.isSetSqlState()) { @@ -173,7 +201,6 @@ public void clear() { * * @see TStatusCode */ - @org.apache.thrift.annotation.Nullable public TStatusCode getStatusCode() { return this.statusCode; } @@ -182,7 +209,7 @@ public TStatusCode getStatusCode() { * * @see TStatusCode */ - public void setStatusCode(@org.apache.thrift.annotation.Nullable TStatusCode statusCode) { + public void setStatusCode(TStatusCode statusCode) { this.statusCode = statusCode; } @@ -205,24 +232,22 @@ public int getInfoMessagesSize() { return (this.infoMessages == null) ? 0 : this.infoMessages.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getInfoMessagesIterator() { + public java.util.Iterator getInfoMessagesIterator() { return (this.infoMessages == null) ? null : this.infoMessages.iterator(); } - public void addToInfoMessages(java.lang.String elem) { + public void addToInfoMessages(String elem) { if (this.infoMessages == null) { - this.infoMessages = new java.util.ArrayList(); + this.infoMessages = new ArrayList(); } this.infoMessages.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getInfoMessages() { + public List getInfoMessages() { return this.infoMessages; } - public void setInfoMessages(@org.apache.thrift.annotation.Nullable java.util.List infoMessages) { + public void setInfoMessages(List infoMessages) { this.infoMessages = infoMessages; } @@ -241,12 +266,11 @@ public void setInfoMessagesIsSet(boolean value) { } } - @org.apache.thrift.annotation.Nullable - public java.lang.String getSqlState() { + public String getSqlState() { return this.sqlState; } - public void setSqlState(@org.apache.thrift.annotation.Nullable java.lang.String sqlState) { + public void setSqlState(String sqlState) { this.sqlState = sqlState; } @@ -275,24 +299,23 @@ public void setErrorCode(int errorCode) { } public void unsetErrorCode() { - __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ public boolean isSetErrorCode() { - return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); } public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); } - @org.apache.thrift.annotation.Nullable - public java.lang.String getErrorMessage() { + public String getErrorMessage() { return this.errorMessage; } - public void setErrorMessage(@org.apache.thrift.annotation.Nullable java.lang.String errorMessage) { + public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; } @@ -311,7 +334,7 @@ public void setErrorMessageIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case STATUS_CODE: if (value == null) { @@ -325,7 +348,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetInfoMessages(); } else { - setInfoMessages((java.util.List)value); + setInfoMessages((List)value); } break; @@ -333,7 +356,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetSqlState(); } else { - setSqlState((java.lang.String)value); + setSqlState((String)value); } break; @@ -341,7 +364,7 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetErrorCode(); } else { - setErrorCode((java.lang.Integer)value); + setErrorCode((Integer)value); } break; @@ -349,15 +372,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetErrorMessage(); } else { - setErrorMessage((java.lang.String)value); + setErrorMessage((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case STATUS_CODE: return getStatusCode(); @@ -375,13 +397,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getErrorMessage(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -396,11 +418,11 @@ public boolean isSet(_Fields field) { case ERROR_MESSAGE: return isSetErrorMessage(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TStatus) @@ -411,8 +433,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TStatus that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_statusCode = true && this.isSetStatusCode(); boolean that_present_statusCode = true && that.isSetStatusCode(); @@ -464,29 +484,34 @@ public boolean equals(TStatus that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetStatusCode()) ? 131071 : 524287); - if (isSetStatusCode()) - hashCode = hashCode * 8191 + statusCode.getValue(); + boolean present_statusCode = true && (isSetStatusCode()); + list.add(present_statusCode); + if (present_statusCode) + list.add(statusCode.getValue()); - hashCode = hashCode * 8191 + ((isSetInfoMessages()) ? 131071 : 524287); - if (isSetInfoMessages()) - hashCode = hashCode * 8191 + infoMessages.hashCode(); + boolean present_infoMessages = true && (isSetInfoMessages()); + list.add(present_infoMessages); + if (present_infoMessages) + list.add(infoMessages); - hashCode = hashCode * 8191 + ((isSetSqlState()) ? 131071 : 524287); - if (isSetSqlState()) - hashCode = hashCode * 8191 + sqlState.hashCode(); + boolean present_sqlState = true && (isSetSqlState()); + list.add(present_sqlState); + if (present_sqlState) + list.add(sqlState); - hashCode = hashCode * 8191 + ((isSetErrorCode()) ? 131071 : 524287); - if (isSetErrorCode()) - hashCode = hashCode * 8191 + errorCode; + boolean present_errorCode = true && (isSetErrorCode()); + list.add(present_errorCode); + if (present_errorCode) + list.add(errorCode); - hashCode = hashCode * 8191 + ((isSetErrorMessage()) ? 131071 : 524287); - if (isSetErrorMessage()) - hashCode = hashCode * 8191 + errorMessage.hashCode(); + boolean present_errorMessage = true && (isSetErrorMessage()); + list.add(present_errorMessage); + if (present_errorMessage) + list.add(errorMessage); - return hashCode; + return list.hashCode(); } @Override @@ -497,7 +522,7 @@ public int compareTo(TStatus other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); + lastComparison = Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); if (lastComparison != 0) { return lastComparison; } @@ -507,7 +532,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); + lastComparison = Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); if (lastComparison != 0) { return lastComparison; } @@ -517,7 +542,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); + lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); if (lastComparison != 0) { return lastComparison; } @@ -527,7 +552,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); + lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); if (lastComparison != 0) { return lastComparison; } @@ -537,7 +562,7 @@ public int compareTo(TStatus other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); + lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); if (lastComparison != 0) { return lastComparison; } @@ -550,22 +575,21 @@ public int compareTo(TStatus other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStatus("); + public String toString() { + StringBuilder sb = new StringBuilder("TStatus("); boolean first = true; sb.append("statusCode:"); @@ -632,7 +656,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; @@ -642,13 +666,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStatusStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStatusStandardSchemeFactory implements SchemeFactory { public TStatusStandardScheme getScheme() { return new TStatusStandardScheme(); } } - private static class TStatusStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TStatusStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -672,8 +696,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) thr if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); - struct.infoMessages = new java.util.ArrayList(_list134.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem135; + struct.infoMessages = new ArrayList(_list134.size); + String _elem135; for (int _i136 = 0; _i136 < _list134.size; ++_i136) { _elem135 = iprot.readString(); @@ -733,7 +757,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) th oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); - for (java.lang.String _iter137 : struct.infoMessages) + for (String _iter137 : struct.infoMessages) { oprot.writeString(_iter137); } @@ -767,19 +791,19 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) th } - private static class TStatusTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStatusTupleSchemeFactory implements SchemeFactory { public TStatusTupleScheme getScheme() { return new TStatusTupleScheme(); } } - private static class TStatusTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TStatusTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.statusCode.getValue()); - java.util.BitSet optionals = new java.util.BitSet(); + BitSet optionals = new BitSet(); if (struct.isSetInfoMessages()) { optionals.set(0); } @@ -796,7 +820,7 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thr if (struct.isSetInfoMessages()) { { oprot.writeI32(struct.infoMessages.size()); - for (java.lang.String _iter138 : struct.infoMessages) + for (String _iter138 : struct.infoMessages) { oprot.writeString(_iter138); } @@ -815,15 +839,15 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thr @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.statusCode = org.apache.spark.sql.thriftserver.cli.thrift.TStatusCode.findByValue(iprot.readI32()); struct.setStatusCodeIsSet(true); - java.util.BitSet incoming = iprot.readBitSet(4); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.infoMessages = new java.util.ArrayList(_list139.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem140; + struct.infoMessages = new ArrayList(_list139.size); + String _elem140; for (int _i141 = 0; _i141 < _list139.size; ++_i141) { _elem140 = iprot.readString(); @@ -847,8 +871,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) thro } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java index 665985167d19..7694f6f1acc6 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TStatusCode implements org.apache.thrift.TEnum { SUCCESS_STATUS(0), SUCCESS_WITH_INFO_STATUS(1), @@ -32,7 +35,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TStatusCode findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java index 46b0ef88db34..6161e27c3f74 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java @@ -1,34 +1,64 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn"); private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringColumnStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringColumnTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStringColumnStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStringColumnTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List values; // required - private @org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls; // required + private List values; // required + private ByteBuffer nulls; // 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 { VALUES((short)1, "values"), NULLS((short)2, "nulls"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -36,7 +66,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUES @@ -54,22 +83,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -78,21 +106,21 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap); } @@ -100,8 +128,8 @@ public TStringColumn() { } public TStringColumn( - java.util.List values, - java.nio.ByteBuffer nulls) + List values, + ByteBuffer nulls) { this(); this.values = values; @@ -113,7 +141,7 @@ public TStringColumn( */ public TStringColumn(TStringColumn other) { if (other.isSetValues()) { - java.util.List __this__values = new java.util.ArrayList(other.values); + List __this__values = new ArrayList(other.values); this.values = __this__values; } if (other.isSetNulls()) { @@ -135,24 +163,22 @@ public int getValuesSize() { return (this.values == null) ? 0 : this.values.size(); } - @org.apache.thrift.annotation.Nullable - public java.util.Iterator getValuesIterator() { + public java.util.Iterator getValuesIterator() { return (this.values == null) ? null : this.values.iterator(); } - public void addToValues(java.lang.String elem) { + public void addToValues(String elem) { if (this.values == null) { - this.values = new java.util.ArrayList(); + this.values = new ArrayList(); } this.values.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getValues() { + public List getValues() { return this.values; } - public void setValues(@org.apache.thrift.annotation.Nullable java.util.List values) { + public void setValues(List values) { this.values = values; } @@ -176,15 +202,15 @@ public byte[] getNulls() { return nulls == null ? null : nulls.array(); } - public java.nio.ByteBuffer bufferForNulls() { + public ByteBuffer bufferForNulls() { return org.apache.thrift.TBaseHelper.copyBinary(nulls); } public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (java.nio.ByteBuffer)null : java.nio.ByteBuffer.wrap(nulls.clone()); + this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); } - public void setNulls(@org.apache.thrift.annotation.Nullable java.nio.ByteBuffer nulls) { + public void setNulls(ByteBuffer nulls) { this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); } @@ -203,13 +229,13 @@ public void setNullsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUES: if (value == null) { unsetValues(); } else { - setValues((java.util.List)value); + setValues((List)value); } break; @@ -217,19 +243,14 @@ public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable if (value == null) { unsetNulls(); } else { - if (value instanceof byte[]) { - setNulls((byte[])value); - } else { - setNulls((java.nio.ByteBuffer)value); - } + setNulls((ByteBuffer)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUES: return getValues(); @@ -238,13 +259,13 @@ public java.lang.Object getFieldValue(_Fields field) { return getNulls(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { @@ -253,11 +274,11 @@ public boolean isSet(_Fields field) { case NULLS: return isSetNulls(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TStringColumn) @@ -268,8 +289,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TStringColumn that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_values = true && this.isSetValues(); boolean that_present_values = true && that.isSetValues(); @@ -294,17 +313,19 @@ public boolean equals(TStringColumn that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValues()) ? 131071 : 524287); - if (isSetValues()) - hashCode = hashCode * 8191 + values.hashCode(); + boolean present_values = true && (isSetValues()); + list.add(present_values); + if (present_values) + list.add(values); - hashCode = hashCode * 8191 + ((isSetNulls()) ? 131071 : 524287); - if (isSetNulls()) - hashCode = hashCode * 8191 + nulls.hashCode(); + boolean present_nulls = true && (isSetNulls()); + list.add(present_nulls); + if (present_nulls) + list.add(nulls); - return hashCode; + return list.hashCode(); } @Override @@ -315,7 +336,7 @@ public int compareTo(TStringColumn other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); + lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); if (lastComparison != 0) { return lastComparison; } @@ -325,7 +346,7 @@ public int compareTo(TStringColumn other) { return lastComparison; } } - lastComparison = java.lang.Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); + lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); if (lastComparison != 0) { return lastComparison; } @@ -338,22 +359,21 @@ public int compareTo(TStringColumn other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringColumn("); + public String toString() { + StringBuilder sb = new StringBuilder("TStringColumn("); boolean first = true; sb.append("values:"); @@ -396,7 +416,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -404,13 +424,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStringColumnStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStringColumnStandardSchemeFactory implements SchemeFactory { public TStringColumnStandardScheme getScheme() { return new TStringColumnStandardScheme(); } } - private static class TStringColumnStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TStringColumnStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -426,8 +446,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn struc if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); - struct.values = new java.util.ArrayList(_list102.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem103; + struct.values = new ArrayList(_list102.size); + String _elem103; for (int _i104 = 0; _i104 < _list102.size; ++_i104) { _elem103 = iprot.readString(); @@ -465,7 +485,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringColumn stru oprot.writeFieldBegin(VALUES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (java.lang.String _iter105 : struct.values) + for (String _iter105 : struct.values) { oprot.writeString(_iter105); } @@ -484,20 +504,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringColumn stru } - private static class TStringColumnTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStringColumnTupleSchemeFactory implements SchemeFactory { public TStringColumnTupleScheme getScheme() { return new TStringColumnTupleScheme(); } } - private static class TStringColumnTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TStringColumnTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.values.size()); - for (java.lang.String _iter106 : struct.values) + for (String _iter106 : struct.values) { oprot.writeString(_iter106); } @@ -507,11 +527,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struc @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new java.util.ArrayList(_list107.size); - @org.apache.thrift.annotation.Nullable java.lang.String _elem108; + struct.values = new ArrayList(_list107.size); + String _elem108; for (int _i109 = 0; _i109 < _list107.size; ++_i109) { _elem108 = iprot.readString(); @@ -524,8 +544,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java index ba6d187ac01a..54c0bcff6e89 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStringValueStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStringValueTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStringValueStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStringValueTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.lang.String value; // optional + private String value; // 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 { VALUE((short)1, "value"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // VALUE @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,19 +101,19 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments private static final _Fields optionals[] = {_Fields.VALUE}; - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); } @@ -110,12 +138,11 @@ public void clear() { this.value = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getValue() { + public String getValue() { return this.value; } - public void setValue(@org.apache.thrift.annotation.Nullable java.lang.String value) { + public void setValue(String value) { this.value = value; } @@ -134,44 +161,43 @@ public void setValueIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case VALUE: if (value == null) { unsetValue(); } else { - setValue((java.lang.String)value); + setValue((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case VALUE: return getValue(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case VALUE: return isSetValue(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TStringValue) @@ -182,8 +208,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TStringValue that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_value = true && this.isSetValue(); boolean that_present_value = true && that.isSetValue(); @@ -199,13 +223,14 @@ public boolean equals(TStringValue that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetValue()) ? 131071 : 524287); - if (isSetValue()) - hashCode = hashCode * 8191 + value.hashCode(); + boolean present_value = true && (isSetValue()); + list.add(present_value); + if (present_value) + list.add(value); - return hashCode; + return list.hashCode(); } @Override @@ -216,7 +241,7 @@ public int compareTo(TStringValue other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); + lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); if (lastComparison != 0) { return lastComparison; } @@ -229,22 +254,21 @@ public int compareTo(TStringValue other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStringValue("); + public String toString() { + StringBuilder sb = new StringBuilder("TStringValue("); boolean first = true; if (isSetValue()) { @@ -273,7 +297,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -281,13 +305,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStringValueStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStringValueStandardSchemeFactory implements SchemeFactory { public TStringValueStandardScheme getScheme() { return new TStringValueStandardScheme(); } } - private static class TStringValueStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TStringValueStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -333,18 +357,18 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStringValue struc } - private static class TStringValueTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStringValueTupleSchemeFactory implements SchemeFactory { public TStringValueTupleScheme getScheme() { return new TStringValueTupleScheme(); } } - private static class TStringValueTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TStringValueTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet optionals = new java.util.BitSet(); + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); if (struct.isSetValue()) { optionals.set(0); } @@ -356,8 +380,8 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(1); + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.value = iprot.readString(); struct.setValueIsSet(true); @@ -365,8 +389,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java index c1bc3c7b61c1..5cdd7e9f2a54 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStructTypeEntry"); private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TStructTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TStructTypeEntryTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TStructTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TStructTypeEntryTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // required + private Map nameToTypePtr; // 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 { NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // NAME_TO_TYPE_PTR @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,20 +101,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStructTypeEntry.class, metaDataMap); } @@ -94,7 +122,7 @@ public TStructTypeEntry() { } public TStructTypeEntry( - java.util.Map nameToTypePtr) + Map nameToTypePtr) { this(); this.nameToTypePtr = nameToTypePtr; @@ -105,15 +133,15 @@ public TStructTypeEntry( */ public TStructTypeEntry(TStructTypeEntry other) { if (other.isSetNameToTypePtr()) { - java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); - for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { + Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); + for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { - java.lang.String other_element_key = other_element.getKey(); - java.lang.Integer other_element_value = other_element.getValue(); + String other_element_key = other_element.getKey(); + Integer other_element_value = other_element.getValue(); - java.lang.String __this__nameToTypePtr_copy_key = other_element_key; + String __this__nameToTypePtr_copy_key = other_element_key; - java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; + Integer __this__nameToTypePtr_copy_value = other_element_value; __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); } @@ -134,19 +162,18 @@ public int getNameToTypePtrSize() { return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); } - public void putToNameToTypePtr(java.lang.String key, int val) { + public void putToNameToTypePtr(String key, int val) { if (this.nameToTypePtr == null) { - this.nameToTypePtr = new java.util.HashMap(); + this.nameToTypePtr = new HashMap(); } this.nameToTypePtr.put(key, val); } - @org.apache.thrift.annotation.Nullable - public java.util.Map getNameToTypePtr() { + public Map getNameToTypePtr() { return this.nameToTypePtr; } - public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { + public void setNameToTypePtr(Map nameToTypePtr) { this.nameToTypePtr = nameToTypePtr; } @@ -165,44 +192,43 @@ public void setNameToTypePtrIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case NAME_TO_TYPE_PTR: if (value == null) { unsetNameToTypePtr(); } else { - setNameToTypePtr((java.util.Map)value); + setNameToTypePtr((Map)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case NAME_TO_TYPE_PTR: return getNameToTypePtr(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case NAME_TO_TYPE_PTR: return isSetNameToTypePtr(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TStructTypeEntry) @@ -213,8 +239,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TStructTypeEntry that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); @@ -230,13 +254,14 @@ public boolean equals(TStructTypeEntry that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); - if (isSetNameToTypePtr()) - hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); + boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); + list.add(present_nameToTypePtr); + if (present_nameToTypePtr) + list.add(nameToTypePtr); - return hashCode; + return list.hashCode(); } @Override @@ -247,7 +272,7 @@ public int compareTo(TStructTypeEntry other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -260,22 +285,21 @@ public int compareTo(TStructTypeEntry other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TStructTypeEntry("); + public String toString() { + StringBuilder sb = new StringBuilder("TStructTypeEntry("); boolean first = true; sb.append("nameToTypePtr:"); @@ -306,7 +330,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -314,13 +338,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TStructTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStructTypeEntryStandardSchemeFactory implements SchemeFactory { public TStructTypeEntryStandardScheme getScheme() { return new TStructTypeEntryStandardScheme(); } } - private static class TStructTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TStructTypeEntryStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -336,8 +360,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry st if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin(); - struct.nameToTypePtr = new java.util.HashMap(2*_map10.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key11; + struct.nameToTypePtr = new HashMap(2*_map10.size); + String _key11; int _val12; for (int _i13 = 0; _i13 < _map10.size; ++_i13) { @@ -369,7 +393,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStructTypeEntry s oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (java.util.Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) + for (Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter14.getKey()); oprot.writeI32(_iter14.getValue()); @@ -384,20 +408,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TStructTypeEntry s } - private static class TStructTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TStructTypeEntryTupleSchemeFactory implements SchemeFactory { public TStructTypeEntryTupleScheme getScheme() { return new TStructTypeEntryTupleScheme(); } } - private static class TStructTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TStructTypeEntryTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.nameToTypePtr.size()); - for (java.util.Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) + for (Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter15.getKey()); oprot.writeI32(_iter15.getValue()); @@ -407,11 +431,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry st @Override public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new java.util.HashMap(2*_map16.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key17; + struct.nameToTypePtr = new HashMap(2*_map16.size); + String _key17; int _val18; for (int _i19 = 0; _i19 < _map16.size; ++_i19) { @@ -424,8 +448,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry str } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java index 9815e9cca6fe..f2f405ce36c9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableSchema"); private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTableSchemaStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTableSchemaTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TTableSchemaStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TTableSchemaTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List columns; // required + private List columns; // 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 { COLUMNS((short)1, "columns"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // COLUMNS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,19 +101,19 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnDesc.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableSchema.class, metaDataMap); } @@ -93,7 +121,7 @@ public TTableSchema() { } public TTableSchema( - java.util.List columns) + List columns) { this(); this.columns = columns; @@ -104,7 +132,7 @@ public TTableSchema( */ public TTableSchema(TTableSchema other) { if (other.isSetColumns()) { - java.util.List __this__columns = new java.util.ArrayList(other.columns.size()); + List __this__columns = new ArrayList(other.columns.size()); for (TColumnDesc other_element : other.columns) { __this__columns.add(new TColumnDesc(other_element)); } @@ -125,24 +153,22 @@ public int getColumnsSize() { return (this.columns == null) ? 0 : this.columns.size(); } - @org.apache.thrift.annotation.Nullable public java.util.Iterator getColumnsIterator() { return (this.columns == null) ? null : this.columns.iterator(); } public void addToColumns(TColumnDesc elem) { if (this.columns == null) { - this.columns = new java.util.ArrayList(); + this.columns = new ArrayList(); } this.columns.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getColumns() { + public List getColumns() { return this.columns; } - public void setColumns(@org.apache.thrift.annotation.Nullable java.util.List columns) { + public void setColumns(List columns) { this.columns = columns; } @@ -161,44 +187,43 @@ public void setColumnsIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case COLUMNS: if (value == null) { unsetColumns(); } else { - setColumns((java.util.List)value); + setColumns((List)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case COLUMNS: return getColumns(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case COLUMNS: return isSetColumns(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TTableSchema) @@ -209,8 +234,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TTableSchema that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_columns = true && this.isSetColumns(); boolean that_present_columns = true && that.isSetColumns(); @@ -226,13 +249,14 @@ public boolean equals(TTableSchema that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetColumns()) ? 131071 : 524287); - if (isSetColumns()) - hashCode = hashCode * 8191 + columns.hashCode(); + boolean present_columns = true && (isSetColumns()); + list.add(present_columns); + if (present_columns) + list.add(columns); - return hashCode; + return list.hashCode(); } @Override @@ -243,7 +267,7 @@ public int compareTo(TTableSchema other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); + lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); if (lastComparison != 0) { return lastComparison; } @@ -256,22 +280,21 @@ public int compareTo(TTableSchema other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TTableSchema("); + public String toString() { + StringBuilder sb = new StringBuilder("TTableSchema("); boolean first = true; sb.append("columns:"); @@ -302,7 +325,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -310,13 +333,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TTableSchemaStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TTableSchemaStandardSchemeFactory implements SchemeFactory { public TTableSchemaStandardScheme getScheme() { return new TTableSchemaStandardScheme(); } } - private static class TTableSchemaStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TTableSchemaStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -332,8 +355,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema struct if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); - struct.columns = new java.util.ArrayList(_list38.size); - @org.apache.thrift.annotation.Nullable TColumnDesc _elem39; + struct.columns = new ArrayList(_list38.size); + TColumnDesc _elem39; for (int _i40 = 0; _i40 < _list38.size; ++_i40) { _elem39 = new TColumnDesc(); @@ -378,17 +401,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTableSchema struc } - private static class TTableSchemaTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TTableSchemaTupleSchemeFactory implements SchemeFactory { public TTableSchemaTupleScheme getScheme() { return new TTableSchemaTupleScheme(); } } - private static class TTableSchemaTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TTableSchemaTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.columns.size()); for (TColumnDesc _iter42 : struct.columns) @@ -400,11 +423,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new java.util.ArrayList(_list43.size); - @org.apache.thrift.annotation.Nullable TColumnDesc _elem44; + struct.columns = new ArrayList(_list43.size); + TColumnDesc _elem44; for (int _i45 = 0; _i45 < _list43.size; ++_i45) { _elem44 = new TColumnDesc(); @@ -416,8 +439,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java index 2ba65bd0bb50..37581c4ff910 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeDesc"); private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeDescStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeDescTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TTypeDescStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TTypeDescTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.List types; // required + private List types; // 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 { TYPES((short)1, "types"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TYPES @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,19 +101,19 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeEntry.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeDesc.class, metaDataMap); } @@ -93,7 +121,7 @@ public TTypeDesc() { } public TTypeDesc( - java.util.List types) + List types) { this(); this.types = types; @@ -104,7 +132,7 @@ public TTypeDesc( */ public TTypeDesc(TTypeDesc other) { if (other.isSetTypes()) { - java.util.List __this__types = new java.util.ArrayList(other.types.size()); + List __this__types = new ArrayList(other.types.size()); for (TTypeEntry other_element : other.types) { __this__types.add(new TTypeEntry(other_element)); } @@ -125,24 +153,22 @@ public int getTypesSize() { return (this.types == null) ? 0 : this.types.size(); } - @org.apache.thrift.annotation.Nullable public java.util.Iterator getTypesIterator() { return (this.types == null) ? null : this.types.iterator(); } public void addToTypes(TTypeEntry elem) { if (this.types == null) { - this.types = new java.util.ArrayList(); + this.types = new ArrayList(); } this.types.add(elem); } - @org.apache.thrift.annotation.Nullable - public java.util.List getTypes() { + public List getTypes() { return this.types; } - public void setTypes(@org.apache.thrift.annotation.Nullable java.util.List types) { + public void setTypes(List types) { this.types = types; } @@ -161,44 +187,43 @@ public void setTypesIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case TYPES: if (value == null) { unsetTypes(); } else { - setTypes((java.util.List)value); + setTypes((List)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case TYPES: return getTypes(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case TYPES: return isSetTypes(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TTypeDesc) @@ -209,8 +234,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TTypeDesc that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_types = true && this.isSetTypes(); boolean that_present_types = true && that.isSetTypes(); @@ -226,13 +249,14 @@ public boolean equals(TTypeDesc that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetTypes()) ? 131071 : 524287); - if (isSetTypes()) - hashCode = hashCode * 8191 + types.hashCode(); + boolean present_types = true && (isSetTypes()); + list.add(present_types); + if (present_types) + list.add(types); - return hashCode; + return list.hashCode(); } @Override @@ -243,7 +267,7 @@ public int compareTo(TTypeDesc other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); + lastComparison = Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); if (lastComparison != 0) { return lastComparison; } @@ -256,22 +280,21 @@ public int compareTo(TTypeDesc other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeDesc("); + public String toString() { + StringBuilder sb = new StringBuilder("TTypeDesc("); boolean first = true; sb.append("types:"); @@ -302,7 +325,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -310,13 +333,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TTypeDescStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TTypeDescStandardSchemeFactory implements SchemeFactory { public TTypeDescStandardScheme getScheme() { return new TTypeDescStandardScheme(); } } - private static class TTypeDescStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TTypeDescStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -332,8 +355,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc struct) t if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); - struct.types = new java.util.ArrayList(_list30.size); - @org.apache.thrift.annotation.Nullable TTypeEntry _elem31; + struct.types = new ArrayList(_list30.size); + TTypeEntry _elem31; for (int _i32 = 0; _i32 < _list30.size; ++_i32) { _elem31 = new TTypeEntry(); @@ -378,17 +401,17 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeDesc struct) } - private static class TTypeDescTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TTypeDescTupleSchemeFactory implements SchemeFactory { public TTypeDescTupleScheme getScheme() { return new TTypeDescTupleScheme(); } } - private static class TTypeDescTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TTypeDescTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.types.size()); for (TTypeEntry _iter34 : struct.types) @@ -400,11 +423,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) t @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.types = new java.util.ArrayList(_list35.size); - @org.apache.thrift.annotation.Nullable TTypeEntry _elem36; + struct.types = new ArrayList(_list35.size); + TTypeEntry _elem36; for (int _i37 = 0; _i37 < _list35.size; ++_i37) { _elem36 = new TTypeEntry(); @@ -416,8 +439,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) th } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java index 9367055e4c7d..3ad494bf2ac2 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java @@ -1,13 +1,39 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) public class TTypeEntry extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry"); private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1); @@ -26,10 +52,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { UNION_ENTRY((short)5, "unionEntry"), USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -37,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // PRIMITIVE_ENTRY @@ -63,22 +88,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -87,27 +111,27 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class))); - tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class))); - tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class))); - tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class))); - tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class))); - tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.OPTIONAL, + tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap); } @@ -115,7 +139,7 @@ public TTypeEntry() { super(); } - public TTypeEntry(_Fields setField, java.lang.Object value) { + public TTypeEntry(_Fields setField, Object value) { super(setField, value); } @@ -164,45 +188,45 @@ public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) { @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + protected void checkType(_Fields setField, Object value) throws ClassCastException { switch (setField) { case PRIMITIVE_ENTRY: if (value instanceof TPrimitiveTypeEntry) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); case ARRAY_ENTRY: if (value instanceof TArrayTypeEntry) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); case MAP_ENTRY: if (value instanceof TMapTypeEntry) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); case STRUCT_ENTRY: if (value instanceof TStructTypeEntry) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); case UNION_ENTRY: if (value instanceof TUnionTypeEntry) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); case USER_DEFINED_TYPE_ENTRY: if (value instanceof TUserDefinedTypeEntry) { break; } - throw new java.lang.ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { @@ -267,7 +291,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP return null; } default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -303,12 +327,12 @@ protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol opr userDefinedTypeEntry.write(oprot); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { @@ -343,10 +367,10 @@ protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProt userDefinedTypeEntry.read(iprot); return userDefinedTypeEntry; default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + throw new TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -378,7 +402,7 @@ protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) userDefinedTypeEntry.write(oprot); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -398,7 +422,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case USER_DEFINED_TYPE_ENTRY: return USER_DEFINED_TYPE_ENTRY_FIELD_DESC; default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @@ -412,7 +436,6 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -422,12 +445,12 @@ public TPrimitiveTypeEntry getPrimitiveEntry() { if (getSetField() == _Fields.PRIMITIVE_ENTRY) { return (TPrimitiveTypeEntry)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setPrimitiveEntry(TPrimitiveTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.PRIMITIVE_ENTRY; value_ = value; } @@ -436,12 +459,12 @@ public TArrayTypeEntry getArrayEntry() { if (getSetField() == _Fields.ARRAY_ENTRY) { return (TArrayTypeEntry)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setArrayEntry(TArrayTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.ARRAY_ENTRY; value_ = value; } @@ -450,12 +473,12 @@ public TMapTypeEntry getMapEntry() { if (getSetField() == _Fields.MAP_ENTRY) { return (TMapTypeEntry)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setMapEntry(TMapTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.MAP_ENTRY; value_ = value; } @@ -464,12 +487,12 @@ public TStructTypeEntry getStructEntry() { if (getSetField() == _Fields.STRUCT_ENTRY) { return (TStructTypeEntry)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setStructEntry(TStructTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.STRUCT_ENTRY; value_ = value; } @@ -478,12 +501,12 @@ public TUnionTypeEntry getUnionEntry() { if (getSetField() == _Fields.UNION_ENTRY) { return (TUnionTypeEntry)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setUnionEntry(TUnionTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.UNION_ENTRY; value_ = value; } @@ -492,12 +515,12 @@ public TUserDefinedTypeEntry getUserDefinedTypeEntry() { if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) { return (TUserDefinedTypeEntry)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); } } public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) { - if (value == null) throw new java.lang.NullPointerException(); + if (value == null) throw new NullPointerException(); setField_ = _Fields.USER_DEFINED_TYPE_ENTRY; value_ = value; } @@ -532,7 +555,7 @@ public boolean isSetUserDefinedTypeEntry() { } - public boolean equals(java.lang.Object other) { + public boolean equals(Object other) { if (other instanceof TTypeEntry) { return equals((TTypeEntry)other); } else { @@ -556,12 +579,12 @@ public int compareTo(TTypeEntry other) { @Override public int hashCode() { - java.util.List list = new java.util.ArrayList(); + List list = new ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); + Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -579,7 +602,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java index 09d276a0cec3..4096404e5a13 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,10 @@ package org.apache.spark.sql.thriftserver.cli.thrift; -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + public enum TTypeId implements org.apache.thrift.TEnum { BOOLEAN_TYPE(0), TINYINT_TYPE(1), @@ -50,7 +53,6 @@ public int getValue() { * Find a the enum type by its integer value, as defined in the Thrift IDL. * @return null if the value is not found. */ - @org.apache.thrift.annotation.Nullable public static TTypeId findByValue(int value) { switch (value) { case 0: diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java index f8598f65e4dd..5dab58f62068 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java @@ -1,13 +1,39 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) public class TTypeQualifierValue extends org.apache.thrift.TUnion { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifierValue"); private static final org.apache.thrift.protocol.TField I32_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Value", org.apache.thrift.protocol.TType.I32, (short)1); @@ -18,10 +44,10 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { I32_VALUE((short)1, "i32Value"), STRING_VALUE((short)2, "stringValue"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -29,7 +55,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // I32_VALUE @@ -47,22 +72,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -71,19 +95,19 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.I32_VALUE, new org.apache.thrift.meta_data.FieldMetaData("i32Value", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifierValue.class, metaDataMap); } @@ -91,7 +115,7 @@ public TTypeQualifierValue() { super(); } - public TTypeQualifierValue(_Fields setField, java.lang.Object value) { + public TTypeQualifierValue(_Fields setField, Object value) { super(setField, value); } @@ -108,7 +132,7 @@ public static TTypeQualifierValue i32Value(int value) { return x; } - public static TTypeQualifierValue stringValue(java.lang.String value) { + public static TTypeQualifierValue stringValue(String value) { TTypeQualifierValue x = new TTypeQualifierValue(); x.setStringValue(value); return x; @@ -116,31 +140,31 @@ public static TTypeQualifierValue stringValue(java.lang.String value) { @Override - protected void checkType(_Fields setField, java.lang.Object value) throws java.lang.ClassCastException { + protected void checkType(_Fields setField, Object value) throws ClassCastException { switch (setField) { case I32_VALUE: - if (value instanceof java.lang.Integer) { + if (value instanceof Integer) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); case STRING_VALUE: - if (value instanceof java.lang.String) { + if (value instanceof String) { break; } - throw new java.lang.ClassCastException("Was expecting value of type java.lang.String for field 'stringValue', but got " + value.getClass().getSimpleName()); + throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @Override - protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { + protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(field.id); if (setField != null) { switch (setField) { case I32_VALUE: if (field.type == I32_VALUE_FIELD_DESC.type) { - java.lang.Integer i32Value; + Integer i32Value; i32Value = iprot.readI32(); return i32Value; } else { @@ -149,7 +173,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP } case STRING_VALUE: if (field.type == STRING_VALUE_FIELD_DESC.type) { - java.lang.String stringValue; + String stringValue; stringValue = iprot.readString(); return stringValue; } else { @@ -157,7 +181,7 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP return null; } default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); @@ -169,36 +193,36 @@ protected java.lang.Object standardSchemeReadValue(org.apache.thrift.protocol.TP protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case I32_VALUE: - java.lang.Integer i32Value = (java.lang.Integer)value_; + Integer i32Value = (Integer)value_; oprot.writeI32(i32Value); return; case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; + String stringValue = (String)value_; oprot.writeString(stringValue); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @Override - protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { + protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { _Fields setField = _Fields.findByThriftId(fieldID); if (setField != null) { switch (setField) { case I32_VALUE: - java.lang.Integer i32Value; + Integer i32Value; i32Value = iprot.readI32(); return i32Value; case STRING_VALUE: - java.lang.String stringValue; + String stringValue; stringValue = iprot.readString(); return stringValue; default: - throw new java.lang.IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); + throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); } } else { - throw new org.apache.thrift.protocol.TProtocolException("Couldn't find a field with field id " + fieldID); + throw new TProtocolException("Couldn't find a field with field id " + fieldID); } } @@ -206,15 +230,15 @@ protected java.lang.Object tupleSchemeReadValue(org.apache.thrift.protocol.TProt protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { switch (setField_) { case I32_VALUE: - java.lang.Integer i32Value = (java.lang.Integer)value_; + Integer i32Value = (Integer)value_; oprot.writeI32(i32Value); return; case STRING_VALUE: - java.lang.String stringValue = (java.lang.String)value_; + String stringValue = (String)value_; oprot.writeString(stringValue); return; default: - throw new java.lang.IllegalStateException("Cannot write union with unknown field " + setField_); + throw new IllegalStateException("Cannot write union with unknown field " + setField_); } } @@ -226,7 +250,7 @@ protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { case STRING_VALUE: return STRING_VALUE_FIELD_DESC; default: - throw new java.lang.IllegalArgumentException("Unknown field id " + setField); + throw new IllegalArgumentException("Unknown field id " + setField); } } @@ -240,7 +264,6 @@ protected _Fields enumForId(short id) { return _Fields.findByThriftIdOrThrow(id); } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } @@ -248,9 +271,9 @@ public _Fields fieldForId(int fieldId) { public int getI32Value() { if (getSetField() == _Fields.I32_VALUE) { - return (java.lang.Integer)getFieldValue(); + return (Integer)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); } } @@ -259,16 +282,16 @@ public void setI32Value(int value) { value_ = value; } - public java.lang.String getStringValue() { + public String getStringValue() { if (getSetField() == _Fields.STRING_VALUE) { - return (java.lang.String)getFieldValue(); + return (String)getFieldValue(); } else { - throw new java.lang.RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); + throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); } } - public void setStringValue(java.lang.String value) { - if (value == null) throw new java.lang.NullPointerException(); + public void setStringValue(String value) { + if (value == null) throw new NullPointerException(); setField_ = _Fields.STRING_VALUE; value_ = value; } @@ -283,7 +306,7 @@ public boolean isSetStringValue() { } - public boolean equals(java.lang.Object other) { + public boolean equals(Object other) { if (other instanceof TTypeQualifierValue) { return equals((TTypeQualifierValue)other); } else { @@ -307,12 +330,12 @@ public int compareTo(TTypeQualifierValue other) { @Override public int hashCode() { - java.util.List list = new java.util.ArrayList(); + List list = new ArrayList(); list.add(this.getClass().getName()); org.apache.thrift.TFieldIdEnum setField = getSetField(); if (setField != null) { list.add(setField.getThriftFieldId()); - java.lang.Object value = getFieldValue(); + Object value = getFieldValue(); if (value instanceof org.apache.thrift.TEnum) { list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); } else { @@ -330,7 +353,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java index 7c3872e2af62..22eedb1e5982 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifiers"); private static final org.apache.thrift.protocol.TField QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifiers", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TTypeQualifiersStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TTypeQualifiersTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TTypeQualifiersStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TTypeQualifiersTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.Map qualifiers; // required + private Map qualifiers; // 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 { QUALIFIERS((short)1, "qualifiers"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // QUALIFIERS @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,20 +101,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("qualifiers", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifierValue.class)))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifiers.class, metaDataMap); } @@ -94,7 +122,7 @@ public TTypeQualifiers() { } public TTypeQualifiers( - java.util.Map qualifiers) + Map qualifiers) { this(); this.qualifiers = qualifiers; @@ -105,13 +133,13 @@ public TTypeQualifiers( */ public TTypeQualifiers(TTypeQualifiers other) { if (other.isSetQualifiers()) { - java.util.Map __this__qualifiers = new java.util.HashMap(other.qualifiers.size()); - for (java.util.Map.Entry other_element : other.qualifiers.entrySet()) { + Map __this__qualifiers = new HashMap(other.qualifiers.size()); + for (Map.Entry other_element : other.qualifiers.entrySet()) { - java.lang.String other_element_key = other_element.getKey(); + String other_element_key = other_element.getKey(); TTypeQualifierValue other_element_value = other_element.getValue(); - java.lang.String __this__qualifiers_copy_key = other_element_key; + String __this__qualifiers_copy_key = other_element_key; TTypeQualifierValue __this__qualifiers_copy_value = new TTypeQualifierValue(other_element_value); @@ -134,19 +162,18 @@ public int getQualifiersSize() { return (this.qualifiers == null) ? 0 : this.qualifiers.size(); } - public void putToQualifiers(java.lang.String key, TTypeQualifierValue val) { + public void putToQualifiers(String key, TTypeQualifierValue val) { if (this.qualifiers == null) { - this.qualifiers = new java.util.HashMap(); + this.qualifiers = new HashMap(); } this.qualifiers.put(key, val); } - @org.apache.thrift.annotation.Nullable - public java.util.Map getQualifiers() { + public Map getQualifiers() { return this.qualifiers; } - public void setQualifiers(@org.apache.thrift.annotation.Nullable java.util.Map qualifiers) { + public void setQualifiers(Map qualifiers) { this.qualifiers = qualifiers; } @@ -165,44 +192,43 @@ public void setQualifiersIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case QUALIFIERS: if (value == null) { unsetQualifiers(); } else { - setQualifiers((java.util.Map)value); + setQualifiers((Map)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case QUALIFIERS: return getQualifiers(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case QUALIFIERS: return isSetQualifiers(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TTypeQualifiers) @@ -213,8 +239,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TTypeQualifiers that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_qualifiers = true && this.isSetQualifiers(); boolean that_present_qualifiers = true && that.isSetQualifiers(); @@ -230,13 +254,14 @@ public boolean equals(TTypeQualifiers that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetQualifiers()) ? 131071 : 524287); - if (isSetQualifiers()) - hashCode = hashCode * 8191 + qualifiers.hashCode(); + boolean present_qualifiers = true && (isSetQualifiers()); + list.add(present_qualifiers); + if (present_qualifiers) + list.add(qualifiers); - return hashCode; + return list.hashCode(); } @Override @@ -247,7 +272,7 @@ public int compareTo(TTypeQualifiers other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); + lastComparison = Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); if (lastComparison != 0) { return lastComparison; } @@ -260,22 +285,21 @@ public int compareTo(TTypeQualifiers other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TTypeQualifiers("); + public String toString() { + StringBuilder sb = new StringBuilder("TTypeQualifiers("); boolean first = true; sb.append("qualifiers:"); @@ -306,7 +330,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -314,13 +338,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TTypeQualifiersStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TTypeQualifiersStandardSchemeFactory implements SchemeFactory { public TTypeQualifiersStandardScheme getScheme() { return new TTypeQualifiersStandardScheme(); } } - private static class TTypeQualifiersStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TTypeQualifiersStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -336,9 +360,9 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers str if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.qualifiers = new java.util.HashMap(2*_map0.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key1; - @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val2; + struct.qualifiers = new HashMap(2*_map0.size); + String _key1; + TTypeQualifierValue _val2; for (int _i3 = 0; _i3 < _map0.size; ++_i3) { _key1 = iprot.readString(); @@ -370,7 +394,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeQualifiers st oprot.writeFieldBegin(QUALIFIERS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.qualifiers.size())); - for (java.util.Map.Entry _iter4 : struct.qualifiers.entrySet()) + for (Map.Entry _iter4 : struct.qualifiers.entrySet()) { oprot.writeString(_iter4.getKey()); _iter4.getValue().write(oprot); @@ -385,20 +409,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeQualifiers st } - private static class TTypeQualifiersTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TTypeQualifiersTupleSchemeFactory implements SchemeFactory { public TTypeQualifiersTupleScheme getScheme() { return new TTypeQualifiersTupleScheme(); } } - private static class TTypeQualifiersTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TTypeQualifiersTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.qualifiers.size()); - for (java.util.Map.Entry _iter5 : struct.qualifiers.entrySet()) + for (Map.Entry _iter5 : struct.qualifiers.entrySet()) { oprot.writeString(_iter5.getKey()); _iter5.getValue().write(oprot); @@ -408,12 +432,12 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.qualifiers = new java.util.HashMap(2*_map6.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key7; - @org.apache.thrift.annotation.Nullable TTypeQualifierValue _val8; + struct.qualifiers = new HashMap(2*_map6.size); + String _key7; + TTypeQualifierValue _val8; for (int _i9 = 0; _i9 < _map6.size; ++_i9) { _key7 = iprot.readString(); @@ -426,8 +450,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java index 9b24c4bcc167..ea037be7db4d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTypeEntry"); private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUnionTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUnionTypeEntryTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TUnionTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TUnionTypeEntryTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr; // required + private Map nameToTypePtr; // 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 { NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // NAME_TO_TYPE_PTR @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,20 +101,20 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTypeEntry.class, metaDataMap); } @@ -94,7 +122,7 @@ public TUnionTypeEntry() { } public TUnionTypeEntry( - java.util.Map nameToTypePtr) + Map nameToTypePtr) { this(); this.nameToTypePtr = nameToTypePtr; @@ -105,15 +133,15 @@ public TUnionTypeEntry( */ public TUnionTypeEntry(TUnionTypeEntry other) { if (other.isSetNameToTypePtr()) { - java.util.Map __this__nameToTypePtr = new java.util.HashMap(other.nameToTypePtr.size()); - for (java.util.Map.Entry other_element : other.nameToTypePtr.entrySet()) { + Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); + for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { - java.lang.String other_element_key = other_element.getKey(); - java.lang.Integer other_element_value = other_element.getValue(); + String other_element_key = other_element.getKey(); + Integer other_element_value = other_element.getValue(); - java.lang.String __this__nameToTypePtr_copy_key = other_element_key; + String __this__nameToTypePtr_copy_key = other_element_key; - java.lang.Integer __this__nameToTypePtr_copy_value = other_element_value; + Integer __this__nameToTypePtr_copy_value = other_element_value; __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); } @@ -134,19 +162,18 @@ public int getNameToTypePtrSize() { return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); } - public void putToNameToTypePtr(java.lang.String key, int val) { + public void putToNameToTypePtr(String key, int val) { if (this.nameToTypePtr == null) { - this.nameToTypePtr = new java.util.HashMap(); + this.nameToTypePtr = new HashMap(); } this.nameToTypePtr.put(key, val); } - @org.apache.thrift.annotation.Nullable - public java.util.Map getNameToTypePtr() { + public Map getNameToTypePtr() { return this.nameToTypePtr; } - public void setNameToTypePtr(@org.apache.thrift.annotation.Nullable java.util.Map nameToTypePtr) { + public void setNameToTypePtr(Map nameToTypePtr) { this.nameToTypePtr = nameToTypePtr; } @@ -165,44 +192,43 @@ public void setNameToTypePtrIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case NAME_TO_TYPE_PTR: if (value == null) { unsetNameToTypePtr(); } else { - setNameToTypePtr((java.util.Map)value); + setNameToTypePtr((Map)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case NAME_TO_TYPE_PTR: return getNameToTypePtr(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case NAME_TO_TYPE_PTR: return isSetNameToTypePtr(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TUnionTypeEntry) @@ -213,8 +239,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TUnionTypeEntry that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); @@ -230,13 +254,14 @@ public boolean equals(TUnionTypeEntry that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetNameToTypePtr()) ? 131071 : 524287); - if (isSetNameToTypePtr()) - hashCode = hashCode * 8191 + nameToTypePtr.hashCode(); + boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); + list.add(present_nameToTypePtr); + if (present_nameToTypePtr) + list.add(nameToTypePtr); - return hashCode; + return list.hashCode(); } @Override @@ -247,7 +272,7 @@ public int compareTo(TUnionTypeEntry other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); + lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); if (lastComparison != 0) { return lastComparison; } @@ -260,22 +285,21 @@ public int compareTo(TUnionTypeEntry other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TUnionTypeEntry("); + public String toString() { + StringBuilder sb = new StringBuilder("TUnionTypeEntry("); boolean first = true; sb.append("nameToTypePtr:"); @@ -306,7 +330,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -314,13 +338,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TUnionTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TUnionTypeEntryStandardSchemeFactory implements SchemeFactory { public TUnionTypeEntryStandardScheme getScheme() { return new TUnionTypeEntryStandardScheme(); } } - private static class TUnionTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TUnionTypeEntryStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -336,8 +360,8 @@ public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry str if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin(); - struct.nameToTypePtr = new java.util.HashMap(2*_map20.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key21; + struct.nameToTypePtr = new HashMap(2*_map20.size); + String _key21; int _val22; for (int _i23 = 0; _i23 < _map20.size; ++_i23) { @@ -369,7 +393,7 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TUnionTypeEntry st oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (java.util.Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) + for (Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter24.getKey()); oprot.writeI32(_iter24.getValue()); @@ -384,20 +408,20 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TUnionTypeEntry st } - private static class TUnionTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TUnionTypeEntryTupleSchemeFactory implements SchemeFactory { public TUnionTypeEntryTupleScheme getScheme() { return new TUnionTypeEntryTupleScheme(); } } - private static class TUnionTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TUnionTypeEntryTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; { oprot.writeI32(struct.nameToTypePtr.size()); - for (java.util.Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) + for (Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) { oprot.writeString(_iter25.getKey()); oprot.writeI32(_iter25.getValue()); @@ -407,11 +431,11 @@ public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry str @Override public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; { org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new java.util.HashMap(2*_map26.size); - @org.apache.thrift.annotation.Nullable java.lang.String _key27; + struct.nameToTypePtr = new HashMap(2*_map26.size); + String _key27; int _val28; for (int _i29 = 0; _i29 < _map26.size; ++_i29) { @@ -424,8 +448,5 @@ public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry stru } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java index 32833f692384..e69e13b3ea2c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java @@ -1,31 +1,61 @@ /** - * Autogenerated by Thrift Compiler (0.12.0) + * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.spark.sql.thriftserver.cli.thrift; -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.12.0)", date = "2019-11-06") +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 org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +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 javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry"); private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new TUserDefinedTypeEntryStandardSchemeFactory(); - private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new TUserDefinedTypeEntryTupleSchemeFactory(); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TUserDefinedTypeEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TUserDefinedTypeEntryTupleSchemeFactory()); + } - private @org.apache.thrift.annotation.Nullable java.lang.String typeClassName; // required + private String typeClassName; // 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 { TYPE_CLASS_NAME((short)1, "typeClassName"); - private static final java.util.Map byName = new java.util.HashMap(); + private static final Map byName = new HashMap(); static { - for (_Fields field : java.util.EnumSet.allOf(_Fields.class)) { + for (_Fields field : EnumSet.allOf(_Fields.class)) { byName.put(field.getFieldName(), field); } } @@ -33,7 +63,6 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { /** * Find the _Fields constant that matches fieldId, or null if its not found. */ - @org.apache.thrift.annotation.Nullable public static _Fields findByThriftId(int fieldId) { switch(fieldId) { case 1: // TYPE_CLASS_NAME @@ -49,22 +78,21 @@ public static _Fields findByThriftId(int fieldId) { */ public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new java.lang.IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + 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. */ - @org.apache.thrift.annotation.Nullable - public static _Fields findByName(java.lang.String name) { + public static _Fields findByName(String name) { return byName.get(name); } private final short _thriftId; - private final java.lang.String _fieldName; + private final String _fieldName; - _Fields(short thriftId, java.lang.String fieldName) { + _Fields(short thriftId, String fieldName) { _thriftId = thriftId; _fieldName = fieldName; } @@ -73,18 +101,18 @@ public short getThriftFieldId() { return _thriftId; } - public java.lang.String getFieldName() { + public String getFieldName() { return _fieldName; } } // isset id assignments - public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { - java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); tmpMap.put(_Fields.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); + metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap); } @@ -92,7 +120,7 @@ public TUserDefinedTypeEntry() { } public TUserDefinedTypeEntry( - java.lang.String typeClassName) + String typeClassName) { this(); this.typeClassName = typeClassName; @@ -116,12 +144,11 @@ public void clear() { this.typeClassName = null; } - @org.apache.thrift.annotation.Nullable - public java.lang.String getTypeClassName() { + public String getTypeClassName() { return this.typeClassName; } - public void setTypeClassName(@org.apache.thrift.annotation.Nullable java.lang.String typeClassName) { + public void setTypeClassName(String typeClassName) { this.typeClassName = typeClassName; } @@ -140,44 +167,43 @@ public void setTypeClassNameIsSet(boolean value) { } } - public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { + public void setFieldValue(_Fields field, Object value) { switch (field) { case TYPE_CLASS_NAME: if (value == null) { unsetTypeClassName(); } else { - setTypeClassName((java.lang.String)value); + setTypeClassName((String)value); } break; } } - @org.apache.thrift.annotation.Nullable - public java.lang.Object getFieldValue(_Fields field) { + public Object getFieldValue(_Fields field) { switch (field) { case TYPE_CLASS_NAME: return getTypeClassName(); } - throw new java.lang.IllegalStateException(); + 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 java.lang.IllegalArgumentException(); + throw new IllegalArgumentException(); } switch (field) { case TYPE_CLASS_NAME: return isSetTypeClassName(); } - throw new java.lang.IllegalStateException(); + throw new IllegalStateException(); } @Override - public boolean equals(java.lang.Object that) { + public boolean equals(Object that) { if (that == null) return false; if (that instanceof TUserDefinedTypeEntry) @@ -188,8 +214,6 @@ public boolean equals(java.lang.Object that) { public boolean equals(TUserDefinedTypeEntry that) { if (that == null) return false; - if (this == that) - return true; boolean this_present_typeClassName = true && this.isSetTypeClassName(); boolean that_present_typeClassName = true && that.isSetTypeClassName(); @@ -205,13 +229,14 @@ public boolean equals(TUserDefinedTypeEntry that) { @Override public int hashCode() { - int hashCode = 1; + List list = new ArrayList(); - hashCode = hashCode * 8191 + ((isSetTypeClassName()) ? 131071 : 524287); - if (isSetTypeClassName()) - hashCode = hashCode * 8191 + typeClassName.hashCode(); + boolean present_typeClassName = true && (isSetTypeClassName()); + list.add(present_typeClassName); + if (present_typeClassName) + list.add(typeClassName); - return hashCode; + return list.hashCode(); } @Override @@ -222,7 +247,7 @@ public int compareTo(TUserDefinedTypeEntry other) { int lastComparison = 0; - lastComparison = java.lang.Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); + lastComparison = Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); if (lastComparison != 0) { return lastComparison; } @@ -235,22 +260,21 @@ public int compareTo(TUserDefinedTypeEntry other) { return 0; } - @org.apache.thrift.annotation.Nullable public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - scheme(iprot).read(iprot, this); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - scheme(oprot).write(oprot, this); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override - public java.lang.String toString() { - java.lang.StringBuilder sb = new java.lang.StringBuilder("TUserDefinedTypeEntry("); + public String toString() { + StringBuilder sb = new StringBuilder("TUserDefinedTypeEntry("); boolean first = true; sb.append("typeClassName:"); @@ -281,7 +305,7 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException { + 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) { @@ -289,13 +313,13 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - private static class TUserDefinedTypeEntryStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TUserDefinedTypeEntryStandardSchemeFactory implements SchemeFactory { public TUserDefinedTypeEntryStandardScheme getScheme() { return new TUserDefinedTypeEntryStandardScheme(); } } - private static class TUserDefinedTypeEntryStandardScheme extends org.apache.thrift.scheme.StandardScheme { + private static class TUserDefinedTypeEntryStandardScheme extends StandardScheme { public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; @@ -339,30 +363,27 @@ public void write(org.apache.thrift.protocol.TProtocol oprot, TUserDefinedTypeEn } - private static class TUserDefinedTypeEntryTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + private static class TUserDefinedTypeEntryTupleSchemeFactory implements SchemeFactory { public TUserDefinedTypeEntryTupleScheme getScheme() { return new TUserDefinedTypeEntryTupleScheme(); } } - private static class TUserDefinedTypeEntryTupleScheme extends org.apache.thrift.scheme.TupleScheme { + private static class TUserDefinedTypeEntryTupleScheme extends TupleScheme { @Override public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeString(struct.typeClassName); } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; + TTupleProtocol iprot = (TTupleProtocol) prot; struct.typeClassName = iprot.readString(); struct.setTypeClassNameIsSet(true); } } - private static S scheme(org.apache.thrift.protocol.TProtocol proto) { - return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme(); - } } From 13da926432baaf5879a65e62cbb6d472066a0181 Mon Sep 17 00:00:00 2001 From: angerszhu Date: Thu, 7 Nov 2019 15:23:30 +0800 Subject: [PATCH 54/55] fix for `mvn install` --- .../spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TByteValue.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java | 2 +- .../sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java | 2 +- .../sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java | 2 +- .../sql/thriftserver/cli/thrift/TExecuteStatementResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TFetchOrientation.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java | 2 +- .../sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java | 2 +- .../sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java | 2 +- .../sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java | 2 +- .../sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java | 2 +- .../sql/thriftserver/cli/thrift/TGetOperationStatusReq.java | 2 +- .../sql/thriftserver/cli/thrift/TGetOperationStatusResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java | 2 +- .../sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java | 2 +- .../sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetTablesResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/THandleIdentifier.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TI16Column.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TI32Column.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TI64Column.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TOperationHandle.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TOperationState.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TOperationType.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TProtocolVersion.java | 2 +- .../sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java | 2 +- .../sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TRow.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TSessionHandle.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TStringValue.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java | 2 +- .../apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java | 2 +- .../org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java | 2 +- .../spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java | 2 +- .../sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java | 2 +- 92 files changed, 92 insertions(+), 92 deletions(-) diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java index 7e552b633da5..792d9186d52e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TArrayTypeEntry.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java index 308e1a5d94aa..c75b851286b0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBinaryColumn.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java index 8ef33bac8547..acf64d10ce74 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolColumn.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java index 0ec6c5cdc853..10a9e0d267f1 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TBoolValue.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java index 5041ad433994..c63771cc0c33 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteColumn.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java index 2d6ef998f9eb..bc773e7716c2 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TByteValue.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java index 3a817c3c864b..8afd5774cc86 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIServiceConstants.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java index b9bd1d187347..99baba1eaf1a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java index 2ad02e3b2a54..fca98b1d6d44 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelDelegationTokenResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java index e797e8fb6433..bc73d6841235 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java index 0ea2de271f15..14b331abe9fc 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCancelOperationResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java index f363b117b099..e82b20079393 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java index 33efd302cdfe..435bae1bb3c5 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseOperationResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java index c7e02eb1bb33..45226bd2f2ad 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java index 947dcb273bfc..eb0cbf8cf3fb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCloseSessionResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java index 760cd2c40cc4..825bad6844d7 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumn.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java index 7f40a4930c8c..4e972073f08c 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnDesc.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java index a2c758dfa98a..db1efe2cf169 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TColumnValue.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java index ac7bc7043e87..25e91052e0ad 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleColumn.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java index 88e18a1c3851..aac3bd945b73 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TDoubleValue.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java index 363d8216d280..64c282f4ac0a 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java index c13f9aa31130..a7659752b602 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TExecuteStatementResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java index 7c353f18229a..cee0e451cbb9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchOrientation.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java index f0fbc23faa0d..5709b23d0399 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java index 4a1f0d5a67db..663477d21bdc 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TFetchResultsResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java index 0e151d5e91e6..f21c01978889 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java index ee113df514db..5a597d95b81d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCatalogsResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java index 3ac8c4968d2f..48c29b9d0622 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java index 2903d4975c93..83ce0be83bad 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetColumnsResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java index 281de4c748b4..c2bb51d32549 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java index 140becdca24d..ecb5caccad92 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetCrossReferenceResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java index a4d52c4f8c02..9508365c3814 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java index 4f517a2a2c44..076f709da902 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetDelegationTokenResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java index 2612b974b16f..d2d6dabf4a78 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java index 7228e2e533b7..e013db6391f4 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetFunctionsResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java index f2bf71d9ec94..a74828faaa02 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java index da770250f95c..5bece7a389a4 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java index d18a1b5b85af..1cdf507930f3 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoType.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java index 4f303079eed8..d33c06a24329 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetInfoValue.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java index a31bf386c761..f9b8f3971e22 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java index 6022287cc23b..703e4c035ea0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetOperationStatusResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java index 8ad4f4591dff..1b2a741847ef 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java index e67a9fcfdaea..b5398ccf8f4e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetPrimaryKeysResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java index 29b10679f412..c4a5bfcbf6cd 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java index 9f1ab8f19157..e9f9e37284d3 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetQueryIdResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java index 5124adc8c5d9..43f069aec269 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java index 6906bff5214f..284b0ba5e99b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetResultSetMetadataResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java index 276dc8fc434e..d67877e3787f 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java index ed284a00af33..e078b4c62491 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetSchemasResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java index e38b6ae93afb..7c236e5e0035 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java index 7724884d91ac..1b98f0697567 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTableTypesResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java index dba6672baf9f..f84dabc35a16 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java index 5b0a712a1b1a..3eaf35ecd34d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTablesResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java index aeadb4666a3b..1c9b2f57e2b5 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java index 0331adb8b11c..134ef1442acb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TGetTypeInfoResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java index 4bb156ac1958..b700c5a1d361 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/THandleIdentifier.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java index 963451a34989..54812c01c896 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Column.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java index 1aa4e6f7a9eb..c210d372bb95 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI16Value.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java index 8b557e47027c..b5dffd6a6221 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Column.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java index 40ec647f375c..02ed2d80d38e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI32Value.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java index 17ee8f81159f..53d940ddcda3 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Column.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java index 1d0330ec3f61..c480ab9199ce 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TI64Value.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java index 9c89111cb8a2..9c3af56a39b0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TJobExecutionStatus.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java index 6b6306eca172..938ab6c309ee 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TMapTypeEntry.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java index 47c8d949a58d..aab2c3505ac0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java index 2892e4d8388b..0c80475542f1 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOpenSessionResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java index 4da33d76e984..a94e09742d98 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationHandle.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java index 0d68f399d7b2..dc785e35abf0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationState.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java index e731590a4395..e4af450aa793 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TOperationType.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java index 87218fe0a8e9..fb37448b580d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TPrimitiveTypeEntry.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java index c5bbdfd089d3..ce74da40a13e 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProgressUpdateResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java index d3fa13224a48..e767b3f6a171 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TProtocolVersion.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java index 078331da06ea..b4db22431cf0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java index 4588d22dd35b..cf654dbc1d1d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRenewDelegationTokenResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java index 5fd827a88630..aa347b5823d6 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRow.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java index 15960abfd9fd..8ba412a85b27 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TRowSet.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java index d99c9c013e54..773c3dcce957 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSessionHandle.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java index 30947d03e399..e0ad423b0157 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoReq.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java index e774339f4a07..bd4e5e52d8cb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TSetClientInfoResp.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java index 7f44a7931ed5..7392912f2181 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatus.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java index 7694f6f1acc6..61de07f176a0 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStatusCode.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java index 6161e27c3f74..15e418870d78 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringColumn.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java index 54c0bcff6e89..ede5fae119ab 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStringValue.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java index 5cdd7e9f2a54..36c37fb48837 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TStructTypeEntry.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java index f2f405ce36c9..661276cc53a9 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTableSchema.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java index 37581c4ff910..89b9837a954b 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeDesc.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java index 3ad494bf2ac2..228d8b0e989d 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeEntry.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java index 4096404e5a13..e3d5c4d20d11 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeId.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java index 5dab58f62068..03aff6477938 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifierValue.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java index 22eedb1e5982..e20d6d0238fa 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TTypeQualifiers.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java index ea037be7db4d..62f0774a9629 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUnionTypeEntry.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java index e69e13b3ea2c..3a0814864d94 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TUserDefinedTypeEntry.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; From d0de49f814a896bbfa4f2c1fbd074e7ac5e354ec Mon Sep 17 00:00:00 2001 From: angerszhu Date: Thu, 7 Nov 2019 15:23:41 +0800 Subject: [PATCH 55/55] fix for `mvn install` --- .../thriftserver/cli/thrift/TCLIService.java | 49 ++++++++++--------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java index a0fdad020853..c27835b744cb 100644 --- a/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java +++ b/sql/thriftserver/src/gen/thrift/gen-javabean/org/apache/spark/sql/thriftserver/cli/thrift/TCLIService.java @@ -2,7 +2,7 @@ * Autogenerated by Thrift Compiler (0.9.3) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated + * */ package org.apache.spark.sql.thriftserver.cli.thrift; @@ -16,6 +16,7 @@ import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer; import org.apache.thrift.server.AbstractNonblockingServer.*; import java.util.List; import java.util.ArrayList; @@ -1987,7 +1988,7 @@ public OpenSession_args getEmptyArgsInstance() { return new OpenSession_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TOpenSessionResp o) { @@ -2038,7 +2039,7 @@ public CloseSession_args getEmptyArgsInstance() { return new CloseSession_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TCloseSessionResp o) { @@ -2089,7 +2090,7 @@ public GetInfo_args getEmptyArgsInstance() { return new GetInfo_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetInfoResp o) { @@ -2140,7 +2141,7 @@ public ExecuteStatement_args getEmptyArgsInstance() { return new ExecuteStatement_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TExecuteStatementResp o) { @@ -2191,7 +2192,7 @@ public GetTypeInfo_args getEmptyArgsInstance() { return new GetTypeInfo_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetTypeInfoResp o) { @@ -2242,7 +2243,7 @@ public GetCatalogs_args getEmptyArgsInstance() { return new GetCatalogs_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetCatalogsResp o) { @@ -2293,7 +2294,7 @@ public GetSchemas_args getEmptyArgsInstance() { return new GetSchemas_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetSchemasResp o) { @@ -2344,7 +2345,7 @@ public GetTables_args getEmptyArgsInstance() { return new GetTables_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetTablesResp o) { @@ -2395,7 +2396,7 @@ public GetTableTypes_args getEmptyArgsInstance() { return new GetTableTypes_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetTableTypesResp o) { @@ -2446,7 +2447,7 @@ public GetColumns_args getEmptyArgsInstance() { return new GetColumns_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetColumnsResp o) { @@ -2497,7 +2498,7 @@ public GetFunctions_args getEmptyArgsInstance() { return new GetFunctions_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetFunctionsResp o) { @@ -2548,7 +2549,7 @@ public GetPrimaryKeys_args getEmptyArgsInstance() { return new GetPrimaryKeys_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetPrimaryKeysResp o) { @@ -2599,7 +2600,7 @@ public GetCrossReference_args getEmptyArgsInstance() { return new GetCrossReference_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetCrossReferenceResp o) { @@ -2650,7 +2651,7 @@ public GetOperationStatus_args getEmptyArgsInstance() { return new GetOperationStatus_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetOperationStatusResp o) { @@ -2701,7 +2702,7 @@ public CancelOperation_args getEmptyArgsInstance() { return new CancelOperation_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TCancelOperationResp o) { @@ -2752,7 +2753,7 @@ public CloseOperation_args getEmptyArgsInstance() { return new CloseOperation_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TCloseOperationResp o) { @@ -2803,7 +2804,7 @@ public GetResultSetMetadata_args getEmptyArgsInstance() { return new GetResultSetMetadata_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetResultSetMetadataResp o) { @@ -2854,7 +2855,7 @@ public FetchResults_args getEmptyArgsInstance() { return new FetchResults_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TFetchResultsResp o) { @@ -2905,7 +2906,7 @@ public GetDelegationToken_args getEmptyArgsInstance() { return new GetDelegationToken_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetDelegationTokenResp o) { @@ -2956,7 +2957,7 @@ public CancelDelegationToken_args getEmptyArgsInstance() { return new CancelDelegationToken_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TCancelDelegationTokenResp o) { @@ -3007,7 +3008,7 @@ public RenewDelegationToken_args getEmptyArgsInstance() { return new RenewDelegationToken_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TRenewDelegationTokenResp o) { @@ -3058,7 +3059,7 @@ public GetQueryId_args getEmptyArgsInstance() { return new GetQueryId_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TGetQueryIdResp o) { @@ -3109,7 +3110,7 @@ public SetClientInfo_args getEmptyArgsInstance() { return new SetClientInfo_args(); } - public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; return new AsyncMethodCallback() { public void onComplete(TSetClientInfoResp o) {